1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
use super::EnumTrait;
use std::str::FromStr;
#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]
pub enum ConditionalFormattingOperatorValues {
    BeginsWith,
    Between,
    ContainsText,
    EndsWith,
    Equal,
    GreaterThan,
    GreaterThanOrEqual,
    LessThan,
    LessThanOrEqual,
    NotBetween,
    NotContains,
    NotEqual,
}
impl Default for ConditionalFormattingOperatorValues {
    fn default() -> Self {
        Self::LessThan
    }
}
impl EnumTrait for ConditionalFormattingOperatorValues {
    fn get_value_string(&self) -> &str {
        match &self {
            Self::BeginsWith => "beginsWith",
            Self::Between => "between",
            Self::ContainsText => "containsText",
            Self::EndsWith => "endsWith",
            Self::Equal => "equal",
            Self::GreaterThan => "greaterThan",
            Self::GreaterThanOrEqual => "greaterThanOrEqual",
            Self::LessThan => "lessThan",
            Self::LessThanOrEqual => "lessThanOrEqual",
            Self::NotBetween => "notBetween",
            Self::NotContains => "notContains",
            Self::NotEqual => "notEqual",
        }
    }
}
impl FromStr for ConditionalFormattingOperatorValues {
    type Err = ();
    fn from_str(input: &str) -> Result<Self, Self::Err> {
        match input {
            "beginsWith" => Ok(Self::BeginsWith),
            "between" => Ok(Self::Between),
            "containsText" => Ok(Self::ContainsText),
            "endsWith" => Ok(Self::EndsWith),
            "equal" => Ok(Self::Equal),
            "greaterThan" => Ok(Self::GreaterThan),
            "greaterThanOrEqual" => Ok(Self::GreaterThanOrEqual),
            "lessThan" => Ok(Self::LessThan),
            "lessThanOrEqual" => Ok(Self::LessThanOrEqual),
            "notBetween" => Ok(Self::NotBetween),
            "notContains" => Ok(Self::NotContains),
            "notEqual" => Ok(Self::NotEqual),
            _ => Err(()),
        }
    }
}