Skip to main content

aws_sdk_appflow/types/
_infor_nexus_connector_operator.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// When writing a match expression against `InforNexusConnectorOperator`, it is important to ensure
4/// your code is forward-compatible. That is, if a match arm handles a case for a
5/// feature that is supported by the service but has not been represented as an enum
6/// variant in a current version of SDK, your code should continue to work when you
7/// upgrade SDK to a future version in which the enum does include a variant for that
8/// feature.
9///
10/// Here is an example of how you can make a match expression forward-compatible:
11///
12/// ```text
13/// # let infornexusconnectoroperator = unimplemented!();
14/// match infornexusconnectoroperator {
15///     InforNexusConnectorOperator::Addition => { /* ... */ },
16///     InforNexusConnectorOperator::Between => { /* ... */ },
17///     InforNexusConnectorOperator::Division => { /* ... */ },
18///     InforNexusConnectorOperator::EqualTo => { /* ... */ },
19///     InforNexusConnectorOperator::MaskAll => { /* ... */ },
20///     InforNexusConnectorOperator::MaskFirstN => { /* ... */ },
21///     InforNexusConnectorOperator::MaskLastN => { /* ... */ },
22///     InforNexusConnectorOperator::Multiplication => { /* ... */ },
23///     InforNexusConnectorOperator::NoOp => { /* ... */ },
24///     InforNexusConnectorOperator::Projection => { /* ... */ },
25///     InforNexusConnectorOperator::Subtraction => { /* ... */ },
26///     InforNexusConnectorOperator::ValidateNonNegative => { /* ... */ },
27///     InforNexusConnectorOperator::ValidateNonNull => { /* ... */ },
28///     InforNexusConnectorOperator::ValidateNonZero => { /* ... */ },
29///     InforNexusConnectorOperator::ValidateNumeric => { /* ... */ },
30///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
31///     _ => { /* ... */ },
32/// }
33/// ```
34/// The above code demonstrates that when `infornexusconnectoroperator` represents
35/// `NewFeature`, the execution path will lead to the second last match arm,
36/// even though the enum does not contain a variant `InforNexusConnectorOperator::NewFeature`
37/// in the current version of SDK. The reason is that the variable `other`,
38/// created by the `@` operator, is bound to
39/// `InforNexusConnectorOperator::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
40/// and calling `as_str` on it yields `"NewFeature"`.
41/// This match expression is forward-compatible when executed with a newer
42/// version of SDK where the variant `InforNexusConnectorOperator::NewFeature` is defined.
43/// Specifically, when `infornexusconnectoroperator` represents `NewFeature`,
44/// the execution path will hit the second last match arm as before by virtue of
45/// calling `as_str` on `InforNexusConnectorOperator::NewFeature` also yielding `"NewFeature"`.
46///
47/// Explicitly matching on the `Unknown` variant should
48/// be avoided for two reasons:
49/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
50/// - It might inadvertently shadow other intended match arms.
51///
52#[allow(missing_docs)] // documentation missing in model
53#[non_exhaustive]
54#[derive(
55    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
56)]
57pub enum InforNexusConnectorOperator {
58    #[allow(missing_docs)] // documentation missing in model
59    Addition,
60    #[allow(missing_docs)] // documentation missing in model
61    Between,
62    #[allow(missing_docs)] // documentation missing in model
63    Division,
64    #[allow(missing_docs)] // documentation missing in model
65    EqualTo,
66    #[allow(missing_docs)] // documentation missing in model
67    MaskAll,
68    #[allow(missing_docs)] // documentation missing in model
69    MaskFirstN,
70    #[allow(missing_docs)] // documentation missing in model
71    MaskLastN,
72    #[allow(missing_docs)] // documentation missing in model
73    Multiplication,
74    #[allow(missing_docs)] // documentation missing in model
75    NoOp,
76    #[allow(missing_docs)] // documentation missing in model
77    Projection,
78    #[allow(missing_docs)] // documentation missing in model
79    Subtraction,
80    #[allow(missing_docs)] // documentation missing in model
81    ValidateNonNegative,
82    #[allow(missing_docs)] // documentation missing in model
83    ValidateNonNull,
84    #[allow(missing_docs)] // documentation missing in model
85    ValidateNonZero,
86    #[allow(missing_docs)] // documentation missing in model
87    ValidateNumeric,
88    /// `Unknown` contains new variants that have been added since this code was generated.
89    #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")]
90    Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue),
91}
92impl ::std::convert::From<&str> for InforNexusConnectorOperator {
93    fn from(s: &str) -> Self {
94        match s {
95            "ADDITION" => InforNexusConnectorOperator::Addition,
96            "BETWEEN" => InforNexusConnectorOperator::Between,
97            "DIVISION" => InforNexusConnectorOperator::Division,
98            "EQUAL_TO" => InforNexusConnectorOperator::EqualTo,
99            "MASK_ALL" => InforNexusConnectorOperator::MaskAll,
100            "MASK_FIRST_N" => InforNexusConnectorOperator::MaskFirstN,
101            "MASK_LAST_N" => InforNexusConnectorOperator::MaskLastN,
102            "MULTIPLICATION" => InforNexusConnectorOperator::Multiplication,
103            "NO_OP" => InforNexusConnectorOperator::NoOp,
104            "PROJECTION" => InforNexusConnectorOperator::Projection,
105            "SUBTRACTION" => InforNexusConnectorOperator::Subtraction,
106            "VALIDATE_NON_NEGATIVE" => InforNexusConnectorOperator::ValidateNonNegative,
107            "VALIDATE_NON_NULL" => InforNexusConnectorOperator::ValidateNonNull,
108            "VALIDATE_NON_ZERO" => InforNexusConnectorOperator::ValidateNonZero,
109            "VALIDATE_NUMERIC" => InforNexusConnectorOperator::ValidateNumeric,
110            other => InforNexusConnectorOperator::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
111        }
112    }
113}
114impl ::std::str::FromStr for InforNexusConnectorOperator {
115    type Err = ::std::convert::Infallible;
116
117    fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
118        ::std::result::Result::Ok(InforNexusConnectorOperator::from(s))
119    }
120}
121impl InforNexusConnectorOperator {
122    /// Returns the `&str` value of the enum member.
123    pub fn as_str(&self) -> &str {
124        match self {
125            InforNexusConnectorOperator::Addition => "ADDITION",
126            InforNexusConnectorOperator::Between => "BETWEEN",
127            InforNexusConnectorOperator::Division => "DIVISION",
128            InforNexusConnectorOperator::EqualTo => "EQUAL_TO",
129            InforNexusConnectorOperator::MaskAll => "MASK_ALL",
130            InforNexusConnectorOperator::MaskFirstN => "MASK_FIRST_N",
131            InforNexusConnectorOperator::MaskLastN => "MASK_LAST_N",
132            InforNexusConnectorOperator::Multiplication => "MULTIPLICATION",
133            InforNexusConnectorOperator::NoOp => "NO_OP",
134            InforNexusConnectorOperator::Projection => "PROJECTION",
135            InforNexusConnectorOperator::Subtraction => "SUBTRACTION",
136            InforNexusConnectorOperator::ValidateNonNegative => "VALIDATE_NON_NEGATIVE",
137            InforNexusConnectorOperator::ValidateNonNull => "VALIDATE_NON_NULL",
138            InforNexusConnectorOperator::ValidateNonZero => "VALIDATE_NON_ZERO",
139            InforNexusConnectorOperator::ValidateNumeric => "VALIDATE_NUMERIC",
140            InforNexusConnectorOperator::Unknown(value) => value.as_str(),
141        }
142    }
143    /// Returns all the `&str` representations of the enum members.
144    pub const fn values() -> &'static [&'static str] {
145        &[
146            "ADDITION",
147            "BETWEEN",
148            "DIVISION",
149            "EQUAL_TO",
150            "MASK_ALL",
151            "MASK_FIRST_N",
152            "MASK_LAST_N",
153            "MULTIPLICATION",
154            "NO_OP",
155            "PROJECTION",
156            "SUBTRACTION",
157            "VALIDATE_NON_NEGATIVE",
158            "VALIDATE_NON_NULL",
159            "VALIDATE_NON_ZERO",
160            "VALIDATE_NUMERIC",
161        ]
162    }
163}
164impl ::std::convert::AsRef<str> for InforNexusConnectorOperator {
165    fn as_ref(&self) -> &str {
166        self.as_str()
167    }
168}
169impl InforNexusConnectorOperator {
170    /// Parses the enum value while disallowing unknown variants.
171    ///
172    /// Unknown variants will result in an error.
173    pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
174        match Self::from(value) {
175            #[allow(deprecated)]
176            Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
177            known => Ok(known),
178        }
179    }
180}
181impl ::std::fmt::Display for InforNexusConnectorOperator {
182    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
183        match self {
184            InforNexusConnectorOperator::Addition => write!(f, "ADDITION"),
185            InforNexusConnectorOperator::Between => write!(f, "BETWEEN"),
186            InforNexusConnectorOperator::Division => write!(f, "DIVISION"),
187            InforNexusConnectorOperator::EqualTo => write!(f, "EQUAL_TO"),
188            InforNexusConnectorOperator::MaskAll => write!(f, "MASK_ALL"),
189            InforNexusConnectorOperator::MaskFirstN => write!(f, "MASK_FIRST_N"),
190            InforNexusConnectorOperator::MaskLastN => write!(f, "MASK_LAST_N"),
191            InforNexusConnectorOperator::Multiplication => write!(f, "MULTIPLICATION"),
192            InforNexusConnectorOperator::NoOp => write!(f, "NO_OP"),
193            InforNexusConnectorOperator::Projection => write!(f, "PROJECTION"),
194            InforNexusConnectorOperator::Subtraction => write!(f, "SUBTRACTION"),
195            InforNexusConnectorOperator::ValidateNonNegative => write!(f, "VALIDATE_NON_NEGATIVE"),
196            InforNexusConnectorOperator::ValidateNonNull => write!(f, "VALIDATE_NON_NULL"),
197            InforNexusConnectorOperator::ValidateNonZero => write!(f, "VALIDATE_NON_ZERO"),
198            InforNexusConnectorOperator::ValidateNumeric => write!(f, "VALIDATE_NUMERIC"),
199            InforNexusConnectorOperator::Unknown(value) => write!(f, "{value}"),
200        }
201    }
202}