Skip to content

Commit 4346b67

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): updates (#398)
1 parent d284b7c commit 4346b67

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
@@ -351,3 +351,18 @@ Methods:
351351

352352
- <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>
353353
- <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>
354+
355+
# Payroll
356+
357+
## PayGroups
358+
359+
Types:
360+
361+
```python
362+
from finch.types.payroll import PayGroupRetrieveResponse, PayGroupListResponse
363+
```
364+
365+
Methods:
366+
367+
- <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>
368+
- <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
@@ -60,6 +60,7 @@ class Finch(SyncAPIClient):
6060
request_forwarding: resources.RequestForwarding
6161
jobs: resources.Jobs
6262
sandbox: resources.Sandbox
63+
payroll: resources.Payroll
6364
with_raw_response: FinchWithRawResponse
6465
with_streaming_response: FinchWithStreamedResponse
6566

@@ -163,6 +164,7 @@ def __init__(
163164
self.request_forwarding = resources.RequestForwarding(self)
164165
self.jobs = resources.Jobs(self)
165166
self.sandbox = resources.Sandbox(self)
167+
self.payroll = resources.Payroll(self)
166168
self.with_raw_response = FinchWithRawResponse(self)
167169
self.with_streaming_response = FinchWithStreamedResponse(self)
168170

@@ -410,6 +412,7 @@ class AsyncFinch(AsyncAPIClient):
410412
request_forwarding: resources.AsyncRequestForwarding
411413
jobs: resources.AsyncJobs
412414
sandbox: resources.AsyncSandbox
415+
payroll: resources.AsyncPayroll
413416
with_raw_response: AsyncFinchWithRawResponse
414417
with_streaming_response: AsyncFinchWithStreamedResponse
415418

@@ -513,6 +516,7 @@ def __init__(
513516
self.request_forwarding = resources.AsyncRequestForwarding(self)
514517
self.jobs = resources.AsyncJobs(self)
515518
self.sandbox = resources.AsyncSandbox(self)
519+
self.payroll = resources.AsyncPayroll(self)
516520
self.with_raw_response = AsyncFinchWithRawResponse(self)
517521
self.with_streaming_response = AsyncFinchWithStreamedResponse(self)
518522

@@ -760,6 +764,7 @@ def __init__(self, client: Finch) -> None:
760764
self.request_forwarding = resources.RequestForwardingWithRawResponse(client.request_forwarding)
761765
self.jobs = resources.JobsWithRawResponse(client.jobs)
762766
self.sandbox = resources.SandboxWithRawResponse(client.sandbox)
767+
self.payroll = resources.PayrollWithRawResponse(client.payroll)
763768

764769

765770
class AsyncFinchWithRawResponse:
@@ -771,6 +776,7 @@ def __init__(self, client: AsyncFinch) -> None:
771776
self.request_forwarding = resources.AsyncRequestForwardingWithRawResponse(client.request_forwarding)
772777
self.jobs = resources.AsyncJobsWithRawResponse(client.jobs)
773778
self.sandbox = resources.AsyncSandboxWithRawResponse(client.sandbox)
779+
self.payroll = resources.AsyncPayrollWithRawResponse(client.payroll)
774780

775781

776782
class FinchWithStreamedResponse:
@@ -782,6 +788,7 @@ def __init__(self, client: Finch) -> None:
782788
self.request_forwarding = resources.RequestForwardingWithStreamingResponse(client.request_forwarding)
783789
self.jobs = resources.JobsWithStreamingResponse(client.jobs)
784790
self.sandbox = resources.SandboxWithStreamingResponse(client.sandbox)
791+
self.payroll = resources.PayrollWithStreamingResponse(client.payroll)
785792

786793

787794
class AsyncFinchWithStreamedResponse:
@@ -793,6 +800,7 @@ def __init__(self, client: AsyncFinch) -> None:
793800
self.request_forwarding = resources.AsyncRequestForwardingWithStreamingResponse(client.request_forwarding)
794801
self.jobs = resources.AsyncJobsWithStreamingResponse(client.jobs)
795802
self.sandbox = resources.AsyncSandboxWithStreamingResponse(client.sandbox)
803+
self.payroll = resources.AsyncPayrollWithStreamingResponse(client.payroll)
796804

797805

798806
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,
@@ -103,4 +111,10 @@
103111
"AsyncSandboxWithRawResponse",
104112
"SandboxWithStreamingResponse",
105113
"AsyncSandboxWithStreamingResponse",
114+
"Payroll",
115+
"AsyncPayroll",
116+
"PayrollWithRawResponse",
117+
"AsyncPayrollWithRawResponse",
118+
"PayrollWithStreamingResponse",
119+
"AsyncPayrollWithStreamingResponse",
106120
]
+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)