1use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum CheckS3FolderExistsError {
22 UnknownValue(serde_json::Value),
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum DatasetStorageTestConnectionError {
29 UnknownValue(serde_json::Value),
30}
31
32#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum DeleteS3FileError {
36 UnknownValue(serde_json::Value),
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum DuckdbConnectionSettingsError {
43 UnknownValue(serde_json::Value),
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum DuckdbConnectionSettingsV2Error {
50 UnknownValue(serde_json::Value),
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum FileDownloadError {
57 UnknownValue(serde_json::Value),
58}
59
60#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum FileDownloadParquetAsCsvError {
64 UnknownValue(serde_json::Value),
65}
66
67#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum FileUploadError {
71 UnknownValue(serde_json::Value),
72}
73
74#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GitRepoViewerFileUploadError {
78 UnknownValue(serde_json::Value),
79}
80
81#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum ListGitRepoFilesError {
85 UnknownValue(serde_json::Value),
86}
87
88#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum ListStoredFilesError {
92 UnknownValue(serde_json::Value),
93}
94
95#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum LoadCsvPreviewError {
99 UnknownValue(serde_json::Value),
100}
101
102#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum LoadFileMetadataError {
106 UnknownValue(serde_json::Value),
107}
108
109#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum LoadFilePreviewError {
113 UnknownValue(serde_json::Value),
114}
115
116#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum LoadGitRepoFileMetadataError {
120 UnknownValue(serde_json::Value),
121}
122
123#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum LoadGitRepoFilePreviewError {
127 UnknownValue(serde_json::Value),
128}
129
130#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum LoadParquetPreviewError {
134 UnknownValue(serde_json::Value),
135}
136
137#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum LoadTableRowCountError {
141 UnknownValue(serde_json::Value),
142}
143
144#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum MoveS3FileError {
148 UnknownValue(serde_json::Value),
149}
150
151#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum PolarsConnectionSettingsError {
155 UnknownValue(serde_json::Value),
156}
157
158#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum PolarsConnectionSettingsV2Error {
162 UnknownValue(serde_json::Value),
163}
164
165#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum S3ResourceInfoError {
169 UnknownValue(serde_json::Value),
170}
171
172
173pub async fn check_s3_folder_exists(configuration: &configuration::Configuration, workspace: &str, file_key: &str) -> Result<models::CheckS3FolderExists200Response, Error<CheckS3FolderExistsError>> {
174 let local_var_configuration = configuration;
175
176 let local_var_client = &local_var_configuration.client;
177
178 let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/check_s3_folder_exists", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
179 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
180
181 local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
182 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
183 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
184 }
185 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
186 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
187 };
188
189 let local_var_req = local_var_req_builder.build()?;
190 let local_var_resp = local_var_client.execute(local_var_req).await?;
191
192 let local_var_status = local_var_resp.status();
193 let local_var_content = local_var_resp.text().await?;
194
195 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
196 crate::from_str_patched(&local_var_content).map_err(Error::from)
197 } else {
198 let local_var_entity: Option<CheckS3FolderExistsError> = crate::from_str_patched(&local_var_content).ok();
199 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
200 Err(Error::ResponseError(local_var_error))
201 }
202}
203
204pub async fn dataset_storage_test_connection(configuration: &configuration::Configuration, workspace: &str, storage: Option<&str>) -> Result<serde_json::Value, Error<DatasetStorageTestConnectionError>> {
205 let local_var_configuration = configuration;
206
207 let local_var_client = &local_var_configuration.client;
208
209 let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/test_connection", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
210 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
211
212 if let Some(ref local_var_str) = storage {
213 local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
214 }
215 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
216 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
217 }
218 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
219 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
220 };
221
222 let local_var_req = local_var_req_builder.build()?;
223 let local_var_resp = local_var_client.execute(local_var_req).await?;
224
225 let local_var_status = local_var_resp.status();
226 let local_var_content = local_var_resp.text().await?;
227
228 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
229 crate::from_str_patched(&local_var_content).map_err(Error::from)
230 } else {
231 let local_var_entity: Option<DatasetStorageTestConnectionError> = crate::from_str_patched(&local_var_content).ok();
232 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
233 Err(Error::ResponseError(local_var_error))
234 }
235}
236
237pub async fn delete_s3_file(configuration: &configuration::Configuration, workspace: &str, file_key: &str, storage: Option<&str>) -> Result<serde_json::Value, Error<DeleteS3FileError>> {
238 let local_var_configuration = configuration;
239
240 let local_var_client = &local_var_configuration.client;
241
242 let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/delete_s3_file", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
243 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
244
245 local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
246 if let Some(ref local_var_str) = storage {
247 local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
248 }
249 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
250 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
251 }
252 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
253 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
254 };
255
256 let local_var_req = local_var_req_builder.build()?;
257 let local_var_resp = local_var_client.execute(local_var_req).await?;
258
259 let local_var_status = local_var_resp.status();
260 let local_var_content = local_var_resp.text().await?;
261
262 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
263 crate::from_str_patched(&local_var_content).map_err(Error::from)
264 } else {
265 let local_var_entity: Option<DeleteS3FileError> = crate::from_str_patched(&local_var_content).ok();
266 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
267 Err(Error::ResponseError(local_var_error))
268 }
269}
270
271pub async fn duckdb_connection_settings(configuration: &configuration::Configuration, workspace: &str, duckdb_connection_settings_request: models::DuckdbConnectionSettingsRequest) -> Result<models::DuckdbConnectionSettings200Response, Error<DuckdbConnectionSettingsError>> {
272 let local_var_configuration = configuration;
273
274 let local_var_client = &local_var_configuration.client;
275
276 let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/duckdb_connection_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
277 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
278
279 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
280 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
281 }
282 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
283 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
284 };
285 local_var_req_builder = local_var_req_builder.json(&duckdb_connection_settings_request);
286
287 let local_var_req = local_var_req_builder.build()?;
288 let local_var_resp = local_var_client.execute(local_var_req).await?;
289
290 let local_var_status = local_var_resp.status();
291 let local_var_content = local_var_resp.text().await?;
292
293 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
294 crate::from_str_patched(&local_var_content).map_err(Error::from)
295 } else {
296 let local_var_entity: Option<DuckdbConnectionSettingsError> = crate::from_str_patched(&local_var_content).ok();
297 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
298 Err(Error::ResponseError(local_var_error))
299 }
300}
301
302pub async fn duckdb_connection_settings_v2(configuration: &configuration::Configuration, workspace: &str, duckdb_connection_settings_v2_request: models::DuckdbConnectionSettingsV2Request) -> Result<models::DuckdbConnectionSettingsV2200Response, Error<DuckdbConnectionSettingsV2Error>> {
303 let local_var_configuration = configuration;
304
305 let local_var_client = &local_var_configuration.client;
306
307 let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/v2/duckdb_connection_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
308 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
309
310 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
311 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
312 }
313 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
314 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
315 };
316 local_var_req_builder = local_var_req_builder.json(&duckdb_connection_settings_v2_request);
317
318 let local_var_req = local_var_req_builder.build()?;
319 let local_var_resp = local_var_client.execute(local_var_req).await?;
320
321 let local_var_status = local_var_resp.status();
322 let local_var_content = local_var_resp.text().await?;
323
324 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
325 crate::from_str_patched(&local_var_content).map_err(Error::from)
326 } else {
327 let local_var_entity: Option<DuckdbConnectionSettingsV2Error> = crate::from_str_patched(&local_var_content).ok();
328 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
329 Err(Error::ResponseError(local_var_error))
330 }
331}
332
333pub async fn file_download(configuration: &configuration::Configuration, workspace: &str, file_key: &str, s3_resource_path: Option<&str>, resource_type: Option<&str>, storage: Option<&str>) -> Result<std::path::PathBuf, Error<FileDownloadError>> {
334 let local_var_configuration = configuration;
335
336 let local_var_client = &local_var_configuration.client;
337
338 let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/download_s3_file", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
339 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
340
341 local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
342 if let Some(ref local_var_str) = s3_resource_path {
343 local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
344 }
345 if let Some(ref local_var_str) = resource_type {
346 local_var_req_builder = local_var_req_builder.query(&[("resource_type", &local_var_str.to_string())]);
347 }
348 if let Some(ref local_var_str) = storage {
349 local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
350 }
351 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
352 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
353 }
354 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
355 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
356 };
357
358 let local_var_req = local_var_req_builder.build()?;
359 let local_var_resp = local_var_client.execute(local_var_req).await?;
360
361 let local_var_status = local_var_resp.status();
362 let local_var_content = local_var_resp.text().await?;
363
364 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
365 crate::from_str_patched(&local_var_content).map_err(Error::from)
366 } else {
367 let local_var_entity: Option<FileDownloadError> = crate::from_str_patched(&local_var_content).ok();
368 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
369 Err(Error::ResponseError(local_var_error))
370 }
371}
372
373pub async fn file_download_parquet_as_csv(configuration: &configuration::Configuration, workspace: &str, file_key: &str, s3_resource_path: Option<&str>, resource_type: Option<&str>) -> Result<String, Error<FileDownloadParquetAsCsvError>> {
374 let local_var_configuration = configuration;
375
376 let local_var_client = &local_var_configuration.client;
377
378 let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/download_s3_parquet_file_as_csv", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
379 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
380
381 local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
382 if let Some(ref local_var_str) = s3_resource_path {
383 local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
384 }
385 if let Some(ref local_var_str) = resource_type {
386 local_var_req_builder = local_var_req_builder.query(&[("resource_type", &local_var_str.to_string())]);
387 }
388 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
389 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
390 }
391 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
392 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
393 };
394
395 let local_var_req = local_var_req_builder.build()?;
396 let local_var_resp = local_var_client.execute(local_var_req).await?;
397
398 let local_var_status = local_var_resp.status();
399 let local_var_content = local_var_resp.text().await?;
400
401 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
402 crate::from_str_patched(&local_var_content).map_err(Error::from)
403 } else {
404 let local_var_entity: Option<FileDownloadParquetAsCsvError> = crate::from_str_patched(&local_var_content).ok();
405 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
406 Err(Error::ResponseError(local_var_error))
407 }
408}
409
410pub async fn file_upload(configuration: &configuration::Configuration, workspace: &str, body: std::path::PathBuf, file_key: Option<&str>, file_extension: Option<&str>, s3_resource_path: Option<&str>, resource_type: Option<&str>, storage: Option<&str>, content_type: Option<&str>, content_disposition: Option<&str>) -> Result<models::FileUpload200Response, Error<FileUploadError>> {
411 let local_var_configuration = configuration;
412
413 let local_var_client = &local_var_configuration.client;
414
415 let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/upload_s3_file", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
416 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
417
418 if let Some(ref local_var_str) = file_key {
419 local_var_req_builder = local_var_req_builder.query(&[("file_key", &local_var_str.to_string())]);
420 }
421 if let Some(ref local_var_str) = file_extension {
422 local_var_req_builder = local_var_req_builder.query(&[("file_extension", &local_var_str.to_string())]);
423 }
424 if let Some(ref local_var_str) = s3_resource_path {
425 local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
426 }
427 if let Some(ref local_var_str) = resource_type {
428 local_var_req_builder = local_var_req_builder.query(&[("resource_type", &local_var_str.to_string())]);
429 }
430 if let Some(ref local_var_str) = storage {
431 local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
432 }
433 if let Some(ref local_var_str) = content_type {
434 local_var_req_builder = local_var_req_builder.query(&[("content_type", &local_var_str.to_string())]);
435 }
436 if let Some(ref local_var_str) = content_disposition {
437 local_var_req_builder = local_var_req_builder.query(&[("content_disposition", &local_var_str.to_string())]);
438 }
439 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
440 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
441 }
442 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
443 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
444 };
445 local_var_req_builder = local_var_req_builder.json(&body);
446
447 let local_var_req = local_var_req_builder.build()?;
448 let local_var_resp = local_var_client.execute(local_var_req).await?;
449
450 let local_var_status = local_var_resp.status();
451 let local_var_content = local_var_resp.text().await?;
452
453 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
454 crate::from_str_patched(&local_var_content).map_err(Error::from)
455 } else {
456 let local_var_entity: Option<FileUploadError> = crate::from_str_patched(&local_var_content).ok();
457 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
458 Err(Error::ResponseError(local_var_error))
459 }
460}
461
462pub async fn git_repo_viewer_file_upload(configuration: &configuration::Configuration, workspace: &str, body: std::path::PathBuf, file_key: Option<&str>, file_extension: Option<&str>, s3_resource_path: Option<&str>, resource_type: Option<&str>, storage: Option<&str>, content_type: Option<&str>, content_disposition: Option<&str>) -> Result<models::FileUpload200Response, Error<GitRepoViewerFileUploadError>> {
463 let local_var_configuration = configuration;
464
465 let local_var_client = &local_var_configuration.client;
466
467 let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/upload_git_repo_file_to_instance_storage", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
468 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
469
470 if let Some(ref local_var_str) = file_key {
471 local_var_req_builder = local_var_req_builder.query(&[("file_key", &local_var_str.to_string())]);
472 }
473 if let Some(ref local_var_str) = file_extension {
474 local_var_req_builder = local_var_req_builder.query(&[("file_extension", &local_var_str.to_string())]);
475 }
476 if let Some(ref local_var_str) = s3_resource_path {
477 local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
478 }
479 if let Some(ref local_var_str) = resource_type {
480 local_var_req_builder = local_var_req_builder.query(&[("resource_type", &local_var_str.to_string())]);
481 }
482 if let Some(ref local_var_str) = storage {
483 local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
484 }
485 if let Some(ref local_var_str) = content_type {
486 local_var_req_builder = local_var_req_builder.query(&[("content_type", &local_var_str.to_string())]);
487 }
488 if let Some(ref local_var_str) = content_disposition {
489 local_var_req_builder = local_var_req_builder.query(&[("content_disposition", &local_var_str.to_string())]);
490 }
491 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
492 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
493 }
494 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
495 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
496 };
497 local_var_req_builder = local_var_req_builder.json(&body);
498
499 let local_var_req = local_var_req_builder.build()?;
500 let local_var_resp = local_var_client.execute(local_var_req).await?;
501
502 let local_var_status = local_var_resp.status();
503 let local_var_content = local_var_resp.text().await?;
504
505 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
506 crate::from_str_patched(&local_var_content).map_err(Error::from)
507 } else {
508 let local_var_entity: Option<GitRepoViewerFileUploadError> = crate::from_str_patched(&local_var_content).ok();
509 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
510 Err(Error::ResponseError(local_var_error))
511 }
512}
513
514pub async fn list_git_repo_files(configuration: &configuration::Configuration, workspace: &str, max_keys: i32, marker: Option<&str>, prefix: Option<&str>, storage: Option<&str>) -> Result<models::ListStoredFiles200Response, Error<ListGitRepoFilesError>> {
515 let local_var_configuration = configuration;
516
517 let local_var_client = &local_var_configuration.client;
518
519 let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/list_git_repo_files", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
520 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
521
522 local_var_req_builder = local_var_req_builder.query(&[("max_keys", &max_keys.to_string())]);
523 if let Some(ref local_var_str) = marker {
524 local_var_req_builder = local_var_req_builder.query(&[("marker", &local_var_str.to_string())]);
525 }
526 if let Some(ref local_var_str) = prefix {
527 local_var_req_builder = local_var_req_builder.query(&[("prefix", &local_var_str.to_string())]);
528 }
529 if let Some(ref local_var_str) = storage {
530 local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
531 }
532 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
533 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
534 }
535 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
536 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
537 };
538
539 let local_var_req = local_var_req_builder.build()?;
540 let local_var_resp = local_var_client.execute(local_var_req).await?;
541
542 let local_var_status = local_var_resp.status();
543 let local_var_content = local_var_resp.text().await?;
544
545 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
546 crate::from_str_patched(&local_var_content).map_err(Error::from)
547 } else {
548 let local_var_entity: Option<ListGitRepoFilesError> = crate::from_str_patched(&local_var_content).ok();
549 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
550 Err(Error::ResponseError(local_var_error))
551 }
552}
553
554pub async fn list_stored_files(configuration: &configuration::Configuration, workspace: &str, max_keys: i32, marker: Option<&str>, prefix: Option<&str>, storage: Option<&str>) -> Result<models::ListStoredFiles200Response, Error<ListStoredFilesError>> {
555 let local_var_configuration = configuration;
556
557 let local_var_client = &local_var_configuration.client;
558
559 let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/list_stored_files", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
560 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
561
562 local_var_req_builder = local_var_req_builder.query(&[("max_keys", &max_keys.to_string())]);
563 if let Some(ref local_var_str) = marker {
564 local_var_req_builder = local_var_req_builder.query(&[("marker", &local_var_str.to_string())]);
565 }
566 if let Some(ref local_var_str) = prefix {
567 local_var_req_builder = local_var_req_builder.query(&[("prefix", &local_var_str.to_string())]);
568 }
569 if let Some(ref local_var_str) = storage {
570 local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
571 }
572 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
573 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
574 }
575 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
576 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
577 };
578
579 let local_var_req = local_var_req_builder.build()?;
580 let local_var_resp = local_var_client.execute(local_var_req).await?;
581
582 let local_var_status = local_var_resp.status();
583 let local_var_content = local_var_resp.text().await?;
584
585 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
586 crate::from_str_patched(&local_var_content).map_err(Error::from)
587 } else {
588 let local_var_entity: Option<ListStoredFilesError> = crate::from_str_patched(&local_var_content).ok();
589 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
590 Err(Error::ResponseError(local_var_error))
591 }
592}
593
594pub async fn load_csv_preview(configuration: &configuration::Configuration, workspace: &str, path: &str, offset: Option<f64>, limit: Option<f64>, sort_col: Option<&str>, sort_desc: Option<bool>, search_col: Option<&str>, search_term: Option<&str>, storage: Option<&str>, csv_separator: Option<&str>) -> Result<(), Error<LoadCsvPreviewError>> {
595 let local_var_configuration = configuration;
596
597 let local_var_client = &local_var_configuration.client;
598
599 let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/load_csv_preview/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
600 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
601
602 if let Some(ref local_var_str) = offset {
603 local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]);
604 }
605 if let Some(ref local_var_str) = limit {
606 local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
607 }
608 if let Some(ref local_var_str) = sort_col {
609 local_var_req_builder = local_var_req_builder.query(&[("sort_col", &local_var_str.to_string())]);
610 }
611 if let Some(ref local_var_str) = sort_desc {
612 local_var_req_builder = local_var_req_builder.query(&[("sort_desc", &local_var_str.to_string())]);
613 }
614 if let Some(ref local_var_str) = search_col {
615 local_var_req_builder = local_var_req_builder.query(&[("search_col", &local_var_str.to_string())]);
616 }
617 if let Some(ref local_var_str) = search_term {
618 local_var_req_builder = local_var_req_builder.query(&[("search_term", &local_var_str.to_string())]);
619 }
620 if let Some(ref local_var_str) = storage {
621 local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
622 }
623 if let Some(ref local_var_str) = csv_separator {
624 local_var_req_builder = local_var_req_builder.query(&[("csv_separator", &local_var_str.to_string())]);
625 }
626 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
627 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
628 }
629 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
630 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
631 };
632
633 let local_var_req = local_var_req_builder.build()?;
634 let local_var_resp = local_var_client.execute(local_var_req).await?;
635
636 let local_var_status = local_var_resp.status();
637 let local_var_content = local_var_resp.text().await?;
638
639 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
640 Ok(())
641 } else {
642 let local_var_entity: Option<LoadCsvPreviewError> = crate::from_str_patched(&local_var_content).ok();
643 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
644 Err(Error::ResponseError(local_var_error))
645 }
646}
647
648pub async fn load_file_metadata(configuration: &configuration::Configuration, workspace: &str, file_key: &str, storage: Option<&str>) -> Result<models::WindmillFileMetadata, Error<LoadFileMetadataError>> {
649 let local_var_configuration = configuration;
650
651 let local_var_client = &local_var_configuration.client;
652
653 let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/load_file_metadata", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
654 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
655
656 local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
657 if let Some(ref local_var_str) = storage {
658 local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
659 }
660 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
661 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
662 }
663 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
664 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
665 };
666
667 let local_var_req = local_var_req_builder.build()?;
668 let local_var_resp = local_var_client.execute(local_var_req).await?;
669
670 let local_var_status = local_var_resp.status();
671 let local_var_content = local_var_resp.text().await?;
672
673 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
674 crate::from_str_patched(&local_var_content).map_err(Error::from)
675 } else {
676 let local_var_entity: Option<LoadFileMetadataError> = crate::from_str_patched(&local_var_content).ok();
677 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
678 Err(Error::ResponseError(local_var_error))
679 }
680}
681
682pub async fn load_file_preview(configuration: &configuration::Configuration, workspace: &str, file_key: &str, file_size_in_bytes: Option<i32>, file_mime_type: Option<&str>, csv_separator: Option<&str>, csv_has_header: Option<bool>, read_bytes_from: Option<i32>, read_bytes_length: Option<i32>, storage: Option<&str>) -> Result<models::WindmillFilePreview, Error<LoadFilePreviewError>> {
683 let local_var_configuration = configuration;
684
685 let local_var_client = &local_var_configuration.client;
686
687 let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/load_file_preview", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
688 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
689
690 local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
691 if let Some(ref local_var_str) = file_size_in_bytes {
692 local_var_req_builder = local_var_req_builder.query(&[("file_size_in_bytes", &local_var_str.to_string())]);
693 }
694 if let Some(ref local_var_str) = file_mime_type {
695 local_var_req_builder = local_var_req_builder.query(&[("file_mime_type", &local_var_str.to_string())]);
696 }
697 if let Some(ref local_var_str) = csv_separator {
698 local_var_req_builder = local_var_req_builder.query(&[("csv_separator", &local_var_str.to_string())]);
699 }
700 if let Some(ref local_var_str) = csv_has_header {
701 local_var_req_builder = local_var_req_builder.query(&[("csv_has_header", &local_var_str.to_string())]);
702 }
703 if let Some(ref local_var_str) = read_bytes_from {
704 local_var_req_builder = local_var_req_builder.query(&[("read_bytes_from", &local_var_str.to_string())]);
705 }
706 if let Some(ref local_var_str) = read_bytes_length {
707 local_var_req_builder = local_var_req_builder.query(&[("read_bytes_length", &local_var_str.to_string())]);
708 }
709 if let Some(ref local_var_str) = storage {
710 local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
711 }
712 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
713 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
714 }
715 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
716 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
717 };
718
719 let local_var_req = local_var_req_builder.build()?;
720 let local_var_resp = local_var_client.execute(local_var_req).await?;
721
722 let local_var_status = local_var_resp.status();
723 let local_var_content = local_var_resp.text().await?;
724
725 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
726 crate::from_str_patched(&local_var_content).map_err(Error::from)
727 } else {
728 let local_var_entity: Option<LoadFilePreviewError> = crate::from_str_patched(&local_var_content).ok();
729 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
730 Err(Error::ResponseError(local_var_error))
731 }
732}
733
734pub async fn load_git_repo_file_metadata(configuration: &configuration::Configuration, workspace: &str, file_key: &str, storage: Option<&str>) -> Result<models::WindmillFileMetadata, Error<LoadGitRepoFileMetadataError>> {
735 let local_var_configuration = configuration;
736
737 let local_var_client = &local_var_configuration.client;
738
739 let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/load_git_repo_file_metadata", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
740 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
741
742 local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
743 if let Some(ref local_var_str) = storage {
744 local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
745 }
746 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
747 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
748 }
749 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
750 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
751 };
752
753 let local_var_req = local_var_req_builder.build()?;
754 let local_var_resp = local_var_client.execute(local_var_req).await?;
755
756 let local_var_status = local_var_resp.status();
757 let local_var_content = local_var_resp.text().await?;
758
759 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
760 crate::from_str_patched(&local_var_content).map_err(Error::from)
761 } else {
762 let local_var_entity: Option<LoadGitRepoFileMetadataError> = crate::from_str_patched(&local_var_content).ok();
763 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
764 Err(Error::ResponseError(local_var_error))
765 }
766}
767
768pub async fn load_git_repo_file_preview(configuration: &configuration::Configuration, workspace: &str, file_key: &str, file_size_in_bytes: Option<i32>, file_mime_type: Option<&str>, csv_separator: Option<&str>, csv_has_header: Option<bool>, read_bytes_from: Option<i32>, read_bytes_length: Option<i32>, storage: Option<&str>) -> Result<models::WindmillFilePreview, Error<LoadGitRepoFilePreviewError>> {
769 let local_var_configuration = configuration;
770
771 let local_var_client = &local_var_configuration.client;
772
773 let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/load_git_repo_file_preview", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
774 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
775
776 local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
777 if let Some(ref local_var_str) = file_size_in_bytes {
778 local_var_req_builder = local_var_req_builder.query(&[("file_size_in_bytes", &local_var_str.to_string())]);
779 }
780 if let Some(ref local_var_str) = file_mime_type {
781 local_var_req_builder = local_var_req_builder.query(&[("file_mime_type", &local_var_str.to_string())]);
782 }
783 if let Some(ref local_var_str) = csv_separator {
784 local_var_req_builder = local_var_req_builder.query(&[("csv_separator", &local_var_str.to_string())]);
785 }
786 if let Some(ref local_var_str) = csv_has_header {
787 local_var_req_builder = local_var_req_builder.query(&[("csv_has_header", &local_var_str.to_string())]);
788 }
789 if let Some(ref local_var_str) = read_bytes_from {
790 local_var_req_builder = local_var_req_builder.query(&[("read_bytes_from", &local_var_str.to_string())]);
791 }
792 if let Some(ref local_var_str) = read_bytes_length {
793 local_var_req_builder = local_var_req_builder.query(&[("read_bytes_length", &local_var_str.to_string())]);
794 }
795 if let Some(ref local_var_str) = storage {
796 local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
797 }
798 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
799 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
800 }
801 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
802 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
803 };
804
805 let local_var_req = local_var_req_builder.build()?;
806 let local_var_resp = local_var_client.execute(local_var_req).await?;
807
808 let local_var_status = local_var_resp.status();
809 let local_var_content = local_var_resp.text().await?;
810
811 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
812 crate::from_str_patched(&local_var_content).map_err(Error::from)
813 } else {
814 let local_var_entity: Option<LoadGitRepoFilePreviewError> = crate::from_str_patched(&local_var_content).ok();
815 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
816 Err(Error::ResponseError(local_var_error))
817 }
818}
819
820pub async fn load_parquet_preview(configuration: &configuration::Configuration, workspace: &str, path: &str, offset: Option<f64>, limit: Option<f64>, sort_col: Option<&str>, sort_desc: Option<bool>, search_col: Option<&str>, search_term: Option<&str>, storage: Option<&str>) -> Result<(), Error<LoadParquetPreviewError>> {
821 let local_var_configuration = configuration;
822
823 let local_var_client = &local_var_configuration.client;
824
825 let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/load_parquet_preview/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
826 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
827
828 if let Some(ref local_var_str) = offset {
829 local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]);
830 }
831 if let Some(ref local_var_str) = limit {
832 local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
833 }
834 if let Some(ref local_var_str) = sort_col {
835 local_var_req_builder = local_var_req_builder.query(&[("sort_col", &local_var_str.to_string())]);
836 }
837 if let Some(ref local_var_str) = sort_desc {
838 local_var_req_builder = local_var_req_builder.query(&[("sort_desc", &local_var_str.to_string())]);
839 }
840 if let Some(ref local_var_str) = search_col {
841 local_var_req_builder = local_var_req_builder.query(&[("search_col", &local_var_str.to_string())]);
842 }
843 if let Some(ref local_var_str) = search_term {
844 local_var_req_builder = local_var_req_builder.query(&[("search_term", &local_var_str.to_string())]);
845 }
846 if let Some(ref local_var_str) = storage {
847 local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
848 }
849 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
850 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
851 }
852 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
853 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
854 };
855
856 let local_var_req = local_var_req_builder.build()?;
857 let local_var_resp = local_var_client.execute(local_var_req).await?;
858
859 let local_var_status = local_var_resp.status();
860 let local_var_content = local_var_resp.text().await?;
861
862 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
863 Ok(())
864 } else {
865 let local_var_entity: Option<LoadParquetPreviewError> = crate::from_str_patched(&local_var_content).ok();
866 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
867 Err(Error::ResponseError(local_var_error))
868 }
869}
870
871pub async fn load_table_row_count(configuration: &configuration::Configuration, workspace: &str, path: &str, search_col: Option<&str>, search_term: Option<&str>, storage: Option<&str>) -> Result<models::LoadTableRowCount200Response, Error<LoadTableRowCountError>> {
872 let local_var_configuration = configuration;
873
874 let local_var_client = &local_var_configuration.client;
875
876 let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/load_table_count/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
877 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
878
879 if let Some(ref local_var_str) = search_col {
880 local_var_req_builder = local_var_req_builder.query(&[("search_col", &local_var_str.to_string())]);
881 }
882 if let Some(ref local_var_str) = search_term {
883 local_var_req_builder = local_var_req_builder.query(&[("search_term", &local_var_str.to_string())]);
884 }
885 if let Some(ref local_var_str) = storage {
886 local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
887 }
888 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
889 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
890 }
891 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
892 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
893 };
894
895 let local_var_req = local_var_req_builder.build()?;
896 let local_var_resp = local_var_client.execute(local_var_req).await?;
897
898 let local_var_status = local_var_resp.status();
899 let local_var_content = local_var_resp.text().await?;
900
901 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
902 crate::from_str_patched(&local_var_content).map_err(Error::from)
903 } else {
904 let local_var_entity: Option<LoadTableRowCountError> = crate::from_str_patched(&local_var_content).ok();
905 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
906 Err(Error::ResponseError(local_var_error))
907 }
908}
909
910pub async fn move_s3_file(configuration: &configuration::Configuration, workspace: &str, src_file_key: &str, dest_file_key: &str, storage: Option<&str>) -> Result<serde_json::Value, Error<MoveS3FileError>> {
911 let local_var_configuration = configuration;
912
913 let local_var_client = &local_var_configuration.client;
914
915 let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/move_s3_file", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
916 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
917
918 local_var_req_builder = local_var_req_builder.query(&[("src_file_key", &src_file_key.to_string())]);
919 local_var_req_builder = local_var_req_builder.query(&[("dest_file_key", &dest_file_key.to_string())]);
920 if let Some(ref local_var_str) = storage {
921 local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
922 }
923 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
924 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
925 }
926 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
927 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
928 };
929
930 let local_var_req = local_var_req_builder.build()?;
931 let local_var_resp = local_var_client.execute(local_var_req).await?;
932
933 let local_var_status = local_var_resp.status();
934 let local_var_content = local_var_resp.text().await?;
935
936 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
937 crate::from_str_patched(&local_var_content).map_err(Error::from)
938 } else {
939 let local_var_entity: Option<MoveS3FileError> = crate::from_str_patched(&local_var_content).ok();
940 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
941 Err(Error::ResponseError(local_var_error))
942 }
943}
944
945pub async fn polars_connection_settings(configuration: &configuration::Configuration, workspace: &str, duckdb_connection_settings_request: models::DuckdbConnectionSettingsRequest) -> Result<models::PolarsConnectionSettings200Response, Error<PolarsConnectionSettingsError>> {
946 let local_var_configuration = configuration;
947
948 let local_var_client = &local_var_configuration.client;
949
950 let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/polars_connection_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
951 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
952
953 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
954 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
955 }
956 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
957 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
958 };
959 local_var_req_builder = local_var_req_builder.json(&duckdb_connection_settings_request);
960
961 let local_var_req = local_var_req_builder.build()?;
962 let local_var_resp = local_var_client.execute(local_var_req).await?;
963
964 let local_var_status = local_var_resp.status();
965 let local_var_content = local_var_resp.text().await?;
966
967 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
968 crate::from_str_patched(&local_var_content).map_err(Error::from)
969 } else {
970 let local_var_entity: Option<PolarsConnectionSettingsError> = crate::from_str_patched(&local_var_content).ok();
971 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
972 Err(Error::ResponseError(local_var_error))
973 }
974}
975
976pub async fn polars_connection_settings_v2(configuration: &configuration::Configuration, workspace: &str, duckdb_connection_settings_v2_request: models::DuckdbConnectionSettingsV2Request) -> Result<models::PolarsConnectionSettingsV2200Response, Error<PolarsConnectionSettingsV2Error>> {
977 let local_var_configuration = configuration;
978
979 let local_var_client = &local_var_configuration.client;
980
981 let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/v2/polars_connection_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
982 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
983
984 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
985 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
986 }
987 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
988 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
989 };
990 local_var_req_builder = local_var_req_builder.json(&duckdb_connection_settings_v2_request);
991
992 let local_var_req = local_var_req_builder.build()?;
993 let local_var_resp = local_var_client.execute(local_var_req).await?;
994
995 let local_var_status = local_var_resp.status();
996 let local_var_content = local_var_resp.text().await?;
997
998 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
999 crate::from_str_patched(&local_var_content).map_err(Error::from)
1000 } else {
1001 let local_var_entity: Option<PolarsConnectionSettingsV2Error> = crate::from_str_patched(&local_var_content).ok();
1002 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1003 Err(Error::ResponseError(local_var_error))
1004 }
1005}
1006
1007pub async fn s3_resource_info(configuration: &configuration::Configuration, workspace: &str, duckdb_connection_settings_v2_request: models::DuckdbConnectionSettingsV2Request) -> Result<models::S3Resource, Error<S3ResourceInfoError>> {
1008 let local_var_configuration = configuration;
1009
1010 let local_var_client = &local_var_configuration.client;
1011
1012 let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/v2/s3_resource_info", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1013 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1014
1015 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1016 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1017 }
1018 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1019 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1020 };
1021 local_var_req_builder = local_var_req_builder.json(&duckdb_connection_settings_v2_request);
1022
1023 let local_var_req = local_var_req_builder.build()?;
1024 let local_var_resp = local_var_client.execute(local_var_req).await?;
1025
1026 let local_var_status = local_var_resp.status();
1027 let local_var_content = local_var_resp.text().await?;
1028
1029 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1030 crate::from_str_patched(&local_var_content).map_err(Error::from)
1031 } else {
1032 let local_var_entity: Option<S3ResourceInfoError> = crate::from_str_patched(&local_var_content).ok();
1033 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1034 Err(Error::ResponseError(local_var_error))
1035 }
1036}
1037