Skip to main content

nominal_api_conjure/conjure/objects/scout/rids/api/
event_disposition_status.rs

1#![allow(deprecated)]
2use std::fmt;
3use std::str;
4#[derive(
5    Debug,
6    Clone,
7    PartialEq,
8    Eq,
9    PartialOrd,
10    Ord,
11    Hash,
12    conjure_object::serde::Deserialize,
13    conjure_object::serde::Serialize,
14    conjure_object::log_safety::derive::LogSafe
15)]
16#[serde(crate = "conjure_object::serde")]
17pub enum EventDispositionStatus {
18    #[serde(rename = "PENDING_REVIEW")]
19    PendingReview,
20    #[serde(rename = "CLOSED_IGNORED")]
21    ClosedIgnored,
22    #[serde(rename = "CLOSED_REQUIRES_FURTHER_ACTION")]
23    ClosedRequiresFurtherAction,
24    #[serde(rename = "NO_DISPOSITION")]
25    NoDisposition,
26    /// An unknown variant.
27    #[serde(untagged)]
28    Unknown(Unknown),
29}
30impl EventDispositionStatus {
31    /// Returns the string representation of the enum.
32    #[inline]
33    pub fn as_str(&self) -> &str {
34        match self {
35            EventDispositionStatus::PendingReview => "PENDING_REVIEW",
36            EventDispositionStatus::ClosedIgnored => "CLOSED_IGNORED",
37            EventDispositionStatus::ClosedRequiresFurtherAction => {
38                "CLOSED_REQUIRES_FURTHER_ACTION"
39            }
40            EventDispositionStatus::NoDisposition => "NO_DISPOSITION",
41            EventDispositionStatus::Unknown(v) => &*v,
42        }
43    }
44}
45impl fmt::Display for EventDispositionStatus {
46    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
47        fmt::Display::fmt(self.as_str(), fmt)
48    }
49}
50impl conjure_object::Plain for EventDispositionStatus {
51    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
52        conjure_object::Plain::fmt(self.as_str(), fmt)
53    }
54}
55impl str::FromStr for EventDispositionStatus {
56    type Err = conjure_object::plain::ParseEnumError;
57    #[inline]
58    fn from_str(
59        v: &str,
60    ) -> Result<EventDispositionStatus, conjure_object::plain::ParseEnumError> {
61        match v {
62            "PENDING_REVIEW" => Ok(EventDispositionStatus::PendingReview),
63            "CLOSED_IGNORED" => Ok(EventDispositionStatus::ClosedIgnored),
64            "CLOSED_REQUIRES_FURTHER_ACTION" => {
65                Ok(EventDispositionStatus::ClosedRequiresFurtherAction)
66            }
67            "NO_DISPOSITION" => Ok(EventDispositionStatus::NoDisposition),
68            v => v.parse().map(|v| EventDispositionStatus::Unknown(Unknown(v))),
69        }
70    }
71}
72impl conjure_object::FromPlain for EventDispositionStatus {
73    type Err = conjure_object::plain::ParseEnumError;
74    #[inline]
75    fn from_plain(
76        v: &str,
77    ) -> Result<EventDispositionStatus, conjure_object::plain::ParseEnumError> {
78        v.parse()
79    }
80}
81///An unknown variant of the EventDispositionStatus enum.
82#[derive(
83    Debug,
84    Clone,
85    PartialEq,
86    Eq,
87    PartialOrd,
88    Ord,
89    Hash,
90    conjure_object::serde::Deserialize,
91    conjure_object::serde::Serialize,
92    conjure_object::log_safety::derive::LogSafe,
93)]
94#[serde(crate = "conjure_object::serde", transparent)]
95pub struct Unknown(conjure_object::private::Variant);
96impl std::ops::Deref for Unknown {
97    type Target = str;
98    #[inline]
99    fn deref(&self) -> &str {
100        &self.0
101    }
102}
103impl fmt::Display for Unknown {
104    #[inline]
105    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
106        fmt::Display::fmt(&self.0, fmt)
107    }
108}