Skip to main content

windmill_api/apis/
resource_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.675.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_resource`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum CreateResourceError {
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`create_resource_type`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum CreateResourceTypeError {
29    UnknownValue(serde_json::Value),
30}
31
32/// struct for typed errors of method [`delete_resource`]
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum DeleteResourceError {
36    UnknownValue(serde_json::Value),
37}
38
39/// struct for typed errors of method [`delete_resource_type`]
40#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum DeleteResourceTypeError {
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`delete_resources_bulk`]
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum DeleteResourcesBulkError {
50    UnknownValue(serde_json::Value),
51}
52
53/// struct for typed errors of method [`exists_resource`]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum ExistsResourceError {
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`exists_resource_type`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum ExistsResourceTypeError {
64    UnknownValue(serde_json::Value),
65}
66
67/// struct for typed errors of method [`file_resource_type_to_file_ext_map`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum FileResourceTypeToFileExtMapError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`get_git_commit_hash`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetGitCommitHashError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`get_mcp_tools`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum GetMcpToolsError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`get_resource`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum GetResourceError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`get_resource_type`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum GetResourceTypeError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`get_resource_value`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum GetResourceValueError {
106    UnknownValue(serde_json::Value),
107}
108
109/// struct for typed errors of method [`get_resource_value_interpolated`]
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum GetResourceValueInterpolatedError {
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`list_resource`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum ListResourceError {
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method [`list_resource_names`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum ListResourceNamesError {
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`list_resource_type`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum ListResourceTypeError {
134    UnknownValue(serde_json::Value),
135}
136
137/// struct for typed errors of method [`list_resource_type_names`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum ListResourceTypeNamesError {
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`list_search_resource`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum ListSearchResourceError {
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`query_resource_types`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum QueryResourceTypesError {
155    UnknownValue(serde_json::Value),
156}
157
158/// struct for typed errors of method [`update_resource`]
159#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum UpdateResourceError {
162    UnknownValue(serde_json::Value),
163}
164
165/// struct for typed errors of method [`update_resource_type`]
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum UpdateResourceTypeError {
169    UnknownValue(serde_json::Value),
170}
171
172/// struct for typed errors of method [`update_resource_value`]
173#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum UpdateResourceValueError {
176    UnknownValue(serde_json::Value),
177}
178
179
180pub async fn create_resource(configuration: &configuration::Configuration, workspace: &str, create_resource: models::CreateResource, update_if_exists: Option<bool>) -> Result<String, Error<CreateResourceError>> {
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}/resources/create", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
186    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
187
188    if let Some(ref local_var_str) = update_if_exists {
189        local_var_req_builder = local_var_req_builder.query(&[("update_if_exists", &local_var_str.to_string())]);
190    }
191    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
192        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
193    }
194    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
195        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
196    };
197    local_var_req_builder = local_var_req_builder.json(&create_resource);
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<CreateResourceError> = 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 create_resource_type(configuration: &configuration::Configuration, workspace: &str, resource_type: models::ResourceType) -> Result<String, Error<CreateResourceTypeError>> {
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}/resources/type/create", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
220    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
221
222    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
223        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
224    }
225    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
226        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
227    };
228    local_var_req_builder = local_var_req_builder.json(&resource_type);
229
230    let local_var_req = local_var_req_builder.build()?;
231    let local_var_resp = local_var_client.execute(local_var_req).await?;
232
233    let local_var_status = local_var_resp.status();
234    let local_var_content = local_var_resp.text().await?;
235
236    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
237        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
238    } else {
239        let local_var_entity: Option<CreateResourceTypeError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
240        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
241        Err(Error::ResponseError(local_var_error))
242    }
243}
244
245pub async fn delete_resource(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<DeleteResourceError>> {
246    let local_var_configuration = configuration;
247
248    let local_var_client = &local_var_configuration.client;
249
250    let local_var_uri_str = format!("{}/w/{workspace}/resources/delete/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
251    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
252
253    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
254        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
255    }
256    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
257        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
258    };
259
260    let local_var_req = local_var_req_builder.build()?;
261    let local_var_resp = local_var_client.execute(local_var_req).await?;
262
263    let local_var_status = local_var_resp.status();
264    let local_var_content = local_var_resp.text().await?;
265
266    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
267        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
268    } else {
269        let local_var_entity: Option<DeleteResourceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
270        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
271        Err(Error::ResponseError(local_var_error))
272    }
273}
274
275pub async fn delete_resource_type(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<DeleteResourceTypeError>> {
276    let local_var_configuration = configuration;
277
278    let local_var_client = &local_var_configuration.client;
279
280    let local_var_uri_str = format!("{}/w/{workspace}/resources/type/delete/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
281    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
282
283    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
284        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
285    }
286    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
287        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
288    };
289
290    let local_var_req = local_var_req_builder.build()?;
291    let local_var_resp = local_var_client.execute(local_var_req).await?;
292
293    let local_var_status = local_var_resp.status();
294    let local_var_content = local_var_resp.text().await?;
295
296    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
297        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
298    } else {
299        let local_var_entity: Option<DeleteResourceTypeError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
300        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
301        Err(Error::ResponseError(local_var_error))
302    }
303}
304
305pub async fn delete_resources_bulk(configuration: &configuration::Configuration, workspace: &str, delete_variables_bulk_request: models::DeleteVariablesBulkRequest) -> Result<Vec<String>, Error<DeleteResourcesBulkError>> {
306    let local_var_configuration = configuration;
307
308    let local_var_client = &local_var_configuration.client;
309
310    let local_var_uri_str = format!("{}/w/{workspace}/resources/delete_bulk", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
311    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
312
313    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
314        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
315    }
316    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
317        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
318    };
319    local_var_req_builder = local_var_req_builder.json(&delete_variables_bulk_request);
320
321    let local_var_req = local_var_req_builder.build()?;
322    let local_var_resp = local_var_client.execute(local_var_req).await?;
323
324    let local_var_status = local_var_resp.status();
325    let local_var_content = local_var_resp.text().await?;
326
327    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
328        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
329    } else {
330        let local_var_entity: Option<DeleteResourcesBulkError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
331        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
332        Err(Error::ResponseError(local_var_error))
333    }
334}
335
336pub async fn exists_resource(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<bool, Error<ExistsResourceError>> {
337    let local_var_configuration = configuration;
338
339    let local_var_client = &local_var_configuration.client;
340
341    let local_var_uri_str = format!("{}/w/{workspace}/resources/exists/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
342    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
343
344    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
345        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
346    }
347    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
348        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
349    };
350
351    let local_var_req = local_var_req_builder.build()?;
352    let local_var_resp = local_var_client.execute(local_var_req).await?;
353
354    let local_var_status = local_var_resp.status();
355    let local_var_content = local_var_resp.text().await?;
356
357    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
358        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
359    } else {
360        let local_var_entity: Option<ExistsResourceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
361        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
362        Err(Error::ResponseError(local_var_error))
363    }
364}
365
366pub async fn exists_resource_type(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<bool, Error<ExistsResourceTypeError>> {
367    let local_var_configuration = configuration;
368
369    let local_var_client = &local_var_configuration.client;
370
371    let local_var_uri_str = format!("{}/w/{workspace}/resources/type/exists/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
372    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
373
374    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
375        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
376    }
377    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
378        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
379    };
380
381    let local_var_req = local_var_req_builder.build()?;
382    let local_var_resp = local_var_client.execute(local_var_req).await?;
383
384    let local_var_status = local_var_resp.status();
385    let local_var_content = local_var_resp.text().await?;
386
387    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
388        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
389    } else {
390        let local_var_entity: Option<ExistsResourceTypeError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
391        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
392        Err(Error::ResponseError(local_var_error))
393    }
394}
395
396pub async fn file_resource_type_to_file_ext_map(configuration: &configuration::Configuration, workspace: &str) -> Result<std::collections::HashMap<String, models::FileResourceTypeToFileExtMap200ResponseValue>, Error<FileResourceTypeToFileExtMapError>> {
397    let local_var_configuration = configuration;
398
399    let local_var_client = &local_var_configuration.client;
400
401    let local_var_uri_str = format!("{}/w/{workspace}/resources/file_resource_type_to_file_ext_map", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
402    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
403
404    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
405        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
406    }
407    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
408        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
409    };
410
411    let local_var_req = local_var_req_builder.build()?;
412    let local_var_resp = local_var_client.execute(local_var_req).await?;
413
414    let local_var_status = local_var_resp.status();
415    let local_var_content = local_var_resp.text().await?;
416
417    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
418        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
419    } else {
420        let local_var_entity: Option<FileResourceTypeToFileExtMapError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
421        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
422        Err(Error::ResponseError(local_var_error))
423    }
424}
425
426pub async fn get_git_commit_hash(configuration: &configuration::Configuration, workspace: &str, path: &str, git_ssh_identity: Option<&str>) -> Result<models::GetGitCommitHash200Response, Error<GetGitCommitHashError>> {
427    let local_var_configuration = configuration;
428
429    let local_var_client = &local_var_configuration.client;
430
431    let local_var_uri_str = format!("{}/w/{workspace}/resources/git_commit_hash/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
432    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
433
434    if let Some(ref local_var_str) = git_ssh_identity {
435        local_var_req_builder = local_var_req_builder.query(&[("git_ssh_identity", &local_var_str.to_string())]);
436    }
437    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
438        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
439    }
440    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
441        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
442    };
443
444    let local_var_req = local_var_req_builder.build()?;
445    let local_var_resp = local_var_client.execute(local_var_req).await?;
446
447    let local_var_status = local_var_resp.status();
448    let local_var_content = local_var_resp.text().await?;
449
450    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
451        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
452    } else {
453        let local_var_entity: Option<GetGitCommitHashError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
454        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
455        Err(Error::ResponseError(local_var_error))
456    }
457}
458
459pub async fn get_mcp_tools(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<Vec<models::GetMcpTools200ResponseInner>, Error<GetMcpToolsError>> {
460    let local_var_configuration = configuration;
461
462    let local_var_client = &local_var_configuration.client;
463
464    let local_var_uri_str = format!("{}/w/{workspace}/resources/mcp_tools/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
465    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
466
467    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
468        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
469    }
470    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
471        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
472    };
473
474    let local_var_req = local_var_req_builder.build()?;
475    let local_var_resp = local_var_client.execute(local_var_req).await?;
476
477    let local_var_status = local_var_resp.status();
478    let local_var_content = local_var_resp.text().await?;
479
480    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
481        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
482    } else {
483        let local_var_entity: Option<GetMcpToolsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
484        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
485        Err(Error::ResponseError(local_var_error))
486    }
487}
488
489pub async fn get_resource(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::Resource, Error<GetResourceError>> {
490    let local_var_configuration = configuration;
491
492    let local_var_client = &local_var_configuration.client;
493
494    let local_var_uri_str = format!("{}/w/{workspace}/resources/get/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
495    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
496
497    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
498        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
499    }
500    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
501        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
502    };
503
504    let local_var_req = local_var_req_builder.build()?;
505    let local_var_resp = local_var_client.execute(local_var_req).await?;
506
507    let local_var_status = local_var_resp.status();
508    let local_var_content = local_var_resp.text().await?;
509
510    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
511        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
512    } else {
513        let local_var_entity: Option<GetResourceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
514        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
515        Err(Error::ResponseError(local_var_error))
516    }
517}
518
519pub async fn get_resource_type(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::ResourceType, Error<GetResourceTypeError>> {
520    let local_var_configuration = configuration;
521
522    let local_var_client = &local_var_configuration.client;
523
524    let local_var_uri_str = format!("{}/w/{workspace}/resources/type/get/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
525    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
526
527    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
528        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
529    }
530    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
531        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
532    };
533
534    let local_var_req = local_var_req_builder.build()?;
535    let local_var_resp = local_var_client.execute(local_var_req).await?;
536
537    let local_var_status = local_var_resp.status();
538    let local_var_content = local_var_resp.text().await?;
539
540    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
541        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
542    } else {
543        let local_var_entity: Option<GetResourceTypeError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
544        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
545        Err(Error::ResponseError(local_var_error))
546    }
547}
548
549pub async fn get_resource_value(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<serde_json::Value, Error<GetResourceValueError>> {
550    let local_var_configuration = configuration;
551
552    let local_var_client = &local_var_configuration.client;
553
554    let local_var_uri_str = format!("{}/w/{workspace}/resources/get_value/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
555    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
556
557    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
558        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
559    }
560    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
561        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
562    };
563
564    let local_var_req = local_var_req_builder.build()?;
565    let local_var_resp = local_var_client.execute(local_var_req).await?;
566
567    let local_var_status = local_var_resp.status();
568    let local_var_content = local_var_resp.text().await?;
569
570    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
571        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
572    } else {
573        let local_var_entity: Option<GetResourceValueError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
574        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
575        Err(Error::ResponseError(local_var_error))
576    }
577}
578
579pub async fn get_resource_value_interpolated(configuration: &configuration::Configuration, workspace: &str, path: &str, job_id: Option<&str>, allow_cache: Option<bool>) -> Result<serde_json::Value, Error<GetResourceValueInterpolatedError>> {
580    let local_var_configuration = configuration;
581
582    let local_var_client = &local_var_configuration.client;
583
584    let local_var_uri_str = format!("{}/w/{workspace}/resources/get_value_interpolated/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
585    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
586
587    if let Some(ref local_var_str) = job_id {
588        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
589    }
590    if let Some(ref local_var_str) = allow_cache {
591        local_var_req_builder = local_var_req_builder.query(&[("allow_cache", &local_var_str.to_string())]);
592    }
593    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
594        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
595    }
596    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
597        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
598    };
599
600    let local_var_req = local_var_req_builder.build()?;
601    let local_var_resp = local_var_client.execute(local_var_req).await?;
602
603    let local_var_status = local_var_resp.status();
604    let local_var_content = local_var_resp.text().await?;
605
606    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
607        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
608    } else {
609        let local_var_entity: Option<GetResourceValueInterpolatedError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
610        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
611        Err(Error::ResponseError(local_var_error))
612    }
613}
614
615pub async fn list_resource(configuration: &configuration::Configuration, workspace: &str, page: Option<i32>, per_page: Option<i32>, resource_type: Option<&str>, resource_type_exclude: Option<&str>, path_start: Option<&str>, path: Option<&str>, description: Option<&str>, value: Option<&str>, broad_filter: Option<&str>, label: Option<&str>) -> Result<Vec<models::ListableResource>, Error<ListResourceError>> {
616    let local_var_configuration = configuration;
617
618    let local_var_client = &local_var_configuration.client;
619
620    let local_var_uri_str = format!("{}/w/{workspace}/resources/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
621    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
622
623    if let Some(ref local_var_str) = page {
624        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
625    }
626    if let Some(ref local_var_str) = per_page {
627        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
628    }
629    if let Some(ref local_var_str) = resource_type {
630        local_var_req_builder = local_var_req_builder.query(&[("resource_type", &local_var_str.to_string())]);
631    }
632    if let Some(ref local_var_str) = resource_type_exclude {
633        local_var_req_builder = local_var_req_builder.query(&[("resource_type_exclude", &local_var_str.to_string())]);
634    }
635    if let Some(ref local_var_str) = path_start {
636        local_var_req_builder = local_var_req_builder.query(&[("path_start", &local_var_str.to_string())]);
637    }
638    if let Some(ref local_var_str) = path {
639        local_var_req_builder = local_var_req_builder.query(&[("path", &local_var_str.to_string())]);
640    }
641    if let Some(ref local_var_str) = description {
642        local_var_req_builder = local_var_req_builder.query(&[("description", &local_var_str.to_string())]);
643    }
644    if let Some(ref local_var_str) = value {
645        local_var_req_builder = local_var_req_builder.query(&[("value", &local_var_str.to_string())]);
646    }
647    if let Some(ref local_var_str) = broad_filter {
648        local_var_req_builder = local_var_req_builder.query(&[("broad_filter", &local_var_str.to_string())]);
649    }
650    if let Some(ref local_var_str) = label {
651        local_var_req_builder = local_var_req_builder.query(&[("label", &local_var_str.to_string())]);
652    }
653    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
654        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
655    }
656    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
657        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
658    };
659
660    let local_var_req = local_var_req_builder.build()?;
661    let local_var_resp = local_var_client.execute(local_var_req).await?;
662
663    let local_var_status = local_var_resp.status();
664    let local_var_content = local_var_resp.text().await?;
665
666    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
667        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
668    } else {
669        let local_var_entity: Option<ListResourceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
670        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
671        Err(Error::ResponseError(local_var_error))
672    }
673}
674
675pub async fn list_resource_names(configuration: &configuration::Configuration, workspace: &str, name: &str) -> Result<Vec<models::ListResourceNames200ResponseInner>, Error<ListResourceNamesError>> {
676    let local_var_configuration = configuration;
677
678    let local_var_client = &local_var_configuration.client;
679
680    let local_var_uri_str = format!("{}/w/{workspace}/resources/list_names/{name}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), name=crate::apis::urlencode(name));
681    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
682
683    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
684        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
685    }
686    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
687        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
688    };
689
690    let local_var_req = local_var_req_builder.build()?;
691    let local_var_resp = local_var_client.execute(local_var_req).await?;
692
693    let local_var_status = local_var_resp.status();
694    let local_var_content = local_var_resp.text().await?;
695
696    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
697        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
698    } else {
699        let local_var_entity: Option<ListResourceNamesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
700        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
701        Err(Error::ResponseError(local_var_error))
702    }
703}
704
705pub async fn list_resource_type(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ResourceType>, Error<ListResourceTypeError>> {
706    let local_var_configuration = configuration;
707
708    let local_var_client = &local_var_configuration.client;
709
710    let local_var_uri_str = format!("{}/w/{workspace}/resources/type/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
711    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
712
713    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
714        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
715    }
716    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
717        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
718    };
719
720    let local_var_req = local_var_req_builder.build()?;
721    let local_var_resp = local_var_client.execute(local_var_req).await?;
722
723    let local_var_status = local_var_resp.status();
724    let local_var_content = local_var_resp.text().await?;
725
726    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
727        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
728    } else {
729        let local_var_entity: Option<ListResourceTypeError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
730        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
731        Err(Error::ResponseError(local_var_error))
732    }
733}
734
735pub async fn list_resource_type_names(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<String>, Error<ListResourceTypeNamesError>> {
736    let local_var_configuration = configuration;
737
738    let local_var_client = &local_var_configuration.client;
739
740    let local_var_uri_str = format!("{}/w/{workspace}/resources/type/listnames", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
741    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
742
743    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
744        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
745    }
746    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
747        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
748    };
749
750    let local_var_req = local_var_req_builder.build()?;
751    let local_var_resp = local_var_client.execute(local_var_req).await?;
752
753    let local_var_status = local_var_resp.status();
754    let local_var_content = local_var_resp.text().await?;
755
756    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
757        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
758    } else {
759        let local_var_entity: Option<ListResourceTypeNamesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
760        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
761        Err(Error::ResponseError(local_var_error))
762    }
763}
764
765pub async fn list_search_resource(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ListSearchResource200ResponseInner>, Error<ListSearchResourceError>> {
766    let local_var_configuration = configuration;
767
768    let local_var_client = &local_var_configuration.client;
769
770    let local_var_uri_str = format!("{}/w/{workspace}/resources/list_search", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
771    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
772
773    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
774        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
775    }
776    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
777        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
778    };
779
780    let local_var_req = local_var_req_builder.build()?;
781    let local_var_resp = local_var_client.execute(local_var_req).await?;
782
783    let local_var_status = local_var_resp.status();
784    let local_var_content = local_var_resp.text().await?;
785
786    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
787        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
788    } else {
789        let local_var_entity: Option<ListSearchResourceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
790        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
791        Err(Error::ResponseError(local_var_error))
792    }
793}
794
795pub async fn query_resource_types(configuration: &configuration::Configuration, workspace: &str, text: &str, limit: Option<f64>) -> Result<Vec<models::QueryResourceTypes200ResponseInner>, Error<QueryResourceTypesError>> {
796    let local_var_configuration = configuration;
797
798    let local_var_client = &local_var_configuration.client;
799
800    let local_var_uri_str = format!("{}/w/{workspace}/embeddings/query_resource_types", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
801    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
802
803    local_var_req_builder = local_var_req_builder.query(&[("text", &text.to_string())]);
804    if let Some(ref local_var_str) = limit {
805        local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
806    }
807    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
808        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
809    }
810    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
811        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
812    };
813
814    let local_var_req = local_var_req_builder.build()?;
815    let local_var_resp = local_var_client.execute(local_var_req).await?;
816
817    let local_var_status = local_var_resp.status();
818    let local_var_content = local_var_resp.text().await?;
819
820    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
821        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
822    } else {
823        let local_var_entity: Option<QueryResourceTypesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
824        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
825        Err(Error::ResponseError(local_var_error))
826    }
827}
828
829pub async fn update_resource(configuration: &configuration::Configuration, workspace: &str, path: &str, edit_resource: models::EditResource) -> Result<String, Error<UpdateResourceError>> {
830    let local_var_configuration = configuration;
831
832    let local_var_client = &local_var_configuration.client;
833
834    let local_var_uri_str = format!("{}/w/{workspace}/resources/update/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
835    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
836
837    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
838        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
839    }
840    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
841        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
842    };
843    local_var_req_builder = local_var_req_builder.json(&edit_resource);
844
845    let local_var_req = local_var_req_builder.build()?;
846    let local_var_resp = local_var_client.execute(local_var_req).await?;
847
848    let local_var_status = local_var_resp.status();
849    let local_var_content = local_var_resp.text().await?;
850
851    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
852        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
853    } else {
854        let local_var_entity: Option<UpdateResourceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
855        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
856        Err(Error::ResponseError(local_var_error))
857    }
858}
859
860pub async fn update_resource_type(configuration: &configuration::Configuration, workspace: &str, path: &str, edit_resource_type: models::EditResourceType) -> Result<String, Error<UpdateResourceTypeError>> {
861    let local_var_configuration = configuration;
862
863    let local_var_client = &local_var_configuration.client;
864
865    let local_var_uri_str = format!("{}/w/{workspace}/resources/type/update/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
866    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
867
868    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
869        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
870    }
871    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
872        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
873    };
874    local_var_req_builder = local_var_req_builder.json(&edit_resource_type);
875
876    let local_var_req = local_var_req_builder.build()?;
877    let local_var_resp = local_var_client.execute(local_var_req).await?;
878
879    let local_var_status = local_var_resp.status();
880    let local_var_content = local_var_resp.text().await?;
881
882    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
883        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
884    } else {
885        let local_var_entity: Option<UpdateResourceTypeError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
886        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
887        Err(Error::ResponseError(local_var_error))
888    }
889}
890
891pub async fn update_resource_value(configuration: &configuration::Configuration, workspace: &str, path: &str, set_global_request: models::SetGlobalRequest) -> Result<String, Error<UpdateResourceValueError>> {
892    let local_var_configuration = configuration;
893
894    let local_var_client = &local_var_configuration.client;
895
896    let local_var_uri_str = format!("{}/w/{workspace}/resources/update_value/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
897    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
898
899    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
900        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
901    }
902    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
903        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
904    };
905    local_var_req_builder = local_var_req_builder.json(&set_global_request);
906
907    let local_var_req = local_var_req_builder.build()?;
908    let local_var_resp = local_var_client.execute(local_var_req).await?;
909
910    let local_var_status = local_var_resp.status();
911    let local_var_content = local_var_resp.text().await?;
912
913    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
914        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
915    } else {
916        let local_var_entity: Option<UpdateResourceValueError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
917        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
918        Err(Error::ResponseError(local_var_error))
919    }
920}
921