hab_rs_api_client/apis/
items_api.rs

1/*
2 * openHAB REST API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 8
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use super::{Error, configuration};
12use crate::apis::ContentType;
13use crate::{apis::ResponseContent, models};
14use async_trait::async_trait;
15#[cfg(feature = "mockall")]
16use mockall::automock;
17use reqwest;
18use serde::{Deserialize, Serialize, de::Error as _};
19use std::sync::Arc;
20
21#[cfg_attr(feature = "mockall", automock)]
22#[async_trait]
23pub trait ItemsApi: Send + Sync {
24    /// PUT /items/{itemName}/members/{memberItemName}
25    ///
26    ///
27    async fn add_member_to_group_item<'item_name, 'member_item_name>(
28        &self,
29        item_name: &'item_name str,
30        member_item_name: &'member_item_name str,
31    ) -> Result<(), Error<AddMemberToGroupItemError>>;
32
33    /// PUT /items/{itemname}/metadata/{namespace}
34    ///
35    ///
36    async fn add_metadata_to_item<'itemname, 'namespace, 'metadata_dto>(
37        &self,
38        itemname: &'itemname str,
39        namespace: &'namespace str,
40        metadata_dto: models::MetadataDto,
41    ) -> Result<(), Error<AddMetadataToItemError>>;
42
43    /// PUT /items/{itemname}
44    ///
45    ///
46    async fn add_or_update_item_in_registry<'itemname, 'group_item_dto, 'accept_language>(
47        &self,
48        itemname: &'itemname str,
49        group_item_dto: models::GroupItemDto,
50        accept_language: Option<&'accept_language str>,
51    ) -> Result<models::EnrichedItemDto, Error<AddOrUpdateItemInRegistryError>>;
52
53    /// PUT /items
54    ///
55    ///
56    async fn add_or_update_items_in_registry<'group_item_dto>(
57        &self,
58        group_item_dto: Vec<models::GroupItemDto>,
59    ) -> Result<String, Error<AddOrUpdateItemsInRegistryError>>;
60
61    /// PUT /items/{itemname}/tags/{tag}
62    ///
63    ///
64    async fn add_tag_to_item<'itemname, 'tag>(
65        &self,
66        itemname: &'itemname str,
67        tag: &'tag str,
68    ) -> Result<(), Error<AddTagToItemError>>;
69
70    /// GET /items/{itemname}
71    ///
72    ///
73    async fn get_item_by_name<'itemname, 'accept_language, 'metadata, 'recursive>(
74        &self,
75        itemname: &'itemname str,
76        accept_language: Option<&'accept_language str>,
77        metadata: Option<&'metadata str>,
78        recursive: Option<bool>,
79    ) -> Result<models::EnrichedItemDto, Error<GetItemByNameError>>;
80
81    /// GET /items/{itemname}/metadata/namespaces
82    ///
83    ///
84    async fn get_item_namespaces<'itemname, 'accept_language>(
85        &self,
86        itemname: &'itemname str,
87        accept_language: Option<&'accept_language str>,
88    ) -> Result<String, Error<GetItemNamespacesError>>;
89
90    /// GET /items/{itemname}/state
91    ///
92    ///
93    async fn get_item_state1<'itemname>(
94        &self,
95        itemname: &'itemname str,
96    ) -> Result<String, Error<GetItemState1Error>>;
97
98    /// GET /items
99    ///
100    ///
101    async fn get_items<
102        'accept_language,
103        'r_type,
104        'tags,
105        'metadata,
106        'recursive,
107        'fields,
108        'static_data_only,
109    >(
110        &self,
111        accept_language: Option<&'accept_language str>,
112        r#type: Option<&'r_type str>,
113        tags: Option<&'tags str>,
114        metadata: Option<&'metadata str>,
115        recursive: Option<bool>,
116        fields: Option<&'fields str>,
117        static_data_only: Option<bool>,
118    ) -> Result<Vec<models::EnrichedItemDto>, Error<GetItemsError>>;
119
120    /// GET /items/{itemName}/semantic/{semanticClass}
121    ///
122    ///
123    async fn get_semantic_item<'item_name, 'semantic_class, 'accept_language>(
124        &self,
125        item_name: &'item_name str,
126        semantic_class: &'semantic_class str,
127        accept_language: Option<&'accept_language str>,
128    ) -> Result<(), Error<GetSemanticItemError>>;
129
130    /// POST /items/metadata/purge
131    ///
132    ///
133    async fn purge_database(&self) -> Result<(), Error<PurgeDatabaseError>>;
134
135    /// DELETE /items/{itemname}
136    ///
137    ///
138    async fn remove_item_from_registry<'itemname>(
139        &self,
140        itemname: &'itemname str,
141    ) -> Result<(), Error<RemoveItemFromRegistryError>>;
142
143    /// DELETE /items/{itemName}/members/{memberItemName}
144    ///
145    ///
146    async fn remove_member_from_group_item<'item_name, 'member_item_name>(
147        &self,
148        item_name: &'item_name str,
149        member_item_name: &'member_item_name str,
150    ) -> Result<(), Error<RemoveMemberFromGroupItemError>>;
151
152    /// DELETE /items/{itemname}/metadata/{namespace}
153    ///
154    ///
155    async fn remove_metadata_from_item<'itemname, 'namespace>(
156        &self,
157        itemname: &'itemname str,
158        namespace: &'namespace str,
159    ) -> Result<(), Error<RemoveMetadataFromItemError>>;
160
161    /// DELETE /items/{itemname}/tags/{tag}
162    ///
163    ///
164    async fn remove_tag_from_item<'itemname, 'tag>(
165        &self,
166        itemname: &'itemname str,
167        tag: &'tag str,
168    ) -> Result<(), Error<RemoveTagFromItemError>>;
169
170    /// POST /items/{itemname}
171    ///
172    ///
173    async fn send_item_command<'itemname, 'body>(
174        &self,
175        itemname: &'itemname str,
176        body: &'body str,
177    ) -> Result<(), Error<SendItemCommandError>>;
178
179    /// PUT /items/{itemname}/state
180    ///
181    ///
182    async fn update_item_state<'itemname, 'body, 'accept_language>(
183        &self,
184        itemname: &'itemname str,
185        body: &'body str,
186        accept_language: Option<&'accept_language str>,
187    ) -> Result<(), Error<UpdateItemStateError>>;
188}
189
190pub struct ItemsApiClient {
191    configuration: Arc<configuration::Configuration>,
192}
193
194impl ItemsApiClient {
195    pub fn new(configuration: Arc<configuration::Configuration>) -> Self {
196        Self { configuration }
197    }
198}
199
200#[async_trait]
201impl ItemsApi for ItemsApiClient {
202    async fn add_member_to_group_item<'item_name, 'member_item_name>(
203        &self,
204        item_name: &'item_name str,
205        member_item_name: &'member_item_name str,
206    ) -> Result<(), Error<AddMemberToGroupItemError>> {
207        let local_var_configuration = &self.configuration;
208
209        let local_var_client = &local_var_configuration.client;
210
211        let local_var_uri_str = format!(
212            "{}/items/{itemName}/members/{memberItemName}",
213            local_var_configuration.base_path,
214            itemName = crate::apis::urlencode(item_name),
215            memberItemName = crate::apis::urlencode(member_item_name)
216        );
217        let mut local_var_req_builder =
218            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
219
220        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
221            local_var_req_builder = local_var_req_builder
222                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
223        }
224        if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
225            local_var_req_builder = local_var_req_builder.basic_auth(
226                local_var_auth_conf.0.to_owned(),
227                local_var_auth_conf.1.to_owned(),
228            );
229        };
230        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
231            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
232        };
233
234        let local_var_req = local_var_req_builder.build()?;
235        let local_var_resp = local_var_client.execute(local_var_req).await?;
236
237        let local_var_status = local_var_resp.status();
238        let local_var_content = local_var_resp.text().await?;
239
240        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
241            Ok(())
242        } else {
243            let local_var_entity: Option<AddMemberToGroupItemError> =
244                serde_json::from_str(&local_var_content).ok();
245            let local_var_error = ResponseContent {
246                status: local_var_status,
247                content: local_var_content,
248                entity: local_var_entity,
249            };
250            Err(Error::ResponseError(local_var_error))
251        }
252    }
253
254    async fn add_metadata_to_item<'itemname, 'namespace, 'metadata_dto>(
255        &self,
256        itemname: &'itemname str,
257        namespace: &'namespace str,
258        metadata_dto: models::MetadataDto,
259    ) -> Result<(), Error<AddMetadataToItemError>> {
260        let local_var_configuration = &self.configuration;
261
262        let local_var_client = &local_var_configuration.client;
263
264        let local_var_uri_str = format!(
265            "{}/items/{itemname}/metadata/{namespace}",
266            local_var_configuration.base_path,
267            itemname = crate::apis::urlencode(itemname),
268            namespace = crate::apis::urlencode(namespace)
269        );
270        let mut local_var_req_builder =
271            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
272
273        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
274            local_var_req_builder = local_var_req_builder
275                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
276        }
277        if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
278            local_var_req_builder = local_var_req_builder.basic_auth(
279                local_var_auth_conf.0.to_owned(),
280                local_var_auth_conf.1.to_owned(),
281            );
282        };
283        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
284            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
285        };
286        local_var_req_builder = local_var_req_builder.json(&metadata_dto);
287
288        let local_var_req = local_var_req_builder.build()?;
289        let local_var_resp = local_var_client.execute(local_var_req).await?;
290
291        let local_var_status = local_var_resp.status();
292        let local_var_content = local_var_resp.text().await?;
293
294        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
295            Ok(())
296        } else {
297            let local_var_entity: Option<AddMetadataToItemError> =
298                serde_json::from_str(&local_var_content).ok();
299            let local_var_error = ResponseContent {
300                status: local_var_status,
301                content: local_var_content,
302                entity: local_var_entity,
303            };
304            Err(Error::ResponseError(local_var_error))
305        }
306    }
307
308    async fn add_or_update_item_in_registry<'itemname, 'group_item_dto, 'accept_language>(
309        &self,
310        itemname: &'itemname str,
311        group_item_dto: models::GroupItemDto,
312        accept_language: Option<&'accept_language str>,
313    ) -> Result<models::EnrichedItemDto, Error<AddOrUpdateItemInRegistryError>> {
314        let local_var_configuration = &self.configuration;
315
316        let local_var_client = &local_var_configuration.client;
317
318        let local_var_uri_str = format!(
319            "{}/items/{itemname}",
320            local_var_configuration.base_path,
321            itemname = crate::apis::urlencode(itemname)
322        );
323        let mut local_var_req_builder =
324            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
325
326        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
327            local_var_req_builder = local_var_req_builder
328                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
329        }
330        if let Some(local_var_param_value) = accept_language {
331            local_var_req_builder =
332                local_var_req_builder.header("Accept-Language", local_var_param_value.to_string());
333        }
334        if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
335            local_var_req_builder = local_var_req_builder.basic_auth(
336                local_var_auth_conf.0.to_owned(),
337                local_var_auth_conf.1.to_owned(),
338            );
339        };
340        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
341            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
342        };
343        local_var_req_builder = local_var_req_builder.json(&group_item_dto);
344
345        let local_var_req = local_var_req_builder.build()?;
346        let local_var_resp = local_var_client.execute(local_var_req).await?;
347
348        let local_var_status = local_var_resp.status();
349        let local_var_content_type = local_var_resp
350            .headers()
351            .get("content-type")
352            .and_then(|v| v.to_str().ok())
353            .unwrap_or("application/octet-stream");
354        let local_var_content_type = super::ContentType::from(local_var_content_type);
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            match local_var_content_type {
359                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
360                ContentType::Text => {
361                    return Err(Error::from(serde_json::Error::custom(
362                        "Received `text/plain` content type response that cannot be converted to `models::EnrichedItemDto`",
363                    )));
364                }
365                ContentType::Unsupported(local_var_unknown_type) => {
366                    return Err(Error::from(serde_json::Error::custom(format!(
367                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EnrichedItemDto`"
368                    ))));
369                }
370            }
371        } else {
372            let local_var_entity: Option<AddOrUpdateItemInRegistryError> =
373                serde_json::from_str(&local_var_content).ok();
374            let local_var_error = ResponseContent {
375                status: local_var_status,
376                content: local_var_content,
377                entity: local_var_entity,
378            };
379            Err(Error::ResponseError(local_var_error))
380        }
381    }
382
383    async fn add_or_update_items_in_registry<'group_item_dto>(
384        &self,
385        group_item_dto: Vec<models::GroupItemDto>,
386    ) -> Result<String, Error<AddOrUpdateItemsInRegistryError>> {
387        let local_var_configuration = &self.configuration;
388
389        let local_var_client = &local_var_configuration.client;
390
391        let local_var_uri_str = format!("{}/items", local_var_configuration.base_path);
392        let mut local_var_req_builder =
393            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
394
395        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
396            local_var_req_builder = local_var_req_builder
397                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
398        }
399        if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
400            local_var_req_builder = local_var_req_builder.basic_auth(
401                local_var_auth_conf.0.to_owned(),
402                local_var_auth_conf.1.to_owned(),
403            );
404        };
405        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
406            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
407        };
408        local_var_req_builder = local_var_req_builder.json(&group_item_dto);
409
410        let local_var_req = local_var_req_builder.build()?;
411        let local_var_resp = local_var_client.execute(local_var_req).await?;
412
413        let local_var_status = local_var_resp.status();
414        let local_var_content_type = local_var_resp
415            .headers()
416            .get("content-type")
417            .and_then(|v| v.to_str().ok())
418            .unwrap_or("application/octet-stream");
419        let local_var_content_type = super::ContentType::from(local_var_content_type);
420        let local_var_content = local_var_resp.text().await?;
421
422        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
423            match local_var_content_type {
424                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
425                ContentType::Text => {
426                    return Err(Error::from(serde_json::Error::custom(
427                        "Received `text/plain` content type response that cannot be converted to `String`",
428                    )));
429                }
430                ContentType::Unsupported(local_var_unknown_type) => {
431                    return Err(Error::from(serde_json::Error::custom(format!(
432                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `String`"
433                    ))));
434                }
435            }
436        } else {
437            let local_var_entity: Option<AddOrUpdateItemsInRegistryError> =
438                serde_json::from_str(&local_var_content).ok();
439            let local_var_error = ResponseContent {
440                status: local_var_status,
441                content: local_var_content,
442                entity: local_var_entity,
443            };
444            Err(Error::ResponseError(local_var_error))
445        }
446    }
447
448    async fn add_tag_to_item<'itemname, 'tag>(
449        &self,
450        itemname: &'itemname str,
451        tag: &'tag str,
452    ) -> Result<(), Error<AddTagToItemError>> {
453        let local_var_configuration = &self.configuration;
454
455        let local_var_client = &local_var_configuration.client;
456
457        let local_var_uri_str = format!(
458            "{}/items/{itemname}/tags/{tag}",
459            local_var_configuration.base_path,
460            itemname = crate::apis::urlencode(itemname),
461            tag = crate::apis::urlencode(tag)
462        );
463        let mut local_var_req_builder =
464            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
465
466        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
467            local_var_req_builder = local_var_req_builder
468                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
469        }
470        if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
471            local_var_req_builder = local_var_req_builder.basic_auth(
472                local_var_auth_conf.0.to_owned(),
473                local_var_auth_conf.1.to_owned(),
474            );
475        };
476        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
477            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
478        };
479
480        let local_var_req = local_var_req_builder.build()?;
481        let local_var_resp = local_var_client.execute(local_var_req).await?;
482
483        let local_var_status = local_var_resp.status();
484        let local_var_content = local_var_resp.text().await?;
485
486        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
487            Ok(())
488        } else {
489            let local_var_entity: Option<AddTagToItemError> =
490                serde_json::from_str(&local_var_content).ok();
491            let local_var_error = ResponseContent {
492                status: local_var_status,
493                content: local_var_content,
494                entity: local_var_entity,
495            };
496            Err(Error::ResponseError(local_var_error))
497        }
498    }
499
500    async fn get_item_by_name<'itemname, 'accept_language, 'metadata, 'recursive>(
501        &self,
502        itemname: &'itemname str,
503        accept_language: Option<&'accept_language str>,
504        metadata: Option<&'metadata str>,
505        recursive: Option<bool>,
506    ) -> Result<models::EnrichedItemDto, Error<GetItemByNameError>> {
507        let local_var_configuration = &self.configuration;
508
509        let local_var_client = &local_var_configuration.client;
510
511        let local_var_uri_str = format!(
512            "{}/items/{itemname}",
513            local_var_configuration.base_path,
514            itemname = crate::apis::urlencode(itemname)
515        );
516        let mut local_var_req_builder =
517            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
518
519        if let Some(ref local_var_str) = metadata {
520            local_var_req_builder =
521                local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]);
522        }
523        if let Some(ref local_var_str) = recursive {
524            local_var_req_builder =
525                local_var_req_builder.query(&[("recursive", &local_var_str.to_string())]);
526        }
527        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
528            local_var_req_builder = local_var_req_builder
529                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
530        }
531        if let Some(local_var_param_value) = accept_language {
532            local_var_req_builder =
533                local_var_req_builder.header("Accept-Language", local_var_param_value.to_string());
534        }
535
536        let local_var_req = local_var_req_builder.build()?;
537        let local_var_resp = local_var_client.execute(local_var_req).await?;
538
539        let local_var_status = local_var_resp.status();
540        let local_var_content_type = local_var_resp
541            .headers()
542            .get("content-type")
543            .and_then(|v| v.to_str().ok())
544            .unwrap_or("application/octet-stream");
545        let local_var_content_type = super::ContentType::from(local_var_content_type);
546        let local_var_content = local_var_resp.text().await?;
547
548        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
549            match local_var_content_type {
550                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
551                ContentType::Text => {
552                    return Err(Error::from(serde_json::Error::custom(
553                        "Received `text/plain` content type response that cannot be converted to `models::EnrichedItemDto`",
554                    )));
555                }
556                ContentType::Unsupported(local_var_unknown_type) => {
557                    return Err(Error::from(serde_json::Error::custom(format!(
558                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::EnrichedItemDto`"
559                    ))));
560                }
561            }
562        } else {
563            let local_var_entity: Option<GetItemByNameError> =
564                serde_json::from_str(&local_var_content).ok();
565            let local_var_error = ResponseContent {
566                status: local_var_status,
567                content: local_var_content,
568                entity: local_var_entity,
569            };
570            Err(Error::ResponseError(local_var_error))
571        }
572    }
573
574    async fn get_item_namespaces<'itemname, 'accept_language>(
575        &self,
576        itemname: &'itemname str,
577        accept_language: Option<&'accept_language str>,
578    ) -> Result<String, Error<GetItemNamespacesError>> {
579        let local_var_configuration = &self.configuration;
580
581        let local_var_client = &local_var_configuration.client;
582
583        let local_var_uri_str = format!(
584            "{}/items/{itemname}/metadata/namespaces",
585            local_var_configuration.base_path,
586            itemname = crate::apis::urlencode(itemname)
587        );
588        let mut local_var_req_builder =
589            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
590
591        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
592            local_var_req_builder = local_var_req_builder
593                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
594        }
595        if let Some(local_var_param_value) = accept_language {
596            local_var_req_builder =
597                local_var_req_builder.header("Accept-Language", local_var_param_value.to_string());
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_type = local_var_resp
605            .headers()
606            .get("content-type")
607            .and_then(|v| v.to_str().ok())
608            .unwrap_or("application/octet-stream");
609        let local_var_content_type = super::ContentType::from(local_var_content_type);
610        let local_var_content = local_var_resp.text().await?;
611
612        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
613            match local_var_content_type {
614                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
615                ContentType::Text => {
616                    return Err(Error::from(serde_json::Error::custom(
617                        "Received `text/plain` content type response that cannot be converted to `String`",
618                    )));
619                }
620                ContentType::Unsupported(local_var_unknown_type) => {
621                    return Err(Error::from(serde_json::Error::custom(format!(
622                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `String`"
623                    ))));
624                }
625            }
626        } else {
627            let local_var_entity: Option<GetItemNamespacesError> =
628                serde_json::from_str(&local_var_content).ok();
629            let local_var_error = ResponseContent {
630                status: local_var_status,
631                content: local_var_content,
632                entity: local_var_entity,
633            };
634            Err(Error::ResponseError(local_var_error))
635        }
636    }
637
638    async fn get_item_state1<'itemname>(
639        &self,
640        itemname: &'itemname str,
641    ) -> Result<String, Error<GetItemState1Error>> {
642        let local_var_configuration = &self.configuration;
643
644        let local_var_client = &local_var_configuration.client;
645
646        let local_var_uri_str = format!(
647            "{}/items/{itemname}/state",
648            local_var_configuration.base_path,
649            itemname = crate::apis::urlencode(itemname)
650        );
651        let mut local_var_req_builder =
652            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
653
654        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
655            local_var_req_builder = local_var_req_builder
656                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
657        }
658
659        let local_var_req = local_var_req_builder.build()?;
660        let local_var_resp = local_var_client.execute(local_var_req).await?;
661
662        let local_var_status = local_var_resp.status();
663        let local_var_content_type = local_var_resp
664            .headers()
665            .get("content-type")
666            .and_then(|v| v.to_str().ok())
667            .unwrap_or("application/octet-stream");
668        let local_var_content_type = super::ContentType::from(local_var_content_type);
669        let local_var_content = local_var_resp.text().await?;
670
671        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
672            match local_var_content_type {
673                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
674                ContentType::Text => return Ok(local_var_content),
675                ContentType::Unsupported(local_var_unknown_type) => {
676                    return Err(Error::from(serde_json::Error::custom(format!(
677                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `String`"
678                    ))));
679                }
680            }
681        } else {
682            let local_var_entity: Option<GetItemState1Error> =
683                serde_json::from_str(&local_var_content).ok();
684            let local_var_error = ResponseContent {
685                status: local_var_status,
686                content: local_var_content,
687                entity: local_var_entity,
688            };
689            Err(Error::ResponseError(local_var_error))
690        }
691    }
692
693    async fn get_items<
694        'accept_language,
695        'r_type,
696        'tags,
697        'metadata,
698        'recursive,
699        'fields,
700        'static_data_only,
701    >(
702        &self,
703        accept_language: Option<&'accept_language str>,
704        r#type: Option<&'r_type str>,
705        tags: Option<&'tags str>,
706        metadata: Option<&'metadata str>,
707        recursive: Option<bool>,
708        fields: Option<&'fields str>,
709        static_data_only: Option<bool>,
710    ) -> Result<Vec<models::EnrichedItemDto>, Error<GetItemsError>> {
711        let local_var_configuration = &self.configuration;
712
713        let local_var_client = &local_var_configuration.client;
714
715        let local_var_uri_str = format!("{}/items", local_var_configuration.base_path);
716        let mut local_var_req_builder =
717            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
718
719        if let Some(ref local_var_str) = r#type {
720            local_var_req_builder =
721                local_var_req_builder.query(&[("type", &local_var_str.to_string())]);
722        }
723        if let Some(ref local_var_str) = tags {
724            local_var_req_builder =
725                local_var_req_builder.query(&[("tags", &local_var_str.to_string())]);
726        }
727        if let Some(ref local_var_str) = metadata {
728            local_var_req_builder =
729                local_var_req_builder.query(&[("metadata", &local_var_str.to_string())]);
730        }
731        if let Some(ref local_var_str) = recursive {
732            local_var_req_builder =
733                local_var_req_builder.query(&[("recursive", &local_var_str.to_string())]);
734        }
735        if let Some(ref local_var_str) = fields {
736            local_var_req_builder =
737                local_var_req_builder.query(&[("fields", &local_var_str.to_string())]);
738        }
739        if let Some(ref local_var_str) = static_data_only {
740            local_var_req_builder =
741                local_var_req_builder.query(&[("staticDataOnly", &local_var_str.to_string())]);
742        }
743        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
744            local_var_req_builder = local_var_req_builder
745                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
746        }
747        if let Some(local_var_param_value) = accept_language {
748            local_var_req_builder =
749                local_var_req_builder.header("Accept-Language", local_var_param_value.to_string());
750        }
751
752        let local_var_req = local_var_req_builder.build()?;
753        let local_var_resp = local_var_client.execute(local_var_req).await?;
754
755        let local_var_status = local_var_resp.status();
756        let local_var_content_type = local_var_resp
757            .headers()
758            .get("content-type")
759            .and_then(|v| v.to_str().ok())
760            .unwrap_or("application/octet-stream");
761        let local_var_content_type = super::ContentType::from(local_var_content_type);
762        let local_var_content = local_var_resp.text().await?;
763
764        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
765            match local_var_content_type {
766                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
767                ContentType::Text => {
768                    return Err(Error::from(serde_json::Error::custom(
769                        "Received `text/plain` content type response that cannot be converted to `Vec&lt;models::EnrichedItemDto&gt;`",
770                    )));
771                }
772                ContentType::Unsupported(local_var_unknown_type) => {
773                    return Err(Error::from(serde_json::Error::custom(format!(
774                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `Vec&lt;models::EnrichedItemDto&gt;`"
775                    ))));
776                }
777            }
778        } else {
779            let local_var_entity: Option<GetItemsError> =
780                serde_json::from_str(&local_var_content).ok();
781            let local_var_error = ResponseContent {
782                status: local_var_status,
783                content: local_var_content,
784                entity: local_var_entity,
785            };
786            Err(Error::ResponseError(local_var_error))
787        }
788    }
789
790    async fn get_semantic_item<'item_name, 'semantic_class, 'accept_language>(
791        &self,
792        item_name: &'item_name str,
793        semantic_class: &'semantic_class str,
794        accept_language: Option<&'accept_language str>,
795    ) -> Result<(), Error<GetSemanticItemError>> {
796        let local_var_configuration = &self.configuration;
797
798        let local_var_client = &local_var_configuration.client;
799
800        let local_var_uri_str = format!(
801            "{}/items/{itemName}/semantic/{semanticClass}",
802            local_var_configuration.base_path,
803            itemName = crate::apis::urlencode(item_name),
804            semanticClass = crate::apis::urlencode(semantic_class)
805        );
806        let mut local_var_req_builder =
807            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
808
809        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
810            local_var_req_builder = local_var_req_builder
811                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
812        }
813        if let Some(local_var_param_value) = accept_language {
814            local_var_req_builder =
815                local_var_req_builder.header("Accept-Language", local_var_param_value.to_string());
816        }
817
818        let local_var_req = local_var_req_builder.build()?;
819        let local_var_resp = local_var_client.execute(local_var_req).await?;
820
821        let local_var_status = local_var_resp.status();
822        let local_var_content = local_var_resp.text().await?;
823
824        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
825            Ok(())
826        } else {
827            let local_var_entity: Option<GetSemanticItemError> =
828                serde_json::from_str(&local_var_content).ok();
829            let local_var_error = ResponseContent {
830                status: local_var_status,
831                content: local_var_content,
832                entity: local_var_entity,
833            };
834            Err(Error::ResponseError(local_var_error))
835        }
836    }
837
838    async fn purge_database(&self) -> Result<(), Error<PurgeDatabaseError>> {
839        let local_var_configuration = &self.configuration;
840
841        let local_var_client = &local_var_configuration.client;
842
843        let local_var_uri_str =
844            format!("{}/items/metadata/purge", local_var_configuration.base_path);
845        let mut local_var_req_builder =
846            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
847
848        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
849            local_var_req_builder = local_var_req_builder
850                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
851        }
852        if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
853            local_var_req_builder = local_var_req_builder.basic_auth(
854                local_var_auth_conf.0.to_owned(),
855                local_var_auth_conf.1.to_owned(),
856            );
857        };
858        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
859            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
860        };
861
862        let local_var_req = local_var_req_builder.build()?;
863        let local_var_resp = local_var_client.execute(local_var_req).await?;
864
865        let local_var_status = local_var_resp.status();
866        let local_var_content = local_var_resp.text().await?;
867
868        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
869            Ok(())
870        } else {
871            let local_var_entity: Option<PurgeDatabaseError> =
872                serde_json::from_str(&local_var_content).ok();
873            let local_var_error = ResponseContent {
874                status: local_var_status,
875                content: local_var_content,
876                entity: local_var_entity,
877            };
878            Err(Error::ResponseError(local_var_error))
879        }
880    }
881
882    async fn remove_item_from_registry<'itemname>(
883        &self,
884        itemname: &'itemname str,
885    ) -> Result<(), Error<RemoveItemFromRegistryError>> {
886        let local_var_configuration = &self.configuration;
887
888        let local_var_client = &local_var_configuration.client;
889
890        let local_var_uri_str = format!(
891            "{}/items/{itemname}",
892            local_var_configuration.base_path,
893            itemname = crate::apis::urlencode(itemname)
894        );
895        let mut local_var_req_builder =
896            local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
897
898        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
899            local_var_req_builder = local_var_req_builder
900                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
901        }
902        if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
903            local_var_req_builder = local_var_req_builder.basic_auth(
904                local_var_auth_conf.0.to_owned(),
905                local_var_auth_conf.1.to_owned(),
906            );
907        };
908        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
909            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
910        };
911
912        let local_var_req = local_var_req_builder.build()?;
913        let local_var_resp = local_var_client.execute(local_var_req).await?;
914
915        let local_var_status = local_var_resp.status();
916        let local_var_content = local_var_resp.text().await?;
917
918        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
919            Ok(())
920        } else {
921            let local_var_entity: Option<RemoveItemFromRegistryError> =
922                serde_json::from_str(&local_var_content).ok();
923            let local_var_error = ResponseContent {
924                status: local_var_status,
925                content: local_var_content,
926                entity: local_var_entity,
927            };
928            Err(Error::ResponseError(local_var_error))
929        }
930    }
931
932    async fn remove_member_from_group_item<'item_name, 'member_item_name>(
933        &self,
934        item_name: &'item_name str,
935        member_item_name: &'member_item_name str,
936    ) -> Result<(), Error<RemoveMemberFromGroupItemError>> {
937        let local_var_configuration = &self.configuration;
938
939        let local_var_client = &local_var_configuration.client;
940
941        let local_var_uri_str = format!(
942            "{}/items/{itemName}/members/{memberItemName}",
943            local_var_configuration.base_path,
944            itemName = crate::apis::urlencode(item_name),
945            memberItemName = crate::apis::urlencode(member_item_name)
946        );
947        let mut local_var_req_builder =
948            local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
949
950        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
951            local_var_req_builder = local_var_req_builder
952                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
953        }
954        if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
955            local_var_req_builder = local_var_req_builder.basic_auth(
956                local_var_auth_conf.0.to_owned(),
957                local_var_auth_conf.1.to_owned(),
958            );
959        };
960        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
961            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
962        };
963
964        let local_var_req = local_var_req_builder.build()?;
965        let local_var_resp = local_var_client.execute(local_var_req).await?;
966
967        let local_var_status = local_var_resp.status();
968        let local_var_content = local_var_resp.text().await?;
969
970        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
971            Ok(())
972        } else {
973            let local_var_entity: Option<RemoveMemberFromGroupItemError> =
974                serde_json::from_str(&local_var_content).ok();
975            let local_var_error = ResponseContent {
976                status: local_var_status,
977                content: local_var_content,
978                entity: local_var_entity,
979            };
980            Err(Error::ResponseError(local_var_error))
981        }
982    }
983
984    async fn remove_metadata_from_item<'itemname, 'namespace>(
985        &self,
986        itemname: &'itemname str,
987        namespace: &'namespace str,
988    ) -> Result<(), Error<RemoveMetadataFromItemError>> {
989        let local_var_configuration = &self.configuration;
990
991        let local_var_client = &local_var_configuration.client;
992
993        let local_var_uri_str = format!(
994            "{}/items/{itemname}/metadata/{namespace}",
995            local_var_configuration.base_path,
996            itemname = crate::apis::urlencode(itemname),
997            namespace = crate::apis::urlencode(namespace)
998        );
999        let mut local_var_req_builder =
1000            local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1001
1002        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1003            local_var_req_builder = local_var_req_builder
1004                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1005        }
1006        if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
1007            local_var_req_builder = local_var_req_builder.basic_auth(
1008                local_var_auth_conf.0.to_owned(),
1009                local_var_auth_conf.1.to_owned(),
1010            );
1011        };
1012        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1013            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1014        };
1015
1016        let local_var_req = local_var_req_builder.build()?;
1017        let local_var_resp = local_var_client.execute(local_var_req).await?;
1018
1019        let local_var_status = local_var_resp.status();
1020        let local_var_content = local_var_resp.text().await?;
1021
1022        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1023            Ok(())
1024        } else {
1025            let local_var_entity: Option<RemoveMetadataFromItemError> =
1026                serde_json::from_str(&local_var_content).ok();
1027            let local_var_error = ResponseContent {
1028                status: local_var_status,
1029                content: local_var_content,
1030                entity: local_var_entity,
1031            };
1032            Err(Error::ResponseError(local_var_error))
1033        }
1034    }
1035
1036    async fn remove_tag_from_item<'itemname, 'tag>(
1037        &self,
1038        itemname: &'itemname str,
1039        tag: &'tag str,
1040    ) -> Result<(), Error<RemoveTagFromItemError>> {
1041        let local_var_configuration = &self.configuration;
1042
1043        let local_var_client = &local_var_configuration.client;
1044
1045        let local_var_uri_str = format!(
1046            "{}/items/{itemname}/tags/{tag}",
1047            local_var_configuration.base_path,
1048            itemname = crate::apis::urlencode(itemname),
1049            tag = crate::apis::urlencode(tag)
1050        );
1051        let mut local_var_req_builder =
1052            local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1053
1054        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1055            local_var_req_builder = local_var_req_builder
1056                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1057        }
1058        if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
1059            local_var_req_builder = local_var_req_builder.basic_auth(
1060                local_var_auth_conf.0.to_owned(),
1061                local_var_auth_conf.1.to_owned(),
1062            );
1063        };
1064        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1065            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1066        };
1067
1068        let local_var_req = local_var_req_builder.build()?;
1069        let local_var_resp = local_var_client.execute(local_var_req).await?;
1070
1071        let local_var_status = local_var_resp.status();
1072        let local_var_content = local_var_resp.text().await?;
1073
1074        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1075            Ok(())
1076        } else {
1077            let local_var_entity: Option<RemoveTagFromItemError> =
1078                serde_json::from_str(&local_var_content).ok();
1079            let local_var_error = ResponseContent {
1080                status: local_var_status,
1081                content: local_var_content,
1082                entity: local_var_entity,
1083            };
1084            Err(Error::ResponseError(local_var_error))
1085        }
1086    }
1087
1088    async fn send_item_command<'itemname, 'body>(
1089        &self,
1090        itemname: &'itemname str,
1091        body: &'body str,
1092    ) -> Result<(), Error<SendItemCommandError>> {
1093        let local_var_configuration = &self.configuration;
1094
1095        let local_var_client = &local_var_configuration.client;
1096
1097        let local_var_uri_str = format!(
1098            "{}/items/{itemname}",
1099            local_var_configuration.base_path,
1100            itemname = crate::apis::urlencode(itemname)
1101        );
1102        let mut local_var_req_builder =
1103            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1104
1105        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1106            local_var_req_builder = local_var_req_builder
1107                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1108        }
1109        local_var_req_builder = local_var_req_builder.body(body.to_string());
1110        local_var_req_builder = local_var_req_builder.header(
1111            reqwest::header::CONTENT_TYPE,
1112            reqwest::header::HeaderValue::from_static("text/plain"),
1113        );
1114
1115        let local_var_req = local_var_req_builder.build()?;
1116        let local_var_resp = local_var_client.execute(local_var_req).await?;
1117
1118        let local_var_status = local_var_resp.status();
1119        let local_var_content = local_var_resp.text().await?;
1120
1121        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1122            Ok(())
1123        } else {
1124            let local_var_entity: Option<SendItemCommandError> =
1125                serde_json::from_str(&local_var_content).ok();
1126            let local_var_error = ResponseContent {
1127                status: local_var_status,
1128                content: local_var_content,
1129                entity: local_var_entity,
1130            };
1131            Err(Error::ResponseError(local_var_error))
1132        }
1133    }
1134
1135    async fn update_item_state<'itemname, 'body, 'accept_language>(
1136        &self,
1137        itemname: &'itemname str,
1138        body: &'body str,
1139        accept_language: Option<&'accept_language str>,
1140    ) -> Result<(), Error<UpdateItemStateError>> {
1141        let local_var_configuration = &self.configuration;
1142
1143        let local_var_client = &local_var_configuration.client;
1144
1145        let local_var_uri_str = format!(
1146            "{}/items/{itemname}/state",
1147            local_var_configuration.base_path,
1148            itemname = crate::apis::urlencode(itemname)
1149        );
1150        let mut local_var_req_builder =
1151            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1152
1153        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1154            local_var_req_builder = local_var_req_builder
1155                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1156        }
1157        if let Some(local_var_param_value) = accept_language {
1158            local_var_req_builder =
1159                local_var_req_builder.header("Accept-Language", local_var_param_value.to_string());
1160        }
1161        local_var_req_builder = local_var_req_builder.body(body.to_string());
1162        local_var_req_builder = local_var_req_builder.header(
1163            reqwest::header::CONTENT_TYPE,
1164            reqwest::header::HeaderValue::from_static("text/plain"),
1165        );
1166
1167        let local_var_req = local_var_req_builder.build()?;
1168        let local_var_resp = local_var_client.execute(local_var_req).await?;
1169
1170        let local_var_status = local_var_resp.status();
1171        let local_var_content = local_var_resp.text().await?;
1172
1173        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1174            Ok(())
1175        } else {
1176            let local_var_entity: Option<UpdateItemStateError> =
1177                serde_json::from_str(&local_var_content).ok();
1178            let local_var_error = ResponseContent {
1179                status: local_var_status,
1180                content: local_var_content,
1181                entity: local_var_entity,
1182            };
1183            Err(Error::ResponseError(local_var_error))
1184        }
1185    }
1186}
1187
1188/// struct for typed errors of method [ItemsApi::add_member_to_group_item]
1189#[derive(Debug, Clone, Serialize, Deserialize)]
1190#[serde(untagged)]
1191pub enum AddMemberToGroupItemError {
1192    Status404(),
1193    Status405(),
1194    UnknownValue(serde_json::Value),
1195}
1196
1197/// struct for typed errors of method [ItemsApi::add_metadata_to_item]
1198#[derive(Debug, Clone, Serialize, Deserialize)]
1199#[serde(untagged)]
1200pub enum AddMetadataToItemError {
1201    Status400(),
1202    Status404(),
1203    Status405(),
1204    UnknownValue(serde_json::Value),
1205}
1206
1207/// struct for typed errors of method [ItemsApi::add_or_update_item_in_registry]
1208#[derive(Debug, Clone, Serialize, Deserialize)]
1209#[serde(untagged)]
1210pub enum AddOrUpdateItemInRegistryError {
1211    Status400(),
1212    Status404(),
1213    Status405(),
1214    UnknownValue(serde_json::Value),
1215}
1216
1217/// struct for typed errors of method [ItemsApi::add_or_update_items_in_registry]
1218#[derive(Debug, Clone, Serialize, Deserialize)]
1219#[serde(untagged)]
1220pub enum AddOrUpdateItemsInRegistryError {
1221    Status400(),
1222    UnknownValue(serde_json::Value),
1223}
1224
1225/// struct for typed errors of method [ItemsApi::add_tag_to_item]
1226#[derive(Debug, Clone, Serialize, Deserialize)]
1227#[serde(untagged)]
1228pub enum AddTagToItemError {
1229    Status404(),
1230    Status405(),
1231    UnknownValue(serde_json::Value),
1232}
1233
1234/// struct for typed errors of method [ItemsApi::get_item_by_name]
1235#[derive(Debug, Clone, Serialize, Deserialize)]
1236#[serde(untagged)]
1237pub enum GetItemByNameError {
1238    Status404(),
1239    UnknownValue(serde_json::Value),
1240}
1241
1242/// struct for typed errors of method [ItemsApi::get_item_namespaces]
1243#[derive(Debug, Clone, Serialize, Deserialize)]
1244#[serde(untagged)]
1245pub enum GetItemNamespacesError {
1246    Status404(),
1247    UnknownValue(serde_json::Value),
1248}
1249
1250/// struct for typed errors of method [ItemsApi::get_item_state1]
1251#[derive(Debug, Clone, Serialize, Deserialize)]
1252#[serde(untagged)]
1253pub enum GetItemState1Error {
1254    Status404(),
1255    UnknownValue(serde_json::Value),
1256}
1257
1258/// struct for typed errors of method [ItemsApi::get_items]
1259#[derive(Debug, Clone, Serialize, Deserialize)]
1260#[serde(untagged)]
1261pub enum GetItemsError {
1262    UnknownValue(serde_json::Value),
1263}
1264
1265/// struct for typed errors of method [ItemsApi::get_semantic_item]
1266#[derive(Debug, Clone, Serialize, Deserialize)]
1267#[serde(untagged)]
1268pub enum GetSemanticItemError {
1269    Status404(),
1270    UnknownValue(serde_json::Value),
1271}
1272
1273/// struct for typed errors of method [ItemsApi::purge_database]
1274#[derive(Debug, Clone, Serialize, Deserialize)]
1275#[serde(untagged)]
1276pub enum PurgeDatabaseError {
1277    UnknownValue(serde_json::Value),
1278}
1279
1280/// struct for typed errors of method [ItemsApi::remove_item_from_registry]
1281#[derive(Debug, Clone, Serialize, Deserialize)]
1282#[serde(untagged)]
1283pub enum RemoveItemFromRegistryError {
1284    Status404(),
1285    UnknownValue(serde_json::Value),
1286}
1287
1288/// struct for typed errors of method [ItemsApi::remove_member_from_group_item]
1289#[derive(Debug, Clone, Serialize, Deserialize)]
1290#[serde(untagged)]
1291pub enum RemoveMemberFromGroupItemError {
1292    Status404(),
1293    Status405(),
1294    UnknownValue(serde_json::Value),
1295}
1296
1297/// struct for typed errors of method [ItemsApi::remove_metadata_from_item]
1298#[derive(Debug, Clone, Serialize, Deserialize)]
1299#[serde(untagged)]
1300pub enum RemoveMetadataFromItemError {
1301    Status404(),
1302    Status405(),
1303    UnknownValue(serde_json::Value),
1304}
1305
1306/// struct for typed errors of method [ItemsApi::remove_tag_from_item]
1307#[derive(Debug, Clone, Serialize, Deserialize)]
1308#[serde(untagged)]
1309pub enum RemoveTagFromItemError {
1310    Status404(),
1311    Status405(),
1312    UnknownValue(serde_json::Value),
1313}
1314
1315/// struct for typed errors of method [ItemsApi::send_item_command]
1316#[derive(Debug, Clone, Serialize, Deserialize)]
1317#[serde(untagged)]
1318pub enum SendItemCommandError {
1319    Status400(),
1320    Status404(),
1321    UnknownValue(serde_json::Value),
1322}
1323
1324/// struct for typed errors of method [ItemsApi::update_item_state]
1325#[derive(Debug, Clone, Serialize, Deserialize)]
1326#[serde(untagged)]
1327pub enum UpdateItemStateError {
1328    Status400(),
1329    Status404(),
1330    UnknownValue(serde_json::Value),
1331}