Skip to main content

orvanta_api/apis/
resource_api.rs

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