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