Skip to content

feat(api): updates #184

New issue

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

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

Already on GitHub? Sign in to your account

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Shared Types

```python
from finch.types import OperationSupport, OperationSupportMatrix
```

# Finch

Methods:
Expand Down Expand Up @@ -96,11 +102,14 @@ Types:
```python
from finch.types.hris import (
BenefitContribution,
BenefitFeaturesAndOperations,
BenefitFrequency,
BenefitType,
BenefitsSupport,
BenfitContribution,
CompanyBenefit,
CreateCompanyBenefitsResponse,
SupportPerBenefitType,
SupportedBenefit,
UpdateCompanyBenefitResponse,
)
Expand Down
24 changes: 16 additions & 8 deletions src/finch/resources/request_forwarding.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,16 @@ def forward(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> RequestForwardingForwardResponse:
"""
The Forward API allows you to make direct requests to an employment system.
"""The Forward API allows you to make direct requests to an employment system.

If
Finch’s unified API doesn’t have a data model that cleanly fits your needs, then
Forward allows you to push or pull data models directly against an integration’s
API.

Args:
method: The HTTP method for the forwarded request. Valid values include: `GET`, `POST`,
`PUT`, `DELETE`, and `PATCH`.
method: The HTTP method for the forwarded request. Valid values include: `GET` , `POST`
, `PUT` , `DELETE` , and `PATCH`.

route: The URL route path for the forwarded request. This value must begin with a
forward-slash ( / ) and may only contain alphanumeric characters, hyphens, and
Expand Down Expand Up @@ -111,12 +115,16 @@ async def forward(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> RequestForwardingForwardResponse:
"""
The Forward API allows you to make direct requests to an employment system.
"""The Forward API allows you to make direct requests to an employment system.

If
Finch’s unified API doesn’t have a data model that cleanly fits your needs, then
Forward allows you to push or pull data models directly against an integration’s
API.

Args:
method: The HTTP method for the forwarded request. Valid values include: `GET`, `POST`,
`PUT`, `DELETE`, and `PATCH`.
method: The HTTP method for the forwarded request. Valid values include: `GET` , `POST`
, `PUT` , `DELETE` , and `PATCH`.

route: The URL route path for the forwarded request. This value must begin with a
forward-slash ( / ) and may only contain alphanumeric characters, hyphens, and
Expand Down
2 changes: 2 additions & 0 deletions src/finch/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from .money import Money as Money
from .income import Income as Income
from .paging import Paging as Paging
from .shared import OperationSupport as OperationSupport
from .shared import OperationSupportMatrix as OperationSupportMatrix
from .location import Location as Location
from .provider import Provider as Provider
from .introspection import Introspection as Introspection
Expand Down
5 changes: 5 additions & 0 deletions src/finch/types/hris/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from .pay_statement import PayStatement as PayStatement
from .company_benefit import CompanyBenefit as CompanyBenefit
from .employment_data import EmploymentData as EmploymentData
from .benefits_support import BenefitsSupport as BenefitsSupport
from .benefit_frequency import BenefitFrequency as BenefitFrequency
from .supported_benefit import SupportedBenefit as SupportedBenefit
from .benfit_contribution import BenfitContribution as BenfitContribution
Expand All @@ -21,9 +22,13 @@
from .pay_statement_response import PayStatementResponse as PayStatementResponse
from .individual_in_directory import IndividualInDirectory as IndividualInDirectory
from .employment_data_response import EmploymentDataResponse as EmploymentDataResponse
from .support_per_benefit_type import SupportPerBenefitType as SupportPerBenefitType
from .pay_statement_response_body import (
PayStatementResponseBody as PayStatementResponseBody,
)
from .benefit_features_and_operations import (
BenefitFeaturesAndOperations as BenefitFeaturesAndOperations,
)
from .employment_retrieve_many_params import (
EmploymentRetrieveManyParams as EmploymentRetrieveManyParams,
)
Expand Down
51 changes: 51 additions & 0 deletions src/finch/types/hris/benefit_features_and_operations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# File generated from our OpenAPI spec by Stainless.

from typing import List, Optional
from typing_extensions import Literal

from ..._models import BaseModel
from .benefit_frequency import BenefitFrequency
from .support_per_benefit_type import SupportPerBenefitType

__all__ = ["BenefitFeaturesAndOperations", "SupportedFeatures"]


class SupportedFeatures(BaseModel):
annual_maximum: Optional[bool] = None
"""Whether the provider supports an annual maximum for this benefit."""

catch_up: Optional[bool] = None
"""Whether the provider supports catch up for this benefit.

This field will only be true for retirement benefits.
"""

company_contribution: Optional[List[Literal["fixed", "percent"]]] = None
"""Supported contribution types.

An empty array indicates contributions are not supported.
"""

description: Optional[str] = None

employee_deduction: Optional[List[Literal["fixed", "percent"]]] = None
"""Supported deduction types.

An empty array indicates deductions are not supported.
"""

frequencies: Optional[List[Optional[BenefitFrequency]]] = None
"""The list of frequencies supported by the provider for this benefit"""

hsa_contribution_limit: Optional[List[Literal["individual", "family"]]] = None
"""Whether the provider supports HSA contribution limits.

Empty if this feature is not supported for the benefit. This array only has
values for HSA benefits.
"""


class BenefitFeaturesAndOperations(BaseModel):
supported_features: Optional[SupportedFeatures] = None

supported_operations: Optional[SupportPerBenefitType] = None
2 changes: 1 addition & 1 deletion src/finch/types/hris/benefit_frequency.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

__all__ = ["BenefitFrequency"]

BenefitFrequency = Optional[Literal["one_time", "every_paycheck"]]
BenefitFrequency = Optional[Literal["one_time", "every_paycheck", "monthly"]]
41 changes: 41 additions & 0 deletions src/finch/types/hris/benefits_support.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# File generated from our OpenAPI spec by Stainless.

from typing import TYPE_CHECKING, Optional

from ..._models import BaseModel
from .benefit_features_and_operations import BenefitFeaturesAndOperations

__all__ = ["BenefitsSupport"]


class BenefitsSupport(BaseModel):
commuter: Optional[BenefitFeaturesAndOperations] = None

custom_post_tax: Optional[BenefitFeaturesAndOperations] = None

custom_pre_tax: Optional[BenefitFeaturesAndOperations] = None

fsa_dependent_care: Optional[BenefitFeaturesAndOperations] = None

fsa_medical: Optional[BenefitFeaturesAndOperations] = None

hsa_post: Optional[BenefitFeaturesAndOperations] = None

hsa_pre: Optional[BenefitFeaturesAndOperations] = None

s125_dental: Optional[BenefitFeaturesAndOperations] = None

s125_medical: Optional[BenefitFeaturesAndOperations] = None

s125_vision: Optional[BenefitFeaturesAndOperations] = None

simple: Optional[BenefitFeaturesAndOperations] = None

simple_ira: Optional[BenefitFeaturesAndOperations] = None

if TYPE_CHECKING:
# 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]:
...
18 changes: 14 additions & 4 deletions src/finch/types/hris/employment_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
from typing import List, Optional
from typing_extensions import Literal

from pydantic import Field as FieldInfo

from ..income import Income
from ..._models import BaseModel
from ..location import Location

__all__ = ["EmploymentData", "Department", "Employment", "Manager"]
__all__ = ["EmploymentData", "CustomField", "Department", "Employment", "Manager"]


class CustomField(BaseModel):
name: Optional[str] = None

value: Optional[object] = None


class Department(BaseModel):
Expand Down Expand Up @@ -41,6 +45,12 @@ class EmploymentData(BaseModel):
class_code: Optional[str] = None
"""Worker's compensation classification code for this employee"""

custom_fields: Optional[List[CustomField]] = None
"""Custom fields for the individual.

These are fields which are defined by the employer in the system.
"""

department: Optional[Department] = None
"""The department object."""

Expand Down Expand Up @@ -96,7 +106,7 @@ class EmploymentData(BaseModel):
Please reach out to your Finch representative if you would like access.
"""

work_id2: Optional[str] = FieldInfo(alias="work_id_2", default=None)
work_id_2: Optional[str] = None
"""Note: This property is only available if enabled for your account.

Please reach out to your Finch representative if you would like access.
Expand Down
14 changes: 14 additions & 0 deletions src/finch/types/hris/individual.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ class Individual(BaseModel):

emails: Optional[List[Email]] = None

ethnicity: Optional[
Literal[
"asian",
"white",
"black_or_african_american",
"native_hawaiian_or_pacific_islander",
"american_indian_or_alaska_native",
"hispanic_or_latino",
"two_or_more_races",
"decline_to_specify",
]
] = None
"""The EEOC-defined ethnicity of the individual."""

first_name: Optional[str] = None
"""The legal first name of the individual."""

Expand Down
14 changes: 14 additions & 0 deletions src/finch/types/hris/support_per_benefit_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# File generated from our OpenAPI spec by Stainless.

from typing import Optional

from ..shared import OperationSupportMatrix
from ..._models import BaseModel

__all__ = ["SupportPerBenefitType"]


class SupportPerBenefitType(BaseModel):
company_benefits: Optional[OperationSupportMatrix] = None

individual_benefits: Optional[OperationSupportMatrix] = None
3 changes: 3 additions & 0 deletions src/finch/types/introspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@


class Introspection(BaseModel):
account_id: str
"""The Finch uuid of the account used to connect this company."""

client_id: str
"""The client id of the application associated with the `access_token`."""

Expand Down
Loading