Skip to content

Commit edcea6c

Browse files
fix(client): fix PayStatementResponse body
1 parent f9bdda7 commit edcea6c

10 files changed

Lines changed: 460 additions & 428 deletions

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 46
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-1a82d3230c420c8562600b0ad45133d79ab68ffd21d524ab26eef11e163dba09.yml
33
openapi_spec_hash: 7bd02ce73505e51c5fd78608fed55c62
4-
config_hash: 81eb5297df860cf29f8c5bdbf9f89608
4+
config_hash: bb896000dc7e790e5c9ddda2549fb7ac

api.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,12 @@ Methods:
128128
Types:
129129

130130
```python
131-
from finch.types.hris import PayStatementResponse, PayStatementResponseBody
131+
from finch.types.hris import (
132+
PayStatement,
133+
PayStatementDataSyncInProgress,
134+
PayStatementResponse,
135+
PayStatementResponseBody,
136+
)
132137
```
133138

134139
Methods:

src/finch/resources/sandbox/payment.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
1515
from ..._base_client import make_request_options
1616
from ...types.sandbox import payment_create_params
17+
from ...types.hris.pay_statement_param import PayStatementParam
1718
from ...types.sandbox.payment_create_response import PaymentCreateResponse
1819

1920
__all__ = ["Payment", "AsyncPayment"]
@@ -43,7 +44,7 @@ def create(
4344
self,
4445
*,
4546
end_date: str | NotGiven = NOT_GIVEN,
46-
pay_statements: Iterable[payment_create_params.PayStatement] | NotGiven = NOT_GIVEN,
47+
pay_statements: Iterable[PayStatementParam] | NotGiven = NOT_GIVEN,
4748
start_date: str | NotGiven = NOT_GIVEN,
4849
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
4950
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -105,7 +106,7 @@ async def create(
105106
self,
106107
*,
107108
end_date: str | NotGiven = NOT_GIVEN,
108-
pay_statements: Iterable[payment_create_params.PayStatement] | NotGiven = NOT_GIVEN,
109+
pay_statements: Iterable[PayStatementParam] | NotGiven = NOT_GIVEN,
109110
start_date: str | NotGiven = NOT_GIVEN,
110111
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
111112
# The extra values given here take precedence over values defined on the client or passed to this method.

src/finch/types/hris/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
from .payment import Payment as Payment
99
from .individual import Individual as Individual
1010
from .benefit_type import BenefitType as BenefitType
11+
from .pay_statement import PayStatement as PayStatement
1112
from .company_benefit import CompanyBenefit as CompanyBenefit
1213
from .employment_data import EmploymentData as EmploymentData
1314
from .benefits_support import BenefitsSupport as BenefitsSupport
1415
from .benefit_frequency import BenefitFrequency as BenefitFrequency
1516
from .document_response import DocumentResponse as DocumentResponse
1617
from .benfit_contribution import BenfitContribution as BenfitContribution
1718
from .individual_response import IndividualResponse as IndividualResponse
19+
from .pay_statement_param import PayStatementParam as PayStatementParam
1820
from .payment_list_params import PaymentListParams as PaymentListParams
1921
from .benefit_contribution import BenefitContribution as BenefitContribution
2022
from .document_list_params import DocumentListParams as DocumentListParams
@@ -35,6 +37,7 @@
3537
from .create_company_benefits_response import CreateCompanyBenefitsResponse as CreateCompanyBenefitsResponse
3638
from .directory_list_individuals_params import DirectoryListIndividualsParams as DirectoryListIndividualsParams
3739
from .pay_statement_retrieve_many_params import PayStatementRetrieveManyParams as PayStatementRetrieveManyParams
40+
from .pay_statement_data_sync_in_progress import PayStatementDataSyncInProgress as PayStatementDataSyncInProgress
3841
from .benefit_list_supported_benefits_response import (
3942
BenefitListSupportedBenefitsResponse as BenefitListSupportedBenefitsResponse,
4043
)
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Dict, List, Optional
4+
from typing_extensions import Literal
5+
6+
from ..money import Money
7+
from ..._models import BaseModel
8+
from .benefit_type import BenefitType
9+
10+
__all__ = [
11+
"PayStatement",
12+
"Earning",
13+
"EarningAttributes",
14+
"EarningAttributesMetadata",
15+
"EmployeeDeduction",
16+
"EmployeeDeductionAttributes",
17+
"EmployeeDeductionAttributesMetadata",
18+
"EmployerContribution",
19+
"EmployerContributionAttributes",
20+
"EmployerContributionAttributesMetadata",
21+
"Tax",
22+
"TaxAttributes",
23+
"TaxAttributesMetadata",
24+
]
25+
26+
27+
class EarningAttributesMetadata(BaseModel):
28+
metadata: Dict[str, Optional[object]]
29+
"""The metadata to be attached to the entity by existing rules.
30+
31+
It is a key-value pairs where the values can be of any type (string, number,
32+
boolean, object, array, etc.).
33+
"""
34+
35+
36+
class EarningAttributes(BaseModel):
37+
metadata: EarningAttributesMetadata
38+
39+
40+
class Earning(BaseModel):
41+
amount: Optional[int] = None
42+
"""The earnings amount in cents."""
43+
44+
currency: Optional[str] = None
45+
"""The earnings currency code."""
46+
47+
hours: Optional[float] = None
48+
"""The number of hours associated with this earning.
49+
50+
(For salaried employees, this could be hours per pay period, `0` or `null`,
51+
depending on the provider).
52+
"""
53+
54+
name: Optional[str] = None
55+
"""The exact name of the deduction from the pay statement."""
56+
57+
type: Optional[
58+
Literal[
59+
"salary",
60+
"wage",
61+
"reimbursement",
62+
"overtime",
63+
"severance",
64+
"double_overtime",
65+
"pto",
66+
"sick",
67+
"bonus",
68+
"commission",
69+
"tips",
70+
"1099",
71+
"other",
72+
]
73+
] = None
74+
"""The type of earning."""
75+
76+
attributes: Optional[EarningAttributes] = None
77+
78+
79+
class EmployeeDeductionAttributesMetadata(BaseModel):
80+
metadata: Dict[str, Optional[object]]
81+
"""The metadata to be attached to the entity by existing rules.
82+
83+
It is a key-value pairs where the values can be of any type (string, number,
84+
boolean, object, array, etc.).
85+
"""
86+
87+
88+
class EmployeeDeductionAttributes(BaseModel):
89+
metadata: EmployeeDeductionAttributesMetadata
90+
91+
92+
class EmployeeDeduction(BaseModel):
93+
amount: Optional[int] = None
94+
"""The deduction amount in cents."""
95+
96+
currency: Optional[str] = None
97+
"""The deduction currency."""
98+
99+
name: Optional[str] = None
100+
"""The deduction name from the pay statement."""
101+
102+
pre_tax: Optional[bool] = None
103+
"""Boolean indicating if the deduction is pre-tax."""
104+
105+
type: Optional[BenefitType] = None
106+
"""Type of benefit."""
107+
108+
attributes: Optional[EmployeeDeductionAttributes] = None
109+
110+
111+
class EmployerContributionAttributesMetadata(BaseModel):
112+
metadata: Dict[str, Optional[object]]
113+
"""The metadata to be attached to the entity by existing rules.
114+
115+
It is a key-value pairs where the values can be of any type (string, number,
116+
boolean, object, array, etc.).
117+
"""
118+
119+
120+
class EmployerContributionAttributes(BaseModel):
121+
metadata: EmployerContributionAttributesMetadata
122+
123+
124+
class EmployerContribution(BaseModel):
125+
currency: Optional[str] = None
126+
"""The contribution currency."""
127+
128+
name: Optional[str] = None
129+
"""The contribution name from the pay statement."""
130+
131+
type: Optional[BenefitType] = None
132+
"""Type of benefit."""
133+
134+
amount: Optional[int] = None
135+
"""The contribution amount in cents."""
136+
137+
attributes: Optional[EmployerContributionAttributes] = None
138+
139+
140+
class TaxAttributesMetadata(BaseModel):
141+
metadata: Dict[str, Optional[object]]
142+
"""The metadata to be attached to the entity by existing rules.
143+
144+
It is a key-value pairs where the values can be of any type (string, number,
145+
boolean, object, array, etc.).
146+
"""
147+
148+
149+
class TaxAttributes(BaseModel):
150+
metadata: TaxAttributesMetadata
151+
152+
153+
class Tax(BaseModel):
154+
currency: Optional[str] = None
155+
"""The currency code."""
156+
157+
employer: Optional[bool] = None
158+
"""`true` if the amount is paid by the employers."""
159+
160+
name: Optional[str] = None
161+
"""The exact name of tax from the pay statement."""
162+
163+
type: Optional[Literal["state", "federal", "local", "fica"]] = None
164+
"""The type of taxes."""
165+
166+
amount: Optional[int] = None
167+
"""The tax amount in cents."""
168+
169+
attributes: Optional[TaxAttributes] = None
170+
171+
172+
class PayStatement(BaseModel):
173+
earnings: Optional[List[Optional[Earning]]] = None
174+
"""The array of earnings objects associated with this pay statement"""
175+
176+
employee_deductions: Optional[List[Optional[EmployeeDeduction]]] = None
177+
"""The array of deductions objects associated with this pay statement."""
178+
179+
employer_contributions: Optional[List[Optional[EmployerContribution]]] = None
180+
181+
gross_pay: Optional[Money] = None
182+
183+
individual_id: str
184+
"""A stable Finch `id` (UUID v4) for an individual in the company"""
185+
186+
net_pay: Optional[Money] = None
187+
188+
payment_method: Optional[Literal["check", "direct_deposit", "other"]] = None
189+
"""The payment method."""
190+
191+
taxes: Optional[List[Optional[Tax]]] = None
192+
"""The array of taxes objects associated with this pay statement."""
193+
194+
total_hours: Optional[float] = None
195+
"""The number of hours worked for this pay period"""
196+
197+
type: Optional[Literal["off_cycle_payroll", "one_time_payment", "regular_payroll"]] = None
198+
"""The type of the payment associated with the pay statement."""
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing_extensions import Literal
4+
5+
from ..._models import BaseModel
6+
7+
__all__ = ["PayStatementDataSyncInProgress"]
8+
9+
10+
class PayStatementDataSyncInProgress(BaseModel):
11+
code: Literal[202]
12+
13+
finch_code: Literal["data_sync_in_progress"]
14+
15+
message: Literal["The pay statements for this payment are being fetched. Please check back later."]
16+
17+
name: Literal["accepted"]

0 commit comments

Comments
 (0)