Skip to content

Commit eda2dc1

Browse files
feat(api): updates (#398)
1 parent d88544a commit eda2dc1

13 files changed

+641
-2
lines changed

.stats.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 35
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch-69265939ed1aa33d9890c86a334730210985961db56757efc28ff43696fbd1a7.yml
1+
configured_endpoints: 37
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch-f1001da4ad3c1503330eebc1e61319a1a5db5e2da9fec98bc8682cb0967894d2.yml

api.md

+15
Original file line numberDiff line numberDiff line change
@@ -339,3 +339,18 @@ Methods:
339339

340340
- <code title="get /sandbox/jobs/configuration">client.sandbox.jobs.configuration.<a href="./src/finch/resources/sandbox/jobs/configuration.py">retrieve</a>() -> <a href="./src/finch/types/sandbox/jobs/configuration_retrieve_response.py">ConfigurationRetrieveResponse</a></code>
341341
- <code title="put /sandbox/jobs/configuration">client.sandbox.jobs.configuration.<a href="./src/finch/resources/sandbox/jobs/configuration.py">update</a>(\*\*<a href="src/finch/types/sandbox/jobs/configuration_update_params.py">params</a>) -> <a href="./src/finch/types/sandbox/jobs/sandbox_job_configuration.py">SandboxJobConfiguration</a></code>
342+
343+
# Payroll
344+
345+
## PayGroups
346+
347+
Types:
348+
349+
```python
350+
from finch.types.payroll import PayGroupRetrieveResponse, PayGroupListResponse
351+
```
352+
353+
Methods:
354+
355+
- <code title="get /employer/pay-group/{pay_group_id}">client.payroll.pay_groups.<a href="./src/finch/resources/payroll/pay_groups.py">retrieve</a>(pay_group_id) -> <a href="./src/finch/types/payroll/pay_group_retrieve_response.py">PayGroupRetrieveResponse</a></code>
356+
- <code title="get /employer/pay-groups">client.payroll.pay_groups.<a href="./src/finch/resources/payroll/pay_groups.py">list</a>(\*\*<a href="src/finch/types/payroll/pay_group_list_params.py">params</a>) -> <a href="./src/finch/types/payroll/pay_group_list_response.py">SyncSinglePage[PayGroupListResponse]</a></code>

src/finch/_client.py

+8
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class Finch(SyncAPIClient):
5959
request_forwarding: resources.RequestForwarding
6060
jobs: resources.Jobs
6161
sandbox: resources.Sandbox
62+
payroll: resources.Payroll
6263
with_raw_response: FinchWithRawResponse
6364
with_streaming_response: FinchWithStreamedResponse
6465

@@ -161,6 +162,7 @@ def __init__(
161162
self.request_forwarding = resources.RequestForwarding(self)
162163
self.jobs = resources.Jobs(self)
163164
self.sandbox = resources.Sandbox(self)
165+
self.payroll = resources.Payroll(self)
164166
self.with_raw_response = FinchWithRawResponse(self)
165167
self.with_streaming_response = FinchWithStreamedResponse(self)
166168

@@ -343,6 +345,7 @@ class AsyncFinch(AsyncAPIClient):
343345
request_forwarding: resources.AsyncRequestForwarding
344346
jobs: resources.AsyncJobs
345347
sandbox: resources.AsyncSandbox
348+
payroll: resources.AsyncPayroll
346349
with_raw_response: AsyncFinchWithRawResponse
347350
with_streaming_response: AsyncFinchWithStreamedResponse
348351

@@ -445,6 +448,7 @@ def __init__(
445448
self.request_forwarding = resources.AsyncRequestForwarding(self)
446449
self.jobs = resources.AsyncJobs(self)
447450
self.sandbox = resources.AsyncSandbox(self)
451+
self.payroll = resources.AsyncPayroll(self)
448452
self.with_raw_response = AsyncFinchWithRawResponse(self)
449453
self.with_streaming_response = AsyncFinchWithStreamedResponse(self)
450454

@@ -628,6 +632,7 @@ def __init__(self, client: Finch) -> None:
628632
self.request_forwarding = resources.RequestForwardingWithRawResponse(client.request_forwarding)
629633
self.jobs = resources.JobsWithRawResponse(client.jobs)
630634
self.sandbox = resources.SandboxWithRawResponse(client.sandbox)
635+
self.payroll = resources.PayrollWithRawResponse(client.payroll)
631636

632637

633638
class AsyncFinchWithRawResponse:
@@ -639,6 +644,7 @@ def __init__(self, client: AsyncFinch) -> None:
639644
self.request_forwarding = resources.AsyncRequestForwardingWithRawResponse(client.request_forwarding)
640645
self.jobs = resources.AsyncJobsWithRawResponse(client.jobs)
641646
self.sandbox = resources.AsyncSandboxWithRawResponse(client.sandbox)
647+
self.payroll = resources.AsyncPayrollWithRawResponse(client.payroll)
642648

643649

644650
class FinchWithStreamedResponse:
@@ -650,6 +656,7 @@ def __init__(self, client: Finch) -> None:
650656
self.request_forwarding = resources.RequestForwardingWithStreamingResponse(client.request_forwarding)
651657
self.jobs = resources.JobsWithStreamingResponse(client.jobs)
652658
self.sandbox = resources.SandboxWithStreamingResponse(client.sandbox)
659+
self.payroll = resources.PayrollWithStreamingResponse(client.payroll)
653660

654661

655662
class AsyncFinchWithStreamedResponse:
@@ -661,6 +668,7 @@ def __init__(self, client: AsyncFinch) -> None:
661668
self.request_forwarding = resources.AsyncRequestForwardingWithStreamingResponse(client.request_forwarding)
662669
self.jobs = resources.AsyncJobsWithStreamingResponse(client.jobs)
663670
self.sandbox = resources.AsyncSandboxWithStreamingResponse(client.sandbox)
671+
self.payroll = resources.AsyncPayrollWithStreamingResponse(client.payroll)
664672

665673

666674
Client = Finch

src/finch/resources/__init__.py

+14
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@
2424
AccountWithStreamingResponse,
2525
AsyncAccountWithStreamingResponse,
2626
)
27+
from .payroll import (
28+
Payroll,
29+
AsyncPayroll,
30+
PayrollWithRawResponse,
31+
AsyncPayrollWithRawResponse,
32+
PayrollWithStreamingResponse,
33+
AsyncPayrollWithStreamingResponse,
34+
)
2735
from .sandbox import (
2836
Sandbox,
2937
AsyncSandbox,
@@ -100,4 +108,10 @@
100108
"AsyncSandboxWithRawResponse",
101109
"SandboxWithStreamingResponse",
102110
"AsyncSandboxWithStreamingResponse",
111+
"Payroll",
112+
"AsyncPayroll",
113+
"PayrollWithRawResponse",
114+
"AsyncPayrollWithRawResponse",
115+
"PayrollWithStreamingResponse",
116+
"AsyncPayrollWithStreamingResponse",
103117
]
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .payroll import (
4+
Payroll,
5+
AsyncPayroll,
6+
PayrollWithRawResponse,
7+
AsyncPayrollWithRawResponse,
8+
PayrollWithStreamingResponse,
9+
AsyncPayrollWithStreamingResponse,
10+
)
11+
from .pay_groups import (
12+
PayGroups,
13+
AsyncPayGroups,
14+
PayGroupsWithRawResponse,
15+
AsyncPayGroupsWithRawResponse,
16+
PayGroupsWithStreamingResponse,
17+
AsyncPayGroupsWithStreamingResponse,
18+
)
19+
20+
__all__ = [
21+
"PayGroups",
22+
"AsyncPayGroups",
23+
"PayGroupsWithRawResponse",
24+
"AsyncPayGroupsWithRawResponse",
25+
"PayGroupsWithStreamingResponse",
26+
"AsyncPayGroupsWithStreamingResponse",
27+
"Payroll",
28+
"AsyncPayroll",
29+
"PayrollWithRawResponse",
30+
"AsyncPayrollWithRawResponse",
31+
"PayrollWithStreamingResponse",
32+
"AsyncPayrollWithStreamingResponse",
33+
]
+244
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import List
6+
7+
import httpx
8+
9+
from ... import _legacy_response
10+
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
11+
from ..._utils import maybe_transform
12+
from ..._compat import cached_property
13+
from ..._resource import SyncAPIResource, AsyncAPIResource
14+
from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
15+
from ...pagination import SyncSinglePage, AsyncSinglePage
16+
from ..._base_client import (
17+
AsyncPaginator,
18+
make_request_options,
19+
)
20+
from ...types.payroll import pay_group_list_params
21+
from ...types.payroll.pay_group_list_response import PayGroupListResponse
22+
from ...types.payroll.pay_group_retrieve_response import PayGroupRetrieveResponse
23+
24+
__all__ = ["PayGroups", "AsyncPayGroups"]
25+
26+
27+
class PayGroups(SyncAPIResource):
28+
@cached_property
29+
def with_raw_response(self) -> PayGroupsWithRawResponse:
30+
return PayGroupsWithRawResponse(self)
31+
32+
@cached_property
33+
def with_streaming_response(self) -> PayGroupsWithStreamingResponse:
34+
return PayGroupsWithStreamingResponse(self)
35+
36+
def retrieve(
37+
self,
38+
pay_group_id: str,
39+
*,
40+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
41+
# The extra values given here take precedence over values defined on the client or passed to this method.
42+
extra_headers: Headers | None = None,
43+
extra_query: Query | None = None,
44+
extra_body: Body | None = None,
45+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
46+
) -> PayGroupRetrieveResponse:
47+
"""
48+
Read information from a single pay group
49+
50+
Args:
51+
extra_headers: Send extra headers
52+
53+
extra_query: Add additional query parameters to the request
54+
55+
extra_body: Add additional JSON properties to the request
56+
57+
timeout: Override the client-level default timeout for this request, in seconds
58+
"""
59+
if not pay_group_id:
60+
raise ValueError(f"Expected a non-empty value for `pay_group_id` but received {pay_group_id!r}")
61+
return self._get(
62+
f"/employer/pay-group/{pay_group_id}",
63+
options=make_request_options(
64+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
65+
),
66+
cast_to=PayGroupRetrieveResponse,
67+
)
68+
69+
def list(
70+
self,
71+
*,
72+
individual_id: str | NotGiven = NOT_GIVEN,
73+
pay_frequencies: List[str] | NotGiven = NOT_GIVEN,
74+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
75+
# The extra values given here take precedence over values defined on the client or passed to this method.
76+
extra_headers: Headers | None = None,
77+
extra_query: Query | None = None,
78+
extra_body: Body | None = None,
79+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
80+
) -> SyncSinglePage[PayGroupListResponse]:
81+
"""
82+
Read company pay groups and frequencies
83+
84+
Args:
85+
extra_headers: Send extra headers
86+
87+
extra_query: Add additional query parameters to the request
88+
89+
extra_body: Add additional JSON properties to the request
90+
91+
timeout: Override the client-level default timeout for this request, in seconds
92+
"""
93+
return self._get_api_list(
94+
"/employer/pay-groups",
95+
page=SyncSinglePage[PayGroupListResponse],
96+
options=make_request_options(
97+
extra_headers=extra_headers,
98+
extra_query=extra_query,
99+
extra_body=extra_body,
100+
timeout=timeout,
101+
query=maybe_transform(
102+
{
103+
"individual_id": individual_id,
104+
"pay_frequencies": pay_frequencies,
105+
},
106+
pay_group_list_params.PayGroupListParams,
107+
),
108+
),
109+
model=PayGroupListResponse,
110+
)
111+
112+
113+
class AsyncPayGroups(AsyncAPIResource):
114+
@cached_property
115+
def with_raw_response(self) -> AsyncPayGroupsWithRawResponse:
116+
return AsyncPayGroupsWithRawResponse(self)
117+
118+
@cached_property
119+
def with_streaming_response(self) -> AsyncPayGroupsWithStreamingResponse:
120+
return AsyncPayGroupsWithStreamingResponse(self)
121+
122+
async def retrieve(
123+
self,
124+
pay_group_id: str,
125+
*,
126+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
127+
# The extra values given here take precedence over values defined on the client or passed to this method.
128+
extra_headers: Headers | None = None,
129+
extra_query: Query | None = None,
130+
extra_body: Body | None = None,
131+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
132+
) -> PayGroupRetrieveResponse:
133+
"""
134+
Read information from a single pay group
135+
136+
Args:
137+
extra_headers: Send extra headers
138+
139+
extra_query: Add additional query parameters to the request
140+
141+
extra_body: Add additional JSON properties to the request
142+
143+
timeout: Override the client-level default timeout for this request, in seconds
144+
"""
145+
if not pay_group_id:
146+
raise ValueError(f"Expected a non-empty value for `pay_group_id` but received {pay_group_id!r}")
147+
return await self._get(
148+
f"/employer/pay-group/{pay_group_id}",
149+
options=make_request_options(
150+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
151+
),
152+
cast_to=PayGroupRetrieveResponse,
153+
)
154+
155+
def list(
156+
self,
157+
*,
158+
individual_id: str | NotGiven = NOT_GIVEN,
159+
pay_frequencies: List[str] | NotGiven = NOT_GIVEN,
160+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
161+
# The extra values given here take precedence over values defined on the client or passed to this method.
162+
extra_headers: Headers | None = None,
163+
extra_query: Query | None = None,
164+
extra_body: Body | None = None,
165+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
166+
) -> AsyncPaginator[PayGroupListResponse, AsyncSinglePage[PayGroupListResponse]]:
167+
"""
168+
Read company pay groups and frequencies
169+
170+
Args:
171+
extra_headers: Send extra headers
172+
173+
extra_query: Add additional query parameters to the request
174+
175+
extra_body: Add additional JSON properties to the request
176+
177+
timeout: Override the client-level default timeout for this request, in seconds
178+
"""
179+
return self._get_api_list(
180+
"/employer/pay-groups",
181+
page=AsyncSinglePage[PayGroupListResponse],
182+
options=make_request_options(
183+
extra_headers=extra_headers,
184+
extra_query=extra_query,
185+
extra_body=extra_body,
186+
timeout=timeout,
187+
query=maybe_transform(
188+
{
189+
"individual_id": individual_id,
190+
"pay_frequencies": pay_frequencies,
191+
},
192+
pay_group_list_params.PayGroupListParams,
193+
),
194+
),
195+
model=PayGroupListResponse,
196+
)
197+
198+
199+
class PayGroupsWithRawResponse:
200+
def __init__(self, pay_groups: PayGroups) -> None:
201+
self._pay_groups = pay_groups
202+
203+
self.retrieve = _legacy_response.to_raw_response_wrapper(
204+
pay_groups.retrieve,
205+
)
206+
self.list = _legacy_response.to_raw_response_wrapper(
207+
pay_groups.list,
208+
)
209+
210+
211+
class AsyncPayGroupsWithRawResponse:
212+
def __init__(self, pay_groups: AsyncPayGroups) -> None:
213+
self._pay_groups = pay_groups
214+
215+
self.retrieve = _legacy_response.async_to_raw_response_wrapper(
216+
pay_groups.retrieve,
217+
)
218+
self.list = _legacy_response.async_to_raw_response_wrapper(
219+
pay_groups.list,
220+
)
221+
222+
223+
class PayGroupsWithStreamingResponse:
224+
def __init__(self, pay_groups: PayGroups) -> None:
225+
self._pay_groups = pay_groups
226+
227+
self.retrieve = to_streamed_response_wrapper(
228+
pay_groups.retrieve,
229+
)
230+
self.list = to_streamed_response_wrapper(
231+
pay_groups.list,
232+
)
233+
234+
235+
class AsyncPayGroupsWithStreamingResponse:
236+
def __init__(self, pay_groups: AsyncPayGroups) -> None:
237+
self._pay_groups = pay_groups
238+
239+
self.retrieve = async_to_streamed_response_wrapper(
240+
pay_groups.retrieve,
241+
)
242+
self.list = async_to_streamed_response_wrapper(
243+
pay_groups.list,
244+
)

0 commit comments

Comments
 (0)