casedev 0.1.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.
- casedev/__init__.py +104 -0
- casedev/_base_client.py +1995 -0
- casedev/_client.py +560 -0
- casedev/_compat.py +219 -0
- casedev/_constants.py +14 -0
- casedev/_exceptions.py +108 -0
- casedev/_files.py +123 -0
- casedev/_models.py +857 -0
- casedev/_qs.py +150 -0
- casedev/_resource.py +43 -0
- casedev/_response.py +830 -0
- casedev/_streaming.py +333 -0
- casedev/_types.py +260 -0
- casedev/_utils/__init__.py +64 -0
- casedev/_utils/_compat.py +45 -0
- casedev/_utils/_datetime_parse.py +136 -0
- casedev/_utils/_logs.py +25 -0
- casedev/_utils/_proxy.py +65 -0
- casedev/_utils/_reflection.py +42 -0
- casedev/_utils/_resources_proxy.py +24 -0
- casedev/_utils/_streams.py +12 -0
- casedev/_utils/_sync.py +58 -0
- casedev/_utils/_transform.py +457 -0
- casedev/_utils/_typing.py +156 -0
- casedev/_utils/_utils.py +421 -0
- casedev/_version.py +4 -0
- casedev/lib/.keep +4 -0
- casedev/py.typed +0 -0
- casedev/resources/__init__.py +173 -0
- casedev/resources/actions/__init__.py +33 -0
- casedev/resources/actions/actions.py +102 -0
- casedev/resources/actions/v1.py +640 -0
- casedev/resources/compute/__init__.py +33 -0
- casedev/resources/compute/compute.py +102 -0
- casedev/resources/compute/v1/__init__.py +89 -0
- casedev/resources/compute/v1/environments.py +492 -0
- casedev/resources/compute/v1/functions.py +278 -0
- casedev/resources/compute/v1/invoke.py +216 -0
- casedev/resources/compute/v1/runs.py +290 -0
- casedev/resources/compute/v1/secrets.py +655 -0
- casedev/resources/compute/v1/v1.py +583 -0
- casedev/resources/convert/__init__.py +33 -0
- casedev/resources/convert/convert.py +102 -0
- casedev/resources/convert/v1/__init__.py +33 -0
- casedev/resources/convert/v1/jobs.py +254 -0
- casedev/resources/convert/v1/v1.py +450 -0
- casedev/resources/format/__init__.py +33 -0
- casedev/resources/format/format.py +102 -0
- casedev/resources/format/v1/__init__.py +33 -0
- casedev/resources/format/v1/templates.py +419 -0
- casedev/resources/format/v1/v1.py +244 -0
- casedev/resources/llm/__init__.py +33 -0
- casedev/resources/llm/llm.py +192 -0
- casedev/resources/llm/v1/__init__.py +33 -0
- casedev/resources/llm/v1/chat.py +243 -0
- casedev/resources/llm/v1/v1.py +317 -0
- casedev/resources/ocr/__init__.py +33 -0
- casedev/resources/ocr/ocr.py +102 -0
- casedev/resources/ocr/v1.py +407 -0
- casedev/resources/search/__init__.py +33 -0
- casedev/resources/search/search.py +102 -0
- casedev/resources/search/v1.py +1052 -0
- casedev/resources/templates/__init__.py +33 -0
- casedev/resources/templates/templates.py +102 -0
- casedev/resources/templates/v1.py +633 -0
- casedev/resources/vault/__init__.py +47 -0
- casedev/resources/vault/graphrag.py +256 -0
- casedev/resources/vault/objects.py +571 -0
- casedev/resources/vault/vault.py +764 -0
- casedev/resources/voice/__init__.py +61 -0
- casedev/resources/voice/streaming.py +160 -0
- casedev/resources/voice/transcription.py +327 -0
- casedev/resources/voice/v1/__init__.py +33 -0
- casedev/resources/voice/v1/speak.py +478 -0
- casedev/resources/voice/v1/v1.py +290 -0
- casedev/resources/voice/voice.py +166 -0
- casedev/resources/webhooks/__init__.py +33 -0
- casedev/resources/webhooks/v1.py +447 -0
- casedev/resources/webhooks/webhooks.py +102 -0
- casedev/resources/workflows/__init__.py +33 -0
- casedev/resources/workflows/v1.py +1053 -0
- casedev/resources/workflows/workflows.py +102 -0
- casedev/types/__init__.py +12 -0
- casedev/types/actions/__init__.py +8 -0
- casedev/types/actions/v1_create_params.py +22 -0
- casedev/types/actions/v1_create_response.py +33 -0
- casedev/types/actions/v1_execute_params.py +16 -0
- casedev/types/actions/v1_execute_response.py +31 -0
- casedev/types/compute/__init__.py +7 -0
- casedev/types/compute/v1/__init__.py +18 -0
- casedev/types/compute/v1/environment_create_params.py +12 -0
- casedev/types/compute/v1/environment_create_response.py +34 -0
- casedev/types/compute/v1/environment_delete_response.py +11 -0
- casedev/types/compute/v1/function_get_logs_params.py +12 -0
- casedev/types/compute/v1/function_list_params.py +12 -0
- casedev/types/compute/v1/invoke_run_params.py +21 -0
- casedev/types/compute/v1/invoke_run_response.py +39 -0
- casedev/types/compute/v1/run_list_params.py +18 -0
- casedev/types/compute/v1/secret_create_params.py +24 -0
- casedev/types/compute/v1/secret_create_response.py +24 -0
- casedev/types/compute/v1/secret_delete_group_params.py +18 -0
- casedev/types/compute/v1/secret_list_params.py +15 -0
- casedev/types/compute/v1/secret_retrieve_group_params.py +12 -0
- casedev/types/compute/v1/secret_update_group_params.py +16 -0
- casedev/types/compute/v1_deploy_params.py +114 -0
- casedev/types/compute/v1_deploy_response.py +30 -0
- casedev/types/compute/v1_get_usage_params.py +15 -0
- casedev/types/convert/__init__.py +8 -0
- casedev/types/convert/v1/__init__.py +3 -0
- casedev/types/convert/v1_process_params.py +15 -0
- casedev/types/convert/v1_process_response.py +19 -0
- casedev/types/convert/v1_webhook_params.py +32 -0
- casedev/types/convert/v1_webhook_response.py +13 -0
- casedev/types/format/__init__.py +5 -0
- casedev/types/format/v1/__init__.py +7 -0
- casedev/types/format/v1/template_create_params.py +32 -0
- casedev/types/format/v1/template_create_response.py +27 -0
- casedev/types/format/v1/template_list_params.py +12 -0
- casedev/types/format/v1_create_document_params.py +42 -0
- casedev/types/llm/__init__.py +5 -0
- casedev/types/llm/v1/__init__.py +6 -0
- casedev/types/llm/v1/chat_create_completion_params.py +42 -0
- casedev/types/llm/v1/chat_create_completion_response.py +49 -0
- casedev/types/llm/v1_create_embedding_params.py +27 -0
- casedev/types/ocr/__init__.py +6 -0
- casedev/types/ocr/v1_process_params.py +44 -0
- casedev/types/ocr/v1_process_response.py +32 -0
- casedev/types/search/__init__.py +15 -0
- casedev/types/search/v1_answer_params.py +45 -0
- casedev/types/search/v1_answer_response.py +35 -0
- casedev/types/search/v1_contents_params.py +42 -0
- casedev/types/search/v1_contents_response.py +31 -0
- casedev/types/search/v1_research_params.py +23 -0
- casedev/types/search/v1_research_response.py +20 -0
- casedev/types/search/v1_retrieve_research_params.py +15 -0
- casedev/types/search/v1_search_params.py +56 -0
- casedev/types/search/v1_search_response.py +38 -0
- casedev/types/search/v1_similar_params.py +44 -0
- casedev/types/search/v1_similar_response.py +33 -0
- casedev/types/templates/__init__.py +8 -0
- casedev/types/templates/v1_execute_params.py +22 -0
- casedev/types/templates/v1_execute_response.py +31 -0
- casedev/types/templates/v1_list_params.py +32 -0
- casedev/types/templates/v1_search_params.py +18 -0
- casedev/types/vault/__init__.py +6 -0
- casedev/types/vault/object_create_presigned_url_params.py +22 -0
- casedev/types/vault/object_create_presigned_url_response.py +51 -0
- casedev/types/vault_create_params.py +20 -0
- casedev/types/vault_create_response.py +36 -0
- casedev/types/vault_ingest_response.py +26 -0
- casedev/types/vault_list_response.py +40 -0
- casedev/types/vault_search_params.py +27 -0
- casedev/types/vault_search_response.py +53 -0
- casedev/types/vault_upload_params.py +26 -0
- casedev/types/vault_upload_response.py +39 -0
- casedev/types/voice/__init__.py +7 -0
- casedev/types/voice/transcription_create_params.py +36 -0
- casedev/types/voice/transcription_retrieve_response.py +41 -0
- casedev/types/voice/v1/__init__.py +6 -0
- casedev/types/voice/v1/speak_create_params.py +59 -0
- casedev/types/voice/v1/speak_stream_params.py +58 -0
- casedev/types/voice/v1_list_voices_params.py +36 -0
- casedev/types/webhooks/__init__.py +6 -0
- casedev/types/webhooks/v1_create_params.py +20 -0
- casedev/types/webhooks/v1_create_response.py +33 -0
- casedev/types/workflows/__init__.py +19 -0
- casedev/types/workflows/v1_create_params.py +32 -0
- casedev/types/workflows/v1_create_response.py +29 -0
- casedev/types/workflows/v1_delete_response.py +13 -0
- casedev/types/workflows/v1_deploy_response.py +20 -0
- casedev/types/workflows/v1_execute_params.py +12 -0
- casedev/types/workflows/v1_execute_response.py +22 -0
- casedev/types/workflows/v1_list_executions_params.py +13 -0
- casedev/types/workflows/v1_list_executions_response.py +27 -0
- casedev/types/workflows/v1_list_params.py +18 -0
- casedev/types/workflows/v1_list_response.py +37 -0
- casedev/types/workflows/v1_retrieve_execution_response.py +31 -0
- casedev/types/workflows/v1_retrieve_response.py +35 -0
- casedev/types/workflows/v1_undeploy_response.py +13 -0
- casedev/types/workflows/v1_update_params.py +26 -0
- casedev/types/workflows/v1_update_response.py +17 -0
- casedev-0.1.0.dist-info/METADATA +454 -0
- casedev-0.1.0.dist-info/RECORD +185 -0
- casedev-0.1.0.dist-info/WHEEL +4 -0
- casedev-0.1.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,640 @@
|
|
|
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 Dict, Union
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
|
|
10
|
+
from ..._utils import maybe_transform, async_maybe_transform
|
|
11
|
+
from ..._compat import cached_property
|
|
12
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
13
|
+
from ..._response import (
|
|
14
|
+
to_raw_response_wrapper,
|
|
15
|
+
to_streamed_response_wrapper,
|
|
16
|
+
async_to_raw_response_wrapper,
|
|
17
|
+
async_to_streamed_response_wrapper,
|
|
18
|
+
)
|
|
19
|
+
from ..._base_client import make_request_options
|
|
20
|
+
from ...types.actions import v1_create_params, v1_execute_params
|
|
21
|
+
from ...types.actions.v1_create_response import V1CreateResponse
|
|
22
|
+
from ...types.actions.v1_execute_response import V1ExecuteResponse
|
|
23
|
+
|
|
24
|
+
__all__ = ["V1Resource", "AsyncV1Resource"]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class V1Resource(SyncAPIResource):
|
|
28
|
+
@cached_property
|
|
29
|
+
def with_raw_response(self) -> V1ResourceWithRawResponse:
|
|
30
|
+
"""
|
|
31
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
32
|
+
the raw response object instead of the parsed content.
|
|
33
|
+
|
|
34
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
|
|
35
|
+
"""
|
|
36
|
+
return V1ResourceWithRawResponse(self)
|
|
37
|
+
|
|
38
|
+
@cached_property
|
|
39
|
+
def with_streaming_response(self) -> V1ResourceWithStreamingResponse:
|
|
40
|
+
"""
|
|
41
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
42
|
+
|
|
43
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
|
|
44
|
+
"""
|
|
45
|
+
return V1ResourceWithStreamingResponse(self)
|
|
46
|
+
|
|
47
|
+
def create(
|
|
48
|
+
self,
|
|
49
|
+
*,
|
|
50
|
+
definition: Union[str, object],
|
|
51
|
+
name: str,
|
|
52
|
+
description: str | Omit = omit,
|
|
53
|
+
webhook_id: str | Omit = omit,
|
|
54
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
55
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
56
|
+
extra_headers: Headers | None = None,
|
|
57
|
+
extra_query: Query | None = None,
|
|
58
|
+
extra_body: Body | None = None,
|
|
59
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
60
|
+
) -> V1CreateResponse:
|
|
61
|
+
"""Create a new action definition for multi-step workflow automation.
|
|
62
|
+
|
|
63
|
+
Actions can
|
|
64
|
+
be defined using YAML or JSON format and support complex workflows including
|
|
65
|
+
document processing, data extraction, and analysis pipelines.
|
|
66
|
+
|
|
67
|
+
Args:
|
|
68
|
+
definition: Action definition in YAML string, JSON string, or JSON object format
|
|
69
|
+
|
|
70
|
+
name: Unique name for the action
|
|
71
|
+
|
|
72
|
+
description: Optional description of the action's purpose
|
|
73
|
+
|
|
74
|
+
webhook_id: Optional webhook endpoint ID for action completion notifications
|
|
75
|
+
|
|
76
|
+
extra_headers: Send extra headers
|
|
77
|
+
|
|
78
|
+
extra_query: Add additional query parameters to the request
|
|
79
|
+
|
|
80
|
+
extra_body: Add additional JSON properties to the request
|
|
81
|
+
|
|
82
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
83
|
+
"""
|
|
84
|
+
return self._post(
|
|
85
|
+
"/actions/v1",
|
|
86
|
+
body=maybe_transform(
|
|
87
|
+
{
|
|
88
|
+
"definition": definition,
|
|
89
|
+
"name": name,
|
|
90
|
+
"description": description,
|
|
91
|
+
"webhook_id": webhook_id,
|
|
92
|
+
},
|
|
93
|
+
v1_create_params.V1CreateParams,
|
|
94
|
+
),
|
|
95
|
+
options=make_request_options(
|
|
96
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
97
|
+
),
|
|
98
|
+
cast_to=V1CreateResponse,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
def retrieve(
|
|
102
|
+
self,
|
|
103
|
+
id: str,
|
|
104
|
+
*,
|
|
105
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
106
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
107
|
+
extra_headers: Headers | None = None,
|
|
108
|
+
extra_query: Query | None = None,
|
|
109
|
+
extra_body: Body | None = None,
|
|
110
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
111
|
+
) -> None:
|
|
112
|
+
"""Retrieve a specific action definition by ID.
|
|
113
|
+
|
|
114
|
+
Actions are reusable workflow
|
|
115
|
+
components that can perform tasks like document analysis, data extraction, or
|
|
116
|
+
API integrations. Only actions belonging to your organization can be accessed.
|
|
117
|
+
|
|
118
|
+
Args:
|
|
119
|
+
extra_headers: Send extra headers
|
|
120
|
+
|
|
121
|
+
extra_query: Add additional query parameters to the request
|
|
122
|
+
|
|
123
|
+
extra_body: Add additional JSON properties to the request
|
|
124
|
+
|
|
125
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
126
|
+
"""
|
|
127
|
+
if not id:
|
|
128
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
129
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
130
|
+
return self._get(
|
|
131
|
+
f"/actions/v1/{id}",
|
|
132
|
+
options=make_request_options(
|
|
133
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
134
|
+
),
|
|
135
|
+
cast_to=NoneType,
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
def list(
|
|
139
|
+
self,
|
|
140
|
+
*,
|
|
141
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
142
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
143
|
+
extra_headers: Headers | None = None,
|
|
144
|
+
extra_query: Query | None = None,
|
|
145
|
+
extra_body: Body | None = None,
|
|
146
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
147
|
+
) -> None:
|
|
148
|
+
"""Retrieve all action definitions for your organization.
|
|
149
|
+
|
|
150
|
+
Actions are reusable
|
|
151
|
+
automation components that can perform tasks like document processing, data
|
|
152
|
+
extraction, and workflow execution.
|
|
153
|
+
"""
|
|
154
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
155
|
+
return self._get(
|
|
156
|
+
"/actions/v1",
|
|
157
|
+
options=make_request_options(
|
|
158
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
159
|
+
),
|
|
160
|
+
cast_to=NoneType,
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
def delete(
|
|
164
|
+
self,
|
|
165
|
+
id: str,
|
|
166
|
+
*,
|
|
167
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
168
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
169
|
+
extra_headers: Headers | None = None,
|
|
170
|
+
extra_query: Query | None = None,
|
|
171
|
+
extra_body: Body | None = None,
|
|
172
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
173
|
+
) -> None:
|
|
174
|
+
"""Permanently deletes an action definition from your organization.
|
|
175
|
+
|
|
176
|
+
This will
|
|
177
|
+
remove all workflow steps and configurations associated with the action.
|
|
178
|
+
**Warning:** This operation cannot be undone.
|
|
179
|
+
|
|
180
|
+
Args:
|
|
181
|
+
extra_headers: Send extra headers
|
|
182
|
+
|
|
183
|
+
extra_query: Add additional query parameters to the request
|
|
184
|
+
|
|
185
|
+
extra_body: Add additional JSON properties to the request
|
|
186
|
+
|
|
187
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
188
|
+
"""
|
|
189
|
+
if not id:
|
|
190
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
191
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
192
|
+
return self._delete(
|
|
193
|
+
f"/actions/v1/{id}",
|
|
194
|
+
options=make_request_options(
|
|
195
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
196
|
+
),
|
|
197
|
+
cast_to=NoneType,
|
|
198
|
+
)
|
|
199
|
+
|
|
200
|
+
def execute(
|
|
201
|
+
self,
|
|
202
|
+
id: str,
|
|
203
|
+
*,
|
|
204
|
+
input: Dict[str, object],
|
|
205
|
+
webhook_id: str | Omit = omit,
|
|
206
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
207
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
208
|
+
extra_headers: Headers | None = None,
|
|
209
|
+
extra_query: Query | None = None,
|
|
210
|
+
extra_body: Body | None = None,
|
|
211
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
212
|
+
) -> V1ExecuteResponse:
|
|
213
|
+
"""Execute a multi-step action workflow with the provided input data.
|
|
214
|
+
|
|
215
|
+
Actions can
|
|
216
|
+
run synchronously (returning results immediately) or asynchronously (with
|
|
217
|
+
webhook notifications when complete).
|
|
218
|
+
|
|
219
|
+
Args:
|
|
220
|
+
input: Input data for the action execution
|
|
221
|
+
|
|
222
|
+
webhook_id: Optional webhook endpoint ID to override the action's default webhook
|
|
223
|
+
|
|
224
|
+
extra_headers: Send extra headers
|
|
225
|
+
|
|
226
|
+
extra_query: Add additional query parameters to the request
|
|
227
|
+
|
|
228
|
+
extra_body: Add additional JSON properties to the request
|
|
229
|
+
|
|
230
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
231
|
+
"""
|
|
232
|
+
if not id:
|
|
233
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
234
|
+
return self._post(
|
|
235
|
+
f"/actions/v1/{id}/execute",
|
|
236
|
+
body=maybe_transform(
|
|
237
|
+
{
|
|
238
|
+
"input": input,
|
|
239
|
+
"webhook_id": webhook_id,
|
|
240
|
+
},
|
|
241
|
+
v1_execute_params.V1ExecuteParams,
|
|
242
|
+
),
|
|
243
|
+
options=make_request_options(
|
|
244
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
245
|
+
),
|
|
246
|
+
cast_to=V1ExecuteResponse,
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
def retrieve_execution(
|
|
250
|
+
self,
|
|
251
|
+
id: str,
|
|
252
|
+
*,
|
|
253
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
254
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
255
|
+
extra_headers: Headers | None = None,
|
|
256
|
+
extra_query: Query | None = None,
|
|
257
|
+
extra_body: Body | None = None,
|
|
258
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
259
|
+
) -> None:
|
|
260
|
+
"""Retrieve the status and results of a specific action execution.
|
|
261
|
+
|
|
262
|
+
Returns
|
|
263
|
+
execution details including current status, results, error messages, and
|
|
264
|
+
execution metadata.
|
|
265
|
+
|
|
266
|
+
Args:
|
|
267
|
+
extra_headers: Send extra headers
|
|
268
|
+
|
|
269
|
+
extra_query: Add additional query parameters to the request
|
|
270
|
+
|
|
271
|
+
extra_body: Add additional JSON properties to the request
|
|
272
|
+
|
|
273
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
274
|
+
"""
|
|
275
|
+
if not id:
|
|
276
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
277
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
278
|
+
return self._get(
|
|
279
|
+
f"/actions/v1/executions/{id}",
|
|
280
|
+
options=make_request_options(
|
|
281
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
282
|
+
),
|
|
283
|
+
cast_to=NoneType,
|
|
284
|
+
)
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
class AsyncV1Resource(AsyncAPIResource):
|
|
288
|
+
@cached_property
|
|
289
|
+
def with_raw_response(self) -> AsyncV1ResourceWithRawResponse:
|
|
290
|
+
"""
|
|
291
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
292
|
+
the raw response object instead of the parsed content.
|
|
293
|
+
|
|
294
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
|
|
295
|
+
"""
|
|
296
|
+
return AsyncV1ResourceWithRawResponse(self)
|
|
297
|
+
|
|
298
|
+
@cached_property
|
|
299
|
+
def with_streaming_response(self) -> AsyncV1ResourceWithStreamingResponse:
|
|
300
|
+
"""
|
|
301
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
302
|
+
|
|
303
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
|
|
304
|
+
"""
|
|
305
|
+
return AsyncV1ResourceWithStreamingResponse(self)
|
|
306
|
+
|
|
307
|
+
async def create(
|
|
308
|
+
self,
|
|
309
|
+
*,
|
|
310
|
+
definition: Union[str, object],
|
|
311
|
+
name: str,
|
|
312
|
+
description: str | Omit = omit,
|
|
313
|
+
webhook_id: str | Omit = omit,
|
|
314
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
315
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
316
|
+
extra_headers: Headers | None = None,
|
|
317
|
+
extra_query: Query | None = None,
|
|
318
|
+
extra_body: Body | None = None,
|
|
319
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
320
|
+
) -> V1CreateResponse:
|
|
321
|
+
"""Create a new action definition for multi-step workflow automation.
|
|
322
|
+
|
|
323
|
+
Actions can
|
|
324
|
+
be defined using YAML or JSON format and support complex workflows including
|
|
325
|
+
document processing, data extraction, and analysis pipelines.
|
|
326
|
+
|
|
327
|
+
Args:
|
|
328
|
+
definition: Action definition in YAML string, JSON string, or JSON object format
|
|
329
|
+
|
|
330
|
+
name: Unique name for the action
|
|
331
|
+
|
|
332
|
+
description: Optional description of the action's purpose
|
|
333
|
+
|
|
334
|
+
webhook_id: Optional webhook endpoint ID for action completion notifications
|
|
335
|
+
|
|
336
|
+
extra_headers: Send extra headers
|
|
337
|
+
|
|
338
|
+
extra_query: Add additional query parameters to the request
|
|
339
|
+
|
|
340
|
+
extra_body: Add additional JSON properties to the request
|
|
341
|
+
|
|
342
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
343
|
+
"""
|
|
344
|
+
return await self._post(
|
|
345
|
+
"/actions/v1",
|
|
346
|
+
body=await async_maybe_transform(
|
|
347
|
+
{
|
|
348
|
+
"definition": definition,
|
|
349
|
+
"name": name,
|
|
350
|
+
"description": description,
|
|
351
|
+
"webhook_id": webhook_id,
|
|
352
|
+
},
|
|
353
|
+
v1_create_params.V1CreateParams,
|
|
354
|
+
),
|
|
355
|
+
options=make_request_options(
|
|
356
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
357
|
+
),
|
|
358
|
+
cast_to=V1CreateResponse,
|
|
359
|
+
)
|
|
360
|
+
|
|
361
|
+
async def retrieve(
|
|
362
|
+
self,
|
|
363
|
+
id: str,
|
|
364
|
+
*,
|
|
365
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
366
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
367
|
+
extra_headers: Headers | None = None,
|
|
368
|
+
extra_query: Query | None = None,
|
|
369
|
+
extra_body: Body | None = None,
|
|
370
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
371
|
+
) -> None:
|
|
372
|
+
"""Retrieve a specific action definition by ID.
|
|
373
|
+
|
|
374
|
+
Actions are reusable workflow
|
|
375
|
+
components that can perform tasks like document analysis, data extraction, or
|
|
376
|
+
API integrations. Only actions belonging to your organization can be accessed.
|
|
377
|
+
|
|
378
|
+
Args:
|
|
379
|
+
extra_headers: Send extra headers
|
|
380
|
+
|
|
381
|
+
extra_query: Add additional query parameters to the request
|
|
382
|
+
|
|
383
|
+
extra_body: Add additional JSON properties to the request
|
|
384
|
+
|
|
385
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
386
|
+
"""
|
|
387
|
+
if not id:
|
|
388
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
389
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
390
|
+
return await self._get(
|
|
391
|
+
f"/actions/v1/{id}",
|
|
392
|
+
options=make_request_options(
|
|
393
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
394
|
+
),
|
|
395
|
+
cast_to=NoneType,
|
|
396
|
+
)
|
|
397
|
+
|
|
398
|
+
async def list(
|
|
399
|
+
self,
|
|
400
|
+
*,
|
|
401
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
402
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
403
|
+
extra_headers: Headers | None = None,
|
|
404
|
+
extra_query: Query | None = None,
|
|
405
|
+
extra_body: Body | None = None,
|
|
406
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
407
|
+
) -> None:
|
|
408
|
+
"""Retrieve all action definitions for your organization.
|
|
409
|
+
|
|
410
|
+
Actions are reusable
|
|
411
|
+
automation components that can perform tasks like document processing, data
|
|
412
|
+
extraction, and workflow execution.
|
|
413
|
+
"""
|
|
414
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
415
|
+
return await self._get(
|
|
416
|
+
"/actions/v1",
|
|
417
|
+
options=make_request_options(
|
|
418
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
419
|
+
),
|
|
420
|
+
cast_to=NoneType,
|
|
421
|
+
)
|
|
422
|
+
|
|
423
|
+
async def delete(
|
|
424
|
+
self,
|
|
425
|
+
id: str,
|
|
426
|
+
*,
|
|
427
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
428
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
429
|
+
extra_headers: Headers | None = None,
|
|
430
|
+
extra_query: Query | None = None,
|
|
431
|
+
extra_body: Body | None = None,
|
|
432
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
433
|
+
) -> None:
|
|
434
|
+
"""Permanently deletes an action definition from your organization.
|
|
435
|
+
|
|
436
|
+
This will
|
|
437
|
+
remove all workflow steps and configurations associated with the action.
|
|
438
|
+
**Warning:** This operation cannot be undone.
|
|
439
|
+
|
|
440
|
+
Args:
|
|
441
|
+
extra_headers: Send extra headers
|
|
442
|
+
|
|
443
|
+
extra_query: Add additional query parameters to the request
|
|
444
|
+
|
|
445
|
+
extra_body: Add additional JSON properties to the request
|
|
446
|
+
|
|
447
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
448
|
+
"""
|
|
449
|
+
if not id:
|
|
450
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
451
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
452
|
+
return await self._delete(
|
|
453
|
+
f"/actions/v1/{id}",
|
|
454
|
+
options=make_request_options(
|
|
455
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
456
|
+
),
|
|
457
|
+
cast_to=NoneType,
|
|
458
|
+
)
|
|
459
|
+
|
|
460
|
+
async def execute(
|
|
461
|
+
self,
|
|
462
|
+
id: str,
|
|
463
|
+
*,
|
|
464
|
+
input: Dict[str, object],
|
|
465
|
+
webhook_id: str | Omit = omit,
|
|
466
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
467
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
468
|
+
extra_headers: Headers | None = None,
|
|
469
|
+
extra_query: Query | None = None,
|
|
470
|
+
extra_body: Body | None = None,
|
|
471
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
472
|
+
) -> V1ExecuteResponse:
|
|
473
|
+
"""Execute a multi-step action workflow with the provided input data.
|
|
474
|
+
|
|
475
|
+
Actions can
|
|
476
|
+
run synchronously (returning results immediately) or asynchronously (with
|
|
477
|
+
webhook notifications when complete).
|
|
478
|
+
|
|
479
|
+
Args:
|
|
480
|
+
input: Input data for the action execution
|
|
481
|
+
|
|
482
|
+
webhook_id: Optional webhook endpoint ID to override the action's default webhook
|
|
483
|
+
|
|
484
|
+
extra_headers: Send extra headers
|
|
485
|
+
|
|
486
|
+
extra_query: Add additional query parameters to the request
|
|
487
|
+
|
|
488
|
+
extra_body: Add additional JSON properties to the request
|
|
489
|
+
|
|
490
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
491
|
+
"""
|
|
492
|
+
if not id:
|
|
493
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
494
|
+
return await self._post(
|
|
495
|
+
f"/actions/v1/{id}/execute",
|
|
496
|
+
body=await async_maybe_transform(
|
|
497
|
+
{
|
|
498
|
+
"input": input,
|
|
499
|
+
"webhook_id": webhook_id,
|
|
500
|
+
},
|
|
501
|
+
v1_execute_params.V1ExecuteParams,
|
|
502
|
+
),
|
|
503
|
+
options=make_request_options(
|
|
504
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
505
|
+
),
|
|
506
|
+
cast_to=V1ExecuteResponse,
|
|
507
|
+
)
|
|
508
|
+
|
|
509
|
+
async def retrieve_execution(
|
|
510
|
+
self,
|
|
511
|
+
id: str,
|
|
512
|
+
*,
|
|
513
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
514
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
515
|
+
extra_headers: Headers | None = None,
|
|
516
|
+
extra_query: Query | None = None,
|
|
517
|
+
extra_body: Body | None = None,
|
|
518
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
519
|
+
) -> None:
|
|
520
|
+
"""Retrieve the status and results of a specific action execution.
|
|
521
|
+
|
|
522
|
+
Returns
|
|
523
|
+
execution details including current status, results, error messages, and
|
|
524
|
+
execution metadata.
|
|
525
|
+
|
|
526
|
+
Args:
|
|
527
|
+
extra_headers: Send extra headers
|
|
528
|
+
|
|
529
|
+
extra_query: Add additional query parameters to the request
|
|
530
|
+
|
|
531
|
+
extra_body: Add additional JSON properties to the request
|
|
532
|
+
|
|
533
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
534
|
+
"""
|
|
535
|
+
if not id:
|
|
536
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
537
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
538
|
+
return await self._get(
|
|
539
|
+
f"/actions/v1/executions/{id}",
|
|
540
|
+
options=make_request_options(
|
|
541
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
542
|
+
),
|
|
543
|
+
cast_to=NoneType,
|
|
544
|
+
)
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
class V1ResourceWithRawResponse:
|
|
548
|
+
def __init__(self, v1: V1Resource) -> None:
|
|
549
|
+
self._v1 = v1
|
|
550
|
+
|
|
551
|
+
self.create = to_raw_response_wrapper(
|
|
552
|
+
v1.create,
|
|
553
|
+
)
|
|
554
|
+
self.retrieve = to_raw_response_wrapper(
|
|
555
|
+
v1.retrieve,
|
|
556
|
+
)
|
|
557
|
+
self.list = to_raw_response_wrapper(
|
|
558
|
+
v1.list,
|
|
559
|
+
)
|
|
560
|
+
self.delete = to_raw_response_wrapper(
|
|
561
|
+
v1.delete,
|
|
562
|
+
)
|
|
563
|
+
self.execute = to_raw_response_wrapper(
|
|
564
|
+
v1.execute,
|
|
565
|
+
)
|
|
566
|
+
self.retrieve_execution = to_raw_response_wrapper(
|
|
567
|
+
v1.retrieve_execution,
|
|
568
|
+
)
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
class AsyncV1ResourceWithRawResponse:
|
|
572
|
+
def __init__(self, v1: AsyncV1Resource) -> None:
|
|
573
|
+
self._v1 = v1
|
|
574
|
+
|
|
575
|
+
self.create = async_to_raw_response_wrapper(
|
|
576
|
+
v1.create,
|
|
577
|
+
)
|
|
578
|
+
self.retrieve = async_to_raw_response_wrapper(
|
|
579
|
+
v1.retrieve,
|
|
580
|
+
)
|
|
581
|
+
self.list = async_to_raw_response_wrapper(
|
|
582
|
+
v1.list,
|
|
583
|
+
)
|
|
584
|
+
self.delete = async_to_raw_response_wrapper(
|
|
585
|
+
v1.delete,
|
|
586
|
+
)
|
|
587
|
+
self.execute = async_to_raw_response_wrapper(
|
|
588
|
+
v1.execute,
|
|
589
|
+
)
|
|
590
|
+
self.retrieve_execution = async_to_raw_response_wrapper(
|
|
591
|
+
v1.retrieve_execution,
|
|
592
|
+
)
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
class V1ResourceWithStreamingResponse:
|
|
596
|
+
def __init__(self, v1: V1Resource) -> None:
|
|
597
|
+
self._v1 = v1
|
|
598
|
+
|
|
599
|
+
self.create = to_streamed_response_wrapper(
|
|
600
|
+
v1.create,
|
|
601
|
+
)
|
|
602
|
+
self.retrieve = to_streamed_response_wrapper(
|
|
603
|
+
v1.retrieve,
|
|
604
|
+
)
|
|
605
|
+
self.list = to_streamed_response_wrapper(
|
|
606
|
+
v1.list,
|
|
607
|
+
)
|
|
608
|
+
self.delete = to_streamed_response_wrapper(
|
|
609
|
+
v1.delete,
|
|
610
|
+
)
|
|
611
|
+
self.execute = to_streamed_response_wrapper(
|
|
612
|
+
v1.execute,
|
|
613
|
+
)
|
|
614
|
+
self.retrieve_execution = to_streamed_response_wrapper(
|
|
615
|
+
v1.retrieve_execution,
|
|
616
|
+
)
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
class AsyncV1ResourceWithStreamingResponse:
|
|
620
|
+
def __init__(self, v1: AsyncV1Resource) -> None:
|
|
621
|
+
self._v1 = v1
|
|
622
|
+
|
|
623
|
+
self.create = async_to_streamed_response_wrapper(
|
|
624
|
+
v1.create,
|
|
625
|
+
)
|
|
626
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
|
627
|
+
v1.retrieve,
|
|
628
|
+
)
|
|
629
|
+
self.list = async_to_streamed_response_wrapper(
|
|
630
|
+
v1.list,
|
|
631
|
+
)
|
|
632
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
633
|
+
v1.delete,
|
|
634
|
+
)
|
|
635
|
+
self.execute = async_to_streamed_response_wrapper(
|
|
636
|
+
v1.execute,
|
|
637
|
+
)
|
|
638
|
+
self.retrieve_execution = async_to_streamed_response_wrapper(
|
|
639
|
+
v1.retrieve_execution,
|
|
640
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .v1 import (
|
|
4
|
+
V1Resource,
|
|
5
|
+
AsyncV1Resource,
|
|
6
|
+
V1ResourceWithRawResponse,
|
|
7
|
+
AsyncV1ResourceWithRawResponse,
|
|
8
|
+
V1ResourceWithStreamingResponse,
|
|
9
|
+
AsyncV1ResourceWithStreamingResponse,
|
|
10
|
+
)
|
|
11
|
+
from .compute import (
|
|
12
|
+
ComputeResource,
|
|
13
|
+
AsyncComputeResource,
|
|
14
|
+
ComputeResourceWithRawResponse,
|
|
15
|
+
AsyncComputeResourceWithRawResponse,
|
|
16
|
+
ComputeResourceWithStreamingResponse,
|
|
17
|
+
AsyncComputeResourceWithStreamingResponse,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"V1Resource",
|
|
22
|
+
"AsyncV1Resource",
|
|
23
|
+
"V1ResourceWithRawResponse",
|
|
24
|
+
"AsyncV1ResourceWithRawResponse",
|
|
25
|
+
"V1ResourceWithStreamingResponse",
|
|
26
|
+
"AsyncV1ResourceWithStreamingResponse",
|
|
27
|
+
"ComputeResource",
|
|
28
|
+
"AsyncComputeResource",
|
|
29
|
+
"ComputeResourceWithRawResponse",
|
|
30
|
+
"AsyncComputeResourceWithRawResponse",
|
|
31
|
+
"ComputeResourceWithStreamingResponse",
|
|
32
|
+
"AsyncComputeResourceWithStreamingResponse",
|
|
33
|
+
]
|