Skip to main content

windmill_api/apis/
azure_trigger_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.727.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 [`create_azure_trigger`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum CreateAzureTriggerError {
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`delete_azure_subscription`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum DeleteAzureSubscriptionError {
29    UnknownValue(serde_json::Value),
30}
31
32/// struct for typed errors of method [`delete_azure_trigger`]
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum DeleteAzureTriggerError {
36    UnknownValue(serde_json::Value),
37}
38
39/// struct for typed errors of method [`exists_azure_trigger`]
40#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum ExistsAzureTriggerError {
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`get_azure_trigger`]
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum GetAzureTriggerError {
50    UnknownValue(serde_json::Value),
51}
52
53/// struct for typed errors of method [`list_azure_basic_topics`]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum ListAzureBasicTopicsError {
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`list_azure_namespace_subscriptions`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum ListAzureNamespaceSubscriptionsError {
64    UnknownValue(serde_json::Value),
65}
66
67/// struct for typed errors of method [`list_azure_namespace_topics`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum ListAzureNamespaceTopicsError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`list_azure_namespaces`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum ListAzureNamespacesError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`list_azure_triggers`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum ListAzureTriggersError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`set_azure_trigger_mode`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum SetAzureTriggerModeError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`test_azure_connection`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum TestAzureConnectionError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`update_azure_trigger`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum UpdateAzureTriggerError {
106    UnknownValue(serde_json::Value),
107}
108
109
110pub async fn create_azure_trigger(configuration: &configuration::Configuration, workspace: &str, azure_trigger_data: models::AzureTriggerData) -> Result<String, Error<CreateAzureTriggerError>> {
111    let local_var_configuration = configuration;
112
113    let local_var_client = &local_var_configuration.client;
114
115    let local_var_uri_str = format!("{}/w/{workspace}/azure_triggers/create", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
116    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
117
118    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
119        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
120    }
121    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
122        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
123    };
124    local_var_req_builder = local_var_req_builder.json(&azure_trigger_data);
125
126    let local_var_req = local_var_req_builder.build()?;
127    let local_var_resp = local_var_client.execute(local_var_req).await?;
128
129    let local_var_status = local_var_resp.status();
130    let local_var_content = local_var_resp.text().await?;
131
132    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
133        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
134    } else {
135        let local_var_entity: Option<CreateAzureTriggerError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
136        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
137        Err(Error::ResponseError(local_var_error))
138    }
139}
140
141pub async fn delete_azure_subscription(configuration: &configuration::Configuration, workspace: &str, path: &str, azure_delete_subscription: models::AzureDeleteSubscription) -> Result<String, Error<DeleteAzureSubscriptionError>> {
142    let local_var_configuration = configuration;
143
144    let local_var_client = &local_var_configuration.client;
145
146    let local_var_uri_str = format!("{}/w/{workspace}/azure_triggers/subscriptions/delete/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
147    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
148
149    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
150        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
151    }
152    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
153        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
154    };
155    local_var_req_builder = local_var_req_builder.json(&azure_delete_subscription);
156
157    let local_var_req = local_var_req_builder.build()?;
158    let local_var_resp = local_var_client.execute(local_var_req).await?;
159
160    let local_var_status = local_var_resp.status();
161    let local_var_content = local_var_resp.text().await?;
162
163    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
164        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
165    } else {
166        let local_var_entity: Option<DeleteAzureSubscriptionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
167        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
168        Err(Error::ResponseError(local_var_error))
169    }
170}
171
172pub async fn delete_azure_trigger(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<DeleteAzureTriggerError>> {
173    let local_var_configuration = configuration;
174
175    let local_var_client = &local_var_configuration.client;
176
177    let local_var_uri_str = format!("{}/w/{workspace}/azure_triggers/delete/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
178    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
179
180    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
181        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
182    }
183    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
184        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
185    };
186
187    let local_var_req = local_var_req_builder.build()?;
188    let local_var_resp = local_var_client.execute(local_var_req).await?;
189
190    let local_var_status = local_var_resp.status();
191    let local_var_content = local_var_resp.text().await?;
192
193    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
194        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
195    } else {
196        let local_var_entity: Option<DeleteAzureTriggerError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
197        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
198        Err(Error::ResponseError(local_var_error))
199    }
200}
201
202pub async fn exists_azure_trigger(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<bool, Error<ExistsAzureTriggerError>> {
203    let local_var_configuration = configuration;
204
205    let local_var_client = &local_var_configuration.client;
206
207    let local_var_uri_str = format!("{}/w/{workspace}/azure_triggers/exists/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
208    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
209
210    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
211        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
212    }
213    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
214        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
215    };
216
217    let local_var_req = local_var_req_builder.build()?;
218    let local_var_resp = local_var_client.execute(local_var_req).await?;
219
220    let local_var_status = local_var_resp.status();
221    let local_var_content = local_var_resp.text().await?;
222
223    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
224        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
225    } else {
226        let local_var_entity: Option<ExistsAzureTriggerError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
227        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
228        Err(Error::ResponseError(local_var_error))
229    }
230}
231
232pub async fn get_azure_trigger(configuration: &configuration::Configuration, workspace: &str, path: &str, get_draft: Option<bool>) -> Result<models::GetAzureTrigger200Response, Error<GetAzureTriggerError>> {
233    let local_var_configuration = configuration;
234
235    let local_var_client = &local_var_configuration.client;
236
237    let local_var_uri_str = format!("{}/w/{workspace}/azure_triggers/get/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
238    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
239
240    if let Some(ref local_var_str) = get_draft {
241        local_var_req_builder = local_var_req_builder.query(&[("get_draft", &local_var_str.to_string())]);
242    }
243    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
244        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
245    }
246    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
247        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
248    };
249
250    let local_var_req = local_var_req_builder.build()?;
251    let local_var_resp = local_var_client.execute(local_var_req).await?;
252
253    let local_var_status = local_var_resp.status();
254    let local_var_content = local_var_resp.text().await?;
255
256    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
257        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
258    } else {
259        let local_var_entity: Option<GetAzureTriggerError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
260        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
261        Err(Error::ResponseError(local_var_error))
262    }
263}
264
265pub async fn list_azure_basic_topics(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<Vec<models::AzureArmResource>, Error<ListAzureBasicTopicsError>> {
266    let local_var_configuration = configuration;
267
268    let local_var_client = &local_var_configuration.client;
269
270    let local_var_uri_str = format!("{}/w/{workspace}/azure_triggers/basic/topics/list/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
271    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
272
273    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
274        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
275    }
276    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
277        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
278    };
279
280    let local_var_req = local_var_req_builder.build()?;
281    let local_var_resp = local_var_client.execute(local_var_req).await?;
282
283    let local_var_status = local_var_resp.status();
284    let local_var_content = local_var_resp.text().await?;
285
286    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
287        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
288    } else {
289        let local_var_entity: Option<ListAzureBasicTopicsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
290        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
291        Err(Error::ResponseError(local_var_error))
292    }
293}
294
295pub async fn list_azure_namespace_subscriptions(configuration: &configuration::Configuration, workspace: &str, path: &str, azure_list_subscriptions: models::AzureListSubscriptions) -> Result<Vec<serde_json::Value>, Error<ListAzureNamespaceSubscriptionsError>> {
296    let local_var_configuration = configuration;
297
298    let local_var_client = &local_var_configuration.client;
299
300    let local_var_uri_str = format!("{}/w/{workspace}/azure_triggers/namespaces/subscriptions/list/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
301    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
302
303    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
304        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
305    }
306    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
307        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
308    };
309    local_var_req_builder = local_var_req_builder.json(&azure_list_subscriptions);
310
311    let local_var_req = local_var_req_builder.build()?;
312    let local_var_resp = local_var_client.execute(local_var_req).await?;
313
314    let local_var_status = local_var_resp.status();
315    let local_var_content = local_var_resp.text().await?;
316
317    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
318        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
319    } else {
320        let local_var_entity: Option<ListAzureNamespaceSubscriptionsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
321        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
322        Err(Error::ResponseError(local_var_error))
323    }
324}
325
326pub async fn list_azure_namespace_topics(configuration: &configuration::Configuration, workspace: &str, path: &str, azure_list_topics: models::AzureListTopics) -> Result<Vec<serde_json::Value>, Error<ListAzureNamespaceTopicsError>> {
327    let local_var_configuration = configuration;
328
329    let local_var_client = &local_var_configuration.client;
330
331    let local_var_uri_str = format!("{}/w/{workspace}/azure_triggers/namespaces/topics/list/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
332    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
333
334    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
335        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
336    }
337    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
338        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
339    };
340    local_var_req_builder = local_var_req_builder.json(&azure_list_topics);
341
342    let local_var_req = local_var_req_builder.build()?;
343    let local_var_resp = local_var_client.execute(local_var_req).await?;
344
345    let local_var_status = local_var_resp.status();
346    let local_var_content = local_var_resp.text().await?;
347
348    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
349        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
350    } else {
351        let local_var_entity: Option<ListAzureNamespaceTopicsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
352        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
353        Err(Error::ResponseError(local_var_error))
354    }
355}
356
357pub async fn list_azure_namespaces(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<Vec<models::AzureArmResource>, Error<ListAzureNamespacesError>> {
358    let local_var_configuration = configuration;
359
360    let local_var_client = &local_var_configuration.client;
361
362    let local_var_uri_str = format!("{}/w/{workspace}/azure_triggers/namespaces/list/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
363    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
364
365    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
366        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
367    }
368    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
369        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
370    };
371
372    let local_var_req = local_var_req_builder.build()?;
373    let local_var_resp = local_var_client.execute(local_var_req).await?;
374
375    let local_var_status = local_var_resp.status();
376    let local_var_content = local_var_resp.text().await?;
377
378    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
379        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
380    } else {
381        let local_var_entity: Option<ListAzureNamespacesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
382        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
383        Err(Error::ResponseError(local_var_error))
384    }
385}
386
387pub async fn list_azure_triggers(configuration: &configuration::Configuration, workspace: &str, page: Option<i32>, per_page: Option<i32>, path: Option<&str>, is_flow: Option<bool>, path_start: Option<&str>, include_draft_only: Option<bool>) -> Result<Vec<models::AzureTrigger>, Error<ListAzureTriggersError>> {
388    let local_var_configuration = configuration;
389
390    let local_var_client = &local_var_configuration.client;
391
392    let local_var_uri_str = format!("{}/w/{workspace}/azure_triggers/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
393    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
394
395    if let Some(ref local_var_str) = page {
396        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
397    }
398    if let Some(ref local_var_str) = per_page {
399        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
400    }
401    if let Some(ref local_var_str) = path {
402        local_var_req_builder = local_var_req_builder.query(&[("path", &local_var_str.to_string())]);
403    }
404    if let Some(ref local_var_str) = is_flow {
405        local_var_req_builder = local_var_req_builder.query(&[("is_flow", &local_var_str.to_string())]);
406    }
407    if let Some(ref local_var_str) = path_start {
408        local_var_req_builder = local_var_req_builder.query(&[("path_start", &local_var_str.to_string())]);
409    }
410    if let Some(ref local_var_str) = include_draft_only {
411        local_var_req_builder = local_var_req_builder.query(&[("include_draft_only", &local_var_str.to_string())]);
412    }
413    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
414        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
415    }
416    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
417        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
418    };
419
420    let local_var_req = local_var_req_builder.build()?;
421    let local_var_resp = local_var_client.execute(local_var_req).await?;
422
423    let local_var_status = local_var_resp.status();
424    let local_var_content = local_var_resp.text().await?;
425
426    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
427        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
428    } else {
429        let local_var_entity: Option<ListAzureTriggersError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
430        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
431        Err(Error::ResponseError(local_var_error))
432    }
433}
434
435pub async fn set_azure_trigger_mode(configuration: &configuration::Configuration, workspace: &str, path: &str, set_http_trigger_mode_request: models::SetHttpTriggerModeRequest) -> Result<String, Error<SetAzureTriggerModeError>> {
436    let local_var_configuration = configuration;
437
438    let local_var_client = &local_var_configuration.client;
439
440    let local_var_uri_str = format!("{}/w/{workspace}/azure_triggers/setmode/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
441    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
442
443    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
444        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
445    }
446    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
447        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
448    };
449    local_var_req_builder = local_var_req_builder.json(&set_http_trigger_mode_request);
450
451    let local_var_req = local_var_req_builder.build()?;
452    let local_var_resp = local_var_client.execute(local_var_req).await?;
453
454    let local_var_status = local_var_resp.status();
455    let local_var_content = local_var_resp.text().await?;
456
457    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
458        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
459    } else {
460        let local_var_entity: Option<SetAzureTriggerModeError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
461        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
462        Err(Error::ResponseError(local_var_error))
463    }
464}
465
466pub async fn test_azure_connection(configuration: &configuration::Configuration, workspace: &str, test_azure_connection: models::TestAzureConnection) -> Result<String, Error<TestAzureConnectionError>> {
467    let local_var_configuration = configuration;
468
469    let local_var_client = &local_var_configuration.client;
470
471    let local_var_uri_str = format!("{}/w/{workspace}/azure_triggers/test", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
472    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
473
474    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
475        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
476    }
477    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
478        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
479    };
480    local_var_req_builder = local_var_req_builder.json(&test_azure_connection);
481
482    let local_var_req = local_var_req_builder.build()?;
483    let local_var_resp = local_var_client.execute(local_var_req).await?;
484
485    let local_var_status = local_var_resp.status();
486    let local_var_content = local_var_resp.text().await?;
487
488    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
489        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
490    } else {
491        let local_var_entity: Option<TestAzureConnectionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
492        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
493        Err(Error::ResponseError(local_var_error))
494    }
495}
496
497pub async fn update_azure_trigger(configuration: &configuration::Configuration, workspace: &str, path: &str, azure_trigger_data: models::AzureTriggerData) -> Result<String, Error<UpdateAzureTriggerError>> {
498    let local_var_configuration = configuration;
499
500    let local_var_client = &local_var_configuration.client;
501
502    let local_var_uri_str = format!("{}/w/{workspace}/azure_triggers/update/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
503    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
504
505    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
506        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
507    }
508    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
509        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
510    };
511    local_var_req_builder = local_var_req_builder.json(&azure_trigger_data);
512
513    let local_var_req = local_var_req_builder.build()?;
514    let local_var_resp = local_var_client.execute(local_var_req).await?;
515
516    let local_var_status = local_var_resp.status();
517    let local_var_content = local_var_resp.text().await?;
518
519    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
520        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
521    } else {
522        let local_var_entity: Option<UpdateAzureTriggerError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
523        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
524        Err(Error::ResponseError(local_var_error))
525    }
526}
527