casedev 0.3.0__py3-none-any.whl → 0.4.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/_client.py +275 -1
- casedev/_version.py +1 -1
- casedev/resources/__init__.py +98 -0
- casedev/resources/applications/__init__.py +33 -0
- casedev/resources/applications/applications.py +102 -0
- casedev/resources/applications/v1/__init__.py +61 -0
- casedev/resources/applications/v1/deployments.py +867 -0
- casedev/resources/applications/v1/projects.py +1377 -0
- casedev/resources/applications/v1/v1.py +166 -0
- casedev/resources/applications/v1/workflows.py +182 -0
- casedev/resources/compute/v1/__init__.py +28 -0
- casedev/resources/compute/v1/instance_types.py +145 -0
- casedev/resources/compute/v1/instances.py +448 -0
- casedev/resources/compute/v1/v1.py +64 -0
- casedev/resources/database/__init__.py +33 -0
- casedev/resources/database/database.py +102 -0
- casedev/resources/database/v1/__init__.py +33 -0
- casedev/resources/database/v1/projects.py +771 -0
- casedev/resources/database/v1/v1.py +175 -0
- casedev/resources/legal/__init__.py +33 -0
- casedev/resources/legal/legal.py +102 -0
- casedev/resources/legal/v1.py +924 -0
- casedev/resources/memory/__init__.py +33 -0
- casedev/resources/memory/memory.py +102 -0
- casedev/resources/memory/v1.py +1100 -0
- casedev/resources/privilege/__init__.py +33 -0
- casedev/resources/privilege/privilege.py +102 -0
- casedev/resources/privilege/v1.py +260 -0
- casedev/resources/superdoc/__init__.py +33 -0
- casedev/resources/superdoc/superdoc.py +102 -0
- casedev/resources/superdoc/v1.py +349 -0
- casedev/resources/translate/__init__.py +33 -0
- casedev/resources/translate/translate.py +102 -0
- casedev/resources/translate/v1.py +418 -0
- casedev/resources/vault/__init__.py +14 -0
- casedev/resources/vault/graphrag.py +91 -0
- casedev/resources/vault/multipart.py +549 -0
- casedev/resources/vault/objects.py +475 -5
- casedev/resources/vault/vault.py +262 -5
- casedev/types/__init__.py +4 -0
- casedev/types/applications/v1/__init__.py +20 -0
- casedev/types/applications/v1/deployment_cancel_params.py +14 -0
- casedev/types/applications/v1/deployment_create_params.py +20 -0
- casedev/types/applications/v1/deployment_get_logs_params.py +14 -0
- casedev/types/applications/v1/deployment_list_params.py +23 -0
- casedev/types/applications/v1/deployment_retrieve_params.py +17 -0
- casedev/types/applications/v1/deployment_stream_params.py +17 -0
- casedev/types/applications/v1/project_create_deployment_params.py +29 -0
- casedev/types/applications/v1/project_create_domain_params.py +17 -0
- casedev/types/applications/v1/project_create_env_params.py +27 -0
- casedev/types/applications/v1/project_create_params.py +53 -0
- casedev/types/applications/v1/project_delete_params.py +14 -0
- casedev/types/applications/v1/project_get_runtime_logs_params.py +12 -0
- casedev/types/applications/v1/project_list_deployments_params.py +18 -0
- casedev/types/applications/v1/project_list_env_params.py +12 -0
- casedev/types/applications/v1/project_list_response.py +45 -0
- casedev/types/applications/v1/workflow_get_status_params.py +14 -0
- casedev/types/compute/v1/__init__.py +6 -0
- casedev/types/compute/v1/instance_create_params.py +28 -0
- casedev/types/compute/v1/instance_create_response.py +35 -0
- casedev/types/compute/v1/instance_delete_response.py +23 -0
- casedev/types/compute/v1/instance_list_response.py +45 -0
- casedev/types/compute/v1/instance_retrieve_response.py +55 -0
- casedev/types/compute/v1/instance_type_list_response.py +46 -0
- casedev/types/database/__init__.py +5 -0
- casedev/types/database/v1/__init__.py +14 -0
- casedev/types/database/v1/project_create_branch_params.py +17 -0
- casedev/types/database/v1/project_create_branch_response.py +30 -0
- casedev/types/database/v1/project_create_params.py +27 -0
- casedev/types/database/v1/project_create_response.py +47 -0
- casedev/types/database/v1/project_delete_response.py +13 -0
- casedev/types/database/v1/project_get_connection_params.py +15 -0
- casedev/types/database/v1/project_get_connection_response.py +18 -0
- casedev/types/database/v1/project_list_branches_response.py +37 -0
- casedev/types/database/v1/project_list_response.py +64 -0
- casedev/types/database/v1/project_retrieve_response.py +100 -0
- casedev/types/database/v1_get_usage_response.py +116 -0
- casedev/types/legal/__init__.py +20 -0
- casedev/types/legal/v1_find_params.py +23 -0
- casedev/types/legal/v1_find_response.py +37 -0
- casedev/types/legal/v1_get_citations_from_url_params.py +12 -0
- casedev/types/legal/v1_get_citations_from_url_response.py +69 -0
- casedev/types/legal/v1_get_citations_params.py +16 -0
- casedev/types/legal/v1_get_citations_response.py +60 -0
- casedev/types/legal/v1_get_full_text_params.py +23 -0
- casedev/types/legal/v1_get_full_text_response.py +35 -0
- casedev/types/legal/v1_list_jurisdictions_params.py +12 -0
- casedev/types/legal/v1_list_jurisdictions_response.py +35 -0
- casedev/types/legal/v1_research_params.py +27 -0
- casedev/types/legal/v1_research_response.py +51 -0
- casedev/types/legal/v1_similar_params.py +25 -0
- casedev/types/legal/v1_similar_response.py +42 -0
- casedev/types/legal/v1_verify_params.py +16 -0
- casedev/types/legal/v1_verify_response.py +92 -0
- casedev/types/memory/__init__.py +14 -0
- casedev/types/memory/v1_create_params.py +69 -0
- casedev/types/memory/v1_create_response.py +23 -0
- casedev/types/memory/v1_delete_all_params.py +45 -0
- casedev/types/memory/v1_delete_all_response.py +12 -0
- casedev/types/memory/v1_delete_response.py +13 -0
- casedev/types/memory/v1_list_params.py +54 -0
- casedev/types/memory/v1_list_response.py +29 -0
- casedev/types/memory/v1_retrieve_response.py +23 -0
- casedev/types/memory/v1_search_params.py +54 -0
- casedev/types/memory/v1_search_response.py +61 -0
- casedev/types/privilege/__init__.py +6 -0
- casedev/types/privilege/v1_detect_params.py +34 -0
- casedev/types/privilege/v1_detect_response.py +41 -0
- casedev/types/superdoc/__init__.py +6 -0
- casedev/types/superdoc/v1_annotate_params.py +56 -0
- casedev/types/superdoc/v1_convert_params.py +23 -0
- casedev/types/translate/__init__.py +10 -0
- casedev/types/translate/v1_detect_params.py +18 -0
- casedev/types/translate/v1_detect_response.py +28 -0
- casedev/types/translate/v1_list_languages_params.py +18 -0
- casedev/types/translate/v1_list_languages_response.py +23 -0
- casedev/types/translate/v1_translate_params.py +30 -0
- casedev/types/translate/v1_translate_response.py +28 -0
- casedev/types/vault/__init__.py +14 -0
- casedev/types/vault/graphrag_process_object_response.py +45 -0
- casedev/types/vault/multipart_abort_params.py +15 -0
- casedev/types/vault/multipart_complete_params.py +26 -0
- casedev/types/vault/multipart_get_part_urls_params.py +24 -0
- casedev/types/vault/multipart_get_part_urls_response.py +19 -0
- casedev/types/vault/multipart_init_params.py +32 -0
- casedev/types/vault/multipart_init_response.py +23 -0
- casedev/types/vault/object_create_presigned_url_params.py +1 -1
- casedev/types/vault/object_delete_params.py +17 -0
- casedev/types/vault/object_delete_response.py +29 -0
- casedev/types/vault/object_get_ocr_words_params.py +28 -0
- casedev/types/vault/object_get_ocr_words_response.py +48 -0
- casedev/types/vault/object_get_summarize_job_response.py +40 -0
- casedev/types/vault/object_update_params.py +24 -0
- casedev/types/vault/object_update_response.py +39 -0
- casedev/types/vault_delete_params.py +17 -0
- casedev/types/vault_delete_response.py +30 -0
- casedev/types/vault_update_params.py +21 -0
- casedev/types/vault_update_response.py +60 -0
- casedev/types/vault_upload_params.py +1 -1
- {casedev-0.3.0.dist-info → casedev-0.4.0.dist-info}/METADATA +1 -1
- casedev-0.4.0.dist-info/RECORD +275 -0
- casedev-0.3.0.dist-info/RECORD +0 -150
- /casedev/types/{webhooks → applications}/__init__.py +0 -0
- {casedev-0.3.0.dist-info → casedev-0.4.0.dist-info}/WHEEL +0 -0
- {casedev-0.3.0.dist-info → casedev-0.4.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,549 @@
|
|
|
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 Iterable
|
|
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 ...types.vault import (
|
|
20
|
+
multipart_init_params,
|
|
21
|
+
multipart_abort_params,
|
|
22
|
+
multipart_complete_params,
|
|
23
|
+
multipart_get_part_urls_params,
|
|
24
|
+
)
|
|
25
|
+
from ..._base_client import make_request_options
|
|
26
|
+
from ...types.vault.multipart_init_response import MultipartInitResponse
|
|
27
|
+
from ...types.vault.multipart_get_part_urls_response import MultipartGetPartURLsResponse
|
|
28
|
+
|
|
29
|
+
__all__ = ["MultipartResource", "AsyncMultipartResource"]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class MultipartResource(SyncAPIResource):
|
|
33
|
+
@cached_property
|
|
34
|
+
def with_raw_response(self) -> MultipartResourceWithRawResponse:
|
|
35
|
+
"""
|
|
36
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
37
|
+
the raw response object instead of the parsed content.
|
|
38
|
+
|
|
39
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
|
|
40
|
+
"""
|
|
41
|
+
return MultipartResourceWithRawResponse(self)
|
|
42
|
+
|
|
43
|
+
@cached_property
|
|
44
|
+
def with_streaming_response(self) -> MultipartResourceWithStreamingResponse:
|
|
45
|
+
"""
|
|
46
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
47
|
+
|
|
48
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
|
|
49
|
+
"""
|
|
50
|
+
return MultipartResourceWithStreamingResponse(self)
|
|
51
|
+
|
|
52
|
+
def abort(
|
|
53
|
+
self,
|
|
54
|
+
id: str,
|
|
55
|
+
*,
|
|
56
|
+
object_id: str,
|
|
57
|
+
upload_id: str,
|
|
58
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
59
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
60
|
+
extra_headers: Headers | None = None,
|
|
61
|
+
extra_query: Query | None = None,
|
|
62
|
+
extra_body: Body | None = None,
|
|
63
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
64
|
+
) -> None:
|
|
65
|
+
"""
|
|
66
|
+
Abort a multipart upload and discard uploaded parts.
|
|
67
|
+
|
|
68
|
+
Args:
|
|
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
|
+
if not id:
|
|
78
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
79
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
80
|
+
return self._post(
|
|
81
|
+
f"/vault/{id}/multipart/abort",
|
|
82
|
+
body=maybe_transform(
|
|
83
|
+
{
|
|
84
|
+
"object_id": object_id,
|
|
85
|
+
"upload_id": upload_id,
|
|
86
|
+
},
|
|
87
|
+
multipart_abort_params.MultipartAbortParams,
|
|
88
|
+
),
|
|
89
|
+
options=make_request_options(
|
|
90
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
91
|
+
),
|
|
92
|
+
cast_to=NoneType,
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
def complete(
|
|
96
|
+
self,
|
|
97
|
+
id: str,
|
|
98
|
+
*,
|
|
99
|
+
object_id: str,
|
|
100
|
+
parts: Iterable[multipart_complete_params.Part],
|
|
101
|
+
size_bytes: int,
|
|
102
|
+
upload_id: str,
|
|
103
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
104
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
105
|
+
extra_headers: Headers | None = None,
|
|
106
|
+
extra_query: Query | None = None,
|
|
107
|
+
extra_body: Body | None = None,
|
|
108
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
109
|
+
) -> None:
|
|
110
|
+
"""
|
|
111
|
+
Complete a multipart upload by providing the list of part numbers and ETags.
|
|
112
|
+
|
|
113
|
+
Args:
|
|
114
|
+
extra_headers: Send extra headers
|
|
115
|
+
|
|
116
|
+
extra_query: Add additional query parameters to the request
|
|
117
|
+
|
|
118
|
+
extra_body: Add additional JSON properties to the request
|
|
119
|
+
|
|
120
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
121
|
+
"""
|
|
122
|
+
if not id:
|
|
123
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
124
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
125
|
+
return self._post(
|
|
126
|
+
f"/vault/{id}/multipart/complete",
|
|
127
|
+
body=maybe_transform(
|
|
128
|
+
{
|
|
129
|
+
"object_id": object_id,
|
|
130
|
+
"parts": parts,
|
|
131
|
+
"size_bytes": size_bytes,
|
|
132
|
+
"upload_id": upload_id,
|
|
133
|
+
},
|
|
134
|
+
multipart_complete_params.MultipartCompleteParams,
|
|
135
|
+
),
|
|
136
|
+
options=make_request_options(
|
|
137
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
138
|
+
),
|
|
139
|
+
cast_to=NoneType,
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
def get_part_urls(
|
|
143
|
+
self,
|
|
144
|
+
id: str,
|
|
145
|
+
*,
|
|
146
|
+
object_id: str,
|
|
147
|
+
parts: Iterable[multipart_get_part_urls_params.Part],
|
|
148
|
+
upload_id: str,
|
|
149
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
150
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
151
|
+
extra_headers: Headers | None = None,
|
|
152
|
+
extra_query: Query | None = None,
|
|
153
|
+
extra_body: Body | None = None,
|
|
154
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
155
|
+
) -> MultipartGetPartURLsResponse:
|
|
156
|
+
"""
|
|
157
|
+
Generate presigned URLs for individual multipart upload parts.
|
|
158
|
+
|
|
159
|
+
Args:
|
|
160
|
+
extra_headers: Send extra headers
|
|
161
|
+
|
|
162
|
+
extra_query: Add additional query parameters to the request
|
|
163
|
+
|
|
164
|
+
extra_body: Add additional JSON properties to the request
|
|
165
|
+
|
|
166
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
167
|
+
"""
|
|
168
|
+
if not id:
|
|
169
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
170
|
+
return self._post(
|
|
171
|
+
f"/vault/{id}/multipart/part-urls",
|
|
172
|
+
body=maybe_transform(
|
|
173
|
+
{
|
|
174
|
+
"object_id": object_id,
|
|
175
|
+
"parts": parts,
|
|
176
|
+
"upload_id": upload_id,
|
|
177
|
+
},
|
|
178
|
+
multipart_get_part_urls_params.MultipartGetPartURLsParams,
|
|
179
|
+
),
|
|
180
|
+
options=make_request_options(
|
|
181
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
182
|
+
),
|
|
183
|
+
cast_to=MultipartGetPartURLsResponse,
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
def init(
|
|
187
|
+
self,
|
|
188
|
+
id: str,
|
|
189
|
+
*,
|
|
190
|
+
content_type: str,
|
|
191
|
+
filename: str,
|
|
192
|
+
size_bytes: int,
|
|
193
|
+
auto_index: bool | Omit = omit,
|
|
194
|
+
metadata: object | Omit = omit,
|
|
195
|
+
part_size_bytes: int | Omit = omit,
|
|
196
|
+
path: str | Omit = omit,
|
|
197
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
198
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
199
|
+
extra_headers: Headers | None = None,
|
|
200
|
+
extra_query: Query | None = None,
|
|
201
|
+
extra_body: Body | None = None,
|
|
202
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
203
|
+
) -> MultipartInitResponse:
|
|
204
|
+
"""Initiate a multipart upload for large files (>5GB).
|
|
205
|
+
|
|
206
|
+
Returns an uploadId and
|
|
207
|
+
object metadata. Use part URLs endpoint to upload parts and complete endpoint to
|
|
208
|
+
finalize.
|
|
209
|
+
|
|
210
|
+
Args:
|
|
211
|
+
content_type: MIME type of the file
|
|
212
|
+
|
|
213
|
+
filename: Name of the file to upload
|
|
214
|
+
|
|
215
|
+
size_bytes: File size in bytes (required, max 8GB).
|
|
216
|
+
|
|
217
|
+
auto_index: Whether to automatically process and index the file for search
|
|
218
|
+
|
|
219
|
+
metadata: Additional metadata to associate with the file
|
|
220
|
+
|
|
221
|
+
part_size_bytes: Multipart part size in bytes (min 5MB). Defaults to 64MB.
|
|
222
|
+
|
|
223
|
+
path: Optional folder path for hierarchy preservation
|
|
224
|
+
|
|
225
|
+
extra_headers: Send extra headers
|
|
226
|
+
|
|
227
|
+
extra_query: Add additional query parameters to the request
|
|
228
|
+
|
|
229
|
+
extra_body: Add additional JSON properties to the request
|
|
230
|
+
|
|
231
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
232
|
+
"""
|
|
233
|
+
if not id:
|
|
234
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
235
|
+
return self._post(
|
|
236
|
+
f"/vault/{id}/multipart/init",
|
|
237
|
+
body=maybe_transform(
|
|
238
|
+
{
|
|
239
|
+
"content_type": content_type,
|
|
240
|
+
"filename": filename,
|
|
241
|
+
"size_bytes": size_bytes,
|
|
242
|
+
"auto_index": auto_index,
|
|
243
|
+
"metadata": metadata,
|
|
244
|
+
"part_size_bytes": part_size_bytes,
|
|
245
|
+
"path": path,
|
|
246
|
+
},
|
|
247
|
+
multipart_init_params.MultipartInitParams,
|
|
248
|
+
),
|
|
249
|
+
options=make_request_options(
|
|
250
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
251
|
+
),
|
|
252
|
+
cast_to=MultipartInitResponse,
|
|
253
|
+
)
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
class AsyncMultipartResource(AsyncAPIResource):
|
|
257
|
+
@cached_property
|
|
258
|
+
def with_raw_response(self) -> AsyncMultipartResourceWithRawResponse:
|
|
259
|
+
"""
|
|
260
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
261
|
+
the raw response object instead of the parsed content.
|
|
262
|
+
|
|
263
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
|
|
264
|
+
"""
|
|
265
|
+
return AsyncMultipartResourceWithRawResponse(self)
|
|
266
|
+
|
|
267
|
+
@cached_property
|
|
268
|
+
def with_streaming_response(self) -> AsyncMultipartResourceWithStreamingResponse:
|
|
269
|
+
"""
|
|
270
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
271
|
+
|
|
272
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
|
|
273
|
+
"""
|
|
274
|
+
return AsyncMultipartResourceWithStreamingResponse(self)
|
|
275
|
+
|
|
276
|
+
async def abort(
|
|
277
|
+
self,
|
|
278
|
+
id: str,
|
|
279
|
+
*,
|
|
280
|
+
object_id: str,
|
|
281
|
+
upload_id: str,
|
|
282
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
283
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
284
|
+
extra_headers: Headers | None = None,
|
|
285
|
+
extra_query: Query | None = None,
|
|
286
|
+
extra_body: Body | None = None,
|
|
287
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
288
|
+
) -> None:
|
|
289
|
+
"""
|
|
290
|
+
Abort a multipart upload and discard uploaded parts.
|
|
291
|
+
|
|
292
|
+
Args:
|
|
293
|
+
extra_headers: Send extra headers
|
|
294
|
+
|
|
295
|
+
extra_query: Add additional query parameters to the request
|
|
296
|
+
|
|
297
|
+
extra_body: Add additional JSON properties to the request
|
|
298
|
+
|
|
299
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
300
|
+
"""
|
|
301
|
+
if not id:
|
|
302
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
303
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
304
|
+
return await self._post(
|
|
305
|
+
f"/vault/{id}/multipart/abort",
|
|
306
|
+
body=await async_maybe_transform(
|
|
307
|
+
{
|
|
308
|
+
"object_id": object_id,
|
|
309
|
+
"upload_id": upload_id,
|
|
310
|
+
},
|
|
311
|
+
multipart_abort_params.MultipartAbortParams,
|
|
312
|
+
),
|
|
313
|
+
options=make_request_options(
|
|
314
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
315
|
+
),
|
|
316
|
+
cast_to=NoneType,
|
|
317
|
+
)
|
|
318
|
+
|
|
319
|
+
async def complete(
|
|
320
|
+
self,
|
|
321
|
+
id: str,
|
|
322
|
+
*,
|
|
323
|
+
object_id: str,
|
|
324
|
+
parts: Iterable[multipart_complete_params.Part],
|
|
325
|
+
size_bytes: int,
|
|
326
|
+
upload_id: str,
|
|
327
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
328
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
329
|
+
extra_headers: Headers | None = None,
|
|
330
|
+
extra_query: Query | None = None,
|
|
331
|
+
extra_body: Body | None = None,
|
|
332
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
333
|
+
) -> None:
|
|
334
|
+
"""
|
|
335
|
+
Complete a multipart upload by providing the list of part numbers and ETags.
|
|
336
|
+
|
|
337
|
+
Args:
|
|
338
|
+
extra_headers: Send extra headers
|
|
339
|
+
|
|
340
|
+
extra_query: Add additional query parameters to the request
|
|
341
|
+
|
|
342
|
+
extra_body: Add additional JSON properties to the request
|
|
343
|
+
|
|
344
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
345
|
+
"""
|
|
346
|
+
if not id:
|
|
347
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
348
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
349
|
+
return await self._post(
|
|
350
|
+
f"/vault/{id}/multipart/complete",
|
|
351
|
+
body=await async_maybe_transform(
|
|
352
|
+
{
|
|
353
|
+
"object_id": object_id,
|
|
354
|
+
"parts": parts,
|
|
355
|
+
"size_bytes": size_bytes,
|
|
356
|
+
"upload_id": upload_id,
|
|
357
|
+
},
|
|
358
|
+
multipart_complete_params.MultipartCompleteParams,
|
|
359
|
+
),
|
|
360
|
+
options=make_request_options(
|
|
361
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
362
|
+
),
|
|
363
|
+
cast_to=NoneType,
|
|
364
|
+
)
|
|
365
|
+
|
|
366
|
+
async def get_part_urls(
|
|
367
|
+
self,
|
|
368
|
+
id: str,
|
|
369
|
+
*,
|
|
370
|
+
object_id: str,
|
|
371
|
+
parts: Iterable[multipart_get_part_urls_params.Part],
|
|
372
|
+
upload_id: str,
|
|
373
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
374
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
375
|
+
extra_headers: Headers | None = None,
|
|
376
|
+
extra_query: Query | None = None,
|
|
377
|
+
extra_body: Body | None = None,
|
|
378
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
379
|
+
) -> MultipartGetPartURLsResponse:
|
|
380
|
+
"""
|
|
381
|
+
Generate presigned URLs for individual multipart upload parts.
|
|
382
|
+
|
|
383
|
+
Args:
|
|
384
|
+
extra_headers: Send extra headers
|
|
385
|
+
|
|
386
|
+
extra_query: Add additional query parameters to the request
|
|
387
|
+
|
|
388
|
+
extra_body: Add additional JSON properties to the request
|
|
389
|
+
|
|
390
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
391
|
+
"""
|
|
392
|
+
if not id:
|
|
393
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
394
|
+
return await self._post(
|
|
395
|
+
f"/vault/{id}/multipart/part-urls",
|
|
396
|
+
body=await async_maybe_transform(
|
|
397
|
+
{
|
|
398
|
+
"object_id": object_id,
|
|
399
|
+
"parts": parts,
|
|
400
|
+
"upload_id": upload_id,
|
|
401
|
+
},
|
|
402
|
+
multipart_get_part_urls_params.MultipartGetPartURLsParams,
|
|
403
|
+
),
|
|
404
|
+
options=make_request_options(
|
|
405
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
406
|
+
),
|
|
407
|
+
cast_to=MultipartGetPartURLsResponse,
|
|
408
|
+
)
|
|
409
|
+
|
|
410
|
+
async def init(
|
|
411
|
+
self,
|
|
412
|
+
id: str,
|
|
413
|
+
*,
|
|
414
|
+
content_type: str,
|
|
415
|
+
filename: str,
|
|
416
|
+
size_bytes: int,
|
|
417
|
+
auto_index: bool | Omit = omit,
|
|
418
|
+
metadata: object | Omit = omit,
|
|
419
|
+
part_size_bytes: int | Omit = omit,
|
|
420
|
+
path: str | Omit = omit,
|
|
421
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
422
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
423
|
+
extra_headers: Headers | None = None,
|
|
424
|
+
extra_query: Query | None = None,
|
|
425
|
+
extra_body: Body | None = None,
|
|
426
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
427
|
+
) -> MultipartInitResponse:
|
|
428
|
+
"""Initiate a multipart upload for large files (>5GB).
|
|
429
|
+
|
|
430
|
+
Returns an uploadId and
|
|
431
|
+
object metadata. Use part URLs endpoint to upload parts and complete endpoint to
|
|
432
|
+
finalize.
|
|
433
|
+
|
|
434
|
+
Args:
|
|
435
|
+
content_type: MIME type of the file
|
|
436
|
+
|
|
437
|
+
filename: Name of the file to upload
|
|
438
|
+
|
|
439
|
+
size_bytes: File size in bytes (required, max 8GB).
|
|
440
|
+
|
|
441
|
+
auto_index: Whether to automatically process and index the file for search
|
|
442
|
+
|
|
443
|
+
metadata: Additional metadata to associate with the file
|
|
444
|
+
|
|
445
|
+
part_size_bytes: Multipart part size in bytes (min 5MB). Defaults to 64MB.
|
|
446
|
+
|
|
447
|
+
path: Optional folder path for hierarchy preservation
|
|
448
|
+
|
|
449
|
+
extra_headers: Send extra headers
|
|
450
|
+
|
|
451
|
+
extra_query: Add additional query parameters to the request
|
|
452
|
+
|
|
453
|
+
extra_body: Add additional JSON properties to the request
|
|
454
|
+
|
|
455
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
456
|
+
"""
|
|
457
|
+
if not id:
|
|
458
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
459
|
+
return await self._post(
|
|
460
|
+
f"/vault/{id}/multipart/init",
|
|
461
|
+
body=await async_maybe_transform(
|
|
462
|
+
{
|
|
463
|
+
"content_type": content_type,
|
|
464
|
+
"filename": filename,
|
|
465
|
+
"size_bytes": size_bytes,
|
|
466
|
+
"auto_index": auto_index,
|
|
467
|
+
"metadata": metadata,
|
|
468
|
+
"part_size_bytes": part_size_bytes,
|
|
469
|
+
"path": path,
|
|
470
|
+
},
|
|
471
|
+
multipart_init_params.MultipartInitParams,
|
|
472
|
+
),
|
|
473
|
+
options=make_request_options(
|
|
474
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
475
|
+
),
|
|
476
|
+
cast_to=MultipartInitResponse,
|
|
477
|
+
)
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
class MultipartResourceWithRawResponse:
|
|
481
|
+
def __init__(self, multipart: MultipartResource) -> None:
|
|
482
|
+
self._multipart = multipart
|
|
483
|
+
|
|
484
|
+
self.abort = to_raw_response_wrapper(
|
|
485
|
+
multipart.abort,
|
|
486
|
+
)
|
|
487
|
+
self.complete = to_raw_response_wrapper(
|
|
488
|
+
multipart.complete,
|
|
489
|
+
)
|
|
490
|
+
self.get_part_urls = to_raw_response_wrapper(
|
|
491
|
+
multipart.get_part_urls,
|
|
492
|
+
)
|
|
493
|
+
self.init = to_raw_response_wrapper(
|
|
494
|
+
multipart.init,
|
|
495
|
+
)
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
class AsyncMultipartResourceWithRawResponse:
|
|
499
|
+
def __init__(self, multipart: AsyncMultipartResource) -> None:
|
|
500
|
+
self._multipart = multipart
|
|
501
|
+
|
|
502
|
+
self.abort = async_to_raw_response_wrapper(
|
|
503
|
+
multipart.abort,
|
|
504
|
+
)
|
|
505
|
+
self.complete = async_to_raw_response_wrapper(
|
|
506
|
+
multipart.complete,
|
|
507
|
+
)
|
|
508
|
+
self.get_part_urls = async_to_raw_response_wrapper(
|
|
509
|
+
multipart.get_part_urls,
|
|
510
|
+
)
|
|
511
|
+
self.init = async_to_raw_response_wrapper(
|
|
512
|
+
multipart.init,
|
|
513
|
+
)
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
class MultipartResourceWithStreamingResponse:
|
|
517
|
+
def __init__(self, multipart: MultipartResource) -> None:
|
|
518
|
+
self._multipart = multipart
|
|
519
|
+
|
|
520
|
+
self.abort = to_streamed_response_wrapper(
|
|
521
|
+
multipart.abort,
|
|
522
|
+
)
|
|
523
|
+
self.complete = to_streamed_response_wrapper(
|
|
524
|
+
multipart.complete,
|
|
525
|
+
)
|
|
526
|
+
self.get_part_urls = to_streamed_response_wrapper(
|
|
527
|
+
multipart.get_part_urls,
|
|
528
|
+
)
|
|
529
|
+
self.init = to_streamed_response_wrapper(
|
|
530
|
+
multipart.init,
|
|
531
|
+
)
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
class AsyncMultipartResourceWithStreamingResponse:
|
|
535
|
+
def __init__(self, multipart: AsyncMultipartResource) -> None:
|
|
536
|
+
self._multipart = multipart
|
|
537
|
+
|
|
538
|
+
self.abort = async_to_streamed_response_wrapper(
|
|
539
|
+
multipart.abort,
|
|
540
|
+
)
|
|
541
|
+
self.complete = async_to_streamed_response_wrapper(
|
|
542
|
+
multipart.complete,
|
|
543
|
+
)
|
|
544
|
+
self.get_part_urls = async_to_streamed_response_wrapper(
|
|
545
|
+
multipart.get_part_urls,
|
|
546
|
+
)
|
|
547
|
+
self.init = async_to_streamed_response_wrapper(
|
|
548
|
+
multipart.init,
|
|
549
|
+
)
|