worqhat 3.5.0__py3-none-any.whl → 3.9.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- worqhat/__init__.py +3 -1
- worqhat/_base_client.py +12 -12
- worqhat/_client.py +20 -11
- worqhat/_compat.py +48 -48
- worqhat/_models.py +51 -45
- worqhat/_qs.py +7 -7
- worqhat/_types.py +53 -12
- worqhat/_utils/__init__.py +9 -2
- worqhat/_utils/_compat.py +45 -0
- worqhat/_utils/_datetime_parse.py +136 -0
- worqhat/_utils/_transform.py +13 -3
- worqhat/_utils/_typing.py +6 -1
- worqhat/_utils/_utils.py +4 -5
- worqhat/_version.py +1 -1
- worqhat/resources/__init__.py +14 -0
- worqhat/resources/db/__init__.py +33 -0
- worqhat/resources/{db.py → db/db.py} +255 -48
- worqhat/resources/db/tables.py +389 -0
- worqhat/resources/flows.py +29 -23
- worqhat/resources/health.py +3 -3
- worqhat/resources/storage.py +462 -0
- worqhat/types/__init__.py +10 -0
- worqhat/types/db/__init__.py +10 -0
- worqhat/types/db/table_get_row_count_params.py +12 -0
- worqhat/types/db/table_get_row_count_response.py +15 -0
- worqhat/types/db/table_list_params.py +15 -0
- worqhat/types/db/table_list_response.py +26 -0
- worqhat/types/db/table_retrieve_schema_params.py +12 -0
- worqhat/types/db/table_retrieve_schema_response.py +29 -0
- worqhat/types/db_delete_records_params.py +6 -2
- worqhat/types/db_delete_records_response.py +2 -2
- worqhat/types/db_execute_batch_params.py +36 -0
- worqhat/types/db_execute_batch_response.py +27 -0
- worqhat/types/db_execute_query_params.py +14 -2
- worqhat/types/db_execute_query_response.py +2 -2
- worqhat/types/db_insert_record_params.py +6 -2
- worqhat/types/db_insert_record_response.py +2 -2
- worqhat/types/db_process_nl_query_params.py +7 -3
- worqhat/types/db_process_nl_query_response.py +2 -2
- worqhat/types/db_update_records_params.py +7 -3
- worqhat/types/db_update_records_response.py +2 -2
- worqhat/types/flow_trigger_with_payload_params.py +3 -2
- worqhat/types/storage_delete_file_by_id_response.py +18 -0
- worqhat/types/storage_retrieve_file_by_id_response.py +33 -0
- worqhat/types/storage_retrieve_file_by_path_params.py +12 -0
- worqhat/types/storage_retrieve_file_by_path_response.py +33 -0
- worqhat/types/storage_upload_file_params.py +17 -0
- worqhat/types/storage_upload_file_response.py +33 -0
- {worqhat-3.5.0.dist-info → worqhat-3.9.0.dist-info}/METADATA +2 -2
- worqhat-3.9.0.dist-info/RECORD +73 -0
- worqhat-3.5.0.dist-info/RECORD +0 -53
- {worqhat-3.5.0.dist-info → worqhat-3.9.0.dist-info}/WHEEL +0 -0
- {worqhat-3.5.0.dist-info → worqhat-3.9.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing_extensions import Literal
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
10
|
+
from ..._utils import maybe_transform, async_maybe_transform
|
|
11
|
+
from ..._compat import cached_property
|
|
12
|
+
from ...types.db import table_list_params, table_get_row_count_params, table_retrieve_schema_params
|
|
13
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
14
|
+
from ..._response import (
|
|
15
|
+
to_raw_response_wrapper,
|
|
16
|
+
to_streamed_response_wrapper,
|
|
17
|
+
async_to_raw_response_wrapper,
|
|
18
|
+
async_to_streamed_response_wrapper,
|
|
19
|
+
)
|
|
20
|
+
from ..._base_client import make_request_options
|
|
21
|
+
from ...types.db.table_list_response import TableListResponse
|
|
22
|
+
from ...types.db.table_get_row_count_response import TableGetRowCountResponse
|
|
23
|
+
from ...types.db.table_retrieve_schema_response import TableRetrieveSchemaResponse
|
|
24
|
+
|
|
25
|
+
__all__ = ["TablesResource", "AsyncTablesResource"]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class TablesResource(SyncAPIResource):
|
|
29
|
+
@cached_property
|
|
30
|
+
def with_raw_response(self) -> TablesResourceWithRawResponse:
|
|
31
|
+
"""
|
|
32
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
33
|
+
the raw response object instead of the parsed content.
|
|
34
|
+
|
|
35
|
+
For more information, see https://www.github.com/WorqHat/worqhat-python-sdk#accessing-raw-response-data-eg-headers
|
|
36
|
+
"""
|
|
37
|
+
return TablesResourceWithRawResponse(self)
|
|
38
|
+
|
|
39
|
+
@cached_property
|
|
40
|
+
def with_streaming_response(self) -> TablesResourceWithStreamingResponse:
|
|
41
|
+
"""
|
|
42
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
43
|
+
|
|
44
|
+
For more information, see https://www.github.com/WorqHat/worqhat-python-sdk#with_streaming_response
|
|
45
|
+
"""
|
|
46
|
+
return TablesResourceWithStreamingResponse(self)
|
|
47
|
+
|
|
48
|
+
def list(
|
|
49
|
+
self,
|
|
50
|
+
*,
|
|
51
|
+
environment: Literal["development", "staging", "production"] | Omit = omit,
|
|
52
|
+
schema: str | Omit = omit,
|
|
53
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
54
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
55
|
+
extra_headers: Headers | None = None,
|
|
56
|
+
extra_query: Query | None = None,
|
|
57
|
+
extra_body: Body | None = None,
|
|
58
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
59
|
+
) -> TableListResponse:
|
|
60
|
+
"""
|
|
61
|
+
Returns a list of all tables in the database that are accessible to your
|
|
62
|
+
organization. Optionally filter by schema and environment.
|
|
63
|
+
|
|
64
|
+
Args:
|
|
65
|
+
environment: Environment to query (development, staging, production)
|
|
66
|
+
|
|
67
|
+
schema: Database schema to filter tables
|
|
68
|
+
|
|
69
|
+
extra_headers: Send extra headers
|
|
70
|
+
|
|
71
|
+
extra_query: Add additional query parameters to the request
|
|
72
|
+
|
|
73
|
+
extra_body: Add additional JSON properties to the request
|
|
74
|
+
|
|
75
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
76
|
+
"""
|
|
77
|
+
return self._get(
|
|
78
|
+
"/db/tables",
|
|
79
|
+
options=make_request_options(
|
|
80
|
+
extra_headers=extra_headers,
|
|
81
|
+
extra_query=extra_query,
|
|
82
|
+
extra_body=extra_body,
|
|
83
|
+
timeout=timeout,
|
|
84
|
+
query=maybe_transform(
|
|
85
|
+
{
|
|
86
|
+
"environment": environment,
|
|
87
|
+
"schema": schema,
|
|
88
|
+
},
|
|
89
|
+
table_list_params.TableListParams,
|
|
90
|
+
),
|
|
91
|
+
),
|
|
92
|
+
cast_to=TableListResponse,
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
def get_row_count(
|
|
96
|
+
self,
|
|
97
|
+
table_name: str,
|
|
98
|
+
*,
|
|
99
|
+
environment: Literal["development", "staging", "production"] | Omit = omit,
|
|
100
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
101
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
102
|
+
extra_headers: Headers | None = None,
|
|
103
|
+
extra_query: Query | None = None,
|
|
104
|
+
extra_body: Body | None = None,
|
|
105
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
106
|
+
) -> TableGetRowCountResponse:
|
|
107
|
+
"""
|
|
108
|
+
Returns the total number of rows in the specified table for your organization.
|
|
109
|
+
|
|
110
|
+
Args:
|
|
111
|
+
environment: Environment to query
|
|
112
|
+
|
|
113
|
+
extra_headers: Send extra headers
|
|
114
|
+
|
|
115
|
+
extra_query: Add additional query parameters to the request
|
|
116
|
+
|
|
117
|
+
extra_body: Add additional JSON properties to the request
|
|
118
|
+
|
|
119
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
120
|
+
"""
|
|
121
|
+
if not table_name:
|
|
122
|
+
raise ValueError(f"Expected a non-empty value for `table_name` but received {table_name!r}")
|
|
123
|
+
return self._get(
|
|
124
|
+
f"/db/tables/{table_name}/count",
|
|
125
|
+
options=make_request_options(
|
|
126
|
+
extra_headers=extra_headers,
|
|
127
|
+
extra_query=extra_query,
|
|
128
|
+
extra_body=extra_body,
|
|
129
|
+
timeout=timeout,
|
|
130
|
+
query=maybe_transform({"environment": environment}, table_get_row_count_params.TableGetRowCountParams),
|
|
131
|
+
),
|
|
132
|
+
cast_to=TableGetRowCountResponse,
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
def retrieve_schema(
|
|
136
|
+
self,
|
|
137
|
+
table_name: str,
|
|
138
|
+
*,
|
|
139
|
+
environment: Literal["development", "staging", "production"] | Omit = omit,
|
|
140
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
141
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
142
|
+
extra_headers: Headers | None = None,
|
|
143
|
+
extra_query: Query | None = None,
|
|
144
|
+
extra_body: Body | None = None,
|
|
145
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
146
|
+
) -> TableRetrieveSchemaResponse:
|
|
147
|
+
"""
|
|
148
|
+
Returns detailed schema information for a specific table, including column
|
|
149
|
+
names, types, and constraints.
|
|
150
|
+
|
|
151
|
+
Args:
|
|
152
|
+
environment: Environment to query
|
|
153
|
+
|
|
154
|
+
extra_headers: Send extra headers
|
|
155
|
+
|
|
156
|
+
extra_query: Add additional query parameters to the request
|
|
157
|
+
|
|
158
|
+
extra_body: Add additional JSON properties to the request
|
|
159
|
+
|
|
160
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
161
|
+
"""
|
|
162
|
+
if not table_name:
|
|
163
|
+
raise ValueError(f"Expected a non-empty value for `table_name` but received {table_name!r}")
|
|
164
|
+
return self._get(
|
|
165
|
+
f"/db/tables/{table_name}/schema",
|
|
166
|
+
options=make_request_options(
|
|
167
|
+
extra_headers=extra_headers,
|
|
168
|
+
extra_query=extra_query,
|
|
169
|
+
extra_body=extra_body,
|
|
170
|
+
timeout=timeout,
|
|
171
|
+
query=maybe_transform(
|
|
172
|
+
{"environment": environment}, table_retrieve_schema_params.TableRetrieveSchemaParams
|
|
173
|
+
),
|
|
174
|
+
),
|
|
175
|
+
cast_to=TableRetrieveSchemaResponse,
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
class AsyncTablesResource(AsyncAPIResource):
|
|
180
|
+
@cached_property
|
|
181
|
+
def with_raw_response(self) -> AsyncTablesResourceWithRawResponse:
|
|
182
|
+
"""
|
|
183
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
184
|
+
the raw response object instead of the parsed content.
|
|
185
|
+
|
|
186
|
+
For more information, see https://www.github.com/WorqHat/worqhat-python-sdk#accessing-raw-response-data-eg-headers
|
|
187
|
+
"""
|
|
188
|
+
return AsyncTablesResourceWithRawResponse(self)
|
|
189
|
+
|
|
190
|
+
@cached_property
|
|
191
|
+
def with_streaming_response(self) -> AsyncTablesResourceWithStreamingResponse:
|
|
192
|
+
"""
|
|
193
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
194
|
+
|
|
195
|
+
For more information, see https://www.github.com/WorqHat/worqhat-python-sdk#with_streaming_response
|
|
196
|
+
"""
|
|
197
|
+
return AsyncTablesResourceWithStreamingResponse(self)
|
|
198
|
+
|
|
199
|
+
async def list(
|
|
200
|
+
self,
|
|
201
|
+
*,
|
|
202
|
+
environment: Literal["development", "staging", "production"] | Omit = omit,
|
|
203
|
+
schema: str | Omit = omit,
|
|
204
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
205
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
206
|
+
extra_headers: Headers | None = None,
|
|
207
|
+
extra_query: Query | None = None,
|
|
208
|
+
extra_body: Body | None = None,
|
|
209
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
210
|
+
) -> TableListResponse:
|
|
211
|
+
"""
|
|
212
|
+
Returns a list of all tables in the database that are accessible to your
|
|
213
|
+
organization. Optionally filter by schema and environment.
|
|
214
|
+
|
|
215
|
+
Args:
|
|
216
|
+
environment: Environment to query (development, staging, production)
|
|
217
|
+
|
|
218
|
+
schema: Database schema to filter tables
|
|
219
|
+
|
|
220
|
+
extra_headers: Send extra headers
|
|
221
|
+
|
|
222
|
+
extra_query: Add additional query parameters to the request
|
|
223
|
+
|
|
224
|
+
extra_body: Add additional JSON properties to the request
|
|
225
|
+
|
|
226
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
227
|
+
"""
|
|
228
|
+
return await self._get(
|
|
229
|
+
"/db/tables",
|
|
230
|
+
options=make_request_options(
|
|
231
|
+
extra_headers=extra_headers,
|
|
232
|
+
extra_query=extra_query,
|
|
233
|
+
extra_body=extra_body,
|
|
234
|
+
timeout=timeout,
|
|
235
|
+
query=await async_maybe_transform(
|
|
236
|
+
{
|
|
237
|
+
"environment": environment,
|
|
238
|
+
"schema": schema,
|
|
239
|
+
},
|
|
240
|
+
table_list_params.TableListParams,
|
|
241
|
+
),
|
|
242
|
+
),
|
|
243
|
+
cast_to=TableListResponse,
|
|
244
|
+
)
|
|
245
|
+
|
|
246
|
+
async def get_row_count(
|
|
247
|
+
self,
|
|
248
|
+
table_name: str,
|
|
249
|
+
*,
|
|
250
|
+
environment: Literal["development", "staging", "production"] | Omit = omit,
|
|
251
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
252
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
253
|
+
extra_headers: Headers | None = None,
|
|
254
|
+
extra_query: Query | None = None,
|
|
255
|
+
extra_body: Body | None = None,
|
|
256
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
257
|
+
) -> TableGetRowCountResponse:
|
|
258
|
+
"""
|
|
259
|
+
Returns the total number of rows in the specified table for your organization.
|
|
260
|
+
|
|
261
|
+
Args:
|
|
262
|
+
environment: Environment to query
|
|
263
|
+
|
|
264
|
+
extra_headers: Send extra headers
|
|
265
|
+
|
|
266
|
+
extra_query: Add additional query parameters to the request
|
|
267
|
+
|
|
268
|
+
extra_body: Add additional JSON properties to the request
|
|
269
|
+
|
|
270
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
271
|
+
"""
|
|
272
|
+
if not table_name:
|
|
273
|
+
raise ValueError(f"Expected a non-empty value for `table_name` but received {table_name!r}")
|
|
274
|
+
return await self._get(
|
|
275
|
+
f"/db/tables/{table_name}/count",
|
|
276
|
+
options=make_request_options(
|
|
277
|
+
extra_headers=extra_headers,
|
|
278
|
+
extra_query=extra_query,
|
|
279
|
+
extra_body=extra_body,
|
|
280
|
+
timeout=timeout,
|
|
281
|
+
query=await async_maybe_transform(
|
|
282
|
+
{"environment": environment}, table_get_row_count_params.TableGetRowCountParams
|
|
283
|
+
),
|
|
284
|
+
),
|
|
285
|
+
cast_to=TableGetRowCountResponse,
|
|
286
|
+
)
|
|
287
|
+
|
|
288
|
+
async def retrieve_schema(
|
|
289
|
+
self,
|
|
290
|
+
table_name: str,
|
|
291
|
+
*,
|
|
292
|
+
environment: Literal["development", "staging", "production"] | Omit = omit,
|
|
293
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
294
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
295
|
+
extra_headers: Headers | None = None,
|
|
296
|
+
extra_query: Query | None = None,
|
|
297
|
+
extra_body: Body | None = None,
|
|
298
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
299
|
+
) -> TableRetrieveSchemaResponse:
|
|
300
|
+
"""
|
|
301
|
+
Returns detailed schema information for a specific table, including column
|
|
302
|
+
names, types, and constraints.
|
|
303
|
+
|
|
304
|
+
Args:
|
|
305
|
+
environment: Environment to query
|
|
306
|
+
|
|
307
|
+
extra_headers: Send extra headers
|
|
308
|
+
|
|
309
|
+
extra_query: Add additional query parameters to the request
|
|
310
|
+
|
|
311
|
+
extra_body: Add additional JSON properties to the request
|
|
312
|
+
|
|
313
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
314
|
+
"""
|
|
315
|
+
if not table_name:
|
|
316
|
+
raise ValueError(f"Expected a non-empty value for `table_name` but received {table_name!r}")
|
|
317
|
+
return await self._get(
|
|
318
|
+
f"/db/tables/{table_name}/schema",
|
|
319
|
+
options=make_request_options(
|
|
320
|
+
extra_headers=extra_headers,
|
|
321
|
+
extra_query=extra_query,
|
|
322
|
+
extra_body=extra_body,
|
|
323
|
+
timeout=timeout,
|
|
324
|
+
query=await async_maybe_transform(
|
|
325
|
+
{"environment": environment}, table_retrieve_schema_params.TableRetrieveSchemaParams
|
|
326
|
+
),
|
|
327
|
+
),
|
|
328
|
+
cast_to=TableRetrieveSchemaResponse,
|
|
329
|
+
)
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
class TablesResourceWithRawResponse:
|
|
333
|
+
def __init__(self, tables: TablesResource) -> None:
|
|
334
|
+
self._tables = tables
|
|
335
|
+
|
|
336
|
+
self.list = to_raw_response_wrapper(
|
|
337
|
+
tables.list,
|
|
338
|
+
)
|
|
339
|
+
self.get_row_count = to_raw_response_wrapper(
|
|
340
|
+
tables.get_row_count,
|
|
341
|
+
)
|
|
342
|
+
self.retrieve_schema = to_raw_response_wrapper(
|
|
343
|
+
tables.retrieve_schema,
|
|
344
|
+
)
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
class AsyncTablesResourceWithRawResponse:
|
|
348
|
+
def __init__(self, tables: AsyncTablesResource) -> None:
|
|
349
|
+
self._tables = tables
|
|
350
|
+
|
|
351
|
+
self.list = async_to_raw_response_wrapper(
|
|
352
|
+
tables.list,
|
|
353
|
+
)
|
|
354
|
+
self.get_row_count = async_to_raw_response_wrapper(
|
|
355
|
+
tables.get_row_count,
|
|
356
|
+
)
|
|
357
|
+
self.retrieve_schema = async_to_raw_response_wrapper(
|
|
358
|
+
tables.retrieve_schema,
|
|
359
|
+
)
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
class TablesResourceWithStreamingResponse:
|
|
363
|
+
def __init__(self, tables: TablesResource) -> None:
|
|
364
|
+
self._tables = tables
|
|
365
|
+
|
|
366
|
+
self.list = to_streamed_response_wrapper(
|
|
367
|
+
tables.list,
|
|
368
|
+
)
|
|
369
|
+
self.get_row_count = to_streamed_response_wrapper(
|
|
370
|
+
tables.get_row_count,
|
|
371
|
+
)
|
|
372
|
+
self.retrieve_schema = to_streamed_response_wrapper(
|
|
373
|
+
tables.retrieve_schema,
|
|
374
|
+
)
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
class AsyncTablesResourceWithStreamingResponse:
|
|
378
|
+
def __init__(self, tables: AsyncTablesResource) -> None:
|
|
379
|
+
self._tables = tables
|
|
380
|
+
|
|
381
|
+
self.list = async_to_streamed_response_wrapper(
|
|
382
|
+
tables.list,
|
|
383
|
+
)
|
|
384
|
+
self.get_row_count = async_to_streamed_response_wrapper(
|
|
385
|
+
tables.get_row_count,
|
|
386
|
+
)
|
|
387
|
+
self.retrieve_schema = async_to_streamed_response_wrapper(
|
|
388
|
+
tables.retrieve_schema,
|
|
389
|
+
)
|
worqhat/resources/flows.py
CHANGED
|
@@ -9,7 +9,7 @@ from typing_extensions import Literal
|
|
|
9
9
|
import httpx
|
|
10
10
|
|
|
11
11
|
from ..types import flow_get_metrics_params, flow_trigger_with_file_params, flow_trigger_with_payload_params
|
|
12
|
-
from .._types import
|
|
12
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, FileTypes, omit, not_given
|
|
13
13
|
from .._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
|
|
14
14
|
from .._compat import cached_property
|
|
15
15
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -50,16 +50,16 @@ class FlowsResource(SyncAPIResource):
|
|
|
50
50
|
def get_metrics(
|
|
51
51
|
self,
|
|
52
52
|
*,
|
|
53
|
-
end_date: Union[str, date] |
|
|
54
|
-
start_date: Union[str, date] |
|
|
55
|
-
status: Literal["completed", "failed", "in_progress"] |
|
|
56
|
-
user_id: str |
|
|
53
|
+
end_date: Union[str, date] | Omit = omit,
|
|
54
|
+
start_date: Union[str, date] | Omit = omit,
|
|
55
|
+
status: Literal["completed", "failed", "in_progress"] | Omit = omit,
|
|
56
|
+
user_id: str | Omit = omit,
|
|
57
57
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
58
58
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
59
59
|
extra_headers: Headers | None = None,
|
|
60
60
|
extra_query: Query | None = None,
|
|
61
61
|
extra_body: Body | None = None,
|
|
62
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
62
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
63
63
|
) -> FlowGetMetricsResponse:
|
|
64
64
|
"""Get metrics for workflows within a specified date range.
|
|
65
65
|
|
|
@@ -111,14 +111,14 @@ class FlowsResource(SyncAPIResource):
|
|
|
111
111
|
self,
|
|
112
112
|
flow_id: str,
|
|
113
113
|
*,
|
|
114
|
-
file: FileTypes |
|
|
115
|
-
url: str |
|
|
114
|
+
file: FileTypes | Omit = omit,
|
|
115
|
+
url: str | Omit = omit,
|
|
116
116
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
117
117
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
118
118
|
extra_headers: Headers | None = None,
|
|
119
119
|
extra_query: Query | None = None,
|
|
120
120
|
extra_body: Body | None = None,
|
|
121
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
121
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
122
122
|
) -> FlowTriggerWithFileResponse:
|
|
123
123
|
"""Trigger a workflow by its ID with either a file upload or a URL to a file.
|
|
124
124
|
|
|
@@ -167,13 +167,13 @@ class FlowsResource(SyncAPIResource):
|
|
|
167
167
|
self,
|
|
168
168
|
flow_id: str,
|
|
169
169
|
*,
|
|
170
|
-
|
|
170
|
+
data: Dict[str, object] | Omit = omit,
|
|
171
171
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
172
172
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
173
173
|
extra_headers: Headers | None = None,
|
|
174
174
|
extra_query: Query | None = None,
|
|
175
175
|
extra_body: Body | None = None,
|
|
176
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
176
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
177
177
|
) -> FlowTriggerWithPayloadResponse:
|
|
178
178
|
"""Trigger a workflow by its ID with a JSON payload.
|
|
179
179
|
|
|
@@ -182,6 +182,8 @@ class FlowsResource(SyncAPIResource):
|
|
|
182
182
|
workflow ID must be specified in the URL path.
|
|
183
183
|
|
|
184
184
|
Args:
|
|
185
|
+
data: Optional structured data to pass to the workflow
|
|
186
|
+
|
|
185
187
|
extra_headers: Send extra headers
|
|
186
188
|
|
|
187
189
|
extra_query: Add additional query parameters to the request
|
|
@@ -194,7 +196,7 @@ class FlowsResource(SyncAPIResource):
|
|
|
194
196
|
raise ValueError(f"Expected a non-empty value for `flow_id` but received {flow_id!r}")
|
|
195
197
|
return self._post(
|
|
196
198
|
f"/flows/trigger/{flow_id}",
|
|
197
|
-
body=maybe_transform(
|
|
199
|
+
body=maybe_transform({"data": data}, flow_trigger_with_payload_params.FlowTriggerWithPayloadParams),
|
|
198
200
|
options=make_request_options(
|
|
199
201
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
200
202
|
),
|
|
@@ -225,16 +227,16 @@ class AsyncFlowsResource(AsyncAPIResource):
|
|
|
225
227
|
async def get_metrics(
|
|
226
228
|
self,
|
|
227
229
|
*,
|
|
228
|
-
end_date: Union[str, date] |
|
|
229
|
-
start_date: Union[str, date] |
|
|
230
|
-
status: Literal["completed", "failed", "in_progress"] |
|
|
231
|
-
user_id: str |
|
|
230
|
+
end_date: Union[str, date] | Omit = omit,
|
|
231
|
+
start_date: Union[str, date] | Omit = omit,
|
|
232
|
+
status: Literal["completed", "failed", "in_progress"] | Omit = omit,
|
|
233
|
+
user_id: str | Omit = omit,
|
|
232
234
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
233
235
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
234
236
|
extra_headers: Headers | None = None,
|
|
235
237
|
extra_query: Query | None = None,
|
|
236
238
|
extra_body: Body | None = None,
|
|
237
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
239
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
238
240
|
) -> FlowGetMetricsResponse:
|
|
239
241
|
"""Get metrics for workflows within a specified date range.
|
|
240
242
|
|
|
@@ -286,14 +288,14 @@ class AsyncFlowsResource(AsyncAPIResource):
|
|
|
286
288
|
self,
|
|
287
289
|
flow_id: str,
|
|
288
290
|
*,
|
|
289
|
-
file: FileTypes |
|
|
290
|
-
url: str |
|
|
291
|
+
file: FileTypes | Omit = omit,
|
|
292
|
+
url: str | Omit = omit,
|
|
291
293
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
292
294
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
293
295
|
extra_headers: Headers | None = None,
|
|
294
296
|
extra_query: Query | None = None,
|
|
295
297
|
extra_body: Body | None = None,
|
|
296
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
298
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
297
299
|
) -> FlowTriggerWithFileResponse:
|
|
298
300
|
"""Trigger a workflow by its ID with either a file upload or a URL to a file.
|
|
299
301
|
|
|
@@ -342,13 +344,13 @@ class AsyncFlowsResource(AsyncAPIResource):
|
|
|
342
344
|
self,
|
|
343
345
|
flow_id: str,
|
|
344
346
|
*,
|
|
345
|
-
|
|
347
|
+
data: Dict[str, object] | Omit = omit,
|
|
346
348
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
347
349
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
348
350
|
extra_headers: Headers | None = None,
|
|
349
351
|
extra_query: Query | None = None,
|
|
350
352
|
extra_body: Body | None = None,
|
|
351
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
353
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
352
354
|
) -> FlowTriggerWithPayloadResponse:
|
|
353
355
|
"""Trigger a workflow by its ID with a JSON payload.
|
|
354
356
|
|
|
@@ -357,6 +359,8 @@ class AsyncFlowsResource(AsyncAPIResource):
|
|
|
357
359
|
workflow ID must be specified in the URL path.
|
|
358
360
|
|
|
359
361
|
Args:
|
|
362
|
+
data: Optional structured data to pass to the workflow
|
|
363
|
+
|
|
360
364
|
extra_headers: Send extra headers
|
|
361
365
|
|
|
362
366
|
extra_query: Add additional query parameters to the request
|
|
@@ -369,7 +373,9 @@ class AsyncFlowsResource(AsyncAPIResource):
|
|
|
369
373
|
raise ValueError(f"Expected a non-empty value for `flow_id` but received {flow_id!r}")
|
|
370
374
|
return await self._post(
|
|
371
375
|
f"/flows/trigger/{flow_id}",
|
|
372
|
-
body=await async_maybe_transform(
|
|
376
|
+
body=await async_maybe_transform(
|
|
377
|
+
{"data": data}, flow_trigger_with_payload_params.FlowTriggerWithPayloadParams
|
|
378
|
+
),
|
|
373
379
|
options=make_request_options(
|
|
374
380
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
375
381
|
),
|
worqhat/resources/health.py
CHANGED
|
@@ -4,7 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import httpx
|
|
6
6
|
|
|
7
|
-
from .._types import
|
|
7
|
+
from .._types import Body, Query, Headers, NotGiven, not_given
|
|
8
8
|
from .._compat import cached_property
|
|
9
9
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
10
10
|
from .._response import (
|
|
@@ -47,7 +47,7 @@ class HealthResource(SyncAPIResource):
|
|
|
47
47
|
extra_headers: Headers | None = None,
|
|
48
48
|
extra_query: Query | None = None,
|
|
49
49
|
extra_body: Body | None = None,
|
|
50
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
50
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
51
51
|
) -> HealthCheckResponse:
|
|
52
52
|
"""Check if the server is running and get uptime information.
|
|
53
53
|
|
|
@@ -91,7 +91,7 @@ class AsyncHealthResource(AsyncAPIResource):
|
|
|
91
91
|
extra_headers: Headers | None = None,
|
|
92
92
|
extra_query: Query | None = None,
|
|
93
93
|
extra_body: Body | None = None,
|
|
94
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
94
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
95
95
|
) -> HealthCheckResponse:
|
|
96
96
|
"""Check if the server is running and get uptime information.
|
|
97
97
|
|