Skip to content

Commit 3967436

Browse files
feat(api): api update (#605)
1 parent b79940a commit 3967436

File tree

4 files changed

+65
-25
lines changed

4 files changed

+65
-25
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 41
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-57fcc886b05984f78d7e68e9b2494af925f1b104e3475ed5281fde6c728a8518.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-7a816d4a5f0039230590a6662f3513d5756344ca662761ecbc49016593f65836.yml

src/finch/types/hris/pay_statement.py

+24-4
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,20 @@
1111
"PayStatement",
1212
"Earning",
1313
"EarningAttributes",
14+
"EarningAttributesMetadata",
1415
"EmployeeDeduction",
1516
"EmployeeDeductionAttributes",
17+
"EmployeeDeductionAttributesMetadata",
1618
"EmployerContribution",
1719
"EmployerContributionAttributes",
20+
"EmployerContributionAttributesMetadata",
1821
"Tax",
1922
"TaxAttributes",
23+
"TaxAttributesMetadata",
2024
]
2125

2226

23-
class EarningAttributes(BaseModel):
27+
class EarningAttributesMetadata(BaseModel):
2428
metadata: Optional[Dict[str, object]] = None
2529
"""The metadata to be attached to the entity by existing rules.
2630
@@ -29,6 +33,10 @@ class EarningAttributes(BaseModel):
2933
"""
3034

3135

36+
class EarningAttributes(BaseModel):
37+
metadata: Optional[EarningAttributesMetadata] = None
38+
39+
3240
class Earning(BaseModel):
3341
amount: Optional[int] = None
3442
"""The earnings amount in cents."""
@@ -68,7 +76,7 @@ class Earning(BaseModel):
6876
"""The type of earning."""
6977

7078

71-
class EmployeeDeductionAttributes(BaseModel):
79+
class EmployeeDeductionAttributesMetadata(BaseModel):
7280
metadata: Optional[Dict[str, object]] = None
7381
"""The metadata to be attached to the entity by existing rules.
7482
@@ -77,6 +85,10 @@ class EmployeeDeductionAttributes(BaseModel):
7785
"""
7886

7987

88+
class EmployeeDeductionAttributes(BaseModel):
89+
metadata: Optional[EmployeeDeductionAttributesMetadata] = None
90+
91+
8092
class EmployeeDeduction(BaseModel):
8193
amount: Optional[int] = None
8294
"""The deduction amount in cents."""
@@ -96,7 +108,7 @@ class EmployeeDeduction(BaseModel):
96108
"""Type of benefit."""
97109

98110

99-
class EmployerContributionAttributes(BaseModel):
111+
class EmployerContributionAttributesMetadata(BaseModel):
100112
metadata: Optional[Dict[str, object]] = None
101113
"""The metadata to be attached to the entity by existing rules.
102114
@@ -105,6 +117,10 @@ class EmployerContributionAttributes(BaseModel):
105117
"""
106118

107119

120+
class EmployerContributionAttributes(BaseModel):
121+
metadata: Optional[EmployerContributionAttributesMetadata] = None
122+
123+
108124
class EmployerContribution(BaseModel):
109125
amount: Optional[int] = None
110126
"""The contribution amount in cents."""
@@ -121,7 +137,7 @@ class EmployerContribution(BaseModel):
121137
"""Type of benefit."""
122138

123139

124-
class TaxAttributes(BaseModel):
140+
class TaxAttributesMetadata(BaseModel):
125141
metadata: Optional[Dict[str, object]] = None
126142
"""The metadata to be attached to the entity by existing rules.
127143
@@ -130,6 +146,10 @@ class TaxAttributes(BaseModel):
130146
"""
131147

132148

149+
class TaxAttributes(BaseModel):
150+
metadata: Optional[TaxAttributesMetadata] = None
151+
152+
133153
class Tax(BaseModel):
134154
amount: Optional[int] = None
135155
"""The tax amount in cents."""

src/finch/types/sandbox/payment_create_params.py

+24-4
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@
1313
"PayStatement",
1414
"PayStatementEarning",
1515
"PayStatementEarningAttributes",
16+
"PayStatementEarningAttributesMetadata",
1617
"PayStatementEmployeeDeduction",
1718
"PayStatementEmployeeDeductionAttributes",
19+
"PayStatementEmployeeDeductionAttributesMetadata",
1820
"PayStatementEmployerContribution",
1921
"PayStatementEmployerContributionAttributes",
22+
"PayStatementEmployerContributionAttributesMetadata",
2023
"PayStatementTax",
2124
"PayStatementTaxAttributes",
25+
"PayStatementTaxAttributesMetadata",
2226
]
2327

2428

@@ -30,7 +34,7 @@ class PaymentCreateParams(TypedDict, total=False):
3034
start_date: str
3135

3236

33-
class PayStatementEarningAttributes(TypedDict, total=False):
37+
class PayStatementEarningAttributesMetadata(TypedDict, total=False):
3438
metadata: Dict[str, object]
3539
"""The metadata to be attached to the entity by existing rules.
3640
@@ -39,6 +43,10 @@ class PayStatementEarningAttributes(TypedDict, total=False):
3943
"""
4044

4145

46+
class PayStatementEarningAttributes(TypedDict, total=False):
47+
metadata: PayStatementEarningAttributesMetadata
48+
49+
4250
class PayStatementEarning(TypedDict, total=False):
4351
amount: Optional[int]
4452
"""The earnings amount in cents."""
@@ -78,7 +86,7 @@ class PayStatementEarning(TypedDict, total=False):
7886
"""The type of earning."""
7987

8088

81-
class PayStatementEmployeeDeductionAttributes(TypedDict, total=False):
89+
class PayStatementEmployeeDeductionAttributesMetadata(TypedDict, total=False):
8290
metadata: Dict[str, object]
8391
"""The metadata to be attached to the entity by existing rules.
8492
@@ -87,6 +95,10 @@ class PayStatementEmployeeDeductionAttributes(TypedDict, total=False):
8795
"""
8896

8997

98+
class PayStatementEmployeeDeductionAttributes(TypedDict, total=False):
99+
metadata: PayStatementEmployeeDeductionAttributesMetadata
100+
101+
90102
class PayStatementEmployeeDeduction(TypedDict, total=False):
91103
amount: Optional[int]
92104
"""The deduction amount in cents."""
@@ -106,7 +118,7 @@ class PayStatementEmployeeDeduction(TypedDict, total=False):
106118
"""Type of benefit."""
107119

108120

109-
class PayStatementEmployerContributionAttributes(TypedDict, total=False):
121+
class PayStatementEmployerContributionAttributesMetadata(TypedDict, total=False):
110122
metadata: Dict[str, object]
111123
"""The metadata to be attached to the entity by existing rules.
112124
@@ -115,6 +127,10 @@ class PayStatementEmployerContributionAttributes(TypedDict, total=False):
115127
"""
116128

117129

130+
class PayStatementEmployerContributionAttributes(TypedDict, total=False):
131+
metadata: PayStatementEmployerContributionAttributesMetadata
132+
133+
118134
class PayStatementEmployerContribution(TypedDict, total=False):
119135
amount: Optional[int]
120136
"""The contribution amount in cents."""
@@ -131,7 +147,7 @@ class PayStatementEmployerContribution(TypedDict, total=False):
131147
"""Type of benefit."""
132148

133149

134-
class PayStatementTaxAttributes(TypedDict, total=False):
150+
class PayStatementTaxAttributesMetadata(TypedDict, total=False):
135151
metadata: Dict[str, object]
136152
"""The metadata to be attached to the entity by existing rules.
137153
@@ -140,6 +156,10 @@ class PayStatementTaxAttributes(TypedDict, total=False):
140156
"""
141157

142158

159+
class PayStatementTaxAttributes(TypedDict, total=False):
160+
metadata: PayStatementTaxAttributesMetadata
161+
162+
143163
class PayStatementTax(TypedDict, total=False):
144164
amount: Optional[int]
145165
"""The tax amount in cents."""

tests/api_resources/sandbox/test_payment.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def test_method_create_with_all_params(self, client: Finch) -> None:
3131
"earnings": [
3232
{
3333
"amount": 0,
34-
"attributes": {"metadata": {"foo": "bar"}},
34+
"attributes": {"metadata": {"metadata": {"foo": "bar"}}},
3535
"currency": "currency",
3636
"hours": 0,
3737
"name": "name",
@@ -40,18 +40,18 @@ def test_method_create_with_all_params(self, client: Finch) -> None:
4040
],
4141
"employee_deductions": [
4242
{
43-
"amount": 0,
44-
"attributes": {"metadata": {"foo": "bar"}},
45-
"currency": "currency",
46-
"name": "name",
43+
"amount": 2000,
44+
"attributes": {"metadata": {"metadata": {"foo": "bar"}}},
45+
"currency": "usd",
46+
"name": "401k test",
4747
"pre_tax": True,
4848
"type": "401k",
4949
}
5050
],
5151
"employer_contributions": [
5252
{
5353
"amount": 0,
54-
"attributes": {"metadata": {"foo": "bar"}},
54+
"attributes": {"metadata": {"metadata": {"foo": "bar"}}},
5555
"currency": "currency",
5656
"name": "name",
5757
"type": "401k",
@@ -61,7 +61,7 @@ def test_method_create_with_all_params(self, client: Finch) -> None:
6161
"amount": 0,
6262
"currency": "currency",
6363
},
64-
"individual_id": "individual_id",
64+
"individual_id": "b2338cfb-472f-4f72-9faa-e028c083144a",
6565
"net_pay": {
6666
"amount": 0,
6767
"currency": "currency",
@@ -70,7 +70,7 @@ def test_method_create_with_all_params(self, client: Finch) -> None:
7070
"taxes": [
7171
{
7272
"amount": 0,
73-
"attributes": {"metadata": {"foo": "bar"}},
73+
"attributes": {"metadata": {"metadata": {"foo": "bar"}}},
7474
"currency": "currency",
7575
"employer": True,
7676
"name": "name",
@@ -123,7 +123,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncFinch) ->
123123
"earnings": [
124124
{
125125
"amount": 0,
126-
"attributes": {"metadata": {"foo": "bar"}},
126+
"attributes": {"metadata": {"metadata": {"foo": "bar"}}},
127127
"currency": "currency",
128128
"hours": 0,
129129
"name": "name",
@@ -132,18 +132,18 @@ async def test_method_create_with_all_params(self, async_client: AsyncFinch) ->
132132
],
133133
"employee_deductions": [
134134
{
135-
"amount": 0,
136-
"attributes": {"metadata": {"foo": "bar"}},
137-
"currency": "currency",
138-
"name": "name",
135+
"amount": 2000,
136+
"attributes": {"metadata": {"metadata": {"foo": "bar"}}},
137+
"currency": "usd",
138+
"name": "401k test",
139139
"pre_tax": True,
140140
"type": "401k",
141141
}
142142
],
143143
"employer_contributions": [
144144
{
145145
"amount": 0,
146-
"attributes": {"metadata": {"foo": "bar"}},
146+
"attributes": {"metadata": {"metadata": {"foo": "bar"}}},
147147
"currency": "currency",
148148
"name": "name",
149149
"type": "401k",
@@ -153,7 +153,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncFinch) ->
153153
"amount": 0,
154154
"currency": "currency",
155155
},
156-
"individual_id": "individual_id",
156+
"individual_id": "b2338cfb-472f-4f72-9faa-e028c083144a",
157157
"net_pay": {
158158
"amount": 0,
159159
"currency": "currency",
@@ -162,7 +162,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncFinch) ->
162162
"taxes": [
163163
{
164164
"amount": 0,
165-
"attributes": {"metadata": {"foo": "bar"}},
165+
"attributes": {"metadata": {"metadata": {"foo": "bar"}}},
166166
"currency": "currency",
167167
"employer": True,
168168
"name": "name",

0 commit comments

Comments
 (0)