aws-sdk-applicationinsights 1.103.0

AWS SDK for Amazon CloudWatch Application Insights
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// When writing a match expression against `Tier`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let tier = unimplemented!();
/// match tier {
///     Tier::ActiveDirectory => { /* ... */ },
///     Tier::Custom => { /* ... */ },
///     Tier::Default => { /* ... */ },
///     Tier::DotNetCore => { /* ... */ },
///     Tier::DotNetWeb => { /* ... */ },
///     Tier::DotNetWebTier => { /* ... */ },
///     Tier::DotNetWorker => { /* ... */ },
///     Tier::JavaJmx => { /* ... */ },
///     Tier::Mysql => { /* ... */ },
///     Tier::Oracle => { /* ... */ },
///     Tier::Postgresql => { /* ... */ },
///     Tier::SapAseHighAvailability => { /* ... */ },
///     Tier::SapAseSingleNode => { /* ... */ },
///     Tier::SapHanaHighAvailability => { /* ... */ },
///     Tier::SapHanaMultiNode => { /* ... */ },
///     Tier::SapHanaSingleNode => { /* ... */ },
///     Tier::SapNetweaverDistributed => { /* ... */ },
///     Tier::SapNetweaverHighAvailability => { /* ... */ },
///     Tier::SapNetweaverStandard => { /* ... */ },
///     Tier::Sharepoint => { /* ... */ },
///     Tier::SqlServer => { /* ... */ },
///     Tier::SqlServerAlwaysonAvailabilityGroup => { /* ... */ },
///     Tier::SqlServerFailoverClusterInstance => { /* ... */ },
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
///     _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `tier` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `Tier::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `Tier::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `Tier::NewFeature` is defined.
/// Specifically, when `tier` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `Tier::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
///
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
)]
pub enum Tier {
    #[allow(missing_docs)] // documentation missing in model
    ActiveDirectory,
    #[allow(missing_docs)] // documentation missing in model
    Custom,
    #[allow(missing_docs)] // documentation missing in model
    Default,
    #[allow(missing_docs)] // documentation missing in model
    DotNetCore,
    #[allow(missing_docs)] // documentation missing in model
    DotNetWeb,
    #[allow(missing_docs)] // documentation missing in model
    DotNetWebTier,
    #[allow(missing_docs)] // documentation missing in model
    DotNetWorker,
    #[allow(missing_docs)] // documentation missing in model
    JavaJmx,
    #[allow(missing_docs)] // documentation missing in model
    Mysql,
    #[allow(missing_docs)] // documentation missing in model
    Oracle,
    #[allow(missing_docs)] // documentation missing in model
    Postgresql,
    #[allow(missing_docs)] // documentation missing in model
    SapAseHighAvailability,
    #[allow(missing_docs)] // documentation missing in model
    SapAseSingleNode,
    #[allow(missing_docs)] // documentation missing in model
    SapHanaHighAvailability,
    #[allow(missing_docs)] // documentation missing in model
    SapHanaMultiNode,
    #[allow(missing_docs)] // documentation missing in model
    SapHanaSingleNode,
    #[allow(missing_docs)] // documentation missing in model
    SapNetweaverDistributed,
    #[allow(missing_docs)] // documentation missing in model
    SapNetweaverHighAvailability,
    #[allow(missing_docs)] // documentation missing in model
    SapNetweaverStandard,
    #[allow(missing_docs)] // documentation missing in model
    Sharepoint,
    #[allow(missing_docs)] // documentation missing in model
    SqlServer,
    #[allow(missing_docs)] // documentation missing in model
    SqlServerAlwaysonAvailabilityGroup,
    #[allow(missing_docs)] // documentation missing in model
    SqlServerFailoverClusterInstance,
    /// `Unknown` contains new variants that have been added since this code was generated.
    #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")]
    Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue),
}
impl ::std::convert::From<&str> for Tier {
    fn from(s: &str) -> Self {
        match s {
            "ACTIVE_DIRECTORY" => Tier::ActiveDirectory,
            "CUSTOM" => Tier::Custom,
            "DEFAULT" => Tier::Default,
            "DOT_NET_CORE" => Tier::DotNetCore,
            "DOT_NET_WEB" => Tier::DotNetWeb,
            "DOT_NET_WEB_TIER" => Tier::DotNetWebTier,
            "DOT_NET_WORKER" => Tier::DotNetWorker,
            "JAVA_JMX" => Tier::JavaJmx,
            "MYSQL" => Tier::Mysql,
            "ORACLE" => Tier::Oracle,
            "POSTGRESQL" => Tier::Postgresql,
            "SAP_ASE_HIGH_AVAILABILITY" => Tier::SapAseHighAvailability,
            "SAP_ASE_SINGLE_NODE" => Tier::SapAseSingleNode,
            "SAP_HANA_HIGH_AVAILABILITY" => Tier::SapHanaHighAvailability,
            "SAP_HANA_MULTI_NODE" => Tier::SapHanaMultiNode,
            "SAP_HANA_SINGLE_NODE" => Tier::SapHanaSingleNode,
            "SAP_NETWEAVER_DISTRIBUTED" => Tier::SapNetweaverDistributed,
            "SAP_NETWEAVER_HIGH_AVAILABILITY" => Tier::SapNetweaverHighAvailability,
            "SAP_NETWEAVER_STANDARD" => Tier::SapNetweaverStandard,
            "SHAREPOINT" => Tier::Sharepoint,
            "SQL_SERVER" => Tier::SqlServer,
            "SQL_SERVER_ALWAYSON_AVAILABILITY_GROUP" => Tier::SqlServerAlwaysonAvailabilityGroup,
            "SQL_SERVER_FAILOVER_CLUSTER_INSTANCE" => Tier::SqlServerFailoverClusterInstance,
            other => Tier::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
        }
    }
}
impl ::std::str::FromStr for Tier {
    type Err = ::std::convert::Infallible;

    fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
        ::std::result::Result::Ok(Tier::from(s))
    }
}
impl Tier {
    /// Returns the `&str` value of the enum member.
    pub fn as_str(&self) -> &str {
        match self {
            Tier::ActiveDirectory => "ACTIVE_DIRECTORY",
            Tier::Custom => "CUSTOM",
            Tier::Default => "DEFAULT",
            Tier::DotNetCore => "DOT_NET_CORE",
            Tier::DotNetWeb => "DOT_NET_WEB",
            Tier::DotNetWebTier => "DOT_NET_WEB_TIER",
            Tier::DotNetWorker => "DOT_NET_WORKER",
            Tier::JavaJmx => "JAVA_JMX",
            Tier::Mysql => "MYSQL",
            Tier::Oracle => "ORACLE",
            Tier::Postgresql => "POSTGRESQL",
            Tier::SapAseHighAvailability => "SAP_ASE_HIGH_AVAILABILITY",
            Tier::SapAseSingleNode => "SAP_ASE_SINGLE_NODE",
            Tier::SapHanaHighAvailability => "SAP_HANA_HIGH_AVAILABILITY",
            Tier::SapHanaMultiNode => "SAP_HANA_MULTI_NODE",
            Tier::SapHanaSingleNode => "SAP_HANA_SINGLE_NODE",
            Tier::SapNetweaverDistributed => "SAP_NETWEAVER_DISTRIBUTED",
            Tier::SapNetweaverHighAvailability => "SAP_NETWEAVER_HIGH_AVAILABILITY",
            Tier::SapNetweaverStandard => "SAP_NETWEAVER_STANDARD",
            Tier::Sharepoint => "SHAREPOINT",
            Tier::SqlServer => "SQL_SERVER",
            Tier::SqlServerAlwaysonAvailabilityGroup => "SQL_SERVER_ALWAYSON_AVAILABILITY_GROUP",
            Tier::SqlServerFailoverClusterInstance => "SQL_SERVER_FAILOVER_CLUSTER_INSTANCE",
            Tier::Unknown(value) => value.as_str(),
        }
    }
    /// Returns all the `&str` representations of the enum members.
    pub const fn values() -> &'static [&'static str] {
        &[
            "ACTIVE_DIRECTORY",
            "CUSTOM",
            "DEFAULT",
            "DOT_NET_CORE",
            "DOT_NET_WEB",
            "DOT_NET_WEB_TIER",
            "DOT_NET_WORKER",
            "JAVA_JMX",
            "MYSQL",
            "ORACLE",
            "POSTGRESQL",
            "SAP_ASE_HIGH_AVAILABILITY",
            "SAP_ASE_SINGLE_NODE",
            "SAP_HANA_HIGH_AVAILABILITY",
            "SAP_HANA_MULTI_NODE",
            "SAP_HANA_SINGLE_NODE",
            "SAP_NETWEAVER_DISTRIBUTED",
            "SAP_NETWEAVER_HIGH_AVAILABILITY",
            "SAP_NETWEAVER_STANDARD",
            "SHAREPOINT",
            "SQL_SERVER",
            "SQL_SERVER_ALWAYSON_AVAILABILITY_GROUP",
            "SQL_SERVER_FAILOVER_CLUSTER_INSTANCE",
        ]
    }
}
impl ::std::convert::AsRef<str> for Tier {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}
impl Tier {
    /// Parses the enum value while disallowing unknown variants.
    ///
    /// Unknown variants will result in an error.
    pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
        match Self::from(value) {
            #[allow(deprecated)]
            Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
            known => Ok(known),
        }
    }
}
impl ::std::fmt::Display for Tier {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        match self {
            Tier::ActiveDirectory => write!(f, "ACTIVE_DIRECTORY"),
            Tier::Custom => write!(f, "CUSTOM"),
            Tier::Default => write!(f, "DEFAULT"),
            Tier::DotNetCore => write!(f, "DOT_NET_CORE"),
            Tier::DotNetWeb => write!(f, "DOT_NET_WEB"),
            Tier::DotNetWebTier => write!(f, "DOT_NET_WEB_TIER"),
            Tier::DotNetWorker => write!(f, "DOT_NET_WORKER"),
            Tier::JavaJmx => write!(f, "JAVA_JMX"),
            Tier::Mysql => write!(f, "MYSQL"),
            Tier::Oracle => write!(f, "ORACLE"),
            Tier::Postgresql => write!(f, "POSTGRESQL"),
            Tier::SapAseHighAvailability => write!(f, "SAP_ASE_HIGH_AVAILABILITY"),
            Tier::SapAseSingleNode => write!(f, "SAP_ASE_SINGLE_NODE"),
            Tier::SapHanaHighAvailability => write!(f, "SAP_HANA_HIGH_AVAILABILITY"),
            Tier::SapHanaMultiNode => write!(f, "SAP_HANA_MULTI_NODE"),
            Tier::SapHanaSingleNode => write!(f, "SAP_HANA_SINGLE_NODE"),
            Tier::SapNetweaverDistributed => write!(f, "SAP_NETWEAVER_DISTRIBUTED"),
            Tier::SapNetweaverHighAvailability => write!(f, "SAP_NETWEAVER_HIGH_AVAILABILITY"),
            Tier::SapNetweaverStandard => write!(f, "SAP_NETWEAVER_STANDARD"),
            Tier::Sharepoint => write!(f, "SHAREPOINT"),
            Tier::SqlServer => write!(f, "SQL_SERVER"),
            Tier::SqlServerAlwaysonAvailabilityGroup => write!(f, "SQL_SERVER_ALWAYSON_AVAILABILITY_GROUP"),
            Tier::SqlServerFailoverClusterInstance => write!(f, "SQL_SERVER_FAILOVER_CLUSTER_INSTANCE"),
            Tier::Unknown(value) => write!(f, "{value}"),
        }
    }
}