windmill_api/apis/
path_autocomplete_api.rs1use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum ListPathAutocompletePathsError {
22 UnknownValue(serde_json::Value),
23}
24
25
26pub async fn list_path_autocomplete_paths(configuration: &configuration::Configuration, workspace: &str) -> Result<models::DeleteVariablesBulkRequest, Error<ListPathAutocompletePathsError>> {
28 let local_var_configuration = configuration;
29
30 let local_var_client = &local_var_configuration.client;
31
32 let local_var_uri_str = format!("{}/w/{workspace}/path_autocomplete/list_paths", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
33 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
34
35 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
36 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
37 }
38 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
39 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
40 };
41
42 let local_var_req = local_var_req_builder.build()?;
43 let local_var_resp = local_var_client.execute(local_var_req).await?;
44
45 let local_var_status = local_var_resp.status();
46 let local_var_content = local_var_resp.text().await?;
47
48 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
49 crate::from_str_patched(&local_var_content).map_err(Error::from)
50 } else {
51 let local_var_entity: Option<ListPathAutocompletePathsError> = crate::from_str_patched(&local_var_content).ok();
52 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
53 Err(Error::ResponseError(local_var_error))
54 }
55}
56