Skip to content

Commit 7b60c37

Browse files
feat(api): api update (#602)
1 parent c1c9f5a commit 7b60c37

File tree

4 files changed

+122
-12
lines changed

4 files changed

+122
-12
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-0bd8297838a887e60787ee1eaea3e348e48e8f418e1fb9fefda2e6d845d97432.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-5d2b3a9cdbcfb6f10b6e621ef7ababbd2701316e5ea1117ced072ab76bdbec34.yml

src/finch/types/hris/pay_statement.py

+56-2
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,40 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import List, Optional
3+
from typing import Dict, List, Optional
44
from typing_extensions import Literal
55

66
from ..money import Money
77
from ..._models import BaseModel
88
from .benefit_type import BenefitType
99

10-
__all__ = ["PayStatement", "Earning", "EmployeeDeduction", "EmployerContribution", "Tax"]
10+
__all__ = [
11+
"PayStatement",
12+
"Earning",
13+
"EarningAttributes",
14+
"EmployeeDeduction",
15+
"EmployeeDeductionAttributes",
16+
"EmployerContribution",
17+
"EmployerContributionAttributes",
18+
"Tax",
19+
"TaxAttributes",
20+
]
21+
22+
23+
class EarningAttributes(BaseModel):
24+
metadata: Optional[Dict[str, object]] = None
25+
"""The metadata to be attached to the entity by existing rules.
26+
27+
It is a key-value pairs where the values can be of any type (string, number,
28+
boolean, object, array, etc.).
29+
"""
1130

1231

1332
class Earning(BaseModel):
1433
amount: Optional[int] = None
1534
"""The earnings amount in cents."""
1635

36+
attributes: Optional[EarningAttributes] = None
37+
1738
currency: Optional[str] = None
1839
"""The earnings currency code."""
1940

@@ -47,10 +68,21 @@ class Earning(BaseModel):
4768
"""The type of earning."""
4869

4970

71+
class EmployeeDeductionAttributes(BaseModel):
72+
metadata: Optional[Dict[str, object]] = None
73+
"""The metadata to be attached to the entity by existing rules.
74+
75+
It is a key-value pairs where the values can be of any type (string, number,
76+
boolean, object, array, etc.).
77+
"""
78+
79+
5080
class EmployeeDeduction(BaseModel):
5181
amount: Optional[int] = None
5282
"""The deduction amount in cents."""
5383

84+
attributes: Optional[EmployeeDeductionAttributes] = None
85+
5486
currency: Optional[str] = None
5587
"""The deduction currency."""
5688

@@ -64,10 +96,21 @@ class EmployeeDeduction(BaseModel):
6496
"""Type of benefit."""
6597

6698

99+
class EmployerContributionAttributes(BaseModel):
100+
metadata: Optional[Dict[str, object]] = None
101+
"""The metadata to be attached to the entity by existing rules.
102+
103+
It is a key-value pairs where the values can be of any type (string, number,
104+
boolean, object, array, etc.).
105+
"""
106+
107+
67108
class EmployerContribution(BaseModel):
68109
amount: Optional[int] = None
69110
"""The contribution amount in cents."""
70111

112+
attributes: Optional[EmployerContributionAttributes] = None
113+
71114
currency: Optional[str] = None
72115
"""The contribution currency."""
73116

@@ -78,10 +121,21 @@ class EmployerContribution(BaseModel):
78121
"""Type of benefit."""
79122

80123

124+
class TaxAttributes(BaseModel):
125+
metadata: Optional[Dict[str, object]] = None
126+
"""The metadata to be attached to the entity by existing rules.
127+
128+
It is a key-value pairs where the values can be of any type (string, number,
129+
boolean, object, array, etc.).
130+
"""
131+
132+
81133
class Tax(BaseModel):
82134
amount: Optional[int] = None
83135
"""The tax amount in cents."""
84136

137+
attributes: Optional[TaxAttributes] = None
138+
85139
currency: Optional[str] = None
86140
"""The currency code."""
87141

src/finch/types/sandbox/payment_create_params.py

+49-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Iterable, Optional
5+
from typing import Dict, Iterable, Optional
66
from typing_extensions import Literal, TypedDict
77

88
from ..money_param import MoneyParam
@@ -12,9 +12,13 @@
1212
"PaymentCreateParams",
1313
"PayStatement",
1414
"PayStatementEarning",
15+
"PayStatementEarningAttributes",
1516
"PayStatementEmployeeDeduction",
17+
"PayStatementEmployeeDeductionAttributes",
1618
"PayStatementEmployerContribution",
19+
"PayStatementEmployerContributionAttributes",
1720
"PayStatementTax",
21+
"PayStatementTaxAttributes",
1822
]
1923

2024

@@ -26,10 +30,21 @@ class PaymentCreateParams(TypedDict, total=False):
2630
start_date: str
2731

2832

33+
class PayStatementEarningAttributes(TypedDict, total=False):
34+
metadata: Dict[str, object]
35+
"""The metadata to be attached to the entity by existing rules.
36+
37+
It is a key-value pairs where the values can be of any type (string, number,
38+
boolean, object, array, etc.).
39+
"""
40+
41+
2942
class PayStatementEarning(TypedDict, total=False):
3043
amount: Optional[int]
3144
"""The earnings amount in cents."""
3245

46+
attributes: Optional[PayStatementEarningAttributes]
47+
3348
currency: Optional[str]
3449
"""The earnings currency code."""
3550

@@ -63,10 +78,21 @@ class PayStatementEarning(TypedDict, total=False):
6378
"""The type of earning."""
6479

