From c86799760455e97fca934c83e2eef0986d7f8e89 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 14 May 2025 23:09:18 +0000 Subject: [PATCH 1/6] chore(ci): upload sdks to package manager --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ scripts/utils/upload-artifact.sh | 25 +++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100755 scripts/utils/upload-artifact.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a843e036..c2b98114 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,30 @@ jobs: - name: Run lints run: ./scripts/lint + upload: + if: github.repository == 'stainless-sdks/finch-python' + timeout-minutes: 10 + name: upload + permissions: + contents: read + id-token: write + runs-on: depot-ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + + - name: Get GitHub OIDC Token + id: github-oidc + uses: actions/github-script@v6 + with: + script: core.setOutput('github_token', await core.getIDToken()); + + - name: Upload tarball + env: + URL: https://pkg.stainless.com/s + AUTH: ${{ steps.github-oidc.outputs.github_token }} + SHA: ${{ github.sha }} + run: ./scripts/utils/upload-artifact.sh + test: timeout-minutes: 10 name: test diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh new file mode 100755 index 00000000..8ae9cc63 --- /dev/null +++ b/scripts/utils/upload-artifact.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -exuo pipefail + +RESPONSE=$(curl -X POST "$URL" \ + -H "Authorization: Bearer $AUTH" \ + -H "Content-Type: application/json") + +SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url') + +if [[ "$SIGNED_URL" == "null" ]]; then + echo -e "\033[31mFailed to get signed URL.\033[0m" + exit 1 +fi + +UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \ + -H "Content-Type: application/gzip" \ + --data-binary @- "$SIGNED_URL" 2>&1) + +if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then + echo -e "\033[32mUploaded build to Stainless storage.\033[0m" + echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/finch-python/$SHA'\033[0m" +else + echo -e "\033[31mFailed to upload artifact.\033[0m" + exit 1 +fi From ac6a9d8edf95f3343dd38f09693fc7ff22cebd91 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 May 2025 12:26:20 +0000 Subject: [PATCH 2/6] chore(ci): fix installation instructions --- scripts/utils/upload-artifact.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh index 8ae9cc63..d89a9ed0 100755 --- a/scripts/utils/upload-artifact.sh +++ b/scripts/utils/upload-artifact.sh @@ -18,7 +18,7 @@ UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \ if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then echo -e "\033[32mUploaded build to Stainless storage.\033[0m" - echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/finch-python/$SHA'\033[0m" + echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/finch-python/$SHA'\033[0m" else echo -e "\033[31mFailed to upload artifact.\033[0m" exit 1 From 0af1c8443ffd922047b0f4f892f712668c9f54c9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 May 2025 20:37:14 +0000 Subject: [PATCH 3/6] feat(api): api update --- .stats.yml | 4 +- src/finch/types/hris/benefit_type.py | 20 +-- .../pay_statement_item_list_response.py | 18 +-- src/finch/types/hris/pay_statement.py | 34 ++--- .../types/hris/pay_statement_response.py | 8 +- .../types/hris/pay_statement_response_body.py | 16 ++- src/finch/types/hris/payment.py | 12 +- src/finch/types/money.py | 2 +- src/finch/types/money_param.py | 6 +- .../types/payroll/pay_group_list_response.py | 24 +--- .../payroll/pay_group_retrieve_response.py | 2 +- .../types/sandbox/payment_create_params.py | 122 +++++++++--------- tests/api_resources/hris/test_benefits.py | 4 +- tests/api_resources/sandbox/test_payment.py | 40 +++--- 14 files changed, 154 insertions(+), 158 deletions(-) diff --git a/.stats.yml b/.stats.yml index ac3940f3..c621e60f 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-f09e5f2c555d7ee764478b7bc73e92cd21f403d6ec189be14574c8367bc131ce.yml -openapi_spec_hash: bd0a8e001f14132c105992d40149909a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-331df2398447990a86899b05ac569534b6a7e4ff1d73a319d57f67b34a201fb7.yml +openapi_spec_hash: 6e57516524c0519e90213c0554b26ab4 config_hash: 53778a0b839c4f6ad34fbba051f5e8a6 diff --git a/src/finch/types/hris/benefit_type.py b/src/finch/types/hris/benefit_type.py index 2c8ad7f4..9f5b4132 100644 --- a/src/finch/types/hris/benefit_type.py +++ b/src/finch/types/hris/benefit_type.py @@ -7,24 +7,24 @@ BenefitType: TypeAlias = Optional[ Literal[ + "457", "401k", "401k_roth", "401k_loan", "403b", "403b_roth", - "457", "457_roth", - "s125_medical", - "s125_dental", - "s125_vision", - "hsa_pre", - "hsa_post", - "fsa_medical", - "fsa_dependent_care", - "simple_ira", - "simple", "commuter", "custom_post_tax", "custom_pre_tax", + "fsa_dependent_care", + "fsa_medical", + "hsa_post", + "hsa_pre", + "s125_dental", + "s125_medical", + "s125_vision", + "simple", + "simple_ira", ] ] diff --git a/src/finch/types/hris/company/pay_statement_item_list_response.py b/src/finch/types/hris/company/pay_statement_item_list_response.py index 31e9cf16..e2ca25b0 100644 --- a/src/finch/types/hris/company/pay_statement_item_list_response.py +++ b/src/finch/types/hris/company/pay_statement_item_list_response.py @@ -9,18 +9,18 @@ class Attributes(BaseModel): - employer: Optional[bool] = None - """`true` if the amount is paid by the employers. - - This field is only available for taxes. - """ - metadata: Optional[Dict[str, Optional[object]]] = None """The metadata of the pay statement item derived by the rules engine if available. Each attribute will be a key-value pair defined by a rule. """ + employer: Optional[bool] = None + """`true` if the amount is paid by the employers. + + This field is only available for taxes. + """ + pre_tax: Optional[bool] = None """`true` if the pay statement item is pre-tax. @@ -32,11 +32,11 @@ class Attributes(BaseModel): class PayStatementItemListResponse(BaseModel): - attributes: Optional[Attributes] = None + attributes: Attributes """The attributes of the pay statement item.""" - category: Optional[Literal["earnings", "taxes", "employee_deductions", "employer_contributions"]] = None + category: Literal["earnings", "taxes", "employee_deductions", "employer_contributions"] """The category of the pay statement item.""" - name: Optional[str] = None + name: str """The name of the pay statement item.""" diff --git a/src/finch/types/hris/pay_statement.py b/src/finch/types/hris/pay_statement.py index 24f97b56..88f344e0 100644 --- a/src/finch/types/hris/pay_statement.py +++ b/src/finch/types/hris/pay_statement.py @@ -25,7 +25,7 @@ class EarningAttributesMetadata(BaseModel): - metadata: Optional[Dict[str, Optional[object]]] = None + metadata: Dict[str, Optional[object]] """The metadata to be attached to the entity by existing rules. It is a key-value pairs where the values can be of any type (string, number, @@ -34,15 +34,13 @@ class EarningAttributesMetadata(BaseModel): class EarningAttributes(BaseModel): - metadata: Optional[EarningAttributesMetadata] = None + metadata: EarningAttributesMetadata class Earning(BaseModel): amount: Optional[int] = None """The earnings amount in cents.""" - attributes: Optional[EarningAttributes] = None - currency: Optional[str] = None """The earnings currency code.""" @@ -75,9 +73,11 @@ class Earning(BaseModel): ] = None """The type of earning.""" + attributes: Optional[EarningAttributes] = None + class EmployeeDeductionAttributesMetadata(BaseModel): - metadata: Optional[Dict[str, Optional[object]]] = None + metadata: Dict[str, Optional[object]] """The metadata to be attached to the entity by existing rules. It is a key-value pairs where the values can be of any type (string, number, @@ -86,15 +86,13 @@ class EmployeeDeductionAttributesMetadata(BaseModel): class EmployeeDeductionAttributes(BaseModel): - metadata: Optional[EmployeeDeductionAttributesMetadata] = None + metadata: EmployeeDeductionAttributesMetadata class EmployeeDeduction(BaseModel): amount: Optional[int] = None """The deduction amount in cents.""" - attributes: Optional[EmployeeDeductionAttributes] = None - currency: Optional[str] = None """The deduction currency.""" @@ -107,9 +105,11 @@ class EmployeeDeduction(BaseModel): type: Optional[BenefitType] = None """Type of benefit.""" + attributes: Optional[EmployeeDeductionAttributes] = None + class EmployerContributionAttributesMetadata(BaseModel): - metadata: Optional[Dict[str, Optional[object]]] = None + metadata: Dict[str, Optional[object]] """The metadata to be attached to the entity by existing rules. It is a key-value pairs where the values can be of any type (string, number, @@ -118,15 +118,13 @@ class EmployerContributionAttributesMetadata(BaseModel): class EmployerContributionAttributes(BaseModel): - metadata: Optional[EmployerContributionAttributesMetadata] = None + metadata: EmployerContributionAttributesMetadata class EmployerContribution(BaseModel): amount: Optional[int] = None """The contribution amount in cents.""" - attributes: Optional[EmployerContributionAttributes] = None - currency: Optional[str] = None """The contribution currency.""" @@ -136,9 +134,11 @@ class EmployerContribution(BaseModel): type: Optional[BenefitType] = None """Type of benefit.""" + attributes: Optional[EmployerContributionAttributes] = None + class TaxAttributesMetadata(BaseModel): - metadata: Optional[Dict[str, Optional[object]]] = None + metadata: Dict[str, Optional[object]] """The metadata to be attached to the entity by existing rules. It is a key-value pairs where the values can be of any type (string, number, @@ -147,15 +147,13 @@ class TaxAttributesMetadata(BaseModel): class TaxAttributes(BaseModel): - metadata: Optional[TaxAttributesMetadata] = None + metadata: TaxAttributesMetadata class Tax(BaseModel): amount: Optional[int] = None """The tax amount in cents.""" - attributes: Optional[TaxAttributes] = None - currency: Optional[str] = None """The currency code.""" @@ -168,6 +166,8 @@ class Tax(BaseModel): type: Optional[Literal["state", "federal", "local", "fica"]] = None """The type of taxes.""" + attributes: Optional[TaxAttributes] = None + class PayStatement(BaseModel): earnings: Optional[List[Optional[Earning]]] = None @@ -180,7 +180,7 @@ class PayStatement(BaseModel): gross_pay: Optional[Money] = None - individual_id: Optional[str] = None + individual_id: str """A stable Finch `id` (UUID v4) for an individual in the company""" net_pay: Optional[Money] = None diff --git a/src/finch/types/hris/pay_statement_response.py b/src/finch/types/hris/pay_statement_response.py index 35c33990..c89ae0fc 100644 --- a/src/finch/types/hris/pay_statement_response.py +++ b/src/finch/types/hris/pay_statement_response.py @@ -1,7 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional - from ..._models import BaseModel from .pay_statement_response_body import PayStatementResponseBody @@ -9,8 +7,8 @@ class PayStatementResponse(BaseModel): - body: Optional[PayStatementResponseBody] = None + body: PayStatementResponseBody - code: Optional[int] = None + code: int - payment_id: Optional[str] = None + payment_id: str diff --git a/src/finch/types/hris/pay_statement_response_body.py b/src/finch/types/hris/pay_statement_response_body.py index 51ef1584..454a807c 100644 --- a/src/finch/types/hris/pay_statement_response_body.py +++ b/src/finch/types/hris/pay_statement_response_body.py @@ -4,13 +4,19 @@ from ..._models import BaseModel from .pay_statement import PayStatement -from ..shared.paging import Paging -__all__ = ["PayStatementResponseBody"] +__all__ = ["PayStatementResponseBody", "Paging"] + + +class Paging(BaseModel): + offset: int + """The current start index of the returned list of elements""" + + count: Optional[int] = None + """The total number of elements for the entire query (not just the given page)""" class PayStatementResponseBody(BaseModel): - paging: Optional[Paging] = None + paging: Paging - pay_statements: Optional[List[PayStatement]] = None - """The array of pay statements for the current payment.""" + pay_statements: List[PayStatement] diff --git a/src/finch/types/hris/payment.py b/src/finch/types/hris/payment.py index d227f162..992006f1 100644 --- a/src/finch/types/hris/payment.py +++ b/src/finch/types/hris/payment.py @@ -16,7 +16,7 @@ class PayPeriod(BaseModel): class Payment(BaseModel): - id: Optional[str] = None + id: str """The unique id for the payment.""" company_debit: Optional[Money] = None @@ -40,14 +40,14 @@ class Payment(BaseModel): List[ Literal[ "annually", - "semi_annually", - "quarterly", - "monthly", - "semi_monthly", "bi_weekly", - "weekly", "daily", + "monthly", "other", + "quarterly", + "semi_annually", + "semi_monthly", + "weekly", ] ] ] = None diff --git a/src/finch/types/money.py b/src/finch/types/money.py index 21ebb963..86c433ad 100644 --- a/src/finch/types/money.py +++ b/src/finch/types/money.py @@ -11,4 +11,4 @@ class Money(BaseModel): amount: Optional[int] = None """Amount for money object (in cents)""" - currency: Optional[str] = None + currency: str diff --git a/src/finch/types/money_param.py b/src/finch/types/money_param.py index 180e8687..03e202e6 100644 --- a/src/finch/types/money_param.py +++ b/src/finch/types/money_param.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["MoneyParam"] class MoneyParam(TypedDict, total=False): - amount: Optional[int] + amount: Required[Optional[int]] """Amount for money object (in cents)""" - currency: str + currency: Required[str] diff --git a/src/finch/types/payroll/pay_group_list_response.py b/src/finch/types/payroll/pay_group_list_response.py index cd25dfcc..a1fb9826 100644 --- a/src/finch/types/payroll/pay_group_list_response.py +++ b/src/finch/types/payroll/pay_group_list_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from typing_extensions import Literal from ..._models import BaseModel @@ -9,25 +9,15 @@ class PayGroupListResponse(BaseModel): - id: Optional[str] = None + id: str """Finch id (uuidv4) for the pay group""" - name: Optional[str] = None + name: str """Name of the pay group""" - pay_frequencies: Optional[ - List[ - Literal[ - "annually", - "semi_annually", - "quarterly", - "monthly", - "semi_monthly", - "bi_weekly", - "weekly", - "daily", - "other", - ] + pay_frequencies: List[ + Literal[ + "annually", "bi_weekly", "daily", "monthly", "other", "quarterly", "semi_annually", "semi_monthly", "weekly" ] - ] = None + ] """List of pay frequencies associated with this pay group""" diff --git a/src/finch/types/payroll/pay_group_retrieve_response.py b/src/finch/types/payroll/pay_group_retrieve_response.py index b07ec41c..b3ff7092 100644 --- a/src/finch/types/payroll/pay_group_retrieve_response.py +++ b/src/finch/types/payroll/pay_group_retrieve_response.py @@ -19,7 +19,7 @@ class PayGroupRetrieveResponse(BaseModel): pay_frequencies: List[ Literal[ - "annually", "semi_annually", "quarterly", "monthly", "semi_monthly", "bi_weekly", "weekly", "daily", "other" + "annually", "bi_weekly", "daily", "monthly", "other", "quarterly", "semi_annually", "semi_monthly", "weekly" ] ] """List of pay frequencies associated with this pay group""" diff --git a/src/finch/types/sandbox/payment_create_params.py b/src/finch/types/sandbox/payment_create_params.py index f8744ec1..e0917dcd 100644 --- a/src/finch/types/sandbox/payment_create_params.py +++ b/src/finch/types/sandbox/payment_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, Iterable, Optional -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from ..money_param import MoneyParam from ..hris.benefit_type import BenefitType @@ -35,7 +35,7 @@ class PaymentCreateParams(TypedDict, total=False): class PayStatementEarningAttributesMetadata(TypedDict, total=False): - metadata: Dict[str, Optional[object]] + metadata: Required[Dict[str, Optional[object]]] """The metadata to be attached to the entity by existing rules. It is a key-value pairs where the values can be of any type (string, number, @@ -44,50 +44,52 @@ class PayStatementEarningAttributesMetadata(TypedDict, total=False): class PayStatementEarningAttributes(TypedDict, total=False): - metadata: PayStatementEarningAttributesMetadata + metadata: Required[PayStatementEarningAttributesMetadata] class PayStatementEarning(TypedDict, total=False): - amount: Optional[int] + amount: Required[Optional[int]] """The earnings amount in cents.""" - attributes: Optional[PayStatementEarningAttributes] - - currency: Optional[str] + currency: Required[Optional[str]] """The earnings currency code.""" - hours: Optional[float] + hours: Required[Optional[float]] """The number of hours associated with this earning. (For salaried employees, this could be hours per pay period, `0` or `null`, depending on the provider). """ - name: Optional[str] + name: Required[Optional[str]] """The exact name of the deduction from the pay statement.""" - type: Optional[ - Literal[ - "salary", - "wage", - "reimbursement", - "overtime", - "severance", - "double_overtime", - "pto", - "sick", - "bonus", - "commission", - "tips", - "1099", - "other", + type: Required[ + Optional[ + Literal[ + "salary", + "wage", + "reimbursement", + "overtime", + "severance", + "double_overtime", + "pto", + "sick", + "bonus", + "commission", + "tips", + "1099", + "other", + ] ] ] """The type of earning.""" + attributes: Optional[PayStatementEarningAttributes] + class PayStatementEmployeeDeductionAttributesMetadata(TypedDict, total=False): - metadata: Dict[str, Optional[object]] + metadata: Required[Dict[str, Optional[object]]] """The metadata to be attached to the entity by existing rules. It is a key-value pairs where the values can be of any type (string, number, @@ -96,30 +98,30 @@ class PayStatementEmployeeDeductionAttributesMetadata(TypedDict, total=False): class PayStatementEmployeeDeductionAttributes(TypedDict, total=False): - metadata: PayStatementEmployeeDeductionAttributesMetadata + metadata: Required[PayStatementEmployeeDeductionAttributesMetadata] class PayStatementEmployeeDeduction(TypedDict, total=False): - amount: Optional[int] + amount: Required[Optional[int]] """The deduction amount in cents.""" - attributes: Optional[PayStatementEmployeeDeductionAttributes] - - currency: Optional[str] + currency: Required[Optional[str]] """The deduction currency.""" - name: Optional[str] + name: Required[Optional[str]] """The deduction name from the pay statement.""" - pre_tax: Optional[bool] + pre_tax: Required[Optional[bool]] """Boolean indicating if the deduction is pre-tax.""" - type: Optional[BenefitType] + type: Required[Optional[BenefitType]] """Type of benefit.""" + attributes: Optional[PayStatementEmployeeDeductionAttributes] + class PayStatementEmployerContributionAttributesMetadata(TypedDict, total=False): - metadata: Dict[str, Optional[object]] + metadata: Required[Dict[str, Optional[object]]] """The metadata to be attached to the entity by existing rules. It is a key-value pairs where the values can be of any type (string, number, @@ -128,27 +130,27 @@ class PayStatementEmployerContributionAttributesMetadata(TypedDict, total=False) class PayStatementEmployerContributionAttributes(TypedDict, total=False): - metadata: PayStatementEmployerContributionAttributesMetadata + metadata: Required[PayStatementEmployerContributionAttributesMetadata] class PayStatementEmployerContribution(TypedDict, total=False): - amount: Optional[int] + amount: Required[Optional[int]] """The contribution amount in cents.""" - attributes: Optional[PayStatementEmployerContributionAttributes] - - currency: Optional[str] + currency: Required[Optional[str]] """The contribution currency.""" - name: Optional[str] + name: Required[Optional[str]] """The contribution name from the pay statement.""" - type: Optional[BenefitType] + type: Required[Optional[BenefitType]] """Type of benefit.""" + attributes: Optional[PayStatementEmployerContributionAttributes] + class PayStatementTaxAttributesMetadata(TypedDict, total=False): - metadata: Dict[str, Optional[object]] + metadata: Required[Dict[str, Optional[object]]] """The metadata to be attached to the entity by existing rules. It is a key-value pairs where the values can be of any type (string, number, @@ -157,52 +159,52 @@ class PayStatementTaxAttributesMetadata(TypedDict, total=False): class PayStatementTaxAttributes(TypedDict, total=False): - metadata: PayStatementTaxAttributesMetadata + metadata: Required[PayStatementTaxAttributesMetadata] class PayStatementTax(TypedDict, total=False): - amount: Optional[int] + amount: Required[Optional[int]] """The tax amount in cents.""" - attributes: Optional[PayStatementTaxAttributes] - - currency: Optional[str] + currency: Required[Optional[str]] """The currency code.""" - employer: Optional[bool] + employer: Required[Optional[bool]] """`true` if the amount is paid by the employers.""" - name: Optional[str] + name: Required[Optional[str]] """The exact name of tax from the pay statement.""" - type: Optional[Literal["state", "federal", "local", "fica"]] + type: Required[Optional[Literal["state", "federal", "local", "fica"]]] """The type of taxes.""" + attributes: Optional[PayStatementTaxAttributes] + class PayStatement(TypedDict, total=False): - earnings: Optional[Iterable[Optional[PayStatementEarning]]] + earnings: Required[Optional[Iterable[Optional[PayStatementEarning]]]] """The array of earnings objects associated with this pay statement""" - employee_deductions: Optional[Iterable[Optional[PayStatementEmployeeDeduction]]] + employee_deductions: Required[Optional[Iterable[Optional[PayStatementEmployeeDeduction]]]] """The array of deductions objects associated with this pay statement.""" - employer_contributions: Optional[Iterable[Optional[PayStatementEmployerContribution]]] + employer_contributions: Required[Optional[Iterable[Optional[PayStatementEmployerContribution]]]] - gross_pay: Optional[MoneyParam] + gross_pay: Required[Optional[MoneyParam]] - individual_id: str + individual_id: Required[str] """A stable Finch `id` (UUID v4) for an individual in the company""" - net_pay: Optional[MoneyParam] + net_pay: Required[Optional[MoneyParam]] - payment_method: Optional[Literal["check", "direct_deposit"]] + payment_method: Required[Optional[Literal["check", "direct_deposit"]]] """The payment method.""" - taxes: Optional[Iterable[Optional[PayStatementTax]]] + taxes: Required[Optional[Iterable[Optional[PayStatementTax]]]] """The array of taxes objects associated with this pay statement.""" - total_hours: Optional[float] + total_hours: Required[Optional[float]] """The number of hours worked for this pay period""" - type: Optional[Literal["regular_payroll", "off_cycle_payroll", "one_time_payment"]] + type: Required[Optional[Literal["regular_payroll", "off_cycle_payroll", "one_time_payment"]]] """The type of the payment associated with the pay statement.""" diff --git a/tests/api_resources/hris/test_benefits.py b/tests/api_resources/hris/test_benefits.py index 9a55c13c..23869d81 100644 --- a/tests/api_resources/hris/test_benefits.py +++ b/tests/api_resources/hris/test_benefits.py @@ -42,7 +42,7 @@ def test_method_create_with_all_params(self, client: Finch) -> None: }, description="description", frequency="one_time", - type="401k", + type="457", ) assert_matches_type(CreateCompanyBenefitsResponse, benefit, path=["response"]) @@ -223,7 +223,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncFinch) -> }, description="description", frequency="one_time", - type="401k", + type="457", ) assert_matches_type(CreateCompanyBenefitsResponse, benefit, path=["response"]) diff --git a/tests/api_resources/sandbox/test_payment.py b/tests/api_resources/sandbox/test_payment.py index 49482a0f..79cdb47e 100644 --- a/tests/api_resources/sandbox/test_payment.py +++ b/tests/api_resources/sandbox/test_payment.py @@ -31,37 +31,37 @@ def test_method_create_with_all_params(self, client: Finch) -> None: "earnings": [ { "amount": 0, - "attributes": {"metadata": {"metadata": {"foo": {}}}}, "currency": "currency", "hours": 0, "name": "name", "type": "salary", + "attributes": {"metadata": {"metadata": {"foo": {}}}}, } ], "employee_deductions": [ { - "amount": 2000, - "attributes": {"metadata": {"metadata": {"foo": {}}}}, - "currency": "usd", - "name": "401k test", + "amount": 0, + "currency": "currency", + "name": "name", "pre_tax": True, - "type": "401k", + "type": "457", + "attributes": {"metadata": {"metadata": {"foo": {}}}}, } ], "employer_contributions": [ { "amount": 0, - "attributes": {"metadata": {"metadata": {"foo": {}}}}, "currency": "currency", "name": "name", - "type": "401k", + "type": "457", + "attributes": {"metadata": {"metadata": {"foo": {}}}}, } ], "gross_pay": { "amount": 0, "currency": "currency", }, - "individual_id": "b2338cfb-472f-4f72-9faa-e028c083144a", + "individual_id": "individual_id", "net_pay": { "amount": 0, "currency": "currency", @@ -70,11 +70,11 @@ def test_method_create_with_all_params(self, client: Finch) -> None: "taxes": [ { "amount": 0, - "attributes": {"metadata": {"metadata": {"foo": {}}}}, "currency": "currency", "employer": True, "name": "name", "type": "state", + "attributes": {"metadata": {"metadata": {"foo": {}}}}, } ], "total_hours": 0, @@ -123,37 +123,37 @@ async def test_method_create_with_all_params(self, async_client: AsyncFinch) -> "earnings": [ { "amount": 0, - "attributes": {"metadata": {"metadata": {"foo": {}}}}, "currency": "currency", "hours": 0, "name": "name", "type": "salary", + "attributes": {"metadata": {"metadata": {"foo": {}}}}, } ], "employee_deductions": [ { - "amount": 2000, - "attributes": {"metadata": {"metadata": {"foo": {}}}}, - "currency": "usd", - "name": "401k test", + "amount": 0, + "currency": "currency", + "name": "name", "pre_tax": True, - "type": "401k", + "type": "457", + "attributes": {"metadata": {"metadata": {"foo": {}}}}, } ], "employer_contributions": [ { "amount": 0, - "attributes": {"metadata": {"metadata": {"foo": {}}}}, "currency": "currency", "name": "name", - "type": "401k", + "type": "457", + "attributes": {"metadata": {"metadata": {"foo": {}}}}, } ], "gross_pay": { "amount": 0, "currency": "currency", }, - "individual_id": "b2338cfb-472f-4f72-9faa-e028c083144a", + "individual_id": "individual_id", "net_pay": { "amount": 0, "currency": "currency", @@ -162,11 +162,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncFinch) -> "taxes": [ { "amount": 0, - "attributes": {"metadata": {"metadata": {"foo": {}}}}, "currency": "currency", "employer": True, "name": "name", "type": "state", + "attributes": {"metadata": {"metadata": {"foo": {}}}}, } ], "total_hours": 0, From fd20b60e775673b78edeb40771d8af7f7a55bb08 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 May 2025 21:39:44 +0000 Subject: [PATCH 4/6] feat(api): api update --- .stats.yml | 4 ++-- src/finch/types/hris/pay_statement.py | 2 +- src/finch/types/sandbox/payment_create_params.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index c621e60f..15160804 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-331df2398447990a86899b05ac569534b6a7e4ff1d73a319d57f67b34a201fb7.yml -openapi_spec_hash: 6e57516524c0519e90213c0554b26ab4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-2450f9bcc309174bb09e7cc75c3d873240626676782a6d0aa7578395adfa80a8.yml +openapi_spec_hash: ce0eebc26042d65a7831455ca7e9c5a8 config_hash: 53778a0b839c4f6ad34fbba051f5e8a6 diff --git a/src/finch/types/hris/pay_statement.py b/src/finch/types/hris/pay_statement.py index 88f344e0..b849cd0a 100644 --- a/src/finch/types/hris/pay_statement.py +++ b/src/finch/types/hris/pay_statement.py @@ -185,7 +185,7 @@ class PayStatement(BaseModel): net_pay: Optional[Money] = None - payment_method: Optional[Literal["check", "direct_deposit"]] = None + payment_method: Optional[Literal["check", "direct_deposit", "other"]] = None """The payment method.""" taxes: Optional[List[Optional[Tax]]] = None diff --git a/src/finch/types/sandbox/payment_create_params.py b/src/finch/types/sandbox/payment_create_params.py index e0917dcd..352dd475 100644 --- a/src/finch/types/sandbox/payment_create_params.py +++ b/src/finch/types/sandbox/payment_create_params.py @@ -197,7 +197,7 @@ class PayStatement(TypedDict, total=False): net_pay: Required[Optional[MoneyParam]] - payment_method: Required[Optional[Literal["check", "direct_deposit"]]] + payment_method: Required[Optional[Literal["check", "direct_deposit", "other"]]] """The payment method.""" taxes: Required[Optional[Iterable[Optional[PayStatementTax]]]] From abc60a28fc9fe40464299491ae8209259f8bca78 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 May 2025 04:49:11 +0000 Subject: [PATCH 5/6] feat(api): api update --- .stats.yml | 4 +- src/finch/types/hris/benefit_type.py | 20 +-- .../pay_statement_item_list_response.py | 18 +-- src/finch/types/hris/pay_statement.py | 34 ++--- .../types/hris/pay_statement_response.py | 8 +- .../types/hris/pay_statement_response_body.py | 16 +-- src/finch/types/hris/payment.py | 12 +- src/finch/types/money.py | 2 +- src/finch/types/money_param.py | 6 +- .../types/payroll/pay_group_list_response.py | 24 +++- .../payroll/pay_group_retrieve_response.py | 2 +- .../types/sandbox/payment_create_params.py | 122 +++++++++--------- tests/api_resources/hris/test_benefits.py | 4 +- tests/api_resources/sandbox/test_payment.py | 40 +++--- 14 files changed, 158 insertions(+), 154 deletions(-) diff --git a/.stats.yml b/.stats.yml index 15160804..c72261be 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-2450f9bcc309174bb09e7cc75c3d873240626676782a6d0aa7578395adfa80a8.yml -openapi_spec_hash: ce0eebc26042d65a7831455ca7e9c5a8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-5b00a0bc705b1d5bfcb5ea79c7af544766d51ec12ccc4721825664ab397789d8.yml +openapi_spec_hash: 34891659cff31395ba7683a8153b1db5 config_hash: 53778a0b839c4f6ad34fbba051f5e8a6 diff --git a/src/finch/types/hris/benefit_type.py b/src/finch/types/hris/benefit_type.py index 9f5b4132..2c8ad7f4 100644 --- a/src/finch/types/hris/benefit_type.py +++ b/src/finch/types/hris/benefit_type.py @@ -7,24 +7,24 @@ BenefitType: TypeAlias = Optional[ Literal[ - "457", "401k", "401k_roth", "401k_loan", "403b", "403b_roth", + "457", "457_roth", - "commuter", - "custom_post_tax", - "custom_pre_tax", - "fsa_dependent_care", - "fsa_medical", - "hsa_post", - "hsa_pre", - "s125_dental", "s125_medical", + "s125_dental", "s125_vision", - "simple", + "hsa_pre", + "hsa_post", + "fsa_medical", + "fsa_dependent_care", "simple_ira", + "simple", + "commuter", + "custom_post_tax", + "custom_pre_tax", ] ] diff --git a/src/finch/types/hris/company/pay_statement_item_list_response.py b/src/finch/types/hris/company/pay_statement_item_list_response.py index e2ca25b0..31e9cf16 100644 --- a/src/finch/types/hris/company/pay_statement_item_list_response.py +++ b/src/finch/types/hris/company/pay_statement_item_list_response.py @@ -9,18 +9,18 @@ class Attributes(BaseModel): - metadata: Optional[Dict[str, Optional[object]]] = None - """The metadata of the pay statement item derived by the rules engine if available. - - Each attribute will be a key-value pair defined by a rule. - """ - employer: Optional[bool] = None """`true` if the amount is paid by the employers. This field is only available for taxes. """ + metadata: Optional[Dict[str, Optional[object]]] = None + """The metadata of the pay statement item derived by the rules engine if available. + + Each attribute will be a key-value pair defined by a rule. + """ + pre_tax: Optional[bool] = None """`true` if the pay statement item is pre-tax. @@ -32,11 +32,11 @@ class Attributes(BaseModel): class PayStatementItemListResponse(BaseModel): - attributes: Attributes + attributes: Optional[Attributes] = None """The attributes of the pay statement item.""" - category: Literal["earnings", "taxes", "employee_deductions", "employer_contributions"] + category: Optional[Literal["earnings", "taxes", "employee_deductions", "employer_contributions"]] = None """The category of the pay statement item.""" - name: str + name: Optional[str] = None """The name of the pay statement item.""" diff --git a/src/finch/types/hris/pay_statement.py b/src/finch/types/hris/pay_statement.py index b849cd0a..7c6f63b6 100644 --- a/src/finch/types/hris/pay_statement.py +++ b/src/finch/types/hris/pay_statement.py @@ -25,7 +25,7 @@ class EarningAttributesMetadata(BaseModel): - metadata: Dict[str, Optional[object]] + metadata: Optional[Dict[str, Optional[object]]] = None """The metadata to be attached to the entity by existing rules. It is a key-value pairs where the values can be of any type (string, number, @@ -34,13 +34,15 @@ class EarningAttributesMetadata(BaseModel): class EarningAttributes(BaseModel): - metadata: EarningAttributesMetadata + metadata: Optional[EarningAttributesMetadata] = None class Earning(BaseModel): amount: Optional[int] = None """The earnings amount in cents.""" + attributes: Optional[EarningAttributes] = None + currency: Optional[str] = None """The earnings currency code.""" @@ -73,11 +75,9 @@ class Earning(BaseModel): ] = None """The type of earning.""" - attributes: Optional[EarningAttributes] = None - class EmployeeDeductionAttributesMetadata(BaseModel): - metadata: Dict[str, Optional[object]] + metadata: Optional[Dict[str, Optional[object]]] = None """The metadata to be attached to the entity by existing rules. It is a key-value pairs where the values can be of any type (string, number, @@ -86,13 +86,15 @@ class EmployeeDeductionAttributesMetadata(BaseModel): class EmployeeDeductionAttributes(BaseModel): - metadata: EmployeeDeductionAttributesMetadata + metadata: Optional[EmployeeDeductionAttributesMetadata] = None class EmployeeDeduction(BaseModel): amount: Optional[int] = None """The deduction amount in cents.""" + attributes: Optional[EmployeeDeductionAttributes] = None + currency: Optional[str] = None """The deduction currency.""" @@ -105,11 +107,9 @@ class EmployeeDeduction(BaseModel): type: Optional[BenefitType] = None """Type of benefit.""" - attributes: Optional[EmployeeDeductionAttributes] = None - class EmployerContributionAttributesMetadata(BaseModel): - metadata: Dict[str, Optional[object]] + metadata: Optional[Dict[str, Optional[object]]] = None """The metadata to be attached to the entity by existing rules. It is a key-value pairs where the values can be of any type (string, number, @@ -118,13 +118,15 @@ class EmployerContributionAttributesMetadata(BaseModel): class EmployerContributionAttributes(BaseModel): - metadata: EmployerContributionAttributesMetadata + metadata: Optional[EmployerContributionAttributesMetadata] = None class EmployerContribution(BaseModel): amount: Optional[int] = None """The contribution amount in cents.""" + attributes: Optional[EmployerContributionAttributes] = None + currency: Optional[str] = None """The contribution currency.""" @@ -134,11 +136,9 @@ class EmployerContribution(BaseModel): type: Optional[BenefitType] = None """Type of benefit.""" - attributes: Optional[EmployerContributionAttributes] = None - class TaxAttributesMetadata(BaseModel): - metadata: Dict[str, Optional[object]] + metadata: Optional[Dict[str, Optional[object]]] = None """The metadata to be attached to the entity by existing rules. It is a key-value pairs where the values can be of any type (string, number, @@ -147,13 +147,15 @@ class TaxAttributesMetadata(BaseModel): class TaxAttributes(BaseModel): - metadata: TaxAttributesMetadata + metadata: Optional[TaxAttributesMetadata] = None class Tax(BaseModel): amount: Optional[int] = None """The tax amount in cents.""" + attributes: Optional[TaxAttributes] = None + currency: Optional[str] = None """The currency code.""" @@ -166,8 +168,6 @@ class Tax(BaseModel): type: Optional[Literal["state", "federal", "local", "fica"]] = None """The type of taxes.""" - attributes: Optional[TaxAttributes] = None - class PayStatement(BaseModel): earnings: Optional[List[Optional[Earning]]] = None @@ -180,7 +180,7 @@ class PayStatement(BaseModel): gross_pay: Optional[Money] = None - individual_id: str + individual_id: Optional[str] = None """A stable Finch `id` (UUID v4) for an individual in the company""" net_pay: Optional[Money] = None diff --git a/src/finch/types/hris/pay_statement_response.py b/src/finch/types/hris/pay_statement_response.py index c89ae0fc..35c33990 100644 --- a/src/finch/types/hris/pay_statement_response.py +++ b/src/finch/types/hris/pay_statement_response.py @@ -1,5 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Optional + from ..._models import BaseModel from .pay_statement_response_body import PayStatementResponseBody @@ -7,8 +9,8 @@ class PayStatementResponse(BaseModel): - body: PayStatementResponseBody + body: Optional[PayStatementResponseBody] = None - code: int + code: Optional[int] = None - payment_id: str + payment_id: Optional[str] = None diff --git a/src/finch/types/hris/pay_statement_response_body.py b/src/finch/types/hris/pay_statement_response_body.py index 454a807c..51ef1584 100644 --- a/src/finch/types/hris/pay_statement_response_body.py +++ b/src/finch/types/hris/pay_statement_response_body.py @@ -4,19 +4,13 @@ from ..._models import BaseModel from .pay_statement import PayStatement +from ..shared.paging import Paging -__all__ = ["PayStatementResponseBody", "Paging"] - - -class Paging(BaseModel): - offset: int - """The current start index of the returned list of elements""" - - count: Optional[int] = None - """The total number of elements for the entire query (not just the given page)""" +__all__ = ["PayStatementResponseBody"] class PayStatementResponseBody(BaseModel): - paging: Paging + paging: Optional[Paging] = None - pay_statements: List[PayStatement] + pay_statements: Optional[List[PayStatement]] = None + """The array of pay statements for the current payment.""" diff --git a/src/finch/types/hris/payment.py b/src/finch/types/hris/payment.py index 992006f1..d227f162 100644 --- a/src/finch/types/hris/payment.py +++ b/src/finch/types/hris/payment.py @@ -16,7 +16,7 @@ class PayPeriod(BaseModel): class Payment(BaseModel): - id: str + id: Optional[str] = None """The unique id for the payment.""" company_debit: Optional[Money] = None @@ -40,14 +40,14 @@ class Payment(BaseModel): List[ Literal[ "annually", - "bi_weekly", - "daily", - "monthly", - "other", - "quarterly", "semi_annually", + "quarterly", + "monthly", "semi_monthly", + "bi_weekly", "weekly", + "daily", + "other", ] ] ] = None diff --git a/src/finch/types/money.py b/src/finch/types/money.py index 86c433ad..21ebb963 100644 --- a/src/finch/types/money.py +++ b/src/finch/types/money.py @@ -11,4 +11,4 @@ class Money(BaseModel): amount: Optional[int] = None """Amount for money object (in cents)""" - currency: str + currency: Optional[str] = None diff --git a/src/finch/types/money_param.py b/src/finch/types/money_param.py index 03e202e6..180e8687 100644 --- a/src/finch/types/money_param.py +++ b/src/finch/types/money_param.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict __all__ = ["MoneyParam"] class MoneyParam(TypedDict, total=False): - amount: Required[Optional[int]] + amount: Optional[int] """Amount for money object (in cents)""" - currency: Required[str] + currency: str diff --git a/src/finch/types/payroll/pay_group_list_response.py b/src/finch/types/payroll/pay_group_list_response.py index a1fb9826..cd25dfcc 100644 --- a/src/finch/types/payroll/pay_group_list_response.py +++ b/src/finch/types/payroll/pay_group_list_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from typing_extensions import Literal from ..._models import BaseModel @@ -9,15 +9,25 @@ class PayGroupListResponse(BaseModel): - id: str + id: Optional[str] = None """Finch id (uuidv4) for the pay group""" - name: str + name: Optional[str] = None """Name of the pay group""" - pay_frequencies: List[ - Literal[ - "annually", "bi_weekly", "daily", "monthly", "other", "quarterly", "semi_annually", "semi_monthly", "weekly" + pay_frequencies: Optional[ + List[ + Literal[ + "annually", + "semi_annually", + "quarterly", + "monthly", + "semi_monthly", + "bi_weekly", + "weekly", + "daily", + "other", + ] ] - ] + ] = None """List of pay frequencies associated with this pay group""" diff --git a/src/finch/types/payroll/pay_group_retrieve_response.py b/src/finch/types/payroll/pay_group_retrieve_response.py index b3ff7092..b07ec41c 100644 --- a/src/finch/types/payroll/pay_group_retrieve_response.py +++ b/src/finch/types/payroll/pay_group_retrieve_response.py @@ -19,7 +19,7 @@ class PayGroupRetrieveResponse(BaseModel): pay_frequencies: List[ Literal[ - "annually", "bi_weekly", "daily", "monthly", "other", "quarterly", "semi_annually", "semi_monthly", "weekly" + "annually", "semi_annually", "quarterly", "monthly", "semi_monthly", "bi_weekly", "weekly", "daily", "other" ] ] """List of pay frequencies associated with this pay group""" diff --git a/src/finch/types/sandbox/payment_create_params.py b/src/finch/types/sandbox/payment_create_params.py index 352dd475..d35089b0 100644 --- a/src/finch/types/sandbox/payment_create_params.py +++ b/src/finch/types/sandbox/payment_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, Iterable, Optional -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Literal, TypedDict from ..money_param import MoneyParam from ..hris.benefit_type import BenefitType @@ -35,7 +35,7 @@ class PaymentCreateParams(TypedDict, total=False): class PayStatementEarningAttributesMetadata(TypedDict, total=False): - metadata: Required[Dict[str, Optional[object]]] + metadata: Dict[str, Optional[object]] """The metadata to be attached to the entity by existing rules. It is a key-value pairs where the values can be of any type (string, number, @@ -44,52 +44,50 @@ class PayStatementEarningAttributesMetadata(TypedDict, total=False): class PayStatementEarningAttributes(TypedDict, total=False): - metadata: Required[PayStatementEarningAttributesMetadata] + metadata: PayStatementEarningAttributesMetadata class PayStatementEarning(TypedDict, total=False): - amount: Required[Optional[int]] + amount: Optional[int] """The earnings amount in cents.""" - currency: Required[Optional[str]] + attributes: Optional[PayStatementEarningAttributes] + + currency: Optional[str] """The earnings currency code.""" - hours: Required[Optional[float]] + hours: Optional[float] """The number of hours associated with this earning. (For salaried employees, this could be hours per pay period, `0` or `null`, depending on the provider). """ - name: Required[Optional[str]] + name: Optional[str] """The exact name of the deduction from the pay statement.""" - type: Required[ - Optional[ - Literal[ - "salary", - "wage", - "reimbursement", - "overtime", - "severance", - "double_overtime", - "pto", - "sick", - "bonus", - "commission", - "tips", - "1099", - "other", - ] + type: Optional[ + Literal[ + "salary", + "wage", + "reimbursement", + "overtime", + "severance", + "double_overtime", + "pto", + "sick", + "bonus", + "commission", + "tips", + "1099", + "other", ] ] """The type of earning.""" - attributes: Optional[PayStatementEarningAttributes] - class PayStatementEmployeeDeductionAttributesMetadata(TypedDict, total=False): - metadata: Required[Dict[str, Optional[object]]] + metadata: Dict[str, Optional[object]] """The metadata to be attached to the entity by existing rules. It is a key-value pairs where the values can be of any type (string, number, @@ -98,30 +96,30 @@ class PayStatementEmployeeDeductionAttributesMetadata(TypedDict, total=False): class PayStatementEmployeeDeductionAttributes(TypedDict, total=False): - metadata: Required[PayStatementEmployeeDeductionAttributesMetadata] + metadata: PayStatementEmployeeDeductionAttributesMetadata class PayStatementEmployeeDeduction(TypedDict, total=False): - amount: Required[Optional[int]] + amount: Optional[int] """The deduction amount in cents.""" - currency: Required[Optional[str]] + attributes: Optional[PayStatementEmployeeDeductionAttributes] + + currency: Optional[str] """The deduction currency.""" - name: Required[Optional[str]] + name: Optional[str] """The deduction name from the pay statement.""" - pre_tax: Required[Optional[bool]] + pre_tax: Optional[bool] """Boolean indicating if the deduction is pre-tax.""" - type: Required[Optional[BenefitType]] + type: Optional[BenefitType] """Type of benefit.""" - attributes: Optional[PayStatementEmployeeDeductionAttributes] - class PayStatementEmployerContributionAttributesMetadata(TypedDict, total=False): - metadata: Required[Dict[str, Optional[object]]] + metadata: Dict[str, Optional[object]] """The metadata to be attached to the entity by existing rules. It is a key-value pairs where the values can be of any type (string, number, @@ -130,27 +128,27 @@ class PayStatementEmployerContributionAttributesMetadata(TypedDict, total=False) class PayStatementEmployerContributionAttributes(TypedDict, total=False): - metadata: Required[PayStatementEmployerContributionAttributesMetadata] + metadata: PayStatementEmployerContributionAttributesMetadata class PayStatementEmployerContribution(TypedDict, total=False): - amount: Required[Optional[int]] + amount: Optional[int] """The contribution amount in cents.""" - currency: Required[Optional[str]] + attributes: Optional[PayStatementEmployerContributionAttributes] + + currency: Optional[str] """The contribution currency.""" - name: Required[Optional[str]] + name: Optional[str] """The contribution name from the pay statement.""" - type: Required[Optional[BenefitType]] + type: Optional[BenefitType] """Type of benefit.""" - attributes: Optional[PayStatementEmployerContributionAttributes] - class PayStatementTaxAttributesMetadata(TypedDict, total=False): - metadata: Required[Dict[str, Optional[object]]] + metadata: Dict[str, Optional[object]] """The metadata to be attached to the entity by existing rules. It is a key-value pairs where the values can be of any type (string, number, @@ -159,52 +157,52 @@ class PayStatementTaxAttributesMetadata(TypedDict, total=False): class PayStatementTaxAttributes(TypedDict, total=False): - metadata: Required[PayStatementTaxAttributesMetadata] + metadata: PayStatementTaxAttributesMetadata class PayStatementTax(TypedDict, total=False): - amount: Required[Optional[int]] + amount: Optional[int] """The tax amount in cents.""" - currency: Required[Optional[str]] + attributes: Optional[PayStatementTaxAttributes] + + currency: Optional[str] """The currency code.""" - employer: Required[Optional[bool]] + employer: Optional[bool] """`true` if the amount is paid by the employers.""" - name: Required[Optional[str]] + name: Optional[str] """The exact name of tax from the pay statement.""" - type: Required[Optional[Literal["state", "federal", "local", "fica"]]] + type: Optional[Literal["state", "federal", "local", "fica"]] """The type of taxes.""" - attributes: Optional[PayStatementTaxAttributes] - class PayStatement(TypedDict, total=False): - earnings: Required[Optional[Iterable[Optional[PayStatementEarning]]]] + earnings: Optional[Iterable[Optional[PayStatementEarning]]] """The array of earnings objects associated with this pay statement""" - employee_deductions: Required[Optional[Iterable[Optional[PayStatementEmployeeDeduction]]]] + employee_deductions: Optional[Iterable[Optional[PayStatementEmployeeDeduction]]] """The array of deductions objects associated with this pay statement.""" - employer_contributions: Required[Optional[Iterable[Optional[PayStatementEmployerContribution]]]] + employer_contributions: Optional[Iterable[Optional[PayStatementEmployerContribution]]] - gross_pay: Required[Optional[MoneyParam]] + gross_pay: Optional[MoneyParam] - individual_id: Required[str] + individual_id: str """A stable Finch `id` (UUID v4) for an individual in the company""" - net_pay: Required[Optional[MoneyParam]] + net_pay: Optional[MoneyParam] - payment_method: Required[Optional[Literal["check", "direct_deposit", "other"]]] + payment_method: Optional[Literal["check", "direct_deposit", "other"]] """The payment method.""" - taxes: Required[Optional[Iterable[Optional[PayStatementTax]]]] + taxes: Optional[Iterable[Optional[PayStatementTax]]] """The array of taxes objects associated with this pay statement.""" - total_hours: Required[Optional[float]] + total_hours: Optional[float] """The number of hours worked for this pay period""" - type: Required[Optional[Literal["regular_payroll", "off_cycle_payroll", "one_time_payment"]]] + type: Optional[Literal["regular_payroll", "off_cycle_payroll", "one_time_payment"]] """The type of the payment associated with the pay statement.""" diff --git a/tests/api_resources/hris/test_benefits.py b/tests/api_resources/hris/test_benefits.py index 23869d81..9a55c13c 100644 --- a/tests/api_resources/hris/test_benefits.py +++ b/tests/api_resources/hris/test_benefits.py @@ -42,7 +42,7 @@ def test_method_create_with_all_params(self, client: Finch) -> None: }, description="description", frequency="one_time", - type="457", + type="401k", ) assert_matches_type(CreateCompanyBenefitsResponse, benefit, path=["response"]) @@ -223,7 +223,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncFinch) -> }, description="description", frequency="one_time", - type="457", + type="401k", ) assert_matches_type(CreateCompanyBenefitsResponse, benefit, path=["response"]) diff --git a/tests/api_resources/sandbox/test_payment.py b/tests/api_resources/sandbox/test_payment.py index 79cdb47e..49482a0f 100644 --- a/tests/api_resources/sandbox/test_payment.py +++ b/tests/api_resources/sandbox/test_payment.py @@ -31,37 +31,37 @@ def test_method_create_with_all_params(self, client: Finch) -> None: "earnings": [ { "amount": 0, + "attributes": {"metadata": {"metadata": {"foo": {}}}}, "currency": "currency", "hours": 0, "name": "name", "type": "salary", - "attributes": {"metadata": {"metadata": {"foo": {}}}}, } ], "employee_deductions": [ { - "amount": 0, - "currency": "currency", - "name": "name", - "pre_tax": True, - "type": "457", + "amount": 2000, "attributes": {"metadata": {"metadata": {"foo": {}}}}, + "currency": "usd", + "name": "401k test", + "pre_tax": True, + "type": "401k", } ], "employer_contributions": [ { "amount": 0, + "attributes": {"metadata": {"metadata": {"foo": {}}}}, "currency": "currency", "name": "name", - "type": "457", - "attributes": {"metadata": {"metadata": {"foo": {}}}}, + "type": "401k", } ], "gross_pay": { "amount": 0, "currency": "currency", }, - "individual_id": "individual_id", + "individual_id": "b2338cfb-472f-4f72-9faa-e028c083144a", "net_pay": { "amount": 0, "currency": "currency", @@ -70,11 +70,11 @@ def test_method_create_with_all_params(self, client: Finch) -> None: "taxes": [ { "amount": 0, + "attributes": {"metadata": {"metadata": {"foo": {}}}}, "currency": "currency", "employer": True, "name": "name", "type": "state", - "attributes": {"metadata": {"metadata": {"foo": {}}}}, } ], "total_hours": 0, @@ -123,37 +123,37 @@ async def test_method_create_with_all_params(self, async_client: AsyncFinch) -> "earnings": [ { "amount": 0, + "attributes": {"metadata": {"metadata": {"foo": {}}}}, "currency": "currency", "hours": 0, "name": "name", "type": "salary", - "attributes": {"metadata": {"metadata": {"foo": {}}}}, } ], "employee_deductions": [ { - "amount": 0, - "currency": "currency", - "name": "name", - "pre_tax": True, - "type": "457", + "amount": 2000, "attributes": {"metadata": {"metadata": {"foo": {}}}}, + "currency": "usd", + "name": "401k test", + "pre_tax": True, + "type": "401k", } ], "employer_contributions": [ { "amount": 0, + "attributes": {"metadata": {"metadata": {"foo": {}}}}, "currency": "currency", "name": "name", - "type": "457", - "attributes": {"metadata": {"metadata": {"foo": {}}}}, + "type": "401k", } ], "gross_pay": { "amount": 0, "currency": "currency", }, - "individual_id": "individual_id", + "individual_id": "b2338cfb-472f-4f72-9faa-e028c083144a", "net_pay": { "amount": 0, "currency": "currency", @@ -162,11 +162,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncFinch) -> "taxes": [ { "amount": 0, + "attributes": {"metadata": {"metadata": {"foo": {}}}}, "currency": "currency", "employer": True, "name": "name", "type": "state", - "attributes": {"metadata": {"metadata": {"foo": {}}}}, } ], "total_hours": 0, From 9d3e79c90e0e881a5575ca4ff57c9121c60bd517 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 May 2025 04:49:31 +0000 Subject: [PATCH 6/6] release: 1.27.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 16 ++++++++++++++++ pyproject.toml | 2 +- src/finch/_version.py | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b33e9fd7..4eb89879 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.26.1" + ".": "1.27.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bb44d97..d96ea116 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 1.27.0 (2025-05-16) + +Full Changelog: [v1.26.1...v1.27.0](https://github.com/Finch-API/finch-api-python/compare/v1.26.1...v1.27.0) + +### Features + +* **api:** api update ([abc60a2](https://github.com/Finch-API/finch-api-python/commit/abc60a28fc9fe40464299491ae8209259f8bca78)) +* **api:** api update ([fd20b60](https://github.com/Finch-API/finch-api-python/commit/fd20b60e775673b78edeb40771d8af7f7a55bb08)) +* **api:** api update ([0af1c84](https://github.com/Finch-API/finch-api-python/commit/0af1c8443ffd922047b0f4f892f712668c9f54c9)) + + +### Chores + +* **ci:** fix installation instructions ([ac6a9d8](https://github.com/Finch-API/finch-api-python/commit/ac6a9d8edf95f3343dd38f09693fc7ff22cebd91)) +* **ci:** upload sdks to package manager ([c867997](https://github.com/Finch-API/finch-api-python/commit/c86799760455e97fca934c83e2eef0986d7f8e89)) + ## 1.26.1 (2025-05-09) Full Changelog: [v1.26.0...v1.26.1](https://github.com/Finch-API/finch-api-python/compare/v1.26.0...v1.26.1) diff --git a/pyproject.toml b/pyproject.toml index f9ddadbb..d919801a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "finch-api" -version = "1.26.1" +version = "1.27.0" description = "The official Python library for the Finch API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/finch/_version.py b/src/finch/_version.py index 3b5c8103..5337dd5b 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.26.1" # x-release-please-version +__version__ = "1.27.0" # x-release-please-version