Skip to main content

windmill_api/apis/
helpers_api.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.841.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18/// struct for typed errors of method [`check_s3_folder_exists`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum CheckS3FolderExistsError {
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`dataset_storage_test_connection`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum DatasetStorageTestConnectionError {
29    UnknownValue(serde_json::Value),
30}
31
32/// struct for typed errors of method [`delete_s3_file`]
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum DeleteS3FileError {
36    UnknownValue(serde_json::Value),
37}
38
39/// struct for typed errors of method [`duckdb_connection_settings`]
40#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum DuckdbConnectionSettingsError {
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`duckdb_connection_settings_v2`]
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum DuckdbConnectionSettingsV2Error {
50    UnknownValue(serde_json::Value),
51}
52
53/// struct for typed errors of method [`file_download`]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum FileDownloadError {
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`file_download_parquet_as_csv`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum FileDownloadParquetAsCsvError {
64    UnknownValue(serde_json::Value),
65}
66
67/// struct for typed errors of method [`file_upload`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum FileUploadError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`get_storage_usage`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetStorageUsageError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`git_repo_viewer_file_upload`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum GitRepoViewerFileUploadError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`list_git_repo_files`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum ListGitRepoFilesError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`list_stored_files`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum ListStoredFilesError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`list_stored_files_paged`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum ListStoredFilesPagedError {
106    UnknownValue(serde_json::Value),
107}
108
109/// struct for typed errors of method [`load_csv_preview`]
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum LoadCsvPreviewError {
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`load_file_metadata`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum LoadFileMetadataError {
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method [`load_file_preview`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum LoadFilePreviewError {
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`load_git_repo_file_metadata`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum LoadGitRepoFileMetadataError {
134    UnknownValue(serde_json::Value),
135}
136
137/// struct for typed errors of method [`load_git_repo_file_preview`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum LoadGitRepoFilePreviewError {
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`load_parquet_preview`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum LoadParquetPreviewError {
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`load_table_row_count`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum LoadTableRowCountError {
155    UnknownValue(serde_json::Value),
156}
157
158/// struct for typed errors of method [`move_s3_file`]
159#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum MoveS3FileError {
162    UnknownValue(serde_json::Value),
163}
164
165/// struct for typed errors of method [`polars_connection_settings`]
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum PolarsConnectionSettingsError {
169    UnknownValue(serde_json::Value),
170}
171
172/// struct for typed errors of method [`polars_connection_settings_v2`]
173#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum PolarsConnectionSettingsV2Error {
176    UnknownValue(serde_json::Value),
177}
178
179/// struct for typed errors of method [`s3_proxy_bucket`]
180#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum S3ProxyBucketError {
183    UnknownValue(serde_json::Value),
184}
185
186/// struct for typed errors of method [`s3_resource_info`]
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum S3ResourceInfoError {
190    UnknownValue(serde_json::Value),
191}
192
193
194pub async fn check_s3_folder_exists(configuration: &configuration::Configuration, workspace: &str, file_key: &str, marker_file: Option<&str>) -> Result<models::CheckS3FolderExists200Response, Error<CheckS3FolderExistsError>> {
195    let local_var_configuration = configuration;
196
197    let local_var_client = &local_var_configuration.client;
198
199    let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/check_s3_folder_exists", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
200    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
201
202    local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
203    if let Some(ref local_var_str) = marker_file {
204        local_var_req_builder = local_var_req_builder.query(&[("marker_file", &local_var_str.to_string())]);
205    }
206    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
207        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
208    }
209    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
210        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
211    };
212
213    let local_var_req = local_var_req_builder.build()?;
214    let local_var_resp = local_var_client.execute(local_var_req).await?;
215
216    let local_var_status = local_var_resp.status();
217    let local_var_content = local_var_resp.text().await?;
218
219    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
220        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
221    } else {
222        let local_var_entity: Option<CheckS3FolderExistsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
223        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
224        Err(Error::ResponseError(local_var_error))
225    }
226}
227
228pub async fn dataset_storage_test_connection(configuration: &configuration::Configuration, workspace: &str, storage: Option<&str>, s3_resource_path: Option<&str>) -> Result<serde_json::Value, Error<DatasetStorageTestConnectionError>> {
229    let local_var_configuration = configuration;
230
231    let local_var_client = &local_var_configuration.client;
232
233    let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/test_connection", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
234    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
235
236    if let Some(ref local_var_str) = storage {
237        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
238    }
239    if let Some(ref local_var_str) = s3_resource_path {
240        local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
241    }
242    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
243        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
244    }
245    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
246        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
247    };
248
249    let local_var_req = local_var_req_builder.build()?;
250    let local_var_resp = local_var_client.execute(local_var_req).await?;
251
252    let local_var_status = local_var_resp.status();
253    let local_var_content = local_var_resp.text().await?;
254
255    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
256        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
257    } else {
258        let local_var_entity: Option<DatasetStorageTestConnectionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
259        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
260        Err(Error::ResponseError(local_var_error))
261    }
262}
263
264pub async fn delete_s3_file(configuration: &configuration::Configuration, workspace: &str, file_key: &str, storage: Option<&str>, s3_resource_path: Option<&str>) -> Result<serde_json::Value, Error<DeleteS3FileError>> {
265    let local_var_configuration = configuration;
266
267    let local_var_client = &local_var_configuration.client;
268
269    let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/delete_s3_file", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
270    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
271
272    local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
273    if let Some(ref local_var_str) = storage {
274        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
275    }
276    if let Some(ref local_var_str) = s3_resource_path {
277        local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
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
286    let local_var_req = local_var_req_builder.build()?;
287    let local_var_resp = local_var_client.execute(local_var_req).await?;
288
289    let local_var_status = local_var_resp.status();
290    let local_var_content = local_var_resp.text().await?;
291
292    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
293        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
294    } else {
295        let local_var_entity: Option<DeleteS3FileError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
296        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
297        Err(Error::ResponseError(local_var_error))
298    }
299}
300
301pub async fn duckdb_connection_settings(configuration: &configuration::Configuration, workspace: &str, duckdb_connection_settings_request: models::DuckdbConnectionSettingsRequest) -> Result<models::DuckdbConnectionSettings200Response, Error<DuckdbConnectionSettingsError>> {
302    let local_var_configuration = configuration;
303
304    let local_var_client = &local_var_configuration.client;
305
306    let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/duckdb_connection_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
307    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
308
309    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
310        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
311    }
312    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
313        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
314    };
315    local_var_req_builder = local_var_req_builder.json(&duckdb_connection_settings_request);
316
317    let local_var_req = local_var_req_builder.build()?;
318    let local_var_resp = local_var_client.execute(local_var_req).await?;
319
320    let local_var_status = local_var_resp.status();
321    let local_var_content = local_var_resp.text().await?;
322
323    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
324        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
325    } else {
326        let local_var_entity: Option<DuckdbConnectionSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
327        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
328        Err(Error::ResponseError(local_var_error))
329    }
330}
331
332pub async fn duckdb_connection_settings_v2(configuration: &configuration::Configuration, workspace: &str, duckdb_connection_settings_v2_request: models::DuckdbConnectionSettingsV2Request) -> Result<models::DuckdbConnectionSettingsV2200Response, Error<DuckdbConnectionSettingsV2Error>> {
333    let local_var_configuration = configuration;
334
335    let local_var_client = &local_var_configuration.client;
336
337    let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/v2/duckdb_connection_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
338    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
339
340    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
341        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
342    }
343    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
344        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
345    };
346    local_var_req_builder = local_var_req_builder.json(&duckdb_connection_settings_v2_request);
347
348    let local_var_req = local_var_req_builder.build()?;
349    let local_var_resp = local_var_client.execute(local_var_req).await?;
350
351    let local_var_status = local_var_resp.status();
352    let local_var_content = local_var_resp.text().await?;
353
354    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
355        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
356    } else {
357        let local_var_entity: Option<DuckdbConnectionSettingsV2Error> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
358        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
359        Err(Error::ResponseError(local_var_error))
360    }
361}
362
363pub 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>> {
364    let local_var_configuration = configuration;
365
366    let local_var_client = &local_var_configuration.client;
367
368    let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/download_s3_file", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
369    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
370
371    local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
372    if let Some(ref local_var_str) = s3_resource_path {
373        local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
374    }
375    if let Some(ref local_var_str) = resource_type {
376        local_var_req_builder = local_var_req_builder.query(&[("resource_type", &local_var_str.to_string())]);
377    }
378    if let Some(ref local_var_str) = storage {
379        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
380    }
381    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
382        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
383    }
384    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
385        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
386    };
387
388    let local_var_req = local_var_req_builder.build()?;
389    let local_var_resp = local_var_client.execute(local_var_req).await?;
390
391    let local_var_status = local_var_resp.status();
392    let local_var_content = local_var_resp.text().await?;
393
394    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
395        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
396    } else {
397        let local_var_entity: Option<FileDownloadError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
398        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
399        Err(Error::ResponseError(local_var_error))
400    }
401}
402
403pub 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>> {
404    let local_var_configuration = configuration;
405
406    let local_var_client = &local_var_configuration.client;
407
408    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));
409    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
410
411    local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
412    if let Some(ref local_var_str) = s3_resource_path {
413        local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
414    }
415    if let Some(ref local_var_str) = resource_type {
416        local_var_req_builder = local_var_req_builder.query(&[("resource_type", &local_var_str.to_string())]);
417    }
418    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
419        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
420    }
421    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
422        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
423    };
424
425    let local_var_req = local_var_req_builder.build()?;
426    let local_var_resp = local_var_client.execute(local_var_req).await?;
427
428    let local_var_status = local_var_resp.status();
429    let local_var_content = local_var_resp.text().await?;
430
431    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
432        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
433    } else {
434        let local_var_entity: Option<FileDownloadParquetAsCsvError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
435        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
436        Err(Error::ResponseError(local_var_error))
437    }
438}
439
440pub 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>> {
441    let local_var_configuration = configuration;
442
443    let local_var_client = &local_var_configuration.client;
444
445    let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/upload_s3_file", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
446    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
447
448    if let Some(ref local_var_str) = file_key {
449        local_var_req_builder = local_var_req_builder.query(&[("file_key", &local_var_str.to_string())]);
450    }
451    if let Some(ref local_var_str) = file_extension {
452        local_var_req_builder = local_var_req_builder.query(&[("file_extension", &local_var_str.to_string())]);
453    }
454    if let Some(ref local_var_str) = s3_resource_path {
455        local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
456    }
457    if let Some(ref local_var_str) = resource_type {
458        local_var_req_builder = local_var_req_builder.query(&[("resource_type", &local_var_str.to_string())]);
459    }
460    if let Some(ref local_var_str) = storage {
461        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
462    }
463    if let Some(ref local_var_str) = content_type {
464        local_var_req_builder = local_var_req_builder.query(&[("content_type", &local_var_str.to_string())]);
465    }
466    if let Some(ref local_var_str) = content_disposition {
467        local_var_req_builder = local_var_req_builder.query(&[("content_disposition", &local_var_str.to_string())]);
468    }
469    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
470        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
471    }
472    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
473        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
474    };
475    local_var_req_builder = local_var_req_builder.json(&body);
476
477    let local_var_req = local_var_req_builder.build()?;
478    let local_var_resp = local_var_client.execute(local_var_req).await?;
479
480    let local_var_status = local_var_resp.status();
481    let local_var_content = local_var_resp.text().await?;
482
483    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
484        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
485    } else {
486        let local_var_entity: Option<FileUploadError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
487        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
488        Err(Error::ResponseError(local_var_error))
489    }
490}
491
492pub async fn get_storage_usage(configuration: &configuration::Configuration, workspace: &str, refresh: Option<bool>) -> Result<models::GetStorageUsage200Response, Error<GetStorageUsageError>> {
493    let local_var_configuration = configuration;
494
495    let local_var_client = &local_var_configuration.client;
496
497    let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/storage_usage", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
498    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
499
500    if let Some(ref local_var_str) = refresh {
501        local_var_req_builder = local_var_req_builder.query(&[("refresh", &local_var_str.to_string())]);
502    }
503    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
504        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
505    }
506    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
507        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
508    };
509
510    let local_var_req = local_var_req_builder.build()?;
511    let local_var_resp = local_var_client.execute(local_var_req).await?;
512
513    let local_var_status = local_var_resp.status();
514    let local_var_content = local_var_resp.text().await?;
515
516    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
517        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
518    } else {
519        let local_var_entity: Option<GetStorageUsageError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
520        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
521        Err(Error::ResponseError(local_var_error))
522    }
523}
524
525pub 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>> {
526    let local_var_configuration = configuration;
527
528    let local_var_client = &local_var_configuration.client;
529
530    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));
531    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
532
533    if let Some(ref local_var_str) = file_key {
534        local_var_req_builder = local_var_req_builder.query(&[("file_key", &local_var_str.to_string())]);
535    }
536    if let Some(ref local_var_str) = file_extension {
537        local_var_req_builder = local_var_req_builder.query(&[("file_extension", &local_var_str.to_string())]);
538    }
539    if let Some(ref local_var_str) = s3_resource_path {
540        local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
541    }
542    if let Some(ref local_var_str) = resource_type {
543        local_var_req_builder = local_var_req_builder.query(&[("resource_type", &local_var_str.to_string())]);
544    }
545    if let Some(ref local_var_str) = storage {
546        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
547    }
548    if let Some(ref local_var_str) = content_type {
549        local_var_req_builder = local_var_req_builder.query(&[("content_type", &local_var_str.to_string())]);
550    }
551    if let Some(ref local_var_str) = content_disposition {
552        local_var_req_builder = local_var_req_builder.query(&[("content_disposition", &local_var_str.to_string())]);
553    }
554    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
555        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
556    }
557    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
558        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
559    };
560    local_var_req_builder = local_var_req_builder.json(&body);
561
562    let local_var_req = local_var_req_builder.build()?;
563    let local_var_resp = local_var_client.execute(local_var_req).await?;
564
565    let local_var_status = local_var_resp.status();
566    let local_var_content = local_var_resp.text().await?;
567
568    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
569        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
570    } else {
571        let local_var_entity: Option<GitRepoViewerFileUploadError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
572        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
573        Err(Error::ResponseError(local_var_error))
574    }
575}
576
577pub 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>> {
578    let local_var_configuration = configuration;
579
580    let local_var_client = &local_var_configuration.client;
581
582    let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/list_git_repo_files", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
583    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
584
585    local_var_req_builder = local_var_req_builder.query(&[("max_keys", &max_keys.to_string())]);
586    if let Some(ref local_var_str) = marker {
587        local_var_req_builder = local_var_req_builder.query(&[("marker", &local_var_str.to_string())]);
588    }
589    if let Some(ref local_var_str) = prefix {
590        local_var_req_builder = local_var_req_builder.query(&[("prefix", &local_var_str.to_string())]);
591    }
592    if let Some(ref local_var_str) = storage {
593        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
594    }
595    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
596        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
597    }
598    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
599        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
600    };
601
602    let local_var_req = local_var_req_builder.build()?;
603    let local_var_resp = local_var_client.execute(local_var_req).await?;
604
605    let local_var_status = local_var_resp.status();
606    let local_var_content = local_var_resp.text().await?;
607
608    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
609        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
610    } else {
611        let local_var_entity: Option<ListGitRepoFilesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
612        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
613        Err(Error::ResponseError(local_var_error))
614    }
615}
616
617pub async fn list_stored_files(configuration: &configuration::Configuration, workspace: &str, max_keys: i32, marker: Option<&str>, prefix: Option<&str>, search: Option<&str>, storage: Option<&str>, s3_resource_path: Option<&str>) -> Result<models::ListStoredFiles200Response, Error<ListStoredFilesError>> {
618    let local_var_configuration = configuration;
619
620    let local_var_client = &local_var_configuration.client;
621
622    let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/list_stored_files", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
623    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
624
625    local_var_req_builder = local_var_req_builder.query(&[("max_keys", &max_keys.to_string())]);
626    if let Some(ref local_var_str) = marker {
627        local_var_req_builder = local_var_req_builder.query(&[("marker", &local_var_str.to_string())]);
628    }
629    if let Some(ref local_var_str) = prefix {
630        local_var_req_builder = local_var_req_builder.query(&[("prefix", &local_var_str.to_string())]);
631    }
632    if let Some(ref local_var_str) = search {
633        local_var_req_builder = local_var_req_builder.query(&[("search", &local_var_str.to_string())]);
634    }
635    if let Some(ref local_var_str) = storage {
636        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
637    }
638    if let Some(ref local_var_str) = s3_resource_path {
639        local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
640    }
641    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
642        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
643    }
644    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
645        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
646    };
647
648    let local_var_req = local_var_req_builder.build()?;
649    let local_var_resp = local_var_client.execute(local_var_req).await?;
650
651    let local_var_status = local_var_resp.status();
652    let local_var_content = local_var_resp.text().await?;
653
654    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
655        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
656    } else {
657        let local_var_entity: Option<ListStoredFilesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
658        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
659        Err(Error::ResponseError(local_var_error))
660    }
661}
662
663pub async fn list_stored_files_paged(configuration: &configuration::Configuration, workspace: &str, prefix: Option<&str>, max_keys: Option<i32>, page_token: Option<&str>, storage: Option<&str>, s3_resource_path: Option<&str>) -> Result<models::ListStoredFilesPaged200Response, Error<ListStoredFilesPagedError>> {
664    let local_var_configuration = configuration;
665
666    let local_var_client = &local_var_configuration.client;
667
668    let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/list_stored_files_paged", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
669    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
670
671    if let Some(ref local_var_str) = prefix {
672        local_var_req_builder = local_var_req_builder.query(&[("prefix", &local_var_str.to_string())]);
673    }
674    if let Some(ref local_var_str) = max_keys {
675        local_var_req_builder = local_var_req_builder.query(&[("max_keys", &local_var_str.to_string())]);
676    }
677    if let Some(ref local_var_str) = page_token {
678        local_var_req_builder = local_var_req_builder.query(&[("page_token", &local_var_str.to_string())]);
679    }
680    if let Some(ref local_var_str) = storage {
681        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
682    }
683    if let Some(ref local_var_str) = s3_resource_path {
684        local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
685    }
686    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
687        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
688    }
689    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
690        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
691    };
692
693    let local_var_req = local_var_req_builder.build()?;
694    let local_var_resp = local_var_client.execute(local_var_req).await?;
695
696    let local_var_status = local_var_resp.status();
697    let local_var_content = local_var_resp.text().await?;
698
699    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
700        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
701    } else {
702        let local_var_entity: Option<ListStoredFilesPagedError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
703        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
704        Err(Error::ResponseError(local_var_error))
705    }
706}
707
708pub 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>, s3_resource_path: Option<&str>, csv_separator: Option<&str>, csv_has_header: Option<bool>, filters: Option<&str>) -> Result<(), Error<LoadCsvPreviewError>> {
709    let local_var_configuration = configuration;
710
711    let local_var_client = &local_var_configuration.client;
712
713    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));
714    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
715
716    if let Some(ref local_var_str) = offset {
717        local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]);
718    }
719    if let Some(ref local_var_str) = limit {
720        local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
721    }
722    if let Some(ref local_var_str) = sort_col {
723        local_var_req_builder = local_var_req_builder.query(&[("sort_col", &local_var_str.to_string())]);
724    }
725    if let Some(ref local_var_str) = sort_desc {
726        local_var_req_builder = local_var_req_builder.query(&[("sort_desc", &local_var_str.to_string())]);
727    }
728    if let Some(ref local_var_str) = search_col {
729        local_var_req_builder = local_var_req_builder.query(&[("search_col", &local_var_str.to_string())]);
730    }
731    if let Some(ref local_var_str) = search_term {
732        local_var_req_builder = local_var_req_builder.query(&[("search_term", &local_var_str.to_string())]);
733    }
734    if let Some(ref local_var_str) = storage {
735        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
736    }
737    if let Some(ref local_var_str) = s3_resource_path {
738        local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
739    }
740    if let Some(ref local_var_str) = csv_separator {
741        local_var_req_builder = local_var_req_builder.query(&[("csv_separator", &local_var_str.to_string())]);
742    }
743    if let Some(ref local_var_str) = csv_has_header {
744        local_var_req_builder = local_var_req_builder.query(&[("csv_has_header", &local_var_str.to_string())]);
745    }
746    if let Some(ref local_var_str) = filters {
747        local_var_req_builder = local_var_req_builder.query(&[("filters", &local_var_str.to_string())]);
748    }
749    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
750        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
751    }
752    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
753        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
754    };
755
756    let local_var_req = local_var_req_builder.build()?;
757    let local_var_resp = local_var_client.execute(local_var_req).await?;
758
759    let local_var_status = local_var_resp.status();
760    let local_var_content = local_var_resp.text().await?;
761
762    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
763        Ok(())
764    } else {
765        let local_var_entity: Option<LoadCsvPreviewError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
766        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
767        Err(Error::ResponseError(local_var_error))
768    }
769}
770
771pub async fn load_file_metadata(configuration: &configuration::Configuration, workspace: &str, file_key: &str, storage: Option<&str>, s3_resource_path: Option<&str>) -> Result<models::WindmillFileMetadata, Error<LoadFileMetadataError>> {
772    let local_var_configuration = configuration;
773
774    let local_var_client = &local_var_configuration.client;
775
776    let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/load_file_metadata", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
777    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
778
779    local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
780    if let Some(ref local_var_str) = storage {
781        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
782    }
783    if let Some(ref local_var_str) = s3_resource_path {
784        local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
785    }
786    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
787        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
788    }
789    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
790        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
791    };
792
793    let local_var_req = local_var_req_builder.build()?;
794    let local_var_resp = local_var_client.execute(local_var_req).await?;
795
796    let local_var_status = local_var_resp.status();
797    let local_var_content = local_var_resp.text().await?;
798
799    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
800        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
801    } else {
802        let local_var_entity: Option<LoadFileMetadataError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
803        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
804        Err(Error::ResponseError(local_var_error))
805    }
806}
807
808pub 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>, s3_resource_path: Option<&str>) -> Result<models::WindmillFilePreview, Error<LoadFilePreviewError>> {
809    let local_var_configuration = configuration;
810
811    let local_var_client = &local_var_configuration.client;
812
813    let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/load_file_preview", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
814    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
815
816    local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
817    if let Some(ref local_var_str) = file_size_in_bytes {
818        local_var_req_builder = local_var_req_builder.query(&[("file_size_in_bytes", &local_var_str.to_string())]);
819    }
820    if let Some(ref local_var_str) = file_mime_type {
821        local_var_req_builder = local_var_req_builder.query(&[("file_mime_type", &local_var_str.to_string())]);
822    }
823    if let Some(ref local_var_str) = csv_separator {
824        local_var_req_builder = local_var_req_builder.query(&[("csv_separator", &local_var_str.to_string())]);
825    }
826    if let Some(ref local_var_str) = csv_has_header {
827        local_var_req_builder = local_var_req_builder.query(&[("csv_has_header", &local_var_str.to_string())]);
828    }
829    if let Some(ref local_var_str) = read_bytes_from {
830        local_var_req_builder = local_var_req_builder.query(&[("read_bytes_from", &local_var_str.to_string())]);
831    }
832    if let Some(ref local_var_str) = read_bytes_length {
833        local_var_req_builder = local_var_req_builder.query(&[("read_bytes_length", &local_var_str.to_string())]);
834    }
835    if let Some(ref local_var_str) = storage {
836        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
837    }
838    if let Some(ref local_var_str) = s3_resource_path {
839        local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
840    }
841    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
842        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
843    }
844    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
845        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
846    };
847
848    let local_var_req = local_var_req_builder.build()?;
849    let local_var_resp = local_var_client.execute(local_var_req).await?;
850
851    let local_var_status = local_var_resp.status();
852    let local_var_content = local_var_resp.text().await?;
853
854    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
855        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
856    } else {
857        let local_var_entity: Option<LoadFilePreviewError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
858        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
859        Err(Error::ResponseError(local_var_error))
860    }
861}
862
863pub async fn load_git_repo_file_metadata(configuration: &configuration::Configuration, workspace: &str, file_key: &str, storage: Option<&str>) -> Result<models::WindmillFileMetadata, Error<LoadGitRepoFileMetadataError>> {
864    let local_var_configuration = configuration;
865
866    let local_var_client = &local_var_configuration.client;
867
868    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));
869    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
870
871    local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
872    if let Some(ref local_var_str) = storage {
873        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
874    }
875    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
876        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
877    }
878    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
879        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
880    };
881
882    let local_var_req = local_var_req_builder.build()?;
883    let local_var_resp = local_var_client.execute(local_var_req).await?;
884
885    let local_var_status = local_var_resp.status();
886    let local_var_content = local_var_resp.text().await?;
887
888    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
889        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
890    } else {
891        let local_var_entity: Option<LoadGitRepoFileMetadataError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
892        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
893        Err(Error::ResponseError(local_var_error))
894    }
895}
896
897pub 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>> {
898    let local_var_configuration = configuration;
899
900    let local_var_client = &local_var_configuration.client;
901
902    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));
903    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
904
905    local_var_req_builder = local_var_req_builder.query(&[("file_key", &file_key.to_string())]);
906    if let Some(ref local_var_str) = file_size_in_bytes {
907        local_var_req_builder = local_var_req_builder.query(&[("file_size_in_bytes", &local_var_str.to_string())]);
908    }
909    if let Some(ref local_var_str) = file_mime_type {
910        local_var_req_builder = local_var_req_builder.query(&[("file_mime_type", &local_var_str.to_string())]);
911    }
912    if let Some(ref local_var_str) = csv_separator {
913        local_var_req_builder = local_var_req_builder.query(&[("csv_separator", &local_var_str.to_string())]);
914    }
915    if let Some(ref local_var_str) = csv_has_header {
916        local_var_req_builder = local_var_req_builder.query(&[("csv_has_header", &local_var_str.to_string())]);
917    }
918    if let Some(ref local_var_str) = read_bytes_from {
919        local_var_req_builder = local_var_req_builder.query(&[("read_bytes_from", &local_var_str.to_string())]);
920    }
921    if let Some(ref local_var_str) = read_bytes_length {
922        local_var_req_builder = local_var_req_builder.query(&[("read_bytes_length", &local_var_str.to_string())]);
923    }
924    if let Some(ref local_var_str) = storage {
925        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
926    }
927    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
928        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
929    }
930    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
931        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
932    };
933
934    let local_var_req = local_var_req_builder.build()?;
935    let local_var_resp = local_var_client.execute(local_var_req).await?;
936
937    let local_var_status = local_var_resp.status();
938    let local_var_content = local_var_resp.text().await?;
939
940    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
941        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
942    } else {
943        let local_var_entity: Option<LoadGitRepoFilePreviewError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
944        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
945        Err(Error::ResponseError(local_var_error))
946    }
947}
948
949pub 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>, s3_resource_path: Option<&str>, filters: Option<&str>) -> Result<(), Error<LoadParquetPreviewError>> {
950    let local_var_configuration = configuration;
951
952    let local_var_client = &local_var_configuration.client;
953
954    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));
955    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
956
957    if let Some(ref local_var_str) = offset {
958        local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]);
959    }
960    if let Some(ref local_var_str) = limit {
961        local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
962    }
963    if let Some(ref local_var_str) = sort_col {
964        local_var_req_builder = local_var_req_builder.query(&[("sort_col", &local_var_str.to_string())]);
965    }
966    if let Some(ref local_var_str) = sort_desc {
967        local_var_req_builder = local_var_req_builder.query(&[("sort_desc", &local_var_str.to_string())]);
968    }
969    if let Some(ref local_var_str) = search_col {
970        local_var_req_builder = local_var_req_builder.query(&[("search_col", &local_var_str.to_string())]);
971    }
972    if let Some(ref local_var_str) = search_term {
973        local_var_req_builder = local_var_req_builder.query(&[("search_term", &local_var_str.to_string())]);
974    }
975    if let Some(ref local_var_str) = storage {
976        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
977    }
978    if let Some(ref local_var_str) = s3_resource_path {
979        local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
980    }
981    if let Some(ref local_var_str) = filters {
982        local_var_req_builder = local_var_req_builder.query(&[("filters", &local_var_str.to_string())]);
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
991    let local_var_req = local_var_req_builder.build()?;
992    let local_var_resp = local_var_client.execute(local_var_req).await?;
993
994    let local_var_status = local_var_resp.status();
995    let local_var_content = local_var_resp.text().await?;
996
997    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
998        Ok(())
999    } else {
1000        let local_var_entity: Option<LoadParquetPreviewError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1001        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1002        Err(Error::ResponseError(local_var_error))
1003    }
1004}
1005
1006pub async fn load_table_row_count(configuration: &configuration::Configuration, workspace: &str, path: &str, search_col: Option<&str>, search_term: Option<&str>, storage: Option<&str>, s3_resource_path: Option<&str>, csv_separator: Option<&str>, csv_has_header: Option<bool>, filters: Option<&str>) -> Result<models::AppLoadTableCount200Response, Error<LoadTableRowCountError>> {
1007    let local_var_configuration = configuration;
1008
1009    let local_var_client = &local_var_configuration.client;
1010
1011    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));
1012    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1013
1014    if let Some(ref local_var_str) = search_col {
1015        local_var_req_builder = local_var_req_builder.query(&[("search_col", &local_var_str.to_string())]);
1016    }
1017    if let Some(ref local_var_str) = search_term {
1018        local_var_req_builder = local_var_req_builder.query(&[("search_term", &local_var_str.to_string())]);
1019    }
1020    if let Some(ref local_var_str) = storage {
1021        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
1022    }
1023    if let Some(ref local_var_str) = s3_resource_path {
1024        local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
1025    }
1026    if let Some(ref local_var_str) = csv_separator {
1027        local_var_req_builder = local_var_req_builder.query(&[("csv_separator", &local_var_str.to_string())]);
1028    }
1029    if let Some(ref local_var_str) = csv_has_header {
1030        local_var_req_builder = local_var_req_builder.query(&[("csv_has_header", &local_var_str.to_string())]);
1031    }
1032    if let Some(ref local_var_str) = filters {
1033        local_var_req_builder = local_var_req_builder.query(&[("filters", &local_var_str.to_string())]);
1034    }
1035    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1036        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1037    }
1038    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1039        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1040    };
1041
1042    let local_var_req = local_var_req_builder.build()?;
1043    let local_var_resp = local_var_client.execute(local_var_req).await?;
1044
1045    let local_var_status = local_var_resp.status();
1046    let local_var_content = local_var_resp.text().await?;
1047
1048    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1049        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1050    } else {
1051        let local_var_entity: Option<LoadTableRowCountError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1052        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1053        Err(Error::ResponseError(local_var_error))
1054    }
1055}
1056
1057pub async fn move_s3_file(configuration: &configuration::Configuration, workspace: &str, src_file_key: &str, dest_file_key: &str, storage: Option<&str>, s3_resource_path: Option<&str>) -> Result<serde_json::Value, Error<MoveS3FileError>> {
1058    let local_var_configuration = configuration;
1059
1060    let local_var_client = &local_var_configuration.client;
1061
1062    let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/move_s3_file", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1063    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1064
1065    local_var_req_builder = local_var_req_builder.query(&[("src_file_key", &src_file_key.to_string())]);
1066    local_var_req_builder = local_var_req_builder.query(&[("dest_file_key", &dest_file_key.to_string())]);
1067    if let Some(ref local_var_str) = storage {
1068        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
1069    }
1070    if let Some(ref local_var_str) = s3_resource_path {
1071        local_var_req_builder = local_var_req_builder.query(&[("s3_resource_path", &local_var_str.to_string())]);
1072    }
1073    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1074        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1075    }
1076    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1077        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1078    };
1079
1080    let local_var_req = local_var_req_builder.build()?;
1081    let local_var_resp = local_var_client.execute(local_var_req).await?;
1082
1083    let local_var_status = local_var_resp.status();
1084    let local_var_content = local_var_resp.text().await?;
1085
1086    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1087        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1088    } else {
1089        let local_var_entity: Option<MoveS3FileError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1090        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1091        Err(Error::ResponseError(local_var_error))
1092    }
1093}
1094
1095pub async fn polars_connection_settings(configuration: &configuration::Configuration, workspace: &str, duckdb_connection_settings_request: models::DuckdbConnectionSettingsRequest) -> Result<models::PolarsConnectionSettings200Response, Error<PolarsConnectionSettingsError>> {
1096    let local_var_configuration = configuration;
1097
1098    let local_var_client = &local_var_configuration.client;
1099
1100    let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/polars_connection_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1101    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1102
1103    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1104        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1105    }
1106    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1107        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1108    };
1109    local_var_req_builder = local_var_req_builder.json(&duckdb_connection_settings_request);
1110
1111    let local_var_req = local_var_req_builder.build()?;
1112    let local_var_resp = local_var_client.execute(local_var_req).await?;
1113
1114    let local_var_status = local_var_resp.status();
1115    let local_var_content = local_var_resp.text().await?;
1116
1117    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1118        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1119    } else {
1120        let local_var_entity: Option<PolarsConnectionSettingsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1121        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1122        Err(Error::ResponseError(local_var_error))
1123    }
1124}
1125
1126pub async fn polars_connection_settings_v2(configuration: &configuration::Configuration, workspace: &str, duckdb_connection_settings_v2_request: models::DuckdbConnectionSettingsV2Request) -> Result<models::PolarsConnectionSettingsV2200Response, Error<PolarsConnectionSettingsV2Error>> {
1127    let local_var_configuration = configuration;
1128
1129    let local_var_client = &local_var_configuration.client;
1130
1131    let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/v2/polars_connection_settings", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1132    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1133
1134    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1135        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1136    }
1137    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1138        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1139    };
1140    local_var_req_builder = local_var_req_builder.json(&duckdb_connection_settings_v2_request);
1141
1142    let local_var_req = local_var_req_builder.build()?;
1143    let local_var_resp = local_var_client.execute(local_var_req).await?;
1144
1145    let local_var_status = local_var_resp.status();
1146    let local_var_content = local_var_resp.text().await?;
1147
1148    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1149        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1150    } else {
1151        let local_var_entity: Option<PolarsConnectionSettingsV2Error> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1152        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1153        Err(Error::ResponseError(local_var_error))
1154    }
1155}
1156
1157pub async fn s3_proxy_bucket(configuration: &configuration::Configuration, workspace: &str, storage: Option<&str>) -> Result<models::S3ProxyBucket200Response, Error<S3ProxyBucketError>> {
1158    let local_var_configuration = configuration;
1159
1160    let local_var_client = &local_var_configuration.client;
1161
1162    let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/v2/s3_proxy_bucket", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1163    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1164
1165    if let Some(ref local_var_str) = storage {
1166        local_var_req_builder = local_var_req_builder.query(&[("storage", &local_var_str.to_string())]);
1167    }
1168    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1169        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1170    }
1171    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1172        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1173    };
1174
1175    let local_var_req = local_var_req_builder.build()?;
1176    let local_var_resp = local_var_client.execute(local_var_req).await?;
1177
1178    let local_var_status = local_var_resp.status();
1179    let local_var_content = local_var_resp.text().await?;
1180
1181    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1182        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1183    } else {
1184        let local_var_entity: Option<S3ProxyBucketError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1185        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1186        Err(Error::ResponseError(local_var_error))
1187    }
1188}
1189
1190pub async fn s3_resource_info(configuration: &configuration::Configuration, workspace: &str, duckdb_connection_settings_v2_request: models::DuckdbConnectionSettingsV2Request) -> Result<models::S3Resource, Error<S3ResourceInfoError>> {
1191    let local_var_configuration = configuration;
1192
1193    let local_var_client = &local_var_configuration.client;
1194
1195    let local_var_uri_str = format!("{}/w/{workspace}/job_helpers/v2/s3_resource_info", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1196    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1197
1198    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1199        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1200    }
1201    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1202        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1203    };
1204    local_var_req_builder = local_var_req_builder.json(&duckdb_connection_settings_v2_request);
1205
1206    let local_var_req = local_var_req_builder.build()?;
1207    let local_var_resp = local_var_client.execute(local_var_req).await?;
1208
1209    let local_var_status = local_var_resp.status();
1210    let local_var_content = local_var_resp.text().await?;
1211
1212    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1213        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1214    } else {
1215        let local_var_entity: Option<S3ResourceInfoError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1216        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1217        Err(Error::ResponseError(local_var_error))
1218    }
1219}
1220