hab_rs_api_client/models/
rule_status_info.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 crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct RuleStatusInfo {
16    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
17    pub description: Option<String>,
18    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
19    pub status: Option<Status>,
20    #[serde(rename = "statusDetail", skip_serializing_if = "Option::is_none")]
21    pub status_detail: Option<StatusDetail>,
22}
23
24impl RuleStatusInfo {
25    pub fn new() -> RuleStatusInfo {
26        RuleStatusInfo {
27            description: None,
28            status: None,
29            status_detail: None,
30        }
31    }
32}
33///
34#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
35pub enum Status {
36    #[serde(rename = "UNINITIALIZED")]
37    Uninitialized,
38    #[serde(rename = "INITIALIZING")]
39    Initializing,
40    #[serde(rename = "IDLE")]
41    Idle,
42    #[serde(rename = "RUNNING")]
43    Running,
44}
45
46impl Default for Status {
47    fn default() -> Status {
48        Self::Uninitialized
49    }
50}
51///
52#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
53pub enum StatusDetail {
54    #[serde(rename = "NONE")]
55    None,
56    #[serde(rename = "HANDLER_MISSING_ERROR")]
57    HandlerMissingError,
58    #[serde(rename = "HANDLER_INITIALIZING_ERROR")]
59    HandlerInitializingError,
60    #[serde(rename = "CONFIGURATION_ERROR")]
61    ConfigurationError,
62    #[serde(rename = "TEMPLATE_MISSING_ERROR")]
63    TemplateMissingError,
64    #[serde(rename = "INVALID_RULE")]
65    InvalidRule,
66    #[serde(rename = "DISABLED")]
67    Disabled,
68}
69
70impl Default for StatusDetail {
71    fn default() -> StatusDetail {
72        Self::None
73    }
74}