Skip to content

feat(client): support passing httpx.Timeout to method timeout argument #171

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 6, 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
2 changes: 1 addition & 1 deletion src/finch/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,7 @@ def make_request_options(
extra_query: Query | None = None,
extra_body: Body | None = None,
idempotency_key: str | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
post_parser: PostParser | NotGiven = NOT_GIVEN,
) -> RequestOptions:
"""Create a dict of type RequestOptions without keys of NotGiven values."""
Expand Down
10 changes: 6 additions & 4 deletions src/finch/resources/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from typing import TYPE_CHECKING

import httpx

from ..types import Introspection, DisconnectResponse
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._resource import SyncAPIResource, AsyncAPIResource
Expand Down Expand Up @@ -31,7 +33,7 @@ def disconnect(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> DisconnectResponse:
"""
Disconnect an employer from your application and invalidate all `access_token`s
Expand All @@ -54,7 +56,7 @@ def introspect(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Introspection:
"""Read account information associated with an `access_token`"""
return self._get(
Expand All @@ -81,7 +83,7 @@ async def disconnect(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> DisconnectResponse:
"""
Disconnect an employer from your application and invalidate all `access_token`s
Expand All @@ -104,7 +106,7 @@ async def introspect(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Introspection:
"""Read account information associated with an `access_token`"""
return await self._get(
Expand Down
22 changes: 12 additions & 10 deletions src/finch/resources/hris/benefits/benefits.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from typing import TYPE_CHECKING, Optional

import httpx

from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ...._utils import maybe_transform
from .individuals import (
Expand Down Expand Up @@ -53,7 +55,7 @@ def create(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CreateCompanyBenefitsResponse:
"""
**Availability: Automated and Assisted Benefits providers**
Expand Down Expand Up @@ -97,7 +99,7 @@ def retrieve(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CompanyBenefit:
"""
**Availability: Automated Benefits providers only**
Expand Down Expand Up @@ -131,7 +133,7 @@ def update(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> UpdateCompanyBenefitResponse:
"""
**Availability: Automated and Assisted Benefits providers**
Expand Down Expand Up @@ -166,7 +168,7 @@ def list(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncSinglePage[CompanyBenefit]:
"""
**Availability: Automated Benefits providers only**
Expand All @@ -190,7 +192,7 @@ def list_supported_benefits(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncSinglePage[SupportedBenefit]:
"""
**Availability: Automated and Assisted Benefits providers**
Expand Down Expand Up @@ -228,7 +230,7 @@ async def create(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CreateCompanyBenefitsResponse:
"""
**Availability: Automated and Assisted Benefits providers**
Expand Down Expand Up @@ -272,7 +274,7 @@ async def retrieve(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CompanyBenefit:
"""
**Availability: Automated Benefits providers only**
Expand Down Expand Up @@ -306,7 +308,7 @@ async def update(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> UpdateCompanyBenefitResponse:
"""
**Availability: Automated and Assisted Benefits providers**
Expand Down Expand Up @@ -341,7 +343,7 @@ def list(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[CompanyBenefit, AsyncSinglePage[CompanyBenefit]]:
"""
**Availability: Automated Benefits providers only**
Expand All @@ -365,7 +367,7 @@ def list_supported_benefits(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[SupportedBenefit, AsyncSinglePage[SupportedBenefit]]:
"""
**Availability: Automated and Assisted Benefits providers**
Expand Down
18 changes: 10 additions & 8 deletions src/finch/resources/hris/benefits/individuals.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from typing import TYPE_CHECKING, List

import httpx

from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ...._utils import maybe_transform
from ...._resource import SyncAPIResource, AsyncAPIResource
Expand Down Expand Up @@ -43,7 +45,7 @@ def enroll_many(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncSinglePage[EnrolledIndividual]:
"""
**Availability: Automated and Assisted Benefits providers**
Expand Down Expand Up @@ -88,7 +90,7 @@ def enrolled_ids(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> IndividualEnrolledIDsResponse:
"""
**Availability: Automated Benefits providers only**
Expand Down Expand Up @@ -122,7 +124,7 @@ def retrieve_many_benefits(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncSinglePage[IndividualBenefit]:
"""
**Availability: Automated Benefits providers only**
Expand Down Expand Up @@ -167,7 +169,7 @@ def unenroll_many(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncSinglePage[UnenrolledIndividual]:
"""
**Availability: Automated and Assisted Benefits providers**
Expand Down Expand Up @@ -216,7 +218,7 @@ def enroll_many(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[EnrolledIndividual, AsyncSinglePage[EnrolledIndividual]]:
"""
**Availability: Automated and Assisted Benefits providers**
Expand Down Expand Up @@ -261,7 +263,7 @@ async def enrolled_ids(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> IndividualEnrolledIDsResponse:
"""
**Availability: Automated Benefits providers only**
Expand Down Expand Up @@ -295,7 +297,7 @@ def retrieve_many_benefits(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[IndividualBenefit, AsyncSinglePage[IndividualBenefit]]:
"""
**Availability: Automated Benefits providers only**
Expand Down Expand Up @@ -340,7 +342,7 @@ def unenroll_many(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[UnenrolledIndividual, AsyncSinglePage[UnenrolledIndividual]]:
"""
**Availability: Automated and Assisted Benefits providers**
Expand Down
6 changes: 4 additions & 2 deletions src/finch/resources/hris/company.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from typing import TYPE_CHECKING

import httpx

from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import to_raw_response_wrapper, async_to_raw_response_wrapper
Expand Down Expand Up @@ -31,7 +33,7 @@ def retrieve(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Company:
"""Read basic company data"""
return self._get(
Expand All @@ -58,7 +60,7 @@ async def retrieve(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Company:
"""Read basic company data"""
return await self._get(
Expand Down
10 changes: 6 additions & 4 deletions src/finch/resources/hris/directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import typing_extensions
from typing import TYPE_CHECKING

import httpx

from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._utils import maybe_transform
from ..._resource import SyncAPIResource, AsyncAPIResource
Expand Down Expand Up @@ -36,7 +38,7 @@ def list(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncIndividualsPage[IndividualInDirectory]:
"""
Read company directory and organization structure
Expand Down Expand Up @@ -84,7 +86,7 @@ def list_individuals(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncIndividualsPage[IndividualInDirectory]:
"""
Read company directory and organization structure
Expand Down Expand Up @@ -129,7 +131,7 @@ def list(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[IndividualInDirectory, AsyncIndividualsPage[IndividualInDirectory]]:
"""
Read company directory and organization structure
Expand Down Expand Up @@ -177,7 +179,7 @@ def list_individuals(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[IndividualInDirectory, AsyncIndividualsPage[IndividualInDirectory]]:
"""
Read company directory and organization structure
Expand Down
6 changes: 4 additions & 2 deletions src/finch/resources/hris/employments.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from typing import TYPE_CHECKING, List

import httpx

from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._utils import maybe_transform
from ..._resource import SyncAPIResource, AsyncAPIResource
Expand Down Expand Up @@ -34,7 +36,7 @@ def retrieve_many(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncResponsesPage[EmploymentDataResponse]:
"""
Read individual employment and income data
Expand Down Expand Up @@ -82,7 +84,7 @@ def retrieve_many(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[EmploymentDataResponse, AsyncResponsesPage[EmploymentDataResponse]]:
"""
Read individual employment and income data
Expand Down
6 changes: 4 additions & 2 deletions src/finch/resources/hris/individuals.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from typing import TYPE_CHECKING, List, Optional

import httpx

from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._utils import maybe_transform
from ..._resource import SyncAPIResource, AsyncAPIResource
Expand Down Expand Up @@ -35,7 +37,7 @@ def retrieve_many(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncResponsesPage[IndividualResponse]:
"""
Read individual data, excluding income and employment data
Expand Down Expand Up @@ -84,7 +86,7 @@ def retrieve_many(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[IndividualResponse, AsyncResponsesPage[IndividualResponse]]:
"""
Read individual data, excluding income and employment data
Expand Down
6 changes: 4 additions & 2 deletions src/finch/resources/hris/pay_statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from typing import TYPE_CHECKING, List

import httpx

from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._utils import maybe_transform
from ..._resource import SyncAPIResource, AsyncAPIResource
Expand Down Expand Up @@ -34,7 +36,7 @@ def retrieve_many(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncResponsesPage[PayStatementResponse]:
"""
Read detailed pay statements for each individual.
Expand Down Expand Up @@ -83,7 +85,7 @@ def retrieve_many(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[PayStatementResponse, AsyncResponsesPage[PayStatementResponse]]:
"""
Read detailed pay statements for each individual.
Expand Down
Loading