groundx 2.5.10__py3-none-any.whl → 2.6.2__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.

Potentially problematic release.


This version of groundx might be problematic. Click here for more details.

Files changed (33) hide show
  1. groundx/__init__.py +44 -1
  2. groundx/client.py +3 -0
  3. groundx/core/client_wrapper.py +2 -2
  4. groundx/types/__init__.py +40 -0
  5. groundx/types/workflow_apply_request.py +24 -0
  6. groundx/types/workflow_detail.py +55 -0
  7. groundx/types/workflow_detail_relationships.py +36 -0
  8. groundx/types/workflow_engine.py +58 -0
  9. groundx/types/workflow_engine_reasoning_effort.py +5 -0
  10. groundx/types/workflow_engine_service.py +7 -0
  11. groundx/types/workflow_prompt.py +39 -0
  12. groundx/types/workflow_prompt_group.py +25 -0
  13. groundx/types/workflow_prompt_role.py +5 -0
  14. groundx/types/workflow_response.py +20 -0
  15. groundx/types/workflow_step.py +26 -0
  16. groundx/types/workflow_steps.py +50 -0
  17. groundx/types/workflow_steps_chunk_instruct.py +24 -0
  18. groundx/types/workflow_steps_chunk_summary.py +26 -0
  19. groundx/types/workflow_steps_doc_keys.py +22 -0
  20. groundx/types/workflow_steps_doc_summary.py +23 -0
  21. groundx/types/workflow_steps_search_query.py +22 -0
  22. groundx/types/workflow_steps_sect_instruct.py +20 -0
  23. groundx/types/workflow_steps_sect_summary.py +23 -0
  24. groundx/types/workflows_response.py +20 -0
  25. groundx/workflows/__init__.py +7 -0
  26. groundx/workflows/client.py +731 -0
  27. groundx/workflows/raw_client.py +836 -0
  28. groundx/workflows/types/__init__.py +7 -0
  29. groundx/workflows/types/workflow_get_request_id.py +5 -0
  30. {groundx-2.5.10.dist-info → groundx-2.6.2.dist-info}/METADATA +1 -1
  31. {groundx-2.5.10.dist-info → groundx-2.6.2.dist-info}/RECORD +33 -8
  32. {groundx-2.5.10.dist-info → groundx-2.6.2.dist-info}/LICENSE +0 -0
  33. {groundx-2.5.10.dist-info → groundx-2.6.2.dist-info}/WHEEL +0 -0
