diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f29e96b8..36116e17 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.36.0" + ".": "1.37.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 496cf9a0..80967a2d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 46 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-bb50c0ae41ff5036adf72344d33057941f6de67c5fae811eba2e758bfa4ffd31.yml -openapi_spec_hash: 1b21e4bfc46daeef1613e410e5aa8f28 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-b57bba4d2e9b4a64e1c8c3f037aad70e35a164bb1f3b5082948717b94d501a30.yml +openapi_spec_hash: 7e111f64fb635d9dc76da7eaedd0296f config_hash: 6d3585c0032e08d723d077d660fc8448 diff --git a/CHANGELOG.md b/CHANGELOG.md index be9676dc..1d613e4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,31 @@ # Changelog +## 1.37.0 (2025-10-14) + +Full Changelog: [v1.36.0...v1.37.0](https://github.com/Finch-API/finch-api-python/compare/v1.36.0...v1.37.0) + +### Features + +* **api:** api update ([b676295](https://github.com/Finch-API/finch-api-python/commit/b676295b15b012c8388ca679ab9815e34ce457df)) +* **api:** api update ([3b99127](https://github.com/Finch-API/finch-api-python/commit/3b9912772396d97b16f2b5dec275ffd5c46fc4ea)) +* **api:** api update ([9885ba4](https://github.com/Finch-API/finch-api-python/commit/9885ba4aba34ab023117ed8cb03bf38bb8baaef2)) +* **api:** api update ([8d08d1b](https://github.com/Finch-API/finch-api-python/commit/8d08d1b5226654243854f230bb34727ec5ac430b)) +* **api:** api update ([647e7c6](https://github.com/Finch-API/finch-api-python/commit/647e7c62de07d1b7ee16e76592f3594b7bba373d)) +* **api:** api update ([e014b8b](https://github.com/Finch-API/finch-api-python/commit/e014b8be6ee16d732b597dd93bcd5f0573c87254)) + + +### Bug Fixes + +* **compat:** compat with `pydantic<2.8.0` when using additional fields ([2d12ad9](https://github.com/Finch-API/finch-api-python/commit/2d12ad9207864192d9166bdf21d61effeabc6ae9)) + + +### Chores + +* do not install brew dependencies in ./scripts/bootstrap by default ([d9ac7ed](https://github.com/Finch-API/finch-api-python/commit/d9ac7edae7fdda865513b488caa03bd305b29b58)) +* **internal:** detect missing future annotations with ruff ([c1e5e28](https://github.com/Finch-API/finch-api-python/commit/c1e5e2841ec38f9d290169abd6320fb0b8438f2f)) +* **internal:** update pydantic dependency ([1e72324](https://github.com/Finch-API/finch-api-python/commit/1e723242d8a86affd25c23a009318ed4da5e3374)) +* **types:** change optional parameter type from NotGiven to Omit ([ae486ab](https://github.com/Finch-API/finch-api-python/commit/ae486abd5198b2aa15615108ef70281b1194666c)) + ## 1.36.0 (2025-09-08) Full Changelog: [v1.35.0...v1.36.0](https://github.com/Finch-API/finch-api-python/compare/v1.35.0...v1.36.0) diff --git a/api.md b/api.md index 8dad5c14..18634d66 100644 --- a/api.md +++ b/api.md @@ -212,12 +212,12 @@ Methods: Types: ```python -from finch.types import Provider +from finch.types import Provider, ProviderListResponse ``` Methods: -- client.providers.list() -> SyncSinglePage[Provider] +- client.providers.list() -> SyncSinglePage[ProviderListResponse] # Account @@ -281,7 +281,7 @@ from finch.types.jobs import AutomatedAsyncJob, AutomatedCreateResponse, Automat Methods: - client.jobs.automated.create(\*\*params) -> AutomatedCreateResponse -- client.jobs.automated.retrieve(job_id, \*\*params) -> AutomatedAsyncJob +- client.jobs.automated.retrieve(job_id) -> AutomatedAsyncJob - client.jobs.automated.list(\*\*params) -> AutomatedListResponse ## Manual @@ -294,7 +294,7 @@ from finch.types.jobs import ManualAsyncJob Methods: -- client.jobs.manual.retrieve(job_id, \*\*params) -> ManualAsyncJob +- client.jobs.manual.retrieve(job_id) -> ManualAsyncJob # Sandbox diff --git a/pyproject.toml b/pyproject.toml index d9e19a7f..5cac29c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "finch-api" -version = "1.36.0" +version = "1.37.0" description = "The official Python library for the Finch API" dynamic = ["readme"] license = "Apache-2.0" @@ -224,6 +224,8 @@ select = [ "B", # remove unused imports "F401", + # check for missing future annotations + "FA102", # bare except statements "E722", # unused arguments @@ -246,6 +248,8 @@ unfixable = [ "T203", ] +extend-safe-fixes = ["FA102"] + [tool.ruff.lint.flake8-tidy-imports.banned-api] "functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead" diff --git a/requirements-dev.lock b/requirements-dev.lock index b353a1ba..1f0c2776 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -88,9 +88,9 @@ pluggy==1.5.0 propcache==0.3.1 # via aiohttp # via yarl -pydantic==2.10.3 +pydantic==2.11.9 # via finch-api -pydantic-core==2.27.1 +pydantic-core==2.33.2 # via pydantic pygments==2.18.0 # via rich @@ -126,6 +126,9 @@ typing-extensions==4.12.2 # via pydantic # via pydantic-core # via pyright + # via typing-inspection +typing-inspection==0.4.1 + # via pydantic virtualenv==20.24.5 # via nox yarl==1.20.0 diff --git a/requirements.lock b/requirements.lock index a7f7f00c..7953c791 100644 --- a/requirements.lock +++ b/requirements.lock @@ -55,9 +55,9 @@ multidict==6.4.4 propcache==0.3.1 # via aiohttp # via yarl -pydantic==2.10.3 +pydantic==2.11.9 # via finch-api -pydantic-core==2.27.1 +pydantic-core==2.33.2 # via pydantic sniffio==1.3.0 # via anyio @@ -68,5 +68,8 @@ typing-extensions==4.12.2 # via multidict # via pydantic # via pydantic-core + # via typing-inspection +typing-inspection==0.4.1 + # via pydantic yarl==1.20.0 # via aiohttp diff --git a/scripts/bootstrap b/scripts/bootstrap index e84fe62c..b430fee3 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,10 +4,18 @@ set -e cd "$(dirname "$0")/.." -if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then brew bundle check >/dev/null 2>&1 || { - echo "==> Installing Homebrew dependencies…" - brew bundle + echo -n "==> Install Homebrew dependencies? (y/N): " + read -r response + case "$response" in + [yY][eE][sS]|[yY]) + brew bundle + ;; + *) + ;; + esac + echo } fi diff --git a/src/finch/__init__.py b/src/finch/__init__.py index 41c80a92..7b799b16 100644 --- a/src/finch/__init__.py +++ b/src/finch/__init__.py @@ -3,7 +3,7 @@ import typing as _t from . import types -from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes +from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given from ._utils import file_from_path from ._client import Finch, Client, Stream, Timeout, Transport, AsyncFinch, AsyncClient, AsyncStream, RequestOptions from ._models import BaseModel @@ -38,7 +38,9 @@ "ProxiesTypes", "NotGiven", "NOT_GIVEN", + "not_given", "Omit", + "omit", "FinchError", "APIError", "APIStatusError", diff --git a/src/finch/_base_client.py b/src/finch/_base_client.py index 4dee4d8e..072c469b 100644 --- a/src/finch/_base_client.py +++ b/src/finch/_base_client.py @@ -42,7 +42,6 @@ from ._qs import Querystring from ._files import to_httpx_files, async_to_httpx_files from ._types import ( - NOT_GIVEN, Body, Omit, Query, @@ -57,6 +56,7 @@ RequestOptions, HttpxRequestFiles, ModelBuilderProtocol, + not_given, ) from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping from ._compat import PYDANTIC_V1, model_copy, model_dump @@ -146,9 +146,9 @@ def __init__( def __init__( self, *, - url: URL | NotGiven = NOT_GIVEN, - json: Body | NotGiven = NOT_GIVEN, - params: Query | NotGiven = NOT_GIVEN, + url: URL | NotGiven = not_given, + json: Body | NotGiven = not_given, + params: Query | NotGiven = not_given, ) -> None: self.url = url self.json = json @@ -596,7 +596,7 @@ def _maybe_override_cast_to(self, cast_to: type[ResponseT], options: FinalReques # we internally support defining a temporary header to override the # default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response` # see _response.py for implementation details - override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, NOT_GIVEN) + override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, not_given) if is_given(override_cast_to): options.headers = headers return cast(Type[ResponseT], override_cast_to) @@ -826,7 +826,7 @@ def __init__( version: str, base_url: str | URL, max_retries: int = DEFAULT_MAX_RETRIES, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.Client | None = None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, @@ -1371,7 +1371,7 @@ def __init__( base_url: str | URL, _strict_response_validation: bool, max_retries: int = DEFAULT_MAX_RETRIES, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.AsyncClient | None = None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, @@ -1847,8 +1847,8 @@ def make_request_options( extra_query: Query | None = None, extra_body: Body | None = None, idempotency_key: str | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - post_parser: PostParser | 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.""" options: RequestOptions = {} diff --git a/src/finch/_client.py b/src/finch/_client.py index f08e2199..cb1cea55 100644 --- a/src/finch/_client.py +++ b/src/finch/_client.py @@ -4,7 +4,7 @@ import os import base64 -from typing import TYPE_CHECKING, Any, Union, Mapping +from typing import TYPE_CHECKING, Any, Mapping from typing_extensions import Self, override import httpx @@ -12,7 +12,6 @@ from . import _exceptions from ._qs import Querystring from ._types import ( - NOT_GIVEN, Omit, Headers, Timeout, @@ -20,6 +19,7 @@ Transport, ProxiesTypes, RequestOptions, + not_given, ) from ._utils import is_given, get_async_library from ._compat import cached_property @@ -73,7 +73,7 @@ def __init__( client_secret: str | None = None, webhook_secret: str | None = None, base_url: str | httpx.URL | None = None, - timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, max_retries: int = DEFAULT_MAX_RETRIES, default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, @@ -261,9 +261,9 @@ def copy( client_secret: str | None = None, webhook_secret: str | None = None, base_url: str | httpx.URL | None = None, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.Client | None = None, - max_retries: int | NotGiven = NOT_GIVEN, + max_retries: int | NotGiven = not_given, default_headers: Mapping[str, str] | None = None, set_default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, @@ -423,7 +423,7 @@ def __init__( client_secret: str | None = None, webhook_secret: str | None = None, base_url: str | httpx.URL | None = None, - timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, max_retries: int = DEFAULT_MAX_RETRIES, default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, @@ -611,9 +611,9 @@ def copy( client_secret: str | None = None, webhook_secret: str | None = None, base_url: str | httpx.URL | None = None, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.AsyncClient | None = None, - max_retries: int | NotGiven = NOT_GIVEN, + max_retries: int | NotGiven = not_given, default_headers: Mapping[str, str] | None = None, set_default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, diff --git a/src/finch/_models.py b/src/finch/_models.py index 3a6017ef..6a3cd1d2 100644 --- a/src/finch/_models.py +++ b/src/finch/_models.py @@ -256,7 +256,7 @@ def model_dump( mode: Literal["json", "python"] | str = "python", include: IncEx | None = None, exclude: IncEx | None = None, - by_alias: bool = False, + by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, @@ -264,6 +264,7 @@ def model_dump( warnings: bool | Literal["none", "warn", "error"] = True, context: dict[str, Any] | None = None, serialize_as_any: bool = False, + fallback: Callable[[Any], Any] | None = None, ) -> dict[str, Any]: """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump @@ -295,10 +296,12 @@ def model_dump( raise ValueError("context is only supported in Pydantic v2") if serialize_as_any != False: raise ValueError("serialize_as_any is only supported in Pydantic v2") + if fallback is not None: + raise ValueError("fallback is only supported in Pydantic v2") dumped = super().dict( # pyright: ignore[reportDeprecated] include=include, exclude=exclude, - by_alias=by_alias, + by_alias=by_alias if by_alias is not None else False, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, exclude_none=exclude_none, @@ -313,13 +316,14 @@ def model_dump_json( indent: int | None = None, include: IncEx | None = None, exclude: IncEx | None = None, - by_alias: bool = False, + by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal["none", "warn", "error"] = True, context: dict[str, Any] | None = None, + fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False, ) -> str: """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json @@ -348,11 +352,13 @@ def model_dump_json( raise ValueError("context is only supported in Pydantic v2") if serialize_as_any != False: raise ValueError("serialize_as_any is only supported in Pydantic v2") + if fallback is not None: + raise ValueError("fallback is only supported in Pydantic v2") return super().json( # type: ignore[reportDeprecated] indent=indent, include=include, exclude=exclude, - by_alias=by_alias, + by_alias=by_alias if by_alias is not None else False, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, exclude_none=exclude_none, diff --git a/src/finch/_qs.py b/src/finch/_qs.py index 274320ca..ada6fd3f 100644 --- a/src/finch/_qs.py +++ b/src/finch/_qs.py @@ -4,7 +4,7 @@ from urllib.parse import parse_qs, urlencode from typing_extensions import Literal, get_args -from ._types import NOT_GIVEN, NotGiven, NotGivenOr +from ._types import NotGiven, not_given from ._utils import flatten _T = TypeVar("_T") @@ -41,8 +41,8 @@ def stringify( self, params: Params, *, - array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, - nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + array_format: ArrayFormat | NotGiven = not_given, + nested_format: NestedFormat | NotGiven = not_given, ) -> str: return urlencode( self.stringify_items( @@ -56,8 +56,8 @@ def stringify_items( self, params: Params, *, - array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, - nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + array_format: ArrayFormat | NotGiven = not_given, + nested_format: NestedFormat | NotGiven = not_given, ) -> list[tuple[str, str]]: opts = Options( qs=self, @@ -143,8 +143,8 @@ def __init__( self, qs: Querystring = _qs, *, - array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, - nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + array_format: ArrayFormat | NotGiven = not_given, + nested_format: NestedFormat | NotGiven = not_given, ) -> None: self.array_format = qs.array_format if isinstance(array_format, NotGiven) else array_format self.nested_format = qs.nested_format if isinstance(nested_format, NotGiven) else nested_format diff --git a/src/finch/_types.py b/src/finch/_types.py index 9a4666ba..b99b2f91 100644 --- a/src/finch/_types.py +++ b/src/finch/_types.py @@ -118,18 +118,21 @@ class RequestOptions(TypedDict, total=False): # Sentinel class used until PEP 0661 is accepted class NotGiven: """ - A sentinel singleton class used to distinguish omitted keyword arguments - from those passed in with the value None (which may have different behavior). + For parameters with a meaningful None value, we need to distinguish between + the user explicitly passing None, and the user not passing the parameter at + all. + + User code shouldn't need to use not_given directly. For example: ```py - def get(timeout: Union[int, NotGiven, None] = NotGiven()) -> Response: ... + def create(timeout: Timeout | None | NotGiven = not_given): ... - get(timeout=1) # 1s timeout - get(timeout=None) # No timeout - get() # Default timeout behavior, which may not be statically known at the method definition. + create(timeout=1) # 1s timeout + create(timeout=None) # No timeout + create() # Default timeout behavior ``` """ @@ -141,13 +144,14 @@ def __repr__(self) -> str: return "NOT_GIVEN" -NotGivenOr = Union[_T, NotGiven] +not_given = NotGiven() +# for backwards compatibility: NOT_GIVEN = NotGiven() class Omit: - """In certain situations you need to be able to represent a case where a default value has - to be explicitly removed and `None` is not an appropriate substitute, for example: + """ + To explicitly omit something from being sent in a request, use `omit`. ```py # as the default `Content-Type` header is `application/json` that will be sent @@ -157,8 +161,8 @@ class Omit: # to look something like: 'multipart/form-data; boundary=0d8382fcf5f8c3be01ca2e11002d2983' client.post(..., headers={"Content-Type": "multipart/form-data"}) - # instead you can remove the default `application/json` header by passing Omit - client.post(..., headers={"Content-Type": Omit()}) + # instead you can remove the default `application/json` header by passing omit + client.post(..., headers={"Content-Type": omit}) ``` """ @@ -166,6 +170,9 @@ def __bool__(self) -> Literal[False]: return False +omit = Omit() + + @runtime_checkable class ModelBuilderProtocol(Protocol): @classmethod diff --git a/src/finch/_utils/_transform.py b/src/finch/_utils/_transform.py index c19124f0..52075492 100644 --- a/src/finch/_utils/_transform.py +++ b/src/finch/_utils/_transform.py @@ -268,7 +268,7 @@ def _transform_typeddict( annotations = get_type_hints(expected_type, include_extras=True) for key, value in data.items(): if not is_given(value): - # we don't need to include `NotGiven` values here as they'll + # we don't need to include omitted values here as they'll # be stripped out before the request is sent anyway continue @@ -434,7 +434,7 @@ async def _async_transform_typeddict( annotations = get_type_hints(expected_type, include_extras=True) for key, value in data.items(): if not is_given(value): - # we don't need to include `NotGiven` values here as they'll + # we don't need to include omitted values here as they'll # be stripped out before the request is sent anyway continue diff --git a/src/finch/_utils/_utils.py b/src/finch/_utils/_utils.py index f0818595..50d59269 100644 --- a/src/finch/_utils/_utils.py +++ b/src/finch/_utils/_utils.py @@ -21,7 +21,7 @@ import sniffio -from .._types import NotGiven, FileTypes, NotGivenOr, HeadersLike +from .._types import Omit, NotGiven, FileTypes, HeadersLike _T = TypeVar("_T") _TupleT = TypeVar("_TupleT", bound=Tuple[object, ...]) @@ -63,7 +63,7 @@ def _extract_items( try: key = path[index] except IndexError: - if isinstance(obj, NotGiven): + if not is_given(obj): # no value was provided - we can safely ignore return [] @@ -126,8 +126,8 @@ def _extract_items( return [] -def is_given(obj: NotGivenOr[_T]) -> TypeGuard[_T]: - return not isinstance(obj, NotGiven) +def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]: + return not isinstance(obj, NotGiven) and not isinstance(obj, Omit) # Type safe methods for narrowing types with TypeVars. diff --git a/src/finch/_version.py b/src/finch/_version.py index 02127b56..d2d9b5da 100644 --- a/src/finch/_version.py +++ b/src/finch/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "finch" -__version__ = "1.36.0" # x-release-please-version +__version__ = "1.37.0" # x-release-please-version diff --git a/src/finch/resources/access_tokens.py b/src/finch/resources/access_tokens.py index 7a171237..39599bc9 100644 --- a/src/finch/resources/access_tokens.py +++ b/src/finch/resources/access_tokens.py @@ -6,7 +6,7 @@ from .. import _legacy_response from ..types import access_token_create_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import is_given, maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -41,15 +41,15 @@ def create( self, *, code: str, - client_id: str | NotGiven = NOT_GIVEN, - client_secret: str | NotGiven = NOT_GIVEN, - redirect_uri: str | NotGiven = NOT_GIVEN, + client_id: str | Omit = omit, + client_secret: str | Omit = omit, + redirect_uri: str | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CreateAccessTokenResponse: """ Exchange the authorization code for an access token @@ -127,15 +127,15 @@ async def create( self, *, code: str, - client_id: str | NotGiven = NOT_GIVEN, - client_secret: str | NotGiven = NOT_GIVEN, - redirect_uri: str | NotGiven = NOT_GIVEN, + client_id: str | Omit = omit, + client_secret: str | Omit = omit, + redirect_uri: str | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CreateAccessTokenResponse: """ Exchange the authorization code for an access token diff --git a/src/finch/resources/account.py b/src/finch/resources/account.py index 7e5658fb..394a29e8 100644 --- a/src/finch/resources/account.py +++ b/src/finch/resources/account.py @@ -5,7 +5,7 @@ import httpx from .. import _legacy_response -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Query, Headers, NotGiven, not_given from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper @@ -44,7 +44,7 @@ def disconnect( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DisconnectResponse: """Disconnect one or more `access_token`s from your application.""" return self._post( @@ -63,7 +63,7 @@ def introspect( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Introspection: """Read account information associated with an `access_token`""" return self._get( @@ -103,7 +103,7 @@ async def disconnect( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DisconnectResponse: """Disconnect one or more `access_token`s from your application.""" return await self._post( @@ -122,7 +122,7 @@ async def introspect( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | 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( diff --git a/src/finch/resources/connect/sessions.py b/src/finch/resources/connect/sessions.py index c88c3a67..66663aff 100644 --- a/src/finch/resources/connect/sessions.py +++ b/src/finch/resources/connect/sessions.py @@ -8,7 +8,7 @@ import httpx from ... import _legacy_response -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -44,42 +44,58 @@ def with_streaming_response(self) -> SessionsWithStreamingResponse: def new( self, *, + customer_email: Optional[str], customer_id: str, customer_name: str, + integration: Optional[session_new_params.Integration], + manual: Optional[bool], + minutes_to_expire: Optional[float], products: List[ Literal[ + "benefits", "company", + "deduction", "directory", - "individual", + "documents", "employment", + "individual", "payment", "pay_statement", - "benefits", "ssn", - "deduction", - "documents", ] ], - customer_email: Optional[str] | NotGiven = NOT_GIVEN, - integration: Optional[session_new_params.Integration] | NotGiven = NOT_GIVEN, - manual: Optional[bool] | NotGiven = NOT_GIVEN, - minutes_to_expire: Optional[float] | NotGiven = NOT_GIVEN, - redirect_uri: Optional[str] | NotGiven = NOT_GIVEN, - sandbox: Optional[Literal["finch", "provider"]] | NotGiven = NOT_GIVEN, + redirect_uri: Optional[str], + sandbox: Optional[Literal["finch", "provider"]], # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SessionNewResponse: """ Create a new connect session for an employer Args: + customer_email: Email address of the customer + + customer_id: Unique identifier for the customer + + customer_name: Name of the customer + + integration: Integration configuration for the connect session + + manual: Enable manual authentication mode + minutes_to_expire: The number of minutes until the session expires (defaults to 129,600, which is 90 days) + products: The Finch products to request access to + + redirect_uri: The URI to redirect to after the Connect flow is completed + + sandbox: Sandbox mode for testing + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -92,13 +108,13 @@ def new( "/connect/sessions", body=maybe_transform( { + "customer_email": customer_email, "customer_id": customer_id, "customer_name": customer_name, - "products": products, - "customer_email": customer_email, "integration": integration, "manual": manual, "minutes_to_expire": minutes_to_expire, + "products": products, "redirect_uri": redirect_uri, "sandbox": sandbox, }, @@ -114,31 +130,30 @@ def reauthenticate( self, *, connection_id: str, - minutes_to_expire: Optional[int] | NotGiven = NOT_GIVEN, + minutes_to_expire: int, products: Optional[ List[ Literal[ + "benefits", "company", + "deduction", "directory", - "individual", + "documents", "employment", + "individual", "payment", "pay_statement", - "benefits", "ssn", - "deduction", - "documents", ] ] - ] - | NotGiven = NOT_GIVEN, - redirect_uri: Optional[str] | NotGiven = NOT_GIVEN, + ], + redirect_uri: Optional[str], # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SessionReauthenticateResponse: """ Create a new Connect session for reauthenticating an existing connection @@ -202,42 +217,58 @@ def with_streaming_response(self) -> AsyncSessionsWithStreamingResponse: async def new( self, *, + customer_email: Optional[str], customer_id: str, customer_name: str, + integration: Optional[session_new_params.Integration], + manual: Optional[bool], + minutes_to_expire: Optional[float], products: List[ Literal[ + "benefits", "company", + "deduction", "directory", - "individual", + "documents", "employment", + "individual", "payment", "pay_statement", - "benefits", "ssn", - "deduction", - "documents", ] ], - customer_email: Optional[str] | NotGiven = NOT_GIVEN, - integration: Optional[session_new_params.Integration] | NotGiven = NOT_GIVEN, - manual: Optional[bool] | NotGiven = NOT_GIVEN, - minutes_to_expire: Optional[float] | NotGiven = NOT_GIVEN, - redirect_uri: Optional[str] | NotGiven = NOT_GIVEN, - sandbox: Optional[Literal["finch", "provider"]] | NotGiven = NOT_GIVEN, + redirect_uri: Optional[str], + sandbox: Optional[Literal["finch", "provider"]], # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SessionNewResponse: """ Create a new connect session for an employer Args: + customer_email: Email address of the customer + + customer_id: Unique identifier for the customer + + customer_name: Name of the customer + + integration: Integration configuration for the connect session + + manual: Enable manual authentication mode + minutes_to_expire: The number of minutes until the session expires (defaults to 129,600, which is 90 days) + products: The Finch products to request access to + + redirect_uri: The URI to redirect to after the Connect flow is completed + + sandbox: Sandbox mode for testing + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -250,13 +281,13 @@ async def new( "/connect/sessions", body=await async_maybe_transform( { + "customer_email": customer_email, "customer_id": customer_id, "customer_name": customer_name, - "products": products, - "customer_email": customer_email, "integration": integration, "manual": manual, "minutes_to_expire": minutes_to_expire, + "products": products, "redirect_uri": redirect_uri, "sandbox": sandbox, }, @@ -272,31 +303,30 @@ async def reauthenticate( self, *, connection_id: str, - minutes_to_expire: Optional[int] | NotGiven = NOT_GIVEN, + minutes_to_expire: int, products: Optional[ List[ Literal[ + "benefits", "company", + "deduction", "directory", - "individual", + "documents", "employment", + "individual", "payment", "pay_statement", - "benefits", "ssn", - "deduction", - "documents", ] ] - ] - | NotGiven = NOT_GIVEN, - redirect_uri: Optional[str] | NotGiven = NOT_GIVEN, + ], + redirect_uri: Optional[str], # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SessionReauthenticateResponse: """ Create a new Connect session for reauthenticating an existing connection diff --git a/src/finch/resources/hris/benefits/benefits.py b/src/finch/resources/hris/benefits/benefits.py index eecb7b7f..9ee6c3b0 100644 --- a/src/finch/resources/hris/benefits/benefits.py +++ b/src/finch/resources/hris/benefits/benefits.py @@ -7,7 +7,7 @@ import httpx from .... import _legacy_response -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from .individuals import ( @@ -60,16 +60,16 @@ def with_streaming_response(self) -> BenefitsWithStreamingResponse: def create( self, *, - company_contribution: Optional[benefit_create_params.CompanyContribution] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - frequency: Optional[BenefitFrequency] | NotGiven = NOT_GIVEN, - type: Optional[BenefitType] | NotGiven = NOT_GIVEN, + company_contribution: Optional[benefit_create_params.CompanyContribution] | Omit = omit, + description: str | Omit = omit, + frequency: Optional[BenefitFrequency] | Omit = omit, + type: Optional[BenefitType] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CreateCompanyBenefitsResponse: """Creates a new company-wide deduction or contribution. @@ -121,7 +121,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CompanyBenefit: """ Lists deductions and contributions information for a given item @@ -149,13 +149,13 @@ def update( self, benefit_id: str, *, - description: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UpdateCompanyBenefitResponse: """ Updates an existing company-wide deduction or contribution @@ -190,7 +190,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[CompanyBenefit]: """List all company-wide deductions and contributions.""" return self._get_api_list( @@ -210,7 +210,7 @@ def list_supported_benefits( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[SupportedBenefit]: """Get deductions metadata""" return self._get_api_list( @@ -250,16 +250,16 @@ def with_streaming_response(self) -> AsyncBenefitsWithStreamingResponse: async def create( self, *, - company_contribution: Optional[benefit_create_params.CompanyContribution] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - frequency: Optional[BenefitFrequency] | NotGiven = NOT_GIVEN, - type: Optional[BenefitType] | NotGiven = NOT_GIVEN, + company_contribution: Optional[benefit_create_params.CompanyContribution] | Omit = omit, + description: str | Omit = omit, + frequency: Optional[BenefitFrequency] | Omit = omit, + type: Optional[BenefitType] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CreateCompanyBenefitsResponse: """Creates a new company-wide deduction or contribution. @@ -311,7 +311,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CompanyBenefit: """ Lists deductions and contributions information for a given item @@ -339,13 +339,13 @@ async def update( self, benefit_id: str, *, - description: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UpdateCompanyBenefitResponse: """ Updates an existing company-wide deduction or contribution @@ -380,7 +380,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[CompanyBenefit, AsyncSinglePage[CompanyBenefit]]: """List all company-wide deductions and contributions.""" return self._get_api_list( @@ -400,7 +400,7 @@ def list_supported_benefits( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SupportedBenefit, AsyncSinglePage[SupportedBenefit]]: """Get deductions metadata""" return self._get_api_list( diff --git a/src/finch/resources/hris/benefits/individuals.py b/src/finch/resources/hris/benefits/individuals.py index f9662196..c8aedc9f 100644 --- a/src/finch/resources/hris/benefits/individuals.py +++ b/src/finch/resources/hris/benefits/individuals.py @@ -7,7 +7,7 @@ import httpx from .... import _legacy_response -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr +from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -51,13 +51,13 @@ def enroll_many( self, benefit_id: str, *, - individuals: Iterable[individual_enroll_many_params.Individual] | NotGiven = NOT_GIVEN, + individuals: Iterable[individual_enroll_many_params.Individual] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnrolledIndividualBenefitResponse: """Enroll an individual into a deduction or contribution. @@ -97,7 +97,7 @@ def enrolled_ids( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IndividualEnrolledIDsResponse: """ Lists individuals currently enrolled in a given deduction. @@ -125,13 +125,13 @@ def retrieve_many_benefits( self, benefit_id: str, *, - individual_ids: str | NotGiven = NOT_GIVEN, + individual_ids: str | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[IndividualBenefit]: """ Get enrollment information for the given individuals. @@ -170,13 +170,13 @@ def unenroll_many( self, benefit_id: str, *, - individual_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + individual_ids: SequenceNotStr[str] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UnenrolledIndividualBenefitResponse: """ Unenroll individuals from a deduction or contribution @@ -230,13 +230,13 @@ async def enroll_many( self, benefit_id: str, *, - individuals: Iterable[individual_enroll_many_params.Individual] | NotGiven = NOT_GIVEN, + individuals: Iterable[individual_enroll_many_params.Individual] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EnrolledIndividualBenefitResponse: """Enroll an individual into a deduction or contribution. @@ -276,7 +276,7 @@ async def enrolled_ids( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IndividualEnrolledIDsResponse: """ Lists individuals currently enrolled in a given deduction. @@ -304,13 +304,13 @@ def retrieve_many_benefits( self, benefit_id: str, *, - individual_ids: str | NotGiven = NOT_GIVEN, + individual_ids: str | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[IndividualBenefit, AsyncSinglePage[IndividualBenefit]]: """ Get enrollment information for the given individuals. @@ -349,13 +349,13 @@ async def unenroll_many( self, benefit_id: str, *, - individual_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + individual_ids: SequenceNotStr[str] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UnenrolledIndividualBenefitResponse: """ Unenroll individuals from a deduction or contribution diff --git a/src/finch/resources/hris/company/company.py b/src/finch/resources/hris/company/company.py index c4b39f5b..62cd597c 100644 --- a/src/finch/resources/hris/company/company.py +++ b/src/finch/resources/hris/company/company.py @@ -5,7 +5,7 @@ import httpx from .... import _legacy_response -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper @@ -55,7 +55,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Company: """Read basic company data""" return self._get( @@ -99,7 +99,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Company: """Read basic company data""" return await self._get( diff --git a/src/finch/resources/hris/company/pay_statement_item/pay_statement_item.py b/src/finch/resources/hris/company/pay_statement_item/pay_statement_item.py index 5ddda1bc..8a6ed278 100644 --- a/src/finch/resources/hris/company/pay_statement_item/pay_statement_item.py +++ b/src/finch/resources/hris/company/pay_statement_item/pay_statement_item.py @@ -17,7 +17,7 @@ RulesWithStreamingResponse, AsyncRulesWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ....._utils import maybe_transform from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource @@ -57,18 +57,17 @@ def with_streaming_response(self) -> PayStatementItemWithStreamingResponse: def list( self, *, - categories: List[Literal["earnings", "taxes", "employee_deductions", "employer_contributions"]] - | NotGiven = NOT_GIVEN, - end_date: Union[str, date] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - start_date: Union[str, date] | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + categories: List[Literal["earnings", "taxes", "employee_deductions", "employer_contributions"]] | Omit = omit, + end_date: Union[str, date] | Omit = omit, + name: str | Omit = omit, + start_date: Union[str, date] | Omit = omit, + type: str | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncResponsesPage[PayStatementItemListResponse]: """ **Beta:** this endpoint currently serves employers onboarded after March 4th and @@ -147,18 +146,17 @@ def with_streaming_response(self) -> AsyncPayStatementItemWithStreamingResponse: def list( self, *, - categories: List[Literal["earnings", "taxes", "employee_deductions", "employer_contributions"]] - | NotGiven = NOT_GIVEN, - end_date: Union[str, date] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - start_date: Union[str, date] | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + categories: List[Literal["earnings", "taxes", "employee_deductions", "employer_contributions"]] | Omit = omit, + end_date: Union[str, date] | Omit = omit, + name: str | Omit = omit, + start_date: Union[str, date] | Omit = omit, + type: str | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[PayStatementItemListResponse, AsyncResponsesPage[PayStatementItemListResponse]]: """ **Beta:** this endpoint currently serves employers onboarded after March 4th and diff --git a/src/finch/resources/hris/company/pay_statement_item/rules.py b/src/finch/resources/hris/company/pay_statement_item/rules.py index e85597be..d1c4e6f7 100644 --- a/src/finch/resources/hris/company/pay_statement_item/rules.py +++ b/src/finch/resources/hris/company/pay_statement_item/rules.py @@ -8,7 +8,7 @@ import httpx from ..... import _legacy_response -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ....._utils import maybe_transform, async_maybe_transform from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource @@ -47,17 +47,17 @@ def with_streaming_response(self) -> RulesWithStreamingResponse: def create( self, *, - attributes: rule_create_params.Attributes | NotGiven = NOT_GIVEN, - conditions: Iterable[rule_create_params.Condition] | NotGiven = NOT_GIVEN, - effective_end_date: Optional[str] | NotGiven = NOT_GIVEN, - effective_start_date: Optional[str] | NotGiven = NOT_GIVEN, - entity_type: Literal["pay_statement_item"] | NotGiven = NOT_GIVEN, + attributes: rule_create_params.Attributes | Omit = omit, + conditions: Iterable[rule_create_params.Condition] | Omit = omit, + effective_end_date: Optional[str] | Omit = omit, + effective_start_date: Optional[str] | Omit = omit, + entity_type: Literal["pay_statement_item"] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """ **Beta:** this endpoint currently serves employers onboarded after March 4th and @@ -106,13 +106,13 @@ def update( self, rule_id: str, *, - optional_property: object | NotGiven = NOT_GIVEN, + optional_property: object | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleUpdateResponse: """ **Beta:** this endpoint currently serves employers onboarded after March 4th and @@ -146,7 +146,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncResponsesPage[RuleListResponse]: """ **Beta:** this endpoint currently serves employers onboarded after March 4th and @@ -170,7 +170,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleDeleteResponse: """ **Beta:** this endpoint currently serves employers onboarded after March 4th and @@ -219,17 +219,17 @@ def with_streaming_response(self) -> AsyncRulesWithStreamingResponse: async def create( self, *, - attributes: rule_create_params.Attributes | NotGiven = NOT_GIVEN, - conditions: Iterable[rule_create_params.Condition] | NotGiven = NOT_GIVEN, - effective_end_date: Optional[str] | NotGiven = NOT_GIVEN, - effective_start_date: Optional[str] | NotGiven = NOT_GIVEN, - entity_type: Literal["pay_statement_item"] | NotGiven = NOT_GIVEN, + attributes: rule_create_params.Attributes | Omit = omit, + conditions: Iterable[rule_create_params.Condition] | Omit = omit, + effective_end_date: Optional[str] | Omit = omit, + effective_start_date: Optional[str] | Omit = omit, + entity_type: Literal["pay_statement_item"] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """ **Beta:** this endpoint currently serves employers onboarded after March 4th and @@ -278,13 +278,13 @@ async def update( self, rule_id: str, *, - optional_property: object | NotGiven = NOT_GIVEN, + optional_property: object | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleUpdateResponse: """ **Beta:** this endpoint currently serves employers onboarded after March 4th and @@ -320,7 +320,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[RuleListResponse, AsyncResponsesPage[RuleListResponse]]: """ **Beta:** this endpoint currently serves employers onboarded after March 4th and @@ -344,7 +344,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleDeleteResponse: """ **Beta:** this endpoint currently serves employers onboarded after March 4th and diff --git a/src/finch/resources/hris/directory.py b/src/finch/resources/hris/directory.py index e4e6827e..68ed65f6 100644 --- a/src/finch/resources/hris/directory.py +++ b/src/finch/resources/hris/directory.py @@ -7,7 +7,7 @@ import httpx from ... import _legacy_response -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -43,14 +43,14 @@ def with_streaming_response(self) -> DirectoryWithStreamingResponse: def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + offset: int | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncIndividualsPage[IndividualInDirectory]: """ Read company directory and organization structure @@ -91,14 +91,14 @@ def list( def list_individuals( self, *, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + offset: int | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncIndividualsPage[IndividualInDirectory]: """ Read company directory and organization structure @@ -149,14 +149,14 @@ def with_streaming_response(self) -> AsyncDirectoryWithStreamingResponse: def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + offset: int | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[IndividualInDirectory, AsyncIndividualsPage[IndividualInDirectory]]: """ Read company directory and organization structure @@ -197,14 +197,14 @@ def list( def list_individuals( self, *, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + offset: int | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[IndividualInDirectory, AsyncIndividualsPage[IndividualInDirectory]]: """ Read company directory and organization structure diff --git a/src/finch/resources/hris/documents.py b/src/finch/resources/hris/documents.py index ce3085e8..08470d21 100644 --- a/src/finch/resources/hris/documents.py +++ b/src/finch/resources/hris/documents.py @@ -8,7 +8,7 @@ import httpx from ... import _legacy_response -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -44,16 +44,16 @@ def with_streaming_response(self) -> DocumentsWithStreamingResponse: def list( self, *, - individual_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, - types: List[Literal["w4_2020", "w4_2005"]] | NotGiven = NOT_GIVEN, + individual_ids: SequenceNotStr[str] | Omit = omit, + limit: int | Omit = omit, + offset: int | Omit = omit, + types: List[Literal["w4_2020", "w4_2005"]] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DocumentListResponse: """**Beta:** This endpoint is in beta and may change. @@ -108,7 +108,7 @@ def retreive( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DocumentRetreiveResponse: """**Beta:** This endpoint is in beta and may change. @@ -163,16 +163,16 @@ def with_streaming_response(self) -> AsyncDocumentsWithStreamingResponse: async def list( self, *, - individual_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, - types: List[Literal["w4_2020", "w4_2005"]] | NotGiven = NOT_GIVEN, + individual_ids: SequenceNotStr[str] | Omit = omit, + limit: int | Omit = omit, + offset: int | Omit = omit, + types: List[Literal["w4_2020", "w4_2005"]] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DocumentListResponse: """**Beta:** This endpoint is in beta and may change. @@ -227,7 +227,7 @@ async def retreive( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DocumentRetreiveResponse: """**Beta:** This endpoint is in beta and may change. diff --git a/src/finch/resources/hris/employments.py b/src/finch/resources/hris/employments.py index 14bdd1ad..957c70f5 100644 --- a/src/finch/resources/hris/employments.py +++ b/src/finch/resources/hris/employments.py @@ -7,7 +7,7 @@ import httpx from ... import _legacy_response -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -49,7 +49,7 @@ def retrieve_many( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncResponsesPage[EmploymentDataResponse]: """ Read individual employment and income data @@ -106,7 +106,7 @@ def retrieve_many( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[EmploymentDataResponse, AsyncResponsesPage[EmploymentDataResponse]]: """ Read individual employment and income data diff --git a/src/finch/resources/hris/individuals.py b/src/finch/resources/hris/individuals.py index 1d5e4aae..d6fdacf3 100644 --- a/src/finch/resources/hris/individuals.py +++ b/src/finch/resources/hris/individuals.py @@ -7,7 +7,7 @@ import httpx from ... import _legacy_response -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -43,14 +43,14 @@ def with_streaming_response(self) -> IndividualsWithStreamingResponse: def retrieve_many( self, *, - options: Optional[individual_retrieve_many_params.Options] | NotGiven = NOT_GIVEN, - requests: Iterable[individual_retrieve_many_params.Request] | NotGiven = NOT_GIVEN, + options: Optional[individual_retrieve_many_params.Options] | Omit = omit, + requests: Iterable[individual_retrieve_many_params.Request] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncResponsesPage[IndividualResponse]: """ Read individual data, excluding income and employment data @@ -105,14 +105,14 @@ def with_streaming_response(self) -> AsyncIndividualsWithStreamingResponse: def retrieve_many( self, *, - options: Optional[individual_retrieve_many_params.Options] | NotGiven = NOT_GIVEN, - requests: Iterable[individual_retrieve_many_params.Request] | NotGiven = NOT_GIVEN, + options: Optional[individual_retrieve_many_params.Options] | Omit = omit, + requests: Iterable[individual_retrieve_many_params.Request] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[IndividualResponse, AsyncResponsesPage[IndividualResponse]]: """ Read individual data, excluding income and employment data diff --git a/src/finch/resources/hris/pay_statements.py b/src/finch/resources/hris/pay_statements.py index a4d919b5..6bf92818 100644 --- a/src/finch/resources/hris/pay_statements.py +++ b/src/finch/resources/hris/pay_statements.py @@ -7,7 +7,7 @@ import httpx from ... import _legacy_response -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -49,7 +49,7 @@ def retrieve_many( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncResponsesPage[PayStatementResponse]: """ Read detailed pay statements for each individual. @@ -111,7 +111,7 @@ def retrieve_many( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[PayStatementResponse, AsyncResponsesPage[PayStatementResponse]]: """ Read detailed pay statements for each individual. diff --git a/src/finch/resources/hris/payments.py b/src/finch/resources/hris/payments.py index f9e2010b..0066cb77 100644 --- a/src/finch/resources/hris/payments.py +++ b/src/finch/resources/hris/payments.py @@ -8,7 +8,7 @@ import httpx from ... import _legacy_response -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -51,7 +51,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Payment]: """ Read payroll and contractor related payments by the company. @@ -121,7 +121,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Payment, AsyncSinglePage[Payment]]: """ Read payroll and contractor related payments by the company. diff --git a/src/finch/resources/jobs/automated.py b/src/finch/resources/jobs/automated.py index eb4e7ca9..687e1389 100644 --- a/src/finch/resources/jobs/automated.py +++ b/src/finch/resources/jobs/automated.py @@ -7,12 +7,12 @@ import httpx from ... import _legacy_response -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import required_args, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper -from ...types.jobs import automated_list_params, automated_create_params, automated_retrieve_params +from ...types.jobs import automated_list_params, automated_create_params from ..._base_client import make_request_options from ...types.jobs.automated_async_job import AutomatedAsyncJob from ...types.jobs.automated_list_response import AutomatedListResponse @@ -51,7 +51,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AutomatedCreateResponse: """ Enqueue an automated job. @@ -93,7 +93,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AutomatedCreateResponse: """ Enqueue an automated job. @@ -129,13 +129,13 @@ def create( self, *, type: Literal["data_sync_all"] | Literal["w4_form_employee_sync"], - params: automated_create_params.W4FormEmployeeSyncParams | NotGiven = NOT_GIVEN, + params: automated_create_params.W4FormEmployeeSyncParams | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AutomatedCreateResponse: return self._post( "/jobs/automated", @@ -156,22 +156,17 @@ def retrieve( self, job_id: str, *, - entity_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AutomatedAsyncJob: """ Get an automated job by `job_id`. Args: - entity_id: The entity ID to use when authenticating with a multi-account token. Required - when using a multi-account token to specify which entity's data to access. - Example: `123e4567-e89b-12d3-a456-426614174000` - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -185,11 +180,7 @@ def retrieve( return self._get( f"/jobs/automated/{job_id}", options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform({"entity_id": entity_id}, automated_retrieve_params.AutomatedRetrieveParams), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=AutomatedAsyncJob, ) @@ -197,15 +188,14 @@ def retrieve( def list( self, *, - entity_id: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + offset: int | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AutomatedListResponse: """Get all automated jobs. @@ -214,10 +204,6 @@ def list( as data syncs, only the next scheduled job is shown. Args: - entity_id: The entity ID to use when authenticating with a multi-account token. Required - when using a multi-account token to specify which entity's data to access. - Example: `123e4567-e89b-12d3-a456-426614174000` - limit: Number of items to return offset: Index to start from (defaults to 0) @@ -239,7 +225,6 @@ def list( timeout=timeout, query=maybe_transform( { - "entity_id": entity_id, "limit": limit, "offset": offset, }, @@ -280,7 +265,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AutomatedCreateResponse: """ Enqueue an automated job. @@ -322,7 +307,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AutomatedCreateResponse: """ Enqueue an automated job. @@ -358,13 +343,13 @@ async def create( self, *, type: Literal["data_sync_all"] | Literal["w4_form_employee_sync"], - params: automated_create_params.W4FormEmployeeSyncParams | NotGiven = NOT_GIVEN, + params: automated_create_params.W4FormEmployeeSyncParams | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AutomatedCreateResponse: return await self._post( "/jobs/automated", @@ -385,22 +370,17 @@ async def retrieve( self, job_id: str, *, - entity_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AutomatedAsyncJob: """ Get an automated job by `job_id`. Args: - entity_id: The entity ID to use when authenticating with a multi-account token. Required - when using a multi-account token to specify which entity's data to access. - Example: `123e4567-e89b-12d3-a456-426614174000` - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -414,13 +394,7 @@ async def retrieve( return await self._get( f"/jobs/automated/{job_id}", options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - {"entity_id": entity_id}, automated_retrieve_params.AutomatedRetrieveParams - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=AutomatedAsyncJob, ) @@ -428,15 +402,14 @@ async def retrieve( async def list( self, *, - entity_id: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + offset: int | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AutomatedListResponse: """Get all automated jobs. @@ -445,10 +418,6 @@ async def list( as data syncs, only the next scheduled job is shown. Args: - entity_id: The entity ID to use when authenticating with a multi-account token. Required - when using a multi-account token to specify which entity's data to access. - Example: `123e4567-e89b-12d3-a456-426614174000` - limit: Number of items to return offset: Index to start from (defaults to 0) @@ -470,7 +439,6 @@ async def list( timeout=timeout, query=await async_maybe_transform( { - "entity_id": entity_id, "limit": limit, "offset": offset, }, diff --git a/src/finch/resources/jobs/manual.py b/src/finch/resources/jobs/manual.py index de9a8413..e2f4d6d8 100644 --- a/src/finch/resources/jobs/manual.py +++ b/src/finch/resources/jobs/manual.py @@ -5,12 +5,10 @@ import httpx from ... import _legacy_response -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import maybe_transform, async_maybe_transform +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper -from ...types.jobs import manual_retrieve_params from ..._base_client import make_request_options from ...types.jobs.manual_async_job import ManualAsyncJob @@ -41,13 +39,12 @@ def retrieve( self, job_id: str, *, - entity_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ManualAsyncJob: """Get a manual job by `job_id`. @@ -55,10 +52,6 @@ def retrieve( Assisted Benefits jobs. Args: - entity_id: The entity ID to use when authenticating with a multi-account token. Required - when using a multi-account token to specify which entity's data to access. - Example: `123e4567-e89b-12d3-a456-426614174000` - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -72,11 +65,7 @@ def retrieve( return self._get( f"/jobs/manual/{job_id}", options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform({"entity_id": entity_id}, manual_retrieve_params.ManualRetrieveParams), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=ManualAsyncJob, ) @@ -106,13 +95,12 @@ async def retrieve( self, job_id: str, *, - entity_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ManualAsyncJob: """Get a manual job by `job_id`. @@ -120,10 +108,6 @@ async def retrieve( Assisted Benefits jobs. Args: - entity_id: The entity ID to use when authenticating with a multi-account token. Required - when using a multi-account token to specify which entity's data to access. - Example: `123e4567-e89b-12d3-a456-426614174000` - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -137,13 +121,7 @@ async def retrieve( return await self._get( f"/jobs/manual/{job_id}", options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - {"entity_id": entity_id}, manual_retrieve_params.ManualRetrieveParams - ), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=ManualAsyncJob, ) diff --git a/src/finch/resources/payroll/pay_groups.py b/src/finch/resources/payroll/pay_groups.py index da646900..dffc9d39 100644 --- a/src/finch/resources/payroll/pay_groups.py +++ b/src/finch/resources/payroll/pay_groups.py @@ -5,7 +5,7 @@ import httpx from ... import _legacy_response -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -48,7 +48,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PayGroupRetrieveResponse: """ Read information from a single pay group @@ -75,14 +75,14 @@ def retrieve( def list( self, *, - individual_id: str | NotGiven = NOT_GIVEN, - pay_frequencies: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + individual_id: str | Omit = omit, + pay_frequencies: SequenceNotStr[str] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[PayGroupListResponse]: """ Read company pay groups and frequencies @@ -145,7 +145,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PayGroupRetrieveResponse: """ Read information from a single pay group @@ -172,14 +172,14 @@ async def retrieve( def list( self, *, - individual_id: str | NotGiven = NOT_GIVEN, - pay_frequencies: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + individual_id: str | Omit = omit, + pay_frequencies: SequenceNotStr[str] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[PayGroupListResponse, AsyncSinglePage[PayGroupListResponse]]: """ Read company pay groups and frequencies diff --git a/src/finch/resources/providers.py b/src/finch/resources/providers.py index 76fc8852..9fc6fad3 100644 --- a/src/finch/resources/providers.py +++ b/src/finch/resources/providers.py @@ -5,13 +5,13 @@ import httpx from .. import _legacy_response -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Query, Headers, NotGiven, not_given from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ..pagination import SyncSinglePage, AsyncSinglePage from .._base_client import AsyncPaginator, make_request_options -from ..types.provider import Provider +from ..types.provider_list_response import ProviderListResponse __all__ = ["Providers", "AsyncProviders"] @@ -44,16 +44,16 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[Provider]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncSinglePage[ProviderListResponse]: """Return details on all available payroll and HR systems.""" return self._get_api_list( "/providers", - page=SyncSinglePage[Provider], + page=SyncSinglePage[ProviderListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=Provider, + model=ProviderListResponse, ) @@ -85,16 +85,16 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Provider, AsyncSinglePage[Provider]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[ProviderListResponse, AsyncSinglePage[ProviderListResponse]]: """Return details on all available payroll and HR systems.""" return self._get_api_list( "/providers", - page=AsyncSinglePage[Provider], + page=AsyncSinglePage[ProviderListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=Provider, + model=ProviderListResponse, ) diff --git a/src/finch/resources/request_forwarding.py b/src/finch/resources/request_forwarding.py index 619d784b..62e2a25e 100644 --- a/src/finch/resources/request_forwarding.py +++ b/src/finch/resources/request_forwarding.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing import Optional +from typing import Dict, Optional import httpx from .. import _legacy_response from ..types import request_forwarding_forward_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -44,15 +44,15 @@ def forward( *, method: str, route: str, - data: Optional[str] | NotGiven = NOT_GIVEN, - headers: Optional[object] | NotGiven = NOT_GIVEN, - params: Optional[object] | NotGiven = NOT_GIVEN, + data: Optional[str] | Omit = omit, + headers: Optional[Dict[str, Optional[object]]] | Omit = omit, + params: Optional[Dict[str, Optional[object]]] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RequestForwardingForwardResponse: """The Forward API allows you to make direct requests to an employment system. @@ -131,15 +131,15 @@ async def forward( *, method: str, route: str, - data: Optional[str] | NotGiven = NOT_GIVEN, - headers: Optional[object] | NotGiven = NOT_GIVEN, - params: Optional[object] | NotGiven = NOT_GIVEN, + data: Optional[str] | Omit = omit, + headers: Optional[Dict[str, Optional[object]]] | Omit = omit, + params: Optional[Dict[str, Optional[object]]] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RequestForwardingForwardResponse: """The Forward API allows you to make direct requests to an employment system. diff --git a/src/finch/resources/sandbox/company.py b/src/finch/resources/sandbox/company.py index 9b76b1c0..45c87dc9 100644 --- a/src/finch/resources/sandbox/company.py +++ b/src/finch/resources/sandbox/company.py @@ -7,7 +7,7 @@ import httpx from ... import _legacy_response -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -56,7 +56,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CompanyUpdateResponse: """ Update a sandbox company's data @@ -143,7 +143,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CompanyUpdateResponse: """ Update a sandbox company's data diff --git a/src/finch/resources/sandbox/connections/accounts.py b/src/finch/resources/sandbox/connections/accounts.py index 956cd971..e38e2a2d 100644 --- a/src/finch/resources/sandbox/connections/accounts.py +++ b/src/finch/resources/sandbox/connections/accounts.py @@ -7,7 +7,7 @@ import httpx from .... import _legacy_response -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr +from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -46,14 +46,14 @@ def create( *, company_id: str, provider_id: str, - authentication_type: Literal["credential", "api_token", "oauth", "assisted"] | NotGiven = NOT_GIVEN, - products: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + authentication_type: Literal["credential", "api_token", "oauth", "assisted"] | Omit = omit, + products: SequenceNotStr[str] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountCreateResponse: """ Create a new account for an existing connection (company/provider pair) @@ -92,13 +92,13 @@ def create( def update( self, *, - connection_status: ConnectionStatusType | NotGiven = NOT_GIVEN, + connection_status: ConnectionStatusType | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountUpdateResponse: """Update an existing sandbox account. @@ -149,14 +149,14 @@ async def create( *, company_id: str, provider_id: str, - authentication_type: Literal["credential", "api_token", "oauth", "assisted"] | NotGiven = NOT_GIVEN, - products: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + authentication_type: Literal["credential", "api_token", "oauth", "assisted"] | Omit = omit, + products: SequenceNotStr[str] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountCreateResponse: """ Create a new account for an existing connection (company/provider pair) @@ -195,13 +195,13 @@ async def create( async def update( self, *, - connection_status: ConnectionStatusType | NotGiven = NOT_GIVEN, + connection_status: ConnectionStatusType | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountUpdateResponse: """Update an existing sandbox account. diff --git a/src/finch/resources/sandbox/connections/connections.py b/src/finch/resources/sandbox/connections/connections.py index 146e6739..c4c35dc3 100644 --- a/src/finch/resources/sandbox/connections/connections.py +++ b/src/finch/resources/sandbox/connections/connections.py @@ -15,7 +15,7 @@ AccountsWithStreamingResponse, AsyncAccountsWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr +from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -55,15 +55,15 @@ def create( self, *, provider_id: str, - authentication_type: Literal["credential", "api_token", "oauth", "assisted"] | NotGiven = NOT_GIVEN, - employee_size: int | NotGiven = NOT_GIVEN, - products: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + authentication_type: Literal["credential", "api_token", "oauth", "assisted"] | Omit = omit, + employee_size: int | Omit = omit, + products: SequenceNotStr[str] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConnectionCreateResponse: """ Create a new connection (new company/provider pair) with a new account @@ -129,15 +129,15 @@ async def create( self, *, provider_id: str, - authentication_type: Literal["credential", "api_token", "oauth", "assisted"] | NotGiven = NOT_GIVEN, - employee_size: int | NotGiven = NOT_GIVEN, - products: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + authentication_type: Literal["credential", "api_token", "oauth", "assisted"] | Omit = omit, + employee_size: int | Omit = omit, + products: SequenceNotStr[str] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConnectionCreateResponse: """ Create a new connection (new company/provider pair) with a new account diff --git a/src/finch/resources/sandbox/directory.py b/src/finch/resources/sandbox/directory.py index 4d3378ca..2afba6a5 100644 --- a/src/finch/resources/sandbox/directory.py +++ b/src/finch/resources/sandbox/directory.py @@ -7,7 +7,7 @@ import httpx from ... import _legacy_response -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -42,13 +42,13 @@ def with_streaming_response(self) -> DirectoryWithStreamingResponse: def create( self, *, - body: Iterable[directory_create_params.Body] | NotGiven = NOT_GIVEN, + body: Iterable[directory_create_params.Body] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DirectoryCreateResponse: """ Add new individuals to a sandbox company @@ -98,13 +98,13 @@ def with_streaming_response(self) -> AsyncDirectoryWithStreamingResponse: async def create( self, *, - body: Iterable[directory_create_params.Body] | NotGiven = NOT_GIVEN, + body: Iterable[directory_create_params.Body] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DirectoryCreateResponse: """ Add new individuals to a sandbox company diff --git a/src/finch/resources/sandbox/employment.py b/src/finch/resources/sandbox/employment.py index 56d44d15..55bd7581 100644 --- a/src/finch/resources/sandbox/employment.py +++ b/src/finch/resources/sandbox/employment.py @@ -8,7 +8,7 @@ import httpx from ... import _legacy_response -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -46,33 +46,33 @@ def update( self, individual_id: str, *, - class_code: Optional[str] | NotGiven = NOT_GIVEN, - custom_fields: Optional[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, + class_code: Optional[str] | Omit = omit, + custom_fields: Optional[Iterable[employment_update_params.CustomField]] | Omit = omit, + department: Optional[employment_update_params.Department] | Omit = omit, + employment: Optional[employment_update_params.Employment] | Omit = omit, employment_status: Optional[ Literal["active", "deceased", "leave", "onboarding", "prehire", "retired", "terminated"] ] - | 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[Iterable[Optional[IncomeParam]]] | NotGiven = NOT_GIVEN, - is_active: Optional[bool] | NotGiven = NOT_GIVEN, - last_name: Optional[str] | NotGiven = NOT_GIVEN, - latest_rehire_date: Optional[str] | NotGiven = NOT_GIVEN, - location: Optional[LocationParam] | NotGiven = NOT_GIVEN, - manager: Optional[employment_update_params.Manager] | NotGiven = NOT_GIVEN, - middle_name: Optional[str] | NotGiven = NOT_GIVEN, - source_id: Optional[str] | NotGiven = NOT_GIVEN, - start_date: Optional[str] | NotGiven = NOT_GIVEN, - title: Optional[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + end_date: Optional[str] | Omit = omit, + first_name: Optional[str] | Omit = omit, + income: Optional[IncomeParam] | Omit = omit, + income_history: Optional[Iterable[Optional[IncomeParam]]] | Omit = omit, + is_active: Optional[bool] | Omit = omit, + last_name: Optional[str] | Omit = omit, + latest_rehire_date: Optional[str] | Omit = omit, + location: Optional[LocationParam] | Omit = omit, + manager: Optional[employment_update_params.Manager] | Omit = omit, + middle_name: Optional[str] | Omit = omit, + source_id: Optional[str] | Omit = omit, + start_date: Optional[str] | Omit = omit, + title: Optional[str] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EmploymentUpdateResponse: """ Update sandbox employment @@ -179,33 +179,33 @@ async def update( self, individual_id: str, *, - class_code: Optional[str] | NotGiven = NOT_GIVEN, - custom_fields: Optional[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, + class_code: Optional[str] | Omit = omit, + custom_fields: Optional[Iterable[employment_update_params.CustomField]] | Omit = omit, + department: Optional[employment_update_params.Department] | Omit = omit, + employment: Optional[employment_update_params.Employment] | Omit = omit, employment_status: Optional[ Literal["active", "deceased", "leave", "onboarding", "prehire", "retired", "terminated"] ] - | 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[Iterable[Optional[IncomeParam]]] | NotGiven = NOT_GIVEN, - is_active: Optional[bool] | NotGiven = NOT_GIVEN, - last_name: Optional[str] | NotGiven = NOT_GIVEN, - latest_rehire_date: Optional[str] | NotGiven = NOT_GIVEN, - location: Optional[LocationParam] | NotGiven = NOT_GIVEN, - manager: Optional[employment_update_params.Manager] | NotGiven = NOT_GIVEN, - middle_name: Optional[str] | NotGiven = NOT_GIVEN, - source_id: Optional[str] | NotGiven = NOT_GIVEN, - start_date: Optional[str] | NotGiven = NOT_GIVEN, - title: Optional[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + end_date: Optional[str] | Omit = omit, + first_name: Optional[str] | Omit = omit, + income: Optional[IncomeParam] | Omit = omit, + income_history: Optional[Iterable[Optional[IncomeParam]]] | Omit = omit, + is_active: Optional[bool] | Omit = omit, + last_name: Optional[str] | Omit = omit, + latest_rehire_date: Optional[str] | Omit = omit, + location: Optional[LocationParam] | Omit = omit, + manager: Optional[employment_update_params.Manager] | Omit = omit, + middle_name: Optional[str] | Omit = omit, + source_id: Optional[str] | Omit = omit, + start_date: Optional[str] | Omit = omit, + title: Optional[str] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EmploymentUpdateResponse: """ Update sandbox employment diff --git a/src/finch/resources/sandbox/individual.py b/src/finch/resources/sandbox/individual.py index fdd077b8..5b9041c0 100644 --- a/src/finch/resources/sandbox/individual.py +++ b/src/finch/resources/sandbox/individual.py @@ -8,7 +8,7 @@ import httpx from ... import _legacy_response -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -45,9 +45,9 @@ def update( self, individual_id: str, *, - dob: Optional[str] | NotGiven = NOT_GIVEN, - emails: Optional[Iterable[individual_update_params.Email]] | NotGiven = NOT_GIVEN, - encrypted_ssn: Optional[str] | NotGiven = NOT_GIVEN, + dob: Optional[str] | Omit = omit, + emails: Optional[Iterable[individual_update_params.Email]] | Omit = omit, + encrypted_ssn: Optional[str] | Omit = omit, ethnicity: Optional[ Literal[ "asian", @@ -60,21 +60,21 @@ def update( "decline_to_specify", ] ] - | NotGiven = NOT_GIVEN, - first_name: Optional[str] | NotGiven = NOT_GIVEN, - 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[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, + | Omit = omit, + first_name: Optional[str] | Omit = omit, + gender: Optional[Literal["female", "male", "other", "decline_to_specify"]] | Omit = omit, + last_name: Optional[str] | Omit = omit, + middle_name: Optional[str] | Omit = omit, + phone_numbers: Optional[Iterable[Optional[individual_update_params.PhoneNumber]]] | Omit = omit, + preferred_name: Optional[str] | Omit = omit, + residence: Optional[LocationParam] | Omit = omit, + ssn: Optional[str] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IndividualUpdateResponse: """ Update sandbox individual @@ -163,9 +163,9 @@ async def update( self, individual_id: str, *, - dob: Optional[str] | NotGiven = NOT_GIVEN, - emails: Optional[Iterable[individual_update_params.Email]] | NotGiven = NOT_GIVEN, - encrypted_ssn: Optional[str] | NotGiven = NOT_GIVEN, + dob: Optional[str] | Omit = omit, + emails: Optional[Iterable[individual_update_params.Email]] | Omit = omit, + encrypted_ssn: Optional[str] | Omit = omit, ethnicity: Optional[ Literal[ "asian", @@ -178,21 +178,21 @@ async def update( "decline_to_specify", ] ] - | NotGiven = NOT_GIVEN, - first_name: Optional[str] | NotGiven = NOT_GIVEN, - 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[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, + | Omit = omit, + first_name: Optional[str] | Omit = omit, + gender: Optional[Literal["female", "male", "other", "decline_to_specify"]] | Omit = omit, + last_name: Optional[str] | Omit = omit, + middle_name: Optional[str] | Omit = omit, + phone_numbers: Optional[Iterable[Optional[individual_update_params.PhoneNumber]]] | Omit = omit, + preferred_name: Optional[str] | Omit = omit, + residence: Optional[LocationParam] | Omit = omit, + ssn: Optional[str] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IndividualUpdateResponse: """ Update sandbox individual diff --git a/src/finch/resources/sandbox/jobs/configuration.py b/src/finch/resources/sandbox/jobs/configuration.py index 3fac04cf..f8839411 100644 --- a/src/finch/resources/sandbox/jobs/configuration.py +++ b/src/finch/resources/sandbox/jobs/configuration.py @@ -7,7 +7,7 @@ import httpx from .... import _legacy_response -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -48,7 +48,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConfigurationRetrieveResponse: """Get configurations for sandbox jobs""" return self._get( @@ -69,7 +69,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SandboxJobConfiguration: """ Update configurations for sandbox jobs @@ -127,7 +127,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConfigurationRetrieveResponse: """Get configurations for sandbox jobs""" return await self._get( @@ -148,7 +148,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SandboxJobConfiguration: """ Update configurations for sandbox jobs diff --git a/src/finch/resources/sandbox/jobs/jobs.py b/src/finch/resources/sandbox/jobs/jobs.py index 38abe210..070bd293 100644 --- a/src/finch/resources/sandbox/jobs/jobs.py +++ b/src/finch/resources/sandbox/jobs/jobs.py @@ -7,7 +7,7 @@ import httpx from .... import _legacy_response -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -60,7 +60,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> JobCreateResponse: """Enqueue a new sandbox job @@ -120,7 +120,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> JobCreateResponse: """Enqueue a new sandbox job diff --git a/src/finch/resources/sandbox/payment.py b/src/finch/resources/sandbox/payment.py index dc2ec15e..2506f49d 100644 --- a/src/finch/resources/sandbox/payment.py +++ b/src/finch/resources/sandbox/payment.py @@ -8,7 +8,7 @@ import httpx from ... import _legacy_response -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -43,15 +43,15 @@ def with_streaming_response(self) -> PaymentWithStreamingResponse: def create( self, *, - end_date: Union[str, date] | NotGiven = NOT_GIVEN, - pay_statements: Iterable[payment_create_params.PayStatement] | NotGiven = NOT_GIVEN, - start_date: Union[str, date] | NotGiven = NOT_GIVEN, + end_date: Union[str, date] | Omit = omit, + pay_statements: Iterable[payment_create_params.PayStatement] | Omit = omit, + start_date: Union[str, date] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PaymentCreateResponse: """ Add a new sandbox payment @@ -107,15 +107,15 @@ def with_streaming_response(self) -> AsyncPaymentWithStreamingResponse: async def create( self, *, - end_date: Union[str, date] | NotGiven = NOT_GIVEN, - pay_statements: Iterable[payment_create_params.PayStatement] | NotGiven = NOT_GIVEN, - start_date: Union[str, date] | NotGiven = NOT_GIVEN, + end_date: Union[str, date] | Omit = omit, + pay_statements: Iterable[payment_create_params.PayStatement] | Omit = omit, + start_date: Union[str, date] | Omit = omit, # 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PaymentCreateResponse: """ Add a new sandbox payment diff --git a/src/finch/types/__init__.py b/src/finch/types/__init__.py index 14bf231d..4981087b 100644 --- a/src/finch/types/__init__.py +++ b/src/finch/types/__init__.py @@ -11,7 +11,6 @@ OperationSupportMatrix as OperationSupportMatrix, ) from .location import Location as Location -from .provider import Provider as Provider from .income_param import IncomeParam as IncomeParam from .company_event import CompanyEvent as CompanyEvent from .introspection import Introspection as Introspection @@ -26,6 +25,7 @@ from .pay_statement_event import PayStatementEvent as PayStatementEvent from .account_update_event import AccountUpdateEvent as AccountUpdateEvent from .job_completion_event import JobCompletionEvent as JobCompletionEvent +from .provider_list_response import ProviderListResponse as ProviderListResponse from .access_token_create_params import AccessTokenCreateParams as AccessTokenCreateParams from .create_access_token_response import CreateAccessTokenResponse as CreateAccessTokenResponse from .request_forwarding_forward_params import RequestForwardingForwardParams as RequestForwardingForwardParams diff --git a/src/finch/types/connect/session_new_params.py b/src/finch/types/connect/session_new_params.py index f49dc752..f62c3f1d 100644 --- a/src/finch/types/connect/session_new_params.py +++ b/src/finch/types/connect/session_new_params.py @@ -9,45 +9,55 @@ class SessionNewParams(TypedDict, total=False): + customer_email: Required[Optional[str]] + """Email address of the customer""" + customer_id: Required[str] + """Unique identifier for the customer""" customer_name: Required[str] + """Name of the customer""" + + integration: Required[Optional[Integration]] + """Integration configuration for the connect session""" + + manual: Required[Optional[bool]] + """Enable manual authentication mode""" + + minutes_to_expire: Required[Optional[float]] + """ + The number of minutes until the session expires (defaults to 129,600, which is + 90 days) + """ products: Required[ List[ Literal[ + "benefits", "company", + "deduction", "directory", - "individual", + "documents", "employment", + "individual", "payment", "pay_statement", - "benefits", "ssn", - "deduction", - "documents", ] ] ] + """The Finch products to request access to""" - customer_email: Optional[str] - - integration: Optional[Integration] - - manual: Optional[bool] - - minutes_to_expire: Optional[float] - """ - The number of minutes until the session expires (defaults to 129,600, which is - 90 days) - """ - - redirect_uri: Optional[str] + redirect_uri: Required[Optional[str]] + """The URI to redirect to after the Connect flow is completed""" - sandbox: Optional[Literal["finch", "provider"]] + sandbox: Required[Optional[Literal["finch", "provider"]]] + """Sandbox mode for testing""" class Integration(TypedDict, total=False): - auth_method: Optional[Literal["assisted", "credential", "oauth", "api_token"]] + auth_method: Required[Optional[Literal["assisted", "credential", "oauth", "api_token"]]] + """The authentication method to use""" - provider: Optional[str] + provider: Required[Optional[str]] + """The provider to integrate with""" diff --git a/src/finch/types/connect/session_reauthenticate_params.py b/src/finch/types/connect/session_reauthenticate_params.py index 124100a5..2e7023ce 100644 --- a/src/finch/types/connect/session_reauthenticate_params.py +++ b/src/finch/types/connect/session_reauthenticate_params.py @@ -12,29 +12,31 @@ class SessionReauthenticateParams(TypedDict, total=False): connection_id: Required[str] """The ID of the existing connection to reauthenticate""" - minutes_to_expire: Optional[int] + minutes_to_expire: Required[int] """ The number of minutes until the session expires (defaults to 43,200, which is 30 days) """ - products: Optional[ - List[ - Literal[ - "company", - "directory", - "individual", - "employment", - "payment", - "pay_statement", - "benefits", - "ssn", - "deduction", - "documents", + products: Required[ + Optional[ + List[ + Literal[ + "benefits", + "company", + "deduction", + "directory", + "documents", + "employment", + "individual", + "payment", + "pay_statement", + "ssn", + ] ] ] ] """The products to request access to (optional for reauthentication)""" - redirect_uri: Optional[str] + redirect_uri: Required[Optional[str]] """The URI to redirect to after the Connect flow is completed""" diff --git a/src/finch/types/hris/benefits/individual_enroll_many_params.py b/src/finch/types/hris/benefits/individual_enroll_many_params.py index d0ea3f43..a20ef4e3 100644 --- a/src/finch/types/hris/benefits/individual_enroll_many_params.py +++ b/src/finch/types/hris/benefits/individual_enroll_many_params.py @@ -4,7 +4,7 @@ from typing import Union, Iterable, Optional from datetime import date -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ...._utils import PropertyInfo @@ -13,6 +13,7 @@ "Individual", "IndividualConfiguration", "IndividualConfigurationCompanyContribution", + "IndividualConfigurationCompanyContributionTier", "IndividualConfigurationEmployeeDeduction", ] @@ -22,6 +23,14 @@ class IndividualEnrollManyParams(TypedDict, total=False): """Array of the individual_id to enroll and a configuration object.""" +class IndividualConfigurationCompanyContributionTier(TypedDict, total=False): + match: Required[int] + """The employer match percentage in basis points (0-10000 = 0-100%)""" + + threshold: Required[int] + """The employee contribution threshold in basis points (0-10000 = 0-100%)""" + + class IndividualConfigurationCompanyContribution(TypedDict, total=False): amount: int """ @@ -29,7 +38,13 @@ class IndividualConfigurationCompanyContribution(TypedDict, total=False): percent type """ - type: Literal["fixed", "percent"] + tiers: Iterable[IndividualConfigurationCompanyContributionTier] + """ + Array of tier objects for tiered contribution matching (required when type is + tiered) + """ + + type: Literal["fixed", "percent", "tiered"] class IndividualConfigurationEmployeeDeduction(TypedDict, total=False): diff --git a/src/finch/types/hris/benefits_support.py b/src/finch/types/hris/benefits_support.py index 99160dd4..9b443bc8 100644 --- a/src/finch/types/hris/benefits_support.py +++ b/src/finch/types/hris/benefits_support.py @@ -35,9 +35,14 @@ class BenefitsSupport(BaseModel): simple_ira: Optional[BenefitFeaturesAndOperations] = None - __pydantic_extra__: Dict[str, Optional[BenefitFeaturesAndOperations]] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, Optional[BenefitFeaturesAndOperations]] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + # Stub to indicate that arbitrary properties are accepted. # To access properties that are not valid identifiers you can use `getattr`, e.g. # `getattr(obj, '$type')` def __getattr__(self, attr: str) -> Optional[BenefitFeaturesAndOperations]: ... + else: + __pydantic_extra__: Dict[str, Optional[BenefitFeaturesAndOperations]] diff --git a/src/finch/types/hris/document_response.py b/src/finch/types/hris/document_response.py index eb68db53..6cee9fb5 100644 --- a/src/finch/types/hris/document_response.py +++ b/src/finch/types/hris/document_response.py @@ -9,7 +9,7 @@ class DocumentResponse(BaseModel): - id: Optional[str] = None + id: str """A stable Finch id for the document.""" individual_id: Optional[str] = None @@ -18,14 +18,14 @@ class DocumentResponse(BaseModel): This will be null for employer-level documents. """ - type: Optional[Literal["w4_2020", "w4_2005"]] = None + type: Literal["w4_2020", "w4_2005"] """The type of document.""" - url: Optional[str] = None + url: str """A URL to access the document. Format: `https://api.tryfinch.com/employer/documents/:document_id`. """ - year: Optional[float] = None + year: float """The year the document applies to, if available.""" diff --git a/src/finch/types/hris/pay_statement.py b/src/finch/types/hris/pay_statement.py index 22fca52d..d8439faf 100644 --- a/src/finch/types/hris/pay_statement.py +++ b/src/finch/types/hris/pay_statement.py @@ -153,10 +153,10 @@ class PayStatement(BaseModel): earnings: Optional[List[Optional[Earning]]] = None """The array of earnings objects associated with this pay statement""" - employee_deductions: Optional[List[Optional[EmployeeDeduction]]] = None + employee_deductions: Optional[List[EmployeeDeduction]] = None """The array of deductions objects associated with this pay statement.""" - employer_contributions: Optional[List[Optional[EmployerContribution]]] = None + employer_contributions: Optional[List[EmployerContribution]] = None gross_pay: Optional[Money] = None @@ -168,7 +168,7 @@ class PayStatement(BaseModel): payment_method: Optional[Literal["check", "direct_deposit", "other"]] = None """The payment method.""" - taxes: Optional[List[Optional[Tax]]] = None + taxes: Optional[List[Tax]] = None """The array of taxes objects associated with this pay statement.""" total_hours: Optional[float] = None diff --git a/src/finch/types/hris/supported_benefit.py b/src/finch/types/hris/supported_benefit.py index 4b57eeb4..1a3634e3 100644 --- a/src/finch/types/hris/supported_benefit.py +++ b/src/finch/types/hris/supported_benefit.py @@ -13,7 +13,7 @@ class SupportedBenefit(BaseModel): annual_maximum: Optional[bool] = None """Whether the provider supports an annual maximum for this benefit.""" - company_contribution: Optional[List[Optional[Literal["fixed", "percent"]]]] = None + company_contribution: Optional[List[Optional[Literal["fixed", "percent", "tiered"]]]] = None """Supported contribution types. An empty array indicates contributions are not supported. diff --git a/src/finch/types/hris/w42005.py b/src/finch/types/hris/w42005.py index 77d3a130..73b7d277 100644 --- a/src/finch/types/hris/w42005.py +++ b/src/finch/types/hris/w42005.py @@ -9,7 +9,7 @@ class Data(BaseModel): - additional_withholding: Optional[int] = None + additional_withholding: int """Additional withholding amount (in cents).""" exemption: Optional[Literal["exempt", "non_exempt"]] = None @@ -18,19 +18,19 @@ class Data(BaseModel): filing_status: Optional[Literal["married", "married_but_withhold_at_higher_single_rate", "single"]] = None """The individual's filing status for tax purposes.""" - individual_id: Optional[str] = None + individual_id: str """The unique identifier for the individual associated with this 2005 W4 form.""" - total_number_of_allowances: Optional[int] = None + total_number_of_allowances: int """Total number of allowances claimed (in cents).""" class W42005(BaseModel): - data: Optional[Data] = None + data: Data """Detailed information specific to the 2005 W4 form.""" - type: Optional[Literal["w4_2005"]] = None + type: Literal["w4_2005"] """Specifies the form type, indicating that this document is a 2005 W4 form.""" - year: Optional[float] = None + year: float """The tax year this W4 document applies to.""" diff --git a/src/finch/types/hris/w42020.py b/src/finch/types/hris/w42020.py index 840463ec..20749283 100644 --- a/src/finch/types/hris/w42020.py +++ b/src/finch/types/hris/w42020.py @@ -9,19 +9,19 @@ class Data(BaseModel): - amount_for_other_dependents: Optional[int] = None + amount_for_other_dependents: int """ Amount claimed for dependents other than qualifying children under 17 (in cents). """ - amount_for_qualifying_children_under_17: Optional[int] = None + amount_for_qualifying_children_under_17: int """Amount claimed for dependents under 17 years old (in cents).""" - deductions: Optional[int] = None + deductions: int """Deductible expenses (in cents).""" - extra_withholding: Optional[int] = None + extra_withholding: int """Additional withholding amount (in cents).""" filing_status: Optional[ @@ -33,22 +33,22 @@ class Data(BaseModel): ] = None """The individual's filing status for tax purposes.""" - individual_id: Optional[str] = None + individual_id: str """The unique identifier for the individual associated with this document.""" - other_income: Optional[int] = None + other_income: int """Additional income from sources outside of primary employment (in cents).""" - total_claim_dependent_and_other_credits: Optional[int] = None + total_claim_dependent_and_other_credits: int """Total amount claimed for dependents and other credits (in cents).""" class W42020(BaseModel): - data: Optional[Data] = None + data: Data """Detailed information specific to the 2020 W4 form.""" - type: Optional[Literal["w4_2020"]] = None + type: Literal["w4_2020"] """Specifies the form type, indicating that this document is a 2020 W4 form.""" - year: Optional[float] = None + year: float """The tax year this W4 document applies to.""" diff --git a/src/finch/types/introspection.py b/src/finch/types/introspection.py index cfe4fbc3..30847577 100644 --- a/src/finch/types/introspection.py +++ b/src/finch/types/introspection.py @@ -98,12 +98,6 @@ class Introspection(BaseModel): created for this connection """ - entity_ids: Optional[List[str]] = None - """Array of entity IDs associated with this connection.""" - - entity_mode: Optional[Literal["single", "multi"]] = None - """Indicates whether this connection manages a single entity or multiple entities.""" - manual: Optional[bool] = None """ Whether the connection associated with the `access_token` uses the Assisted diff --git a/src/finch/types/jobs/__init__.py b/src/finch/types/jobs/__init__.py index b7a24a08..ee2d3e8e 100644 --- a/src/finch/types/jobs/__init__.py +++ b/src/finch/types/jobs/__init__.py @@ -5,8 +5,6 @@ from .manual_async_job import ManualAsyncJob as ManualAsyncJob from .automated_async_job import AutomatedAsyncJob as AutomatedAsyncJob from .automated_list_params import AutomatedListParams as AutomatedListParams -from .manual_retrieve_params import ManualRetrieveParams as ManualRetrieveParams from .automated_create_params import AutomatedCreateParams as AutomatedCreateParams from .automated_list_response import AutomatedListResponse as AutomatedListResponse from .automated_create_response import AutomatedCreateResponse as AutomatedCreateResponse -from .automated_retrieve_params import AutomatedRetrieveParams as AutomatedRetrieveParams diff --git a/src/finch/types/jobs/automated_list_params.py b/src/finch/types/jobs/automated_list_params.py index 2e41586c..21032e2c 100644 --- a/src/finch/types/jobs/automated_list_params.py +++ b/src/finch/types/jobs/automated_list_params.py @@ -8,13 +8,6 @@ class AutomatedListParams(TypedDict, total=False): - entity_id: str - """The entity ID to use when authenticating with a multi-account token. - - Required when using a multi-account token to specify which entity's data to - access. Example: `123e4567-e89b-12d3-a456-426614174000` - """ - limit: int """Number of items to return""" diff --git a/src/finch/types/jobs/automated_retrieve_params.py b/src/finch/types/jobs/automated_retrieve_params.py deleted file mode 100644 index d009691e..00000000 --- a/src/finch/types/jobs/automated_retrieve_params.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["AutomatedRetrieveParams"] - - -class AutomatedRetrieveParams(TypedDict, total=False): - entity_id: str - """The entity ID to use when authenticating with a multi-account token. - - Required when using a multi-account token to specify which entity's data to - access. Example: `123e4567-e89b-12d3-a456-426614174000` - """ diff --git a/src/finch/types/jobs/manual_retrieve_params.py b/src/finch/types/jobs/manual_retrieve_params.py deleted file mode 100644 index 3a4e4b11..00000000 --- a/src/finch/types/jobs/manual_retrieve_params.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["ManualRetrieveParams"] - - -class ManualRetrieveParams(TypedDict, total=False): - entity_id: str - """The entity ID to use when authenticating with a multi-account token. - - Required when using a multi-account token to specify which entity's data to - access. Example: `123e4567-e89b-12d3-a456-426614174000` - """ diff --git a/src/finch/types/provider.py b/src/finch/types/provider.py deleted file mode 100644 index b7051379..00000000 --- a/src/finch/types/provider.py +++ /dev/null @@ -1,449 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import Literal - -from .._models import BaseModel -from .hris.benefits_support import BenefitsSupport - -__all__ = [ - "Provider", - "AuthenticationMethod", - "AuthenticationMethodSupportedFields", - "AuthenticationMethodSupportedFieldsCompany", - "AuthenticationMethodSupportedFieldsCompanyAccounts", - "AuthenticationMethodSupportedFieldsCompanyDepartments", - "AuthenticationMethodSupportedFieldsCompanyDepartmentsParent", - "AuthenticationMethodSupportedFieldsCompanyEntity", - "AuthenticationMethodSupportedFieldsCompanyLocations", - "AuthenticationMethodSupportedFieldsDirectory", - "AuthenticationMethodSupportedFieldsDirectoryIndividuals", - "AuthenticationMethodSupportedFieldsDirectoryIndividualsManager", - "AuthenticationMethodSupportedFieldsDirectoryPaging", - "AuthenticationMethodSupportedFieldsEmployment", - "AuthenticationMethodSupportedFieldsEmploymentDepartment", - "AuthenticationMethodSupportedFieldsEmploymentEmployment", - "AuthenticationMethodSupportedFieldsEmploymentIncome", - "AuthenticationMethodSupportedFieldsEmploymentLocation", - "AuthenticationMethodSupportedFieldsEmploymentManager", - "AuthenticationMethodSupportedFieldsIndividual", - "AuthenticationMethodSupportedFieldsIndividualEmails", - "AuthenticationMethodSupportedFieldsIndividualPhoneNumbers", - "AuthenticationMethodSupportedFieldsIndividualResidence", - "AuthenticationMethodSupportedFieldsPayGroup", - "AuthenticationMethodSupportedFieldsPayStatement", - "AuthenticationMethodSupportedFieldsPayStatementPaging", - "AuthenticationMethodSupportedFieldsPayStatementPayStatements", - "AuthenticationMethodSupportedFieldsPayStatementPayStatementsEarnings", - "AuthenticationMethodSupportedFieldsPayStatementPayStatementsEmployeeDeductions", - "AuthenticationMethodSupportedFieldsPayStatementPayStatementsEmployerContributions", - "AuthenticationMethodSupportedFieldsPayStatementPayStatementsTaxes", - "AuthenticationMethodSupportedFieldsPayment", - "AuthenticationMethodSupportedFieldsPaymentPayPeriod", -] - - -class AuthenticationMethodSupportedFieldsCompanyAccounts(BaseModel): - account_name: Optional[bool] = None - - account_number: Optional[bool] = None - - account_type: Optional[bool] = None - - institution_name: Optional[bool] = None - - routing_number: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsCompanyDepartmentsParent(BaseModel): - name: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsCompanyDepartments(BaseModel): - name: Optional[bool] = None - - parent: Optional[AuthenticationMethodSupportedFieldsCompanyDepartmentsParent] = None - - -class AuthenticationMethodSupportedFieldsCompanyEntity(BaseModel): - subtype: Optional[bool] = None - - type: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsCompanyLocations(BaseModel): - city: Optional[bool] = None - - country: Optional[bool] = None - - line1: Optional[bool] = None - - line2: Optional[bool] = None - - postal_code: Optional[bool] = None - - state: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsCompany(BaseModel): - id: Optional[bool] = None - - accounts: Optional[AuthenticationMethodSupportedFieldsCompanyAccounts] = None - - departments: Optional[AuthenticationMethodSupportedFieldsCompanyDepartments] = None - - ein: Optional[bool] = None - - entity: Optional[AuthenticationMethodSupportedFieldsCompanyEntity] = None - - legal_name: Optional[bool] = None - - locations: Optional[AuthenticationMethodSupportedFieldsCompanyLocations] = None - - primary_email: Optional[bool] = None - - primary_phone_number: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsDirectoryIndividualsManager(BaseModel): - id: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsDirectoryIndividuals(BaseModel): - id: Optional[bool] = None - - department: Optional[bool] = None - - first_name: Optional[bool] = None - - is_active: Optional[bool] = None - - last_name: Optional[bool] = None - - manager: Optional[AuthenticationMethodSupportedFieldsDirectoryIndividualsManager] = None - - middle_name: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsDirectoryPaging(BaseModel): - count: Optional[bool] = None - - offset: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsDirectory(BaseModel): - individuals: Optional[AuthenticationMethodSupportedFieldsDirectoryIndividuals] = None - - paging: Optional[AuthenticationMethodSupportedFieldsDirectoryPaging] = None - - -class AuthenticationMethodSupportedFieldsEmploymentDepartment(BaseModel): - name: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsEmploymentEmployment(BaseModel): - subtype: Optional[bool] = None - - type: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsEmploymentIncome(BaseModel): - amount: Optional[bool] = None - - currency: Optional[bool] = None - - unit: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsEmploymentLocation(BaseModel): - city: Optional[bool] = None - - country: Optional[bool] = None - - line1: Optional[bool] = None - - line2: Optional[bool] = None - - postal_code: Optional[bool] = None - - state: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsEmploymentManager(BaseModel): - id: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsEmployment(BaseModel): - id: Optional[bool] = None - - class_code: Optional[bool] = None - - custom_fields: Optional[bool] = None - - department: Optional[AuthenticationMethodSupportedFieldsEmploymentDepartment] = None - - employment: Optional[AuthenticationMethodSupportedFieldsEmploymentEmployment] = None - - employment_status: Optional[bool] = None - - end_date: Optional[bool] = None - - first_name: Optional[bool] = None - - income_history: Optional[bool] = None - - income: Optional[AuthenticationMethodSupportedFieldsEmploymentIncome] = None - - is_active: Optional[bool] = None - - last_name: Optional[bool] = None - - location: Optional[AuthenticationMethodSupportedFieldsEmploymentLocation] = None - - manager: Optional[AuthenticationMethodSupportedFieldsEmploymentManager] = None - - middle_name: Optional[bool] = None - - start_date: Optional[bool] = None - - title: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsIndividualEmails(BaseModel): - data: Optional[bool] = None - - type: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsIndividualPhoneNumbers(BaseModel): - data: Optional[bool] = None - - type: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsIndividualResidence(BaseModel): - city: Optional[bool] = None - - country: Optional[bool] = None - - line1: Optional[bool] = None - - line2: Optional[bool] = None - - postal_code: Optional[bool] = None - - state: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsIndividual(BaseModel): - id: Optional[bool] = None - - dob: Optional[bool] = None - - emails: Optional[AuthenticationMethodSupportedFieldsIndividualEmails] = None - - encrypted_ssn: Optional[bool] = None - - ethnicity: Optional[bool] = None - - first_name: Optional[bool] = None - - gender: Optional[bool] = None - - last_name: Optional[bool] = None - - middle_name: Optional[bool] = None - - phone_numbers: Optional[AuthenticationMethodSupportedFieldsIndividualPhoneNumbers] = None - - preferred_name: Optional[bool] = None - - residence: Optional[AuthenticationMethodSupportedFieldsIndividualResidence] = None - - ssn: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsPayGroup(BaseModel): - id: Optional[bool] = None - - individual_ids: Optional[bool] = None - - name: Optional[bool] = None - - pay_frequencies: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsPayStatementPaging(BaseModel): - count: bool - - offset: bool - - -class AuthenticationMethodSupportedFieldsPayStatementPayStatementsEarnings(BaseModel): - amount: Optional[bool] = None - - currency: Optional[bool] = None - - name: Optional[bool] = None - - type: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsPayStatementPayStatementsEmployeeDeductions(BaseModel): - amount: Optional[bool] = None - - currency: Optional[bool] = None - - name: Optional[bool] = None - - pre_tax: Optional[bool] = None - - type: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsPayStatementPayStatementsEmployerContributions(BaseModel): - amount: Optional[bool] = None - - currency: Optional[bool] = None - - name: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsPayStatementPayStatementsTaxes(BaseModel): - amount: Optional[bool] = None - - currency: Optional[bool] = None - - employer: Optional[bool] = None - - name: Optional[bool] = None - - type: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsPayStatementPayStatements(BaseModel): - earnings: Optional[AuthenticationMethodSupportedFieldsPayStatementPayStatementsEarnings] = None - - employee_deductions: Optional[AuthenticationMethodSupportedFieldsPayStatementPayStatementsEmployeeDeductions] = None - - employer_contributions: Optional[ - AuthenticationMethodSupportedFieldsPayStatementPayStatementsEmployerContributions - ] = None - - gross_pay: Optional[bool] = None - - individual_id: Optional[bool] = None - - net_pay: Optional[bool] = None - - payment_method: Optional[bool] = None - - taxes: Optional[AuthenticationMethodSupportedFieldsPayStatementPayStatementsTaxes] = None - - total_hours: Optional[bool] = None - - type: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsPayStatement(BaseModel): - paging: Optional[AuthenticationMethodSupportedFieldsPayStatementPaging] = None - - pay_statements: Optional[AuthenticationMethodSupportedFieldsPayStatementPayStatements] = None - - -class AuthenticationMethodSupportedFieldsPaymentPayPeriod(BaseModel): - end_date: Optional[bool] = None - - start_date: Optional[bool] = None - - -class AuthenticationMethodSupportedFieldsPayment(BaseModel): - id: Optional[bool] = None - - company_debit: Optional[bool] = None - - debit_date: Optional[bool] = None - - employee_taxes: Optional[bool] = None - - employer_taxes: Optional[bool] = None - - gross_pay: Optional[bool] = None - - individual_ids: Optional[bool] = None - - net_pay: Optional[bool] = None - - pay_date: Optional[bool] = None - - pay_frequencies: Optional[bool] = None - - pay_group_ids: Optional[bool] = None - - pay_period: Optional[AuthenticationMethodSupportedFieldsPaymentPayPeriod] = None - - -class AuthenticationMethodSupportedFields(BaseModel): - company: Optional[AuthenticationMethodSupportedFieldsCompany] = None - - directory: Optional[AuthenticationMethodSupportedFieldsDirectory] = None - - employment: Optional[AuthenticationMethodSupportedFieldsEmployment] = None - - individual: Optional[AuthenticationMethodSupportedFieldsIndividual] = None - - pay_group: Optional[AuthenticationMethodSupportedFieldsPayGroup] = None - - pay_statement: Optional[AuthenticationMethodSupportedFieldsPayStatement] = None - - payment: Optional[AuthenticationMethodSupportedFieldsPayment] = None - - -class AuthenticationMethod(BaseModel): - benefits_support: Optional[BenefitsSupport] = None - """Each benefit type and their supported features. - - If the benefit type is not supported, the property will be null - """ - - supported_fields: Optional[AuthenticationMethodSupportedFields] = None - """The supported data fields returned by our HR and payroll endpoints""" - - type: Optional[Literal["assisted", "credential", "api_token", "api_credential", "oauth"]] = None - """The type of authentication method.""" - - -class Provider(BaseModel): - id: Optional[str] = None - """The id of the payroll provider used in Connect.""" - - authentication_methods: Optional[List[AuthenticationMethod]] = None - """The list of authentication methods supported by the provider.""" - - beta: Optional[bool] = None - """`true` if the integration is in a beta state, `false` otherwise""" - - display_name: Optional[str] = None - """The display name of the payroll provider.""" - - icon: Optional[str] = None - """The url to the official icon of the payroll provider.""" - - logo: Optional[str] = None - """The url to the official logo of the payroll provider.""" - - manual: Optional[bool] = None - """ - [DEPRECATED] Whether the Finch integration with this provider uses the Assisted - Connect Flow by default. This field is now deprecated. Please check for a `type` - of `assisted` in the `authentication_methods` field instead. - """ - - mfa_required: Optional[bool] = None - """whether MFA is required for the provider.""" - - primary_color: Optional[str] = None - """The hex code for the primary color of the payroll provider.""" - - products: Optional[List[str]] = None - """The list of Finch products supported on this payroll provider.""" diff --git a/src/finch/types/provider_list_response.py b/src/finch/types/provider_list_response.py new file mode 100644 index 00000000..effab9c2 --- /dev/null +++ b/src/finch/types/provider_list_response.py @@ -0,0 +1,55 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["ProviderListResponse", "AuthenticationMethod"] + + +class AuthenticationMethod(BaseModel): + type: Literal["assisted", "credential", "api_token", "api_credential", "oauth", "api"] + """The type of authentication method""" + + benefits_support: Optional[Dict[str, Optional[object]]] = None + """The supported benefit types and their configurations""" + + supported_fields: Optional[Dict[str, Optional[object]]] = None + """The supported fields for each Finch product""" + + +class ProviderListResponse(BaseModel): + id: str + """The id of the payroll provider used in Connect.""" + + display_name: str + """The display name of the payroll provider.""" + + products: List[str] + """The list of Finch products supported on this payroll provider.""" + + authentication_methods: Optional[List[AuthenticationMethod]] = None + """The authentication methods supported by the provider.""" + + beta: Optional[bool] = None + """`true` if the integration is in a beta state, `false` otherwise""" + + icon: Optional[str] = None + """The url to the official icon of the payroll provider.""" + + logo: Optional[str] = None + """The url to the official logo of the payroll provider.""" + + manual: Optional[bool] = None + """ + [DEPRECATED] Whether the Finch integration with this provider uses the Assisted + Connect Flow by default. This field is now deprecated. Please check for a `type` + of `assisted` in the `authentication_methods` field instead. + """ + + mfa_required: Optional[bool] = None + """whether MFA is required for the provider.""" + + primary_color: Optional[str] = None + """The hex code for the primary color of the payroll provider.""" diff --git a/src/finch/types/request_forwarding_forward_params.py b/src/finch/types/request_forwarding_forward_params.py index 76f06fed..a7d9f205 100644 --- a/src/finch/types/request_forwarding_forward_params.py +++ b/src/finch/types/request_forwarding_forward_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Optional +from typing import Dict, Optional from typing_extensions import Required, TypedDict __all__ = ["RequestForwardingForwardParams"] @@ -28,14 +28,14 @@ class RequestForwardingForwardParams(TypedDict, total=False): This value must be specified as either a string or a valid JSON object. """ - headers: Optional[object] + headers: Optional[Dict[str, Optional[object]]] """The HTTP headers to include on the forwarded request. This value must be specified as an object of key-value pairs. Example: `{"Content-Type": "application/xml", "X-API-Version": "v1" }` """ - params: Optional[object] + params: Optional[Dict[str, Optional[object]]] """The query parameters for the forwarded request. This value must be specified as a valid JSON object rather than a query string. diff --git a/src/finch/types/request_forwarding_forward_response.py b/src/finch/types/request_forwarding_forward_response.py index 61fde1b5..c9777e09 100644 --- a/src/finch/types/request_forwarding_forward_response.py +++ b/src/finch/types/request_forwarding_forward_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import Dict, Union, Optional from pydantic import Field as FieldInfo @@ -10,49 +10,26 @@ class Request(BaseModel): - data: Optional[str] = None - """The body that was specified for the forwarded request. - - If a value was not specified in the original request, this value will be - returned as null ; otherwise, this value will always be returned as a string. - """ - - headers: Optional[object] = None - """The specified HTTP headers that were included in the forwarded request. - - If no headers were specified, this will be returned as `null`. - """ - method: str """The HTTP method that was specified for the forwarded request. Valid values include: `GET` , `POST` , `PUT` , `DELETE` , and `PATCH`. """ - params: Optional[object] = None - """The query parameters that were included in the forwarded request. - - If no query parameters were specified, this will be returned as `null`. - """ - route: str """The URL route path that was specified for the forwarded request.""" + data: Union[str, Dict[str, Optional[object]], None] = None + """The body that was specified for the forwarded request.""" -class RequestForwardingForwardResponse(BaseModel): - data: Optional[str] = None - """ - A string representation of the HTTP response body of the forwarded request's - response received from the underlying integration's API. This field may be null - in the case where the upstream system's response is empty. - """ + headers: Optional[Dict[str, Optional[object]]] = None + """The HTTP headers that were specified for the forwarded request.""" - headers: Optional[object] = None - """ - The HTTP headers of the forwarded request's response, exactly as received from - the underlying integration's API. - """ + params: Optional[Dict[str, Optional[object]]] = None + """The query parameters that were specified for the forwarded request.""" + +class RequestForwardingForwardResponse(BaseModel): request: Request """ An object containing details of your original forwarded request, for your ease @@ -64,3 +41,16 @@ class RequestForwardingForwardResponse(BaseModel): The HTTP status code of the forwarded request's response, exactly received from the underlying integration's API. This value will be returned as an integer. """ + + data: Optional[str] = None + """ + A string representation of the HTTP response body of the forwarded request's + response received from the underlying integration's API. This field may be null + in the case where the upstream system's response is empty. + """ + + headers: Optional[Dict[str, Optional[object]]] = None + """ + The HTTP headers of the forwarded request's response, exactly as received from + the underlying integration's API. + """ diff --git a/tests/api_resources/connect/test_sessions.py b/tests/api_resources/connect/test_sessions.py index f437d7e6..1728d397 100644 --- a/tests/api_resources/connect/test_sessions.py +++ b/tests/api_resources/connect/test_sessions.py @@ -24,26 +24,16 @@ class TestSessions: @parametrize def test_method_new(self, client: Finch) -> None: session = client.connect.sessions.new( + customer_email="dev@stainless.com", customer_id="x", customer_name="x", - products=["company"], - ) - assert_matches_type(SessionNewResponse, session, path=["response"]) - - @pytest.mark.skip(reason="prism tests are broken") - @parametrize - def test_method_new_with_all_params(self, client: Finch) -> None: - session = client.connect.sessions.new( - customer_id="x", - customer_name="x", - products=["company"], - customer_email="dev@stainless.com", integration={ "auth_method": "assisted", "provider": "provider", }, manual=True, minutes_to_expire=1, + products=["benefits"], redirect_uri="redirect_uri", sandbox="finch", ) @@ -53,9 +43,18 @@ def test_method_new_with_all_params(self, client: Finch) -> None: @parametrize def test_raw_response_new(self, client: Finch) -> None: response = client.connect.sessions.with_raw_response.new( + customer_email="dev@stainless.com", customer_id="x", customer_name="x", - products=["company"], + integration={ + "auth_method": "assisted", + "provider": "provider", + }, + manual=True, + minutes_to_expire=1, + products=["benefits"], + redirect_uri="redirect_uri", + sandbox="finch", ) assert response.is_closed is True @@ -67,9 +66,18 @@ def test_raw_response_new(self, client: Finch) -> None: @parametrize def test_streaming_response_new(self, client: Finch) -> None: with client.connect.sessions.with_streaming_response.new( + customer_email="dev@stainless.com", customer_id="x", customer_name="x", - products=["company"], + integration={ + "auth_method": "assisted", + "provider": "provider", + }, + manual=True, + minutes_to_expire=1, + products=["benefits"], + redirect_uri="redirect_uri", + sandbox="finch", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -82,18 +90,10 @@ def test_streaming_response_new(self, client: Finch) -> None: @pytest.mark.skip(reason="prism tests are broken") @parametrize def test_method_reauthenticate(self, client: Finch) -> None: - session = client.connect.sessions.reauthenticate( - connection_id="connection_id", - ) - assert_matches_type(SessionReauthenticateResponse, session, path=["response"]) - - @pytest.mark.skip(reason="prism tests are broken") - @parametrize - def test_method_reauthenticate_with_all_params(self, client: Finch) -> None: session = client.connect.sessions.reauthenticate( connection_id="connection_id", minutes_to_expire=0, - products=["company"], + products=["benefits"], redirect_uri="https://example.com", ) assert_matches_type(SessionReauthenticateResponse, session, path=["response"]) @@ -103,6 +103,9 @@ def test_method_reauthenticate_with_all_params(self, client: Finch) -> None: def test_raw_response_reauthenticate(self, client: Finch) -> None: response = client.connect.sessions.with_raw_response.reauthenticate( connection_id="connection_id", + minutes_to_expire=0, + products=["benefits"], + redirect_uri="https://example.com", ) assert response.is_closed is True @@ -115,6 +118,9 @@ def test_raw_response_reauthenticate(self, client: Finch) -> None: def test_streaming_response_reauthenticate(self, client: Finch) -> None: with client.connect.sessions.with_streaming_response.reauthenticate( connection_id="connection_id", + minutes_to_expire=0, + products=["benefits"], + redirect_uri="https://example.com", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -134,26 +140,16 @@ class TestAsyncSessions: @parametrize async def test_method_new(self, async_client: AsyncFinch) -> None: session = await async_client.connect.sessions.new( + customer_email="dev@stainless.com", customer_id="x", customer_name="x", - products=["company"], - ) - assert_matches_type(SessionNewResponse, session, path=["response"]) - - @pytest.mark.skip(reason="prism tests are broken") - @parametrize - async def test_method_new_with_all_params(self, async_client: AsyncFinch) -> None: - session = await async_client.connect.sessions.new( - customer_id="x", - customer_name="x", - products=["company"], - customer_email="dev@stainless.com", integration={ "auth_method": "assisted", "provider": "provider", }, manual=True, minutes_to_expire=1, + products=["benefits"], redirect_uri="redirect_uri", sandbox="finch", ) @@ -163,9 +159,18 @@ async def test_method_new_with_all_params(self, async_client: AsyncFinch) -> Non @parametrize async def test_raw_response_new(self, async_client: AsyncFinch) -> None: response = await async_client.connect.sessions.with_raw_response.new( + customer_email="dev@stainless.com", customer_id="x", customer_name="x", - products=["company"], + integration={ + "auth_method": "assisted", + "provider": "provider", + }, + manual=True, + minutes_to_expire=1, + products=["benefits"], + redirect_uri="redirect_uri", + sandbox="finch", ) assert response.is_closed is True @@ -177,9 +182,18 @@ async def test_raw_response_new(self, async_client: AsyncFinch) -> None: @parametrize async def test_streaming_response_new(self, async_client: AsyncFinch) -> None: async with async_client.connect.sessions.with_streaming_response.new( + customer_email="dev@stainless.com", customer_id="x", customer_name="x", - products=["company"], + integration={ + "auth_method": "assisted", + "provider": "provider", + }, + manual=True, + minutes_to_expire=1, + products=["benefits"], + redirect_uri="redirect_uri", + sandbox="finch", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -192,18 +206,10 @@ async def test_streaming_response_new(self, async_client: AsyncFinch) -> None: @pytest.mark.skip(reason="prism tests are broken") @parametrize async def test_method_reauthenticate(self, async_client: AsyncFinch) -> None: - session = await async_client.connect.sessions.reauthenticate( - connection_id="connection_id", - ) - assert_matches_type(SessionReauthenticateResponse, session, path=["response"]) - - @pytest.mark.skip(reason="prism tests are broken") - @parametrize - async def test_method_reauthenticate_with_all_params(self, async_client: AsyncFinch) -> None: session = await async_client.connect.sessions.reauthenticate( connection_id="connection_id", minutes_to_expire=0, - products=["company"], + products=["benefits"], redirect_uri="https://example.com", ) assert_matches_type(SessionReauthenticateResponse, session, path=["response"]) @@ -213,6 +219,9 @@ async def test_method_reauthenticate_with_all_params(self, async_client: AsyncFi async def test_raw_response_reauthenticate(self, async_client: AsyncFinch) -> None: response = await async_client.connect.sessions.with_raw_response.reauthenticate( connection_id="connection_id", + minutes_to_expire=0, + products=["benefits"], + redirect_uri="https://example.com", ) assert response.is_closed is True @@ -225,6 +234,9 @@ async def test_raw_response_reauthenticate(self, async_client: AsyncFinch) -> No async def test_streaming_response_reauthenticate(self, async_client: AsyncFinch) -> None: async with async_client.connect.sessions.with_streaming_response.reauthenticate( connection_id="connection_id", + minutes_to_expire=0, + products=["benefits"], + redirect_uri="https://example.com", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/hris/benefits/test_individuals.py b/tests/api_resources/hris/benefits/test_individuals.py index 13ee6a10..d689761e 100644 --- a/tests/api_resources/hris/benefits/test_individuals.py +++ b/tests/api_resources/hris/benefits/test_individuals.py @@ -43,6 +43,12 @@ def test_method_enroll_many_with_all_params(self, client: Finch) -> None: "catch_up": True, "company_contribution": { "amount": 0, + "tiers": [ + { + "match": 0, + "threshold": 0, + } + ], "type": "fixed", }, "effective_date": parse_date("2019-12-27"), @@ -243,6 +249,12 @@ async def test_method_enroll_many_with_all_params(self, async_client: AsyncFinch "catch_up": True, "company_contribution": { "amount": 0, + "tiers": [ + { + "match": 0, + "threshold": 0, + } + ], "type": "fixed", }, "effective_date": parse_date("2019-12-27"), diff --git a/tests/api_resources/jobs/test_automated.py b/tests/api_resources/jobs/test_automated.py index 1593aeda..746efc27 100644 --- a/tests/api_resources/jobs/test_automated.py +++ b/tests/api_resources/jobs/test_automated.py @@ -89,22 +89,14 @@ def test_streaming_response_create_overload_2(self, client: Finch) -> None: @parametrize def test_method_retrieve(self, client: Finch) -> None: automated = client.jobs.automated.retrieve( - job_id="job_id", - ) - assert_matches_type(AutomatedAsyncJob, automated, path=["response"]) - - @parametrize - def test_method_retrieve_with_all_params(self, client: Finch) -> None: - automated = client.jobs.automated.retrieve( - job_id="job_id", - entity_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "job_id", ) assert_matches_type(AutomatedAsyncJob, automated, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Finch) -> None: response = client.jobs.automated.with_raw_response.retrieve( - job_id="job_id", + "job_id", ) assert response.is_closed is True @@ -115,7 +107,7 @@ def test_raw_response_retrieve(self, client: Finch) -> None: @parametrize def test_streaming_response_retrieve(self, client: Finch) -> None: with client.jobs.automated.with_streaming_response.retrieve( - job_id="job_id", + "job_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -129,7 +121,7 @@ def test_streaming_response_retrieve(self, client: Finch) -> None: def test_path_params_retrieve(self, client: Finch) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_id` but received ''"): client.jobs.automated.with_raw_response.retrieve( - job_id="", + "", ) @parametrize @@ -140,7 +132,6 @@ def test_method_list(self, client: Finch) -> None: @parametrize def test_method_list_with_all_params(self, client: Finch) -> None: automated = client.jobs.automated.list( - entity_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", limit=0, offset=0, ) @@ -240,22 +231,14 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncFin @parametrize async def test_method_retrieve(self, async_client: AsyncFinch) -> None: automated = await async_client.jobs.automated.retrieve( - job_id="job_id", - ) - assert_matches_type(AutomatedAsyncJob, automated, path=["response"]) - - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncFinch) -> None: - automated = await async_client.jobs.automated.retrieve( - job_id="job_id", - entity_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "job_id", ) assert_matches_type(AutomatedAsyncJob, automated, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncFinch) -> None: response = await async_client.jobs.automated.with_raw_response.retrieve( - job_id="job_id", + "job_id", ) assert response.is_closed is True @@ -266,7 +249,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncFinch) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncFinch) -> None: async with async_client.jobs.automated.with_streaming_response.retrieve( - job_id="job_id", + "job_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -280,7 +263,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncFinch) -> No async def test_path_params_retrieve(self, async_client: AsyncFinch) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_id` but received ''"): await async_client.jobs.automated.with_raw_response.retrieve( - job_id="", + "", ) @parametrize @@ -291,7 +274,6 @@ async def test_method_list(self, async_client: AsyncFinch) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncFinch) -> None: automated = await async_client.jobs.automated.list( - entity_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", limit=0, offset=0, ) diff --git a/tests/api_resources/jobs/test_manual.py b/tests/api_resources/jobs/test_manual.py index bc3d5a8f..1cd30215 100644 --- a/tests/api_resources/jobs/test_manual.py +++ b/tests/api_resources/jobs/test_manual.py @@ -20,22 +20,14 @@ class TestManual: @parametrize def test_method_retrieve(self, client: Finch) -> None: manual = client.jobs.manual.retrieve( - job_id="job_id", - ) - assert_matches_type(ManualAsyncJob, manual, path=["response"]) - - @parametrize - def test_method_retrieve_with_all_params(self, client: Finch) -> None: - manual = client.jobs.manual.retrieve( - job_id="job_id", - entity_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "job_id", ) assert_matches_type(ManualAsyncJob, manual, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Finch) -> None: response = client.jobs.manual.with_raw_response.retrieve( - job_id="job_id", + "job_id", ) assert response.is_closed is True @@ -46,7 +38,7 @@ def test_raw_response_retrieve(self, client: Finch) -> None: @parametrize def test_streaming_response_retrieve(self, client: Finch) -> None: with client.jobs.manual.with_streaming_response.retrieve( - job_id="job_id", + "job_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -60,7 +52,7 @@ def test_streaming_response_retrieve(self, client: Finch) -> None: def test_path_params_retrieve(self, client: Finch) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_id` but received ''"): client.jobs.manual.with_raw_response.retrieve( - job_id="", + "", ) @@ -72,22 +64,14 @@ class TestAsyncManual: @parametrize async def test_method_retrieve(self, async_client: AsyncFinch) -> None: manual = await async_client.jobs.manual.retrieve( - job_id="job_id", - ) - assert_matches_type(ManualAsyncJob, manual, path=["response"]) - - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncFinch) -> None: - manual = await async_client.jobs.manual.retrieve( - job_id="job_id", - entity_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "job_id", ) assert_matches_type(ManualAsyncJob, manual, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncFinch) -> None: response = await async_client.jobs.manual.with_raw_response.retrieve( - job_id="job_id", + "job_id", ) assert response.is_closed is True @@ -98,7 +82,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncFinch) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncFinch) -> None: async with async_client.jobs.manual.with_streaming_response.retrieve( - job_id="job_id", + "job_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -112,5 +96,5 @@ async def test_streaming_response_retrieve(self, async_client: AsyncFinch) -> No async def test_path_params_retrieve(self, async_client: AsyncFinch) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_id` but received ''"): await async_client.jobs.manual.with_raw_response.retrieve( - job_id="", + "", ) diff --git a/tests/api_resources/test_providers.py b/tests/api_resources/test_providers.py index 7228af21..be5dd8ce 100644 --- a/tests/api_resources/test_providers.py +++ b/tests/api_resources/test_providers.py @@ -8,7 +8,7 @@ import pytest from finch import Finch, AsyncFinch -from finch.types import Provider +from finch.types import ProviderListResponse from tests.utils import assert_matches_type from finch.pagination import SyncSinglePage, AsyncSinglePage @@ -21,7 +21,7 @@ class TestProviders: @parametrize def test_method_list(self, client: Finch) -> None: provider = client.providers.list() - assert_matches_type(SyncSinglePage[Provider], provider, path=["response"]) + assert_matches_type(SyncSinglePage[ProviderListResponse], provider, path=["response"]) @parametrize def test_raw_response_list(self, client: Finch) -> None: @@ -30,7 +30,7 @@ def test_raw_response_list(self, client: Finch) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" provider = response.parse() - assert_matches_type(SyncSinglePage[Provider], provider, path=["response"]) + assert_matches_type(SyncSinglePage[ProviderListResponse], provider, path=["response"]) @parametrize def test_streaming_response_list(self, client: Finch) -> None: @@ -39,7 +39,7 @@ def test_streaming_response_list(self, client: Finch) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" provider = response.parse() - assert_matches_type(SyncSinglePage[Provider], provider, path=["response"]) + assert_matches_type(SyncSinglePage[ProviderListResponse], provider, path=["response"]) assert cast(Any, response.is_closed) is True @@ -52,7 +52,7 @@ class TestAsyncProviders: @parametrize async def test_method_list(self, async_client: AsyncFinch) -> None: provider = await async_client.providers.list() - assert_matches_type(AsyncSinglePage[Provider], provider, path=["response"]) + assert_matches_type(AsyncSinglePage[ProviderListResponse], provider, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncFinch) -> None: @@ -61,7 +61,7 @@ async def test_raw_response_list(self, async_client: AsyncFinch) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" provider = response.parse() - assert_matches_type(AsyncSinglePage[Provider], provider, path=["response"]) + assert_matches_type(AsyncSinglePage[ProviderListResponse], provider, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncFinch) -> None: @@ -70,6 +70,6 @@ async def test_streaming_response_list(self, async_client: AsyncFinch) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" provider = await response.parse() - assert_matches_type(AsyncSinglePage[Provider], provider, path=["response"]) + assert_matches_type(AsyncSinglePage[ProviderListResponse], provider, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_request_forwarding.py b/tests/api_resources/test_request_forwarding.py index be7ec45f..5615e4d2 100644 --- a/tests/api_resources/test_request_forwarding.py +++ b/tests/api_resources/test_request_forwarding.py @@ -20,30 +20,27 @@ class TestRequestForwarding: @parametrize def test_method_forward(self, client: Finch) -> None: request_forwarding = client.request_forwarding.forward( - method="POST", - route="/people/search", + method="method", + route="route", ) assert_matches_type(RequestForwardingForwardResponse, request_forwarding, path=["response"]) @parametrize def test_method_forward_with_all_params(self, client: Finch) -> None: request_forwarding = client.request_forwarding.forward( - method="POST", - route="/people/search", - data=None, - headers={"content-type": "application/json"}, - params={ - "showInactive": True, - "humanReadable": True, - }, + method="method", + route="route", + data="data", + headers={"foo": "bar"}, + params={"foo": "bar"}, ) assert_matches_type(RequestForwardingForwardResponse, request_forwarding, path=["response"]) @parametrize def test_raw_response_forward(self, client: Finch) -> None: response = client.request_forwarding.with_raw_response.forward( - method="POST", - route="/people/search", + method="method", + route="route", ) assert response.is_closed is True @@ -54,8 +51,8 @@ def test_raw_response_forward(self, client: Finch) -> None: @parametrize def test_streaming_response_forward(self, client: Finch) -> None: with client.request_forwarding.with_streaming_response.forward( - method="POST", - route="/people/search", + method="method", + route="route", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -74,30 +71,27 @@ class TestAsyncRequestForwarding: @parametrize async def test_method_forward(self, async_client: AsyncFinch) -> None: request_forwarding = await async_client.request_forwarding.forward( - method="POST", - route="/people/search", + method="method", + route="route", ) assert_matches_type(RequestForwardingForwardResponse, request_forwarding, path=["response"]) @parametrize async def test_method_forward_with_all_params(self, async_client: AsyncFinch) -> None: request_forwarding = await async_client.request_forwarding.forward( - method="POST", - route="/people/search", - data=None, - headers={"content-type": "application/json"}, - params={ - "showInactive": True, - "humanReadable": True, - }, + method="method", + route="route", + data="data", + headers={"foo": "bar"}, + params={"foo": "bar"}, ) assert_matches_type(RequestForwardingForwardResponse, request_forwarding, path=["response"]) @parametrize async def test_raw_response_forward(self, async_client: AsyncFinch) -> None: response = await async_client.request_forwarding.with_raw_response.forward( - method="POST", - route="/people/search", + method="method", + route="route", ) assert response.is_closed is True @@ -108,8 +102,8 @@ async def test_raw_response_forward(self, async_client: AsyncFinch) -> None: @parametrize async def test_streaming_response_forward(self, async_client: AsyncFinch) -> None: async with async_client.request_forwarding.with_streaming_response.forward( - method="POST", - route="/people/search", + method="method", + route="route", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/test_transform.py b/tests/test_transform.py index 916fd75c..223fa54c 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -8,7 +8,7 @@ import pytest -from finch._types import NOT_GIVEN, Base64FileInput +from finch._types import Base64FileInput, omit, not_given from finch._utils import ( PropertyInfo, transform as _transform, @@ -450,4 +450,11 @@ async def test_transform_skipping(use_async: bool) -> None: @pytest.mark.asyncio async def test_strips_notgiven(use_async: bool) -> None: assert await transform({"foo_bar": "bar"}, Foo1, use_async) == {"fooBar": "bar"} - assert await transform({"foo_bar": NOT_GIVEN}, Foo1, use_async) == {} + assert await transform({"foo_bar": not_given}, Foo1, use_async) == {} + + +@parametrize +@pytest.mark.asyncio +async def test_strips_omit(use_async: bool) -> None: + assert await transform({"foo_bar": "bar"}, Foo1, use_async) == {"fooBar": "bar"} + assert await transform({"foo_bar": omit}, Foo1, use_async) == {}