6580

81+
class PayStatementEmployeeDeductionAttributes(TypedDict, total=False):
82+
metadata: Dict[str, object]
83+
"""The metadata to be attached to the entity by existing rules.
84+
85+
It is a key-value pairs where the values can be of any type (string, number,
86+
boolean, object, array, etc.).
87+
"""
88+
89+
6690
class PayStatementEmployeeDeduction(TypedDict, total=False):
6791
amount: Optional[int]
6892
"""The deduction amount in cents."""
6993

94+
attributes: Optional[PayStatementEmployeeDeductionAttributes]
95+
7096
currency: Optional[str]
7197
"""The deduction currency."""
7298

@@ -80,10 +106,21 @@ class PayStatementEmployeeDeduction(TypedDict, total=False):
80106
"""Type of benefit."""
81107

82108

109+
class PayStatementEmployerContributionAttributes(TypedDict, total=False):
110+
metadata: Dict[str, object]
111+
"""The metadata to be attached to the entity by existing rules.
112+
113+
It is a key-value pairs where the values can be of any type (string, number,
114+
boolean, object, array, etc.).
115+
"""
116+
117+
83118
class PayStatementEmployerContribution(TypedDict, total=False):
84119
amount: Optional[int]
85120
"""The contribution amount in cents."""
86121

122+
attributes: Optional[PayStatementEmployerContributionAttributes]
123+
87124
currency: Optional[str]
88125
"""The contribution currency."""
89126

@@ -94,10 +131,21 @@ class PayStatementEmployerContribution(TypedDict, total=False):
94131
"""Type of benefit."""
95132

96133

134+
class PayStatementTaxAttributes(TypedDict, total=False):
135+
metadata: Dict[str, object]
136+
"""The metadata to be attached to the entity by existing rules.
137+
138+
It is a key-value pairs where the values can be of any type (string, number,
139+
boolean, object, array, etc.).
140+
"""
141+
142+
97143
class PayStatementTax(TypedDict, total=False):
98144
amount: Optional[int]
99145
"""The tax amount in cents."""
100146

147+
attributes: Optional[PayStatementTaxAttributes]
148+
101149
currency: Optional[str]
102150
"""The currency code."""
103151

tests/api_resources/sandbox/test_payment.py

+16-8
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def test_method_create_with_all_params(self, client: Finch) -> None:
3131
"earnings": [
3232
{
3333
"amount": 0,
34+
"attributes": {"metadata": {"foo": "bar"}},
3435
"currency": "currency",
3536
"hours": 0,
3637
"name": "name",
@@ -39,16 +40,18 @@ def test_method_create_with_all_params(self, client: Finch) -> None:
3940
],
4041
"employee_deductions": [
4142
{
42-
"amount": 2000,
43-
"currency": "usd",
44-
"name": "401k test",
43+
"amount": 0,
44+
"attributes": {"metadata": {"foo": "bar"}},
45+
"currency": "currency",
46+
"name": "name",
4547
"pre_tax": True,
4648
"type": "401k",
4749
}
4850
],
4951
"employer_contributions": [
5052
{
5153
"amount": 0,
54+
"attributes": {"metadata": {"foo": "bar"}},
5255
"currency": "currency",
5356
"name": "name",
5457
"type": "401k",
@@ -58,7 +61,7 @@ def test_method_create_with_all_params(self, client: Finch) -> None:
5861
"amount": 0,
5962
"currency": "currency",
6063
},
61-
"individual_id": "b2338cfb-472f-4f72-9faa-e028c083144a",
64+
"individual_id": "individual_id",
6265
"net_pay": {
6366
"amount": 0,
6467
"currency": "currency",
@@ -67,6 +70,7 @@ def test_method_create_with_all_params(self, client: Finch) -> None:
6770
"taxes": [
6871
{
6972
"amount": 0,
73+
"attributes": {"metadata": {"foo": "bar"}},
7074
"currency": "currency",
7175
"employer": True,
7276
"name": "name",
@@ -119,6 +123,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncFinch) ->
119123
"earnings": [
120124
{
121125
"amount": 0,
126+
"attributes": {"metadata": {"foo": "bar"}},
122127
"currency": "currency",
123128
"hours": 0,
124129
"name": "name",
@@ -127,16 +132,18 @@ async def test_method_create_with_all_params(self, async_client: AsyncFinch) ->
127132
],
128133
"employee_deductions": [
129134
{
130-
"amount": 2000,
131-
"currency": "usd",
132-
"name": "401k test",
135+
"amount": 0,
136+
"attributes": {"metadata": {"foo": "bar"}},
137+
"currency": "currency",
138+
"name": "name",
133139
"pre_tax": True,
134140
"type": "401k",
135141
}
136142
],
137143
"employer_contributions": [
138144
{
139145
"amount": 0,
146+
"attributes": {"metadata": {"foo": "bar"}},
140147
"currency": "currency",
141148
"name": "name",
142149
"type": "401k",
@@ -146,7 +153,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncFinch) ->
146153
"amount": 0,
147154
"currency": "currency",
148155
},
149-
"individual_id": "b2338cfb-472f-4f72-9faa-e028c083144a",
156+
"individual_id": "individual_id",
150157
"net_pay": {
151158
"amount": 0,
152159
"currency": "currency",
@@ -155,6 +162,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncFinch) ->
155162
"taxes": [
156163
{
157164
"amount": 0,
165+
"attributes": {"metadata": {"foo": "bar"}},
158166
"currency": "currency",
159167
"employer": True,
160168
"name": "name",

0 commit comments

Comments
 (0)