@@ -0,0 +1,836 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from json.decoder import JSONDecodeError
5
+
6
+ from ..core.api_error import ApiError
7
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
+ from ..core.http_response import AsyncHttpResponse, HttpResponse
9
+ from ..core.jsonable_encoder import jsonable_encoder
10
+ from ..core.pydantic_utilities import parse_obj_as
11
+ from ..core.request_options import RequestOptions
12
+ from ..core.serialization import convert_and_respect_annotation_metadata
13
+ from ..types.message_response import MessageResponse
14
+ from ..types.workflow_response import WorkflowResponse
15
+ from ..types.workflow_steps import WorkflowSteps
16
+ from ..types.workflows_response import WorkflowsResponse
17
+ from .types.workflow_get_request_id import WorkflowGetRequestId
18
+
19
+ # this is used as the default value for optional parameters
20
+ OMIT = typing.cast(typing.Any, ...)
21
+
22
+
23
+ class RawWorkflowsClient:
24
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
25
+ self._client_wrapper = client_wrapper
26
+
27
+ def workflow_list(
28
+ self, *, request_options: typing.Optional[RequestOptions] = None
29
+ ) -> HttpResponse[WorkflowsResponse]:
30
+ """
31
+ Get all workflows associated with the API key.
32
+
33
+ Parameters
34
+ ----------
35
+ request_options : typing.Optional[RequestOptions]
36
+ Request-specific configuration.
37
+
38
+ Returns
39
+ -------
40
+ HttpResponse[WorkflowsResponse]
41
+ Look up success
42
+ """
43
+ _response = self._client_wrapper.httpx_client.request(
44
+ "v1/workflow",
45
+ method="GET",
46
+ request_options=request_options,
47
+ )
48
+ try:
49
+ if 200 <= _response.status_code < 300:
50
+ _data = typing.cast(
51
+ WorkflowsResponse,
52
+ parse_obj_as(
53
+ type_=WorkflowsResponse, # type: ignore
54
+ object_=_response.json(),
55
+ ),
56
+ )
57
+ return HttpResponse(response=_response, data=_data)
58
+ _response_json = _response.json()
59
+ except JSONDecodeError:
60
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
61
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
62
+
63
+ def workflow_create(
64
+ self,
65
+ *,
66
+ name: typing.Optional[str] = OMIT,
67
+ steps: typing.Optional[WorkflowSteps] = OMIT,
68
+ request_options: typing.Optional[RequestOptions] = None,
69
+ ) -> HttpResponse[WorkflowResponse]:
70
+ """
71
+ Create a workflow.
72
+
73
+ Parameters
74
+ ----------
75
+ name : typing.Optional[str]
76
+ The name of the workflow being created.
77
+
78
+ steps : typing.Optional[WorkflowSteps]
79
+
80
+ request_options : typing.Optional[RequestOptions]
81
+ Request-specific configuration.
82
+
83
+ Returns
84
+ -------
85
+ HttpResponse[WorkflowResponse]
86
+ Workflow successfully created
87
+ """
88
+ _response = self._client_wrapper.httpx_client.request(
89
+ "v1/workflow",
90
+ method="POST",
91
+ json={
92
+ "name": name,
93
+ "steps": convert_and_respect_annotation_metadata(
94
+ object_=steps, annotation=WorkflowSteps, direction="write"
95
+ ),
96
+ },
97
+ headers={
98
+ "content-type": "application/json",
99
+ },
100
+ request_options=request_options,
101
+ omit=OMIT,
102
+ )
103
+ try:
104
+ if 200 <= _response.status_code < 300:
105
+ _data = typing.cast(
106
+ WorkflowResponse,
107
+ parse_obj_as(
108
+ type_=WorkflowResponse, # type: ignore
109
+ object_=_response.json(),
110
+ ),
111
+ )
112
+ return HttpResponse(response=_response, data=_data)
113
+ _response_json = _response.json()
114
+ except JSONDecodeError:
115
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
116
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
117
+
118
+ def add_to_account(
119
+ self, *, workflow_id: str, request_options: typing.Optional[RequestOptions] = None
120
+ ) -> HttpResponse[MessageResponse]:
121
+ """
122
+ Assigns the given workflow to the customer account and is applied by default to all files unless overridden by document or bucket workflows.
123
+
124
+ Parameters
125
+ ----------
126
+ workflow_id : str
127
+ The id of the workflow that is being applied.
128
+
129
+ request_options : typing.Optional[RequestOptions]
130
+ Request-specific configuration.
131
+
132
+ Returns
133
+ -------
134
+ HttpResponse[MessageResponse]
135
+ Apply success
136
+ """
137
+ _response = self._client_wrapper.httpx_client.request(
138
+ "v1/workflow/relationship",
139
+ method="POST",
140
+ json={
141
+ "workflowId": workflow_id,
142
+ },
143
+ headers={
144
+ "content-type": "application/json",
145
+ },
146
+ request_options=request_options,
147
+ omit=OMIT,
148
+ )
149
+ try:
150
+ if 200 <= _response.status_code < 300:
151
+ _data = typing.cast(
152
+ MessageResponse,
153
+ parse_obj_as(
154
+ type_=MessageResponse, # type: ignore
155
+ object_=_response.json(),
156
+ ),
157
+ )
158
+ return HttpResponse(response=_response, data=_data)
159
+ _response_json = _response.json()
160
+ except JSONDecodeError:
161
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
162
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
163
+
164
+ def remove_from_account(
165
+ self, *, request_options: typing.Optional[RequestOptions] = None
166
+ ) -> HttpResponse[MessageResponse]:
167
+ """
168
+ Removes the assigned workflow from the customer account.
169
+
170
+ Parameters
171
+ ----------
172
+ request_options : typing.Optional[RequestOptions]
173
+ Request-specific configuration.
174
+
175
+ Returns
176
+ -------
177
+ HttpResponse[MessageResponse]
178
+ Apply success
179
+ """
180
+ _response = self._client_wrapper.httpx_client.request(
181
+ "v1/workflow/relationship",
182
+ method="DELETE",
183
+ request_options=request_options,
184
+ )
185
+ try:
186
+ if 200 <= _response.status_code < 300:
187
+ _data = typing.cast(
188
+ MessageResponse,
189
+ parse_obj_as(
190
+ type_=MessageResponse, # type: ignore
191
+ object_=_response.json(),
192
+ ),
193
+ )
194
+ return HttpResponse(response=_response, data=_data)
195
+ _response_json = _response.json()
196
+ except JSONDecodeError:
197
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
198
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
199
+
200
+ def add_to_id(
201
+ self, id: int, *, workflow_id: str, request_options: typing.Optional[RequestOptions] = None
202
+ ) -> HttpResponse[MessageResponse]:
203
+ """
204
+ Assigns the given workflow to the group or bucket and is applied by default to all files unless overridden by document workflows.
205
+
206
+ Parameters
207
+ ----------
208
+ id : int
209
+ The id of the group or bucket that the workflow will be assigned to.
210
+
211
+ workflow_id : str
212
+ The id of the workflow that is being applied.
213
+
214
+ request_options : typing.Optional[RequestOptions]
215
+ Request-specific configuration.
216
+
217
+ Returns
218
+ -------
219
+ HttpResponse[MessageResponse]
220
+ Apply success
221
+ """
222
+ _response = self._client_wrapper.httpx_client.request(
223
+ f"v1/workflow/relationship/{jsonable_encoder(id)}",
224
+ method="POST",
225
+ json={
226
+ "workflowId": workflow_id,
227
+ },
228
+ headers={
229
+ "content-type": "application/json",
230
+ },
231
+ request_options=request_options,
232
+ omit=OMIT,
233
+ )
234
+ try:
235
+ if 200 <= _response.status_code < 300:
236
+ _data = typing.cast(
237
+ MessageResponse,
238
+ parse_obj_as(
239
+ type_=MessageResponse, # type: ignore
240
+ object_=_response.json(),
241
+ ),
242
+ )
243
+ return HttpResponse(response=_response, data=_data)
244
+ _response_json = _response.json()
245
+ except JSONDecodeError:
246
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
247
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
248
+
249
+ def remove_from_id(
250
+ self, id: int, *, request_options: typing.Optional[RequestOptions] = None
251
+ ) -> HttpResponse[MessageResponse]:
252
+ """
253
+ Removes the assigned workflow from the customer account.
254
+
255
+ Parameters
256
+ ----------
257
+ id : int
258
+ The id of the group or bucket that the workflow will removed from.
259
+
260
+ request_options : typing.Optional[RequestOptions]
261
+ Request-specific configuration.
262
+
263
+ Returns
264
+ -------
265
+ HttpResponse[MessageResponse]
266
+ Apply success
267
+ """
268
+ _response = self._client_wrapper.httpx_client.request(
269
+ f"v1/workflow/relationship/{jsonable_encoder(id)}",
270
+ method="DELETE",
271
+ request_options=request_options,
272
+ )
273
+ try:
274
+ if 200 <= _response.status_code < 300:
275
+ _data = typing.cast(
276
+ MessageResponse,
277
+ parse_obj_as(
278
+ type_=MessageResponse, # type: ignore
279
+ object_=_response.json(),
280
+ ),
281
+ )
282
+ return HttpResponse(response=_response, data=_data)
283
+ _response_json = _response.json()
284
+ except JSONDecodeError:
285
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
286
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
287
+
288
+ def workflow_get(
289
+ self, id: WorkflowGetRequestId, *, request_options: typing.Optional[RequestOptions] = None
290
+ ) -> HttpResponse[WorkflowResponse]:
291
+ """
292
+ look up a specific workflow by groupId, bucketId, or workflowId.
293
+
294
+ Parameters
295
+ ----------
296
+ id : WorkflowGetRequestId
297
+ The id of the group, bucket, or workflow to look up.
298
+
299
+ request_options : typing.Optional[RequestOptions]
300
+ Request-specific configuration.
301
+
302
+ Returns
303
+ -------
304
+ HttpResponse[WorkflowResponse]
305
+ Look up success
306
+ """
307
+ _response = self._client_wrapper.httpx_client.request(
308
+ f"v1/workflow/{jsonable_encoder(id)}",
309
+ method="GET",
310
+ request_options=request_options,
311
+ )
312
+ try:
313
+ if 200 <= _response.status_code < 300:
314
+ _data = typing.cast(
315
+ WorkflowResponse,
316
+ parse_obj_as(
317
+ type_=WorkflowResponse, # type: ignore
318
+ object_=_response.json(),
319
+ ),
320
+ )
321
+ return HttpResponse(response=_response, data=_data)
322
+ _response_json = _response.json()
323
+ except JSONDecodeError:
324
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
325
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
326
+
327
+ def workflow_update(
328
+ self,
329
+ id: str,
330
+ *,
331
+ workflow_id: str,
332
+ name: typing.Optional[str] = OMIT,
333
+ steps: typing.Optional[WorkflowSteps] = OMIT,
334
+ request_options: typing.Optional[RequestOptions] = None,
335
+ ) -> HttpResponse[WorkflowResponse]:
336
+ """
337
+ Update an existing workflow.
338
+
339
+ Parameters
340
+ ----------
341
+ id : str
342
+ The workflowId of the workflow being updated.
343
+
344
+ workflow_id : str
345
+ The id of the workflow that is being updated.
346
+
347
+ name : typing.Optional[str]
348
+ The name of the workflow being created.
349
+
350
+ steps : typing.Optional[WorkflowSteps]
351
+
352
+ request_options : typing.Optional[RequestOptions]
353
+ Request-specific configuration.
354
+
355
+ Returns
356
+ -------
357
+ HttpResponse[WorkflowResponse]
358
+ Update success
359
+ """
360
+ _response = self._client_wrapper.httpx_client.request(
361
+ f"v1/workflow/{jsonable_encoder(id)}",
362
+ method="PUT",
363
+ json={
364
+ "name": name,
365
+ "steps": convert_and_respect_annotation_metadata(
366
+ object_=steps, annotation=WorkflowSteps, direction="write"
367
+ ),
368
+ "workflowId": workflow_id,
369
+ },
370
+ headers={
371
+ "content-type": "application/json",
372
+ },
373
+ request_options=request_options,
374
+ omit=OMIT,
375
+ )
376
+ try:
377
+ if 200 <= _response.status_code < 300:
378
+ _data = typing.cast(
379
+ WorkflowResponse,
380
+ parse_obj_as(
381
+ type_=WorkflowResponse, # type: ignore
382
+ object_=_response.json(),
383
+ ),
384
+ )
385
+ return HttpResponse(response=_response, data=_data)
386
+ _response_json = _response.json()
387
+ except JSONDecodeError:
388
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
389
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
390
+
391
+ def workflow_delete(
392
+ self, id: str, *, request_options: typing.Optional[RequestOptions] = None
393
+ ) -> HttpResponse[MessageResponse]:
394
+ """
395
+ Delete a workflow.
396
+
397
+ Parameters
398
+ ----------
399
+ id : str
400
+ The workflowId of the workflow being deleted.
401
+
402
+ request_options : typing.Optional[RequestOptions]
403
+ Request-specific configuration.
404
+
405
+ Returns
406
+ -------
407
+ HttpResponse[MessageResponse]
408
+ Delete success
409
+ """
410
+ _response = self._client_wrapper.httpx_client.request(
411
+ f"v1/workflow/{jsonable_encoder(id)}",
412
+ method="DELETE",
413
+ request_options=request_options,
414
+ )
415
+ try:
416
+ if 200 <= _response.status_code < 300:
417
+ _data = typing.cast(
418
+ MessageResponse,
419
+ parse_obj_as(
420
+ type_=MessageResponse, # type: ignore
421
+ object_=_response.json(),
422
+ ),
423
+ )
424
+ return HttpResponse(response=_response, data=_data)
425
+ _response_json = _response.json()
426
+ except JSONDecodeError:
427
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
428
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
429
+
430
+
431
+ class AsyncRawWorkflowsClient:
432
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
433
+ self._client_wrapper = client_wrapper
434
+
435
+ async def workflow_list(
436
+ self, *, request_options: typing.Optional[RequestOptions] = None
437
+ ) -> AsyncHttpResponse[WorkflowsResponse]:
438
+ """
439
+ Get all workflows associated with the API key.
440
+
441
+ Parameters
442
+ ----------
443
+ request_options : typing.Optional[RequestOptions]
444
+ Request-specific configuration.
445
+
446
+ Returns
447
+ -------
448
+ AsyncHttpResponse[WorkflowsResponse]
449
+ Look up success
450
+ """
451
+ _response = await self._client_wrapper.httpx_client.request(
452
+ "v1/workflow",
453
+ method="GET",
454
+ request_options=request_options,
455
+ )
456
+ try:
457
+ if 200 <= _response.status_code < 300:
458
+ _data = typing.cast(
459
+ WorkflowsResponse,
460
+ parse_obj_as(
461
+ type_=WorkflowsResponse, # type: ignore
462
+ object_=_response.json(),
463
+ ),
464
+ )
465
+ return AsyncHttpResponse(response=_response, data=_data)
466
+ _response_json = _response.json()
467
+ except JSONDecodeError:
468
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
469
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
470
+
471
+ async def workflow_create(
472
+ self,
473
+ *,
474
+ name: typing.Optional[str] = OMIT,
475
+ steps: typing.Optional[WorkflowSteps] = OMIT,
476
+ request_options: typing.Optional[RequestOptions] = None,
477
+ ) -> AsyncHttpResponse[WorkflowResponse]:
478
+ """
479
+ Create a workflow.
480
+
481
+ Parameters
482
+ ----------
483
+ name : typing.Optional[str]
484
+ The name of the workflow being created.
485
+
486
+ steps : typing.Optional[WorkflowSteps]
487
+
488
+ request_options : typing.Optional[RequestOptions]
489
+ Request-specific configuration.
490
+
491
+ Returns
492
+ -------
493
+ AsyncHttpResponse[WorkflowResponse]
494
+ Workflow successfully created
495
+ """
496
+ _response = await self._client_wrapper.httpx_client.request(
497
+ "v1/workflow",
498
+ method="POST",
499
+ json={
500
+ "name": name,
501
+ "steps": convert_and_respect_annotation_metadata(
502
+ object_=steps, annotation=WorkflowSteps, direction="write"
503
+ ),
504
+ },
505
+ headers={
506
+ "content-type": "application/json",
507
+ },
508
+ request_options=request_options,
509
+ omit=OMIT,
510
+ )
511
+ try:
512
+ if 200 <= _response.status_code < 300:
513
+ _data = typing.cast(
514
+ WorkflowResponse,
515
+ parse_obj_as(
516
+ type_=WorkflowResponse, # type: ignore
517
+ object_=_response.json(),
518
+ ),
519
+ )
520
+ return AsyncHttpResponse(response=_response, data=_data)
521
+ _response_json = _response.json()
522
+ except JSONDecodeError:
523
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
524
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
525
+
526
+ async def add_to_account(
527
+ self, *, workflow_id: str, request_options: typing.Optional[RequestOptions] = None
528
+ ) -> AsyncHttpResponse[MessageResponse]:
529
+ """
530
+ Assigns the given workflow to the customer account and is applied by default to all files unless overridden by document or bucket workflows.
531
+
532
+ Parameters
533
+ ----------
534
+ workflow_id : str
535
+ The id of the workflow that is being applied.
536
+
537
+ request_options : typing.Optional[RequestOptions]
538
+ Request-specific configuration.
539
+
540
+ Returns
541
+ -------
542
+ AsyncHttpResponse[MessageResponse]
543
+ Apply success
544
+ """
545
+ _response = await self._client_wrapper.httpx_client.request(
546
+ "v1/workflow/relationship",
547
+ method="POST",
548
+ json={
549
+ "workflowId": workflow_id,
550
+ },
551
+ headers={
552
+ "content-type": "application/json",
553
+ },
554
+ request_options=request_options,
555
+ omit=OMIT,
556
+ )
557
+ try:
558
+ if 200 <= _response.status_code < 300:
559
+ _data = typing.cast(
560
+ MessageResponse,
561
+ parse_obj_as(
562
+ type_=MessageResponse, # type: ignore
563
+ object_=_response.json(),
564
+ ),
565
+ )
566
+ return AsyncHttpResponse(response=_response, data=_data)
567
+ _response_json = _response.json()
568
+ except JSONDecodeError:
569
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
570
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
571
+
572
+ async def remove_from_account(
573
+ self, *, request_options: typing.Optional[RequestOptions] = None
574
+ ) -> AsyncHttpResponse[MessageResponse]:
575
+ """
576
+ Removes the assigned workflow from the customer account.
577
+
578
+ Parameters
579
+ ----------
580
+ request_options : typing.Optional[RequestOptions]
581
+ Request-specific configuration.
582
+
583
+ Returns
584
+ -------
585
+ AsyncHttpResponse[MessageResponse]
586
+ Apply success
587
+ """
588
+ _response = await self._client_wrapper.httpx_client.request(
589
+ "v1/workflow/relationship",
590
+ method="DELETE",
591
+ request_options=request_options,
592
+ )
593
+ try:
594
+ if 200 <= _response.status_code < 300:
595
+ _data = typing.cast(
596
+ MessageResponse,
597
+ parse_obj_as(
598
+ type_=MessageResponse, # type: ignore
599
+ object_=_response.json(),
600
+ ),
601
+ )
602
+ return AsyncHttpResponse(response=_response, data=_data)
603
+ _response_json = _response.json()
604
+ except JSONDecodeError:
605
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
606
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
607
+
608
+ async def add_to_id(
609
+ self, id: int, *, workflow_id: str, request_options: typing.Optional[RequestOptions] = None
610
+ ) -> AsyncHttpResponse[MessageResponse]:
611
+ """
612
+ Assigns the given workflow to the group or bucket and is applied by default to all files unless overridden by document workflows.
613
+
614
+ Parameters
615
+ ----------
616
+ id : int
617
+ The id of the group or bucket that the workflow will be assigned to.
618
+
619
+ workflow_id : str
620
+ The id of the workflow that is being applied.
621
+
622
+ request_options : typing.Optional[RequestOptions]
623
+ Request-specific configuration.
624
+
625
+ Returns
626
+ -------
627
+ AsyncHttpResponse[MessageResponse]
628
+ Apply success
629
+ """
630
+ _response = await self._client_wrapper.httpx_client.request(
631
+ f"v1/workflow/relationship/{jsonable_encoder(id)}",
632
+ method="POST",
633
+ json={
634
+ "workflowId": workflow_id,
635
+ },
636
+ headers={
637
+ "content-type": "application/json",
638
+ },
639
+ request_options=request_options,
640
+ omit=OMIT,
641
+ )
642
+ try:
643
+ if 200 <= _response.status_code < 300:
644
+ _data = typing.cast(
645
+ MessageResponse,
646
+ parse_obj_as(
647
+ type_=MessageResponse, # type: ignore
648
+ object_=_response.json(),
649
+ ),
650
+ )
651
+ return AsyncHttpResponse(response=_response, data=_data)
652
+ _response_json = _response.json()
653
+ except JSONDecodeError:
654
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
655
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
656
+
657
+ async def remove_from_id(
658
+ self, id: int, *, request_options: typing.Optional[RequestOptions] = None
659
+ ) -> AsyncHttpResponse[MessageResponse]:
660
+ """
661
+ Removes the assigned workflow from the customer account.
662
+
663
+ Parameters
664
+ ----------
665
+ id : int
666
+ The id of the group or bucket that the workflow will removed from.
667
+
668
+ request_options : typing.Optional[RequestOptions]
669
+ Request-specific configuration.
670
+
671
+ Returns
672
+ -------
673
+ AsyncHttpResponse[MessageResponse]
674
+ Apply success
675
+ """
676
+ _response = await self._client_wrapper.httpx_client.request(
677
+ f"v1/workflow/relationship/{jsonable_encoder(id)}",
678
+ method="DELETE",
679
+ request_options=request_options,
680
+ )
681
+ try:
682
+ if 200 <= _response.status_code < 300:
683
+ _data = typing.cast(
684
+ MessageResponse,
685
+ parse_obj_as(
686
+ type_=MessageResponse, # type: ignore
687
+ object_=_response.json(),
688
+ ),
689
+ )
690
+ return AsyncHttpResponse(response=_response, data=_data)
691
+ _response_json = _response.json()
692
+ except JSONDecodeError:
693
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
694
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
695
+
696
+ async def workflow_get(
697
+ self, id: WorkflowGetRequestId, *, request_options: typing.Optional[RequestOptions] = None
698
+ ) -> AsyncHttpResponse[WorkflowResponse]:
699
+ """
700
+ look up a specific workflow by groupId, bucketId, or workflowId.
701
+
702
+ Parameters
703
+ ----------
704
+ id : WorkflowGetRequestId
705
+ The id of the group, bucket, or workflow to look up.
706
+
707
+ request_options : typing.Optional[RequestOptions]
708
+ Request-specific configuration.
709
+
710
+ Returns
711
+ -------
712
+ AsyncHttpResponse[WorkflowResponse]
713
+ Look up success
714
+ """
715
+ _response = await self._client_wrapper.httpx_client.request(
716
+ f"v1/workflow/{jsonable_encoder(id)}",
717
+ method="GET",
718
+ request_options=request_options,
719
+ )
720
+ try:
721
+ if 200 <= _response.status_code < 300:
722
+ _data = typing.cast(
723
+ WorkflowResponse,
724
+ parse_obj_as(
725
+ type_=WorkflowResponse, # type: ignore
726
+ object_=_response.json(),
727
+ ),
728
+ )
729
+ return AsyncHttpResponse(response=_response, data=_data)
730
+ _response_json = _response.json()
731
+ except JSONDecodeError:
732
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
733
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
734
+
735
+ async def workflow_update(
736
+ self,
737
+ id: str,
738
+ *,
739
+ workflow_id: str,
740
+ name: typing.Optional[str] = OMIT,
741
+ steps: typing.Optional[WorkflowSteps] = OMIT,
742
+ request_options: typing.Optional[RequestOptions] = None,
743
+ ) -> AsyncHttpResponse[WorkflowResponse]:
744
+ """
745
+ Update an existing workflow.
746
+
747
+ Parameters
748
+ ----------
749
+ id : str
750
+ The workflowId of the workflow being updated.
751
+
752
+ workflow_id : str
753
+ The id of the workflow that is being updated.
754
+
755
+ name : typing.Optional[str]
756
+ The name of the workflow being created.
757
+
758
+ steps : typing.Optional[WorkflowSteps]
759
+
760
+ request_options : typing.Optional[RequestOptions]
761
+ Request-specific configuration.
762
+
763
+ Returns
764
+ -------
765
+ AsyncHttpResponse[WorkflowResponse]
766
+ Update success
767
+ """
768
+ _response = await self._client_wrapper.httpx_client.request(
769
+ f"v1/workflow/{jsonable_encoder(id)}",
770
+ method="PUT",
771
+ json={
772
+ "name": name,
773
+ "steps": convert_and_respect_annotation_metadata(
774
+ object_=steps, annotation=WorkflowSteps, direction="write"
775
+ ),
776
+ "workflowId": workflow_id,
777
+ },
778
+ headers={
779
+ "content-type": "application/json",
780
+ },
781
+ request_options=request_options,
782
+ omit=OMIT,
783
+ )
784
+ try:
785
+ if 200 <= _response.status_code < 300:
786
+ _data = typing.cast(
787
+ WorkflowResponse,
788
+ parse_obj_as(
789
+ type_=WorkflowResponse, # type: ignore
790
+ object_=_response.json(),
791
+ ),
792
+ )
793
+ return AsyncHttpResponse(response=_response, data=_data)
794
+ _response_json = _response.json()
795
+ except JSONDecodeError:
796
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
797
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
798
+
799
+ async def workflow_delete(
800
+ self, id: str, *, request_options: typing.Optional[RequestOptions] = None
801
+ ) -> AsyncHttpResponse[MessageResponse]:
802
+ """
803
+ Delete a workflow.
804
+
805
+ Parameters
806
+ ----------
807
+ id : str
808
+ The workflowId of the workflow being deleted.
809
+
810
+ request_options : typing.Optional[RequestOptions]
811
+ Request-specific configuration.
812
+
813
+ Returns
814
+ -------
815
+ AsyncHttpResponse[MessageResponse]
816
+ Delete success
817
+ """
818
+ _response = await self._client_wrapper.httpx_client.request(
819
+ f"v1/workflow/{jsonable_encoder(id)}",
820
+ method="DELETE",
821
+ request_options=request_options,
822
+ )
823
+ try:
824
+ if 200 <= _response.status_code < 300:
825
+ _data = typing.cast(
826
+ MessageResponse,
827
+ parse_obj_as(
828
+ type_=MessageResponse, # type: ignore
829
+ object_=_response.json(),
830
+ ),
831
+ )
832
+ return AsyncHttpResponse(response=_response, data=_data)
833
+ _response_json = _response.json()
834
+ except JSONDecodeError:
835
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
836
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)