2
2
3
3
from __future__ import annotations
4
4
5
- from typing_extensions import Literal
5
+ from typing_extensions import Literal , overload
6
6
7
7
import httpx
8
8
9
9
from ... import _legacy_response
10
10
from ..._types import NOT_GIVEN , Body , Query , Headers , NotGiven
11
11
from ..._utils import (
12
+ required_args ,
12
13
maybe_transform ,
13
14
async_maybe_transform ,
14
15
)
@@ -44,6 +45,7 @@ def with_streaming_response(self) -> AutomatedWithStreamingResponse:
44
45
"""
45
46
return AutomatedWithStreamingResponse (self )
46
47
48
+ @overload
47
49
def create (
48
50
self ,
49
51
* ,
@@ -55,21 +57,68 @@ def create(
55
57
extra_body : Body | None = None ,
56
58
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
57
59
) -> AutomatedCreateResponse :
58
- """Enqueue an automated job.
60
+ """
61
+ Enqueue an automated job.
62
+
63
+ `data_sync_all`: Enqueue a job to re-sync all data for a connection.
64
+ `data_sync_all` has a concurrency limit of 1 job at a time per connection. This
65
+ means that if this endpoint is called while a job is already in progress for
66
+ this connection, Finch will return the `job_id` of the job that is currently in
67
+ progress. Finch allows a fixed window rate limit of 1 forced refresh per hour
68
+ per connection.
69
+
70
+ `w4_data_sync`: Enqueues a job for sync W-4 data for a particular individual,
71
+ identified by `individual_id`. This feature is currently in beta.
72
+
73
+ This endpoint is available for _Scale_ tier customers as an add-on. To request
74
+ access to this endpoint, please contact your Finch account manager.
75
+
76
+ Args:
77
+ type: The type of job to start.
78
+
79
+ extra_headers: Send extra headers
80
+
81
+ extra_query: Add additional query parameters to the request
82
+
83
+ extra_body: Add additional JSON properties to the request
84
+
85
+ timeout: Override the client-level default timeout for this request, in seconds
86
+ """
87
+ ...
88
+
89
+ @overload
90
+ def create (
91
+ self ,
92
+ * ,
93
+ individual_id : str ,
94
+ type : Literal ["w4_data_sync" ],
95
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
96
+ # The extra values given here take precedence over values defined on the client or passed to this method.
97
+ extra_headers : Headers | None = None ,
98
+ extra_query : Query | None = None ,
99
+ extra_body : Body | None = None ,
100
+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
101
+ ) -> AutomatedCreateResponse :
102
+ """
103
+ Enqueue an automated job.
59
104
60
- Currently, only the `data_sync_all` job type is
61
- supported, which will enqueue a job to re-sync all data for a connection.
105
+ `data_sync_all`: Enqueue a job to re-sync all data for a connection.
62
106
`data_sync_all` has a concurrency limit of 1 job at a time per connection. This
63
107
means that if this endpoint is called while a job is already in progress for
64
108
this connection, Finch will return the `job_id` of the job that is currently in
65
109
progress. Finch allows a fixed window rate limit of 1 forced refresh per hour
66
110
per connection.
67
111
112
+ `w4_data_sync`: Enqueues a job for sync W-4 data for a particular individual,
113
+ identified by `individual_id`. This feature is currently in beta.
114
+
68
115
This endpoint is available for _Scale_ tier customers as an add-on. To request
69
116
access to this endpoint, please contact your Finch account manager.
70
117
71
118
Args:
72
- type: The type of job to start. Currently the only supported type is `data_sync_all`
119
+ individual_id: The unique ID of the individual for W-4 data sync.
120
+
121
+ type: The type of job to start.
73
122
74
123
extra_headers: Send extra headers
75
124
@@ -79,9 +128,30 @@ def create(
79
128
80
129
timeout: Override the client-level default timeout for this request, in seconds
81
130
"""
131
+ ...
132
+
133
+ @required_args (["type" ], ["individual_id" , "type" ])
134
+ def create (
135
+ self ,
136
+ * ,
137
+ type : Literal ["data_sync_all" ] | Literal ["w4_data_sync" ],
138
+ individual_id : str | NotGiven = NOT_GIVEN ,
139
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
140
+ # The extra values given here take precedence over values defined on the client or passed to this method.
141
+ extra_headers : Headers | None = None ,
142
+ extra_query : Query | None = None ,
143
+ extra_body : Body | None = None ,
144
+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
145
+ ) -> AutomatedCreateResponse :
82
146
return self ._post (
83
147
"/jobs/automated" ,
84
- body = maybe_transform ({"type" : type }, automated_create_params .AutomatedCreateParams ),
148
+ body = maybe_transform (
149
+ {
150
+ "type" : type ,
151
+ "individual_id" : individual_id ,
152
+ },
153
+ automated_create_params .AutomatedCreateParams ,
154
+ ),
85
155
options = make_request_options (
86
156
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
87
157
),
@@ -192,6 +262,7 @@ def with_streaming_response(self) -> AsyncAutomatedWithStreamingResponse:
192
262
"""
193
263
return AsyncAutomatedWithStreamingResponse (self )
194
264
265
+ @overload
195
266
async def create (
196
267
self ,
197
268
* ,
@@ -203,21 +274,68 @@ async def create(
203
274
extra_body : Body | None = None ,
204
275
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
205
276
) -> AutomatedCreateResponse :
206
- """Enqueue an automated job.
277
+ """
278
+ Enqueue an automated job.
279
+
280
+ `data_sync_all`: Enqueue a job to re-sync all data for a connection.
281
+ `data_sync_all` has a concurrency limit of 1 job at a time per connection. This
282
+ means that if this endpoint is called while a job is already in progress for
283
+ this connection, Finch will return the `job_id` of the job that is currently in
284
+ progress. Finch allows a fixed window rate limit of 1 forced refresh per hour
285
+ per connection.
286
+
287
+ `w4_data_sync`: Enqueues a job for sync W-4 data for a particular individual,
288
+ identified by `individual_id`. This feature is currently in beta.
289
+
290
+ This endpoint is available for _Scale_ tier customers as an add-on. To request
291
+ access to this endpoint, please contact your Finch account manager.
292
+
293
+ Args:
294
+ type: The type of job to start.
295
+
296
+ extra_headers: Send extra headers
297
+
298
+ extra_query: Add additional query parameters to the request
299
+
300
+ extra_body: Add additional JSON properties to the request
301
+
302
+ timeout: Override the client-level default timeout for this request, in seconds
303
+ """
304
+ ...
305
+
306
+ @overload
307
+ async def create (
308
+ self ,
309
+ * ,
310
+ individual_id : str ,
311
+ type : Literal ["w4_data_sync" ],
312
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
313
+ # The extra values given here take precedence over values defined on the client or passed to this method.
314
+ extra_headers : Headers | None = None ,
315
+ extra_query : Query | None = None ,
316
+ extra_body : Body | None = None ,
317
+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
318
+ ) -> AutomatedCreateResponse :
319
+ """
320
+ Enqueue an automated job.
207
321
208
- Currently, only the `data_sync_all` job type is
209
- supported, which will enqueue a job to re-sync all data for a connection.
322
+ `data_sync_all`: Enqueue a job to re-sync all data for a connection.
210
323
`data_sync_all` has a concurrency limit of 1 job at a time per connection. This
211
324
means that if this endpoint is called while a job is already in progress for
212
325
this connection, Finch will return the `job_id` of the job that is currently in
213
326
progress. Finch allows a fixed window rate limit of 1 forced refresh per hour
214
327
per connection.
215
328
329
+ `w4_data_sync`: Enqueues a job for sync W-4 data for a particular individual,
330
+ identified by `individual_id`. This feature is currently in beta.
331
+
216
332
This endpoint is available for _Scale_ tier customers as an add-on. To request
217
333
access to this endpoint, please contact your Finch account manager.
218
334
219
335
Args:
220
- type: The type of job to start. Currently the only supported type is `data_sync_all`
336
+ individual_id: The unique ID of the individual for W-4 data sync.
337
+
338
+ type: The type of job to start.
221
339
222
340
extra_headers: Send extra headers
223
341
@@ -227,9 +345,30 @@ async def create(
227
345
228
346
timeout: Override the client-level default timeout for this request, in seconds
229
347
"""
348
+ ...
349
+
350
+ @required_args (["type" ], ["individual_id" , "type" ])
351
+ async def create (
352
+ self ,
353
+ * ,
354
+ type : Literal ["data_sync_all" ] | Literal ["w4_data_sync" ],
355
+ individual_id : str | NotGiven = NOT_GIVEN ,
356
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
357
+ # The extra values given here take precedence over values defined on the client or passed to this method.
358
+ extra_headers : Headers | None = None ,
359
+ extra_query : Query | None = None ,
360
+ extra_body : Body | None = None ,
361
+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
362
+ ) -> AutomatedCreateResponse :
230
363
return await self ._post (
231
364
"/jobs/automated" ,
232
- body = await async_maybe_transform ({"type" : type }, automated_create_params .AutomatedCreateParams ),
365
+ body = await async_maybe_transform (
366
+ {
367
+ "type" : type ,
368
+ "individual_id" : individual_id ,
369
+ },
370
+ automated_create_params .AutomatedCreateParams ,
371
+ ),
233
372
options = make_request_options (
234
373
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
235
374
),
0 commit comments