Skip to main content

aws_sdk_connect/types/
_instance_storage_resource_type.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// When writing a match expression against `InstanceStorageResourceType`, 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 instancestorageresourcetype = unimplemented!();
14/// match instancestorageresourcetype {
15///     InstanceStorageResourceType::AgentEvents => { /* ... */ },
16///     InstanceStorageResourceType::Attachments => { /* ... */ },
17///     InstanceStorageResourceType::CallRecordings => { /* ... */ },
18///     InstanceStorageResourceType::ChatTranscripts => { /* ... */ },
19///     InstanceStorageResourceType::ContactEvaluations => { /* ... */ },
20///     InstanceStorageResourceType::ContactTraceRecords => { /* ... */ },
21///     InstanceStorageResourceType::EmailMessages => { /* ... */ },
22///     InstanceStorageResourceType::MediaStreams => { /* ... */ },
23///     InstanceStorageResourceType::RealTimeContactAnalysisChatSegments => { /* ... */ },
24///     InstanceStorageResourceType::RealTimeContactAnalysisSegments => { /* ... */ },
25///     InstanceStorageResourceType::RealTimeContactAnalysisVoiceSegments => { /* ... */ },
26///     InstanceStorageResourceType::ScheduledReports => { /* ... */ },
27///     InstanceStorageResourceType::ScreenRecordings => { /* ... */ },
28///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
29///     _ => { /* ... */ },
30/// }
31/// ```
32/// The above code demonstrates that when `instancestorageresourcetype` represents
33/// `NewFeature`, the execution path will lead to the second last match arm,
34/// even though the enum does not contain a variant `InstanceStorageResourceType::NewFeature`
35/// in the current version of SDK. The reason is that the variable `other`,
36/// created by the `@` operator, is bound to
37/// `InstanceStorageResourceType::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
38/// and calling `as_str` on it yields `"NewFeature"`.
39/// This match expression is forward-compatible when executed with a newer
40/// version of SDK where the variant `InstanceStorageResourceType::NewFeature` is defined.
41/// Specifically, when `instancestorageresourcetype` represents `NewFeature`,
42/// the execution path will hit the second last match arm as before by virtue of
43/// calling `as_str` on `InstanceStorageResourceType::NewFeature` also yielding `"NewFeature"`.
44///
45/// Explicitly matching on the `Unknown` variant should
46/// be avoided for two reasons:
47/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
48/// - It might inadvertently shadow other intended match arms.
49///
50#[allow(missing_docs)] // documentation missing in model
51#[non_exhaustive]
52#[derive(
53    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
54)]
55pub enum InstanceStorageResourceType {
56    #[allow(missing_docs)] // documentation missing in model
57    AgentEvents,
58    #[allow(missing_docs)] // documentation missing in model
59    Attachments,
60    #[allow(missing_docs)] // documentation missing in model
61    CallRecordings,
62    #[allow(missing_docs)] // documentation missing in model
63    ChatTranscripts,
64    #[allow(missing_docs)] // documentation missing in model
65    ContactEvaluations,
66    #[allow(missing_docs)] // documentation missing in model
67    ContactTraceRecords,
68    #[allow(missing_docs)] // documentation missing in model
69    EmailMessages,
70    #[allow(missing_docs)] // documentation missing in model
71    MediaStreams,
72    #[allow(missing_docs)] // documentation missing in model
73    RealTimeContactAnalysisChatSegments,
74    #[allow(missing_docs)] // documentation missing in model
75    RealTimeContactAnalysisSegments,
76    #[allow(missing_docs)] // documentation missing in model
77    RealTimeContactAnalysisVoiceSegments,
78    #[allow(missing_docs)] // documentation missing in model
79    ScheduledReports,
80    #[allow(missing_docs)] // documentation missing in model
81    ScreenRecordings,
82    /// `Unknown` contains new variants that have been added since this code was generated.
83    #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")]
84    Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue),
85}
86impl ::std::convert::From<&str> for InstanceStorageResourceType {
87    fn from(s: &str) -> Self {
88        match s {
89            "AGENT_EVENTS" => InstanceStorageResourceType::AgentEvents,
90            "ATTACHMENTS" => InstanceStorageResourceType::Attachments,
91            "CALL_RECORDINGS" => InstanceStorageResourceType::CallRecordings,
92            "CHAT_TRANSCRIPTS" => InstanceStorageResourceType::ChatTranscripts,
93            "CONTACT_EVALUATIONS" => InstanceStorageResourceType::ContactEvaluations,
94            "CONTACT_TRACE_RECORDS" => InstanceStorageResourceType::ContactTraceRecords,
95            "EMAIL_MESSAGES" => InstanceStorageResourceType::EmailMessages,
96            "MEDIA_STREAMS" => InstanceStorageResourceType::MediaStreams,
97            "REAL_TIME_CONTACT_ANALYSIS_CHAT_SEGMENTS" => InstanceStorageResourceType::RealTimeContactAnalysisChatSegments,
98            "REAL_TIME_CONTACT_ANALYSIS_SEGMENTS" => InstanceStorageResourceType::RealTimeContactAnalysisSegments,
99            "REAL_TIME_CONTACT_ANALYSIS_VOICE_SEGMENTS" => InstanceStorageResourceType::RealTimeContactAnalysisVoiceSegments,
100            "SCHEDULED_REPORTS" => InstanceStorageResourceType::ScheduledReports,
101            "SCREEN_RECORDINGS" => InstanceStorageResourceType::ScreenRecordings,
102            other => InstanceStorageResourceType::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
103        }
104    }
105}
106impl ::std::str::FromStr for InstanceStorageResourceType {
107    type Err = ::std::convert::Infallible;
108
109    fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
110        ::std::result::Result::Ok(InstanceStorageResourceType::from(s))
111    }
112}
113impl InstanceStorageResourceType {
114    /// Returns the `&str` value of the enum member.
115    pub fn as_str(&self) -> &str {
116        match self {
117            InstanceStorageResourceType::AgentEvents => "AGENT_EVENTS",
118            InstanceStorageResourceType::Attachments => "ATTACHMENTS",
119            InstanceStorageResourceType::CallRecordings => "CALL_RECORDINGS",
120            InstanceStorageResourceType::ChatTranscripts => "CHAT_TRANSCRIPTS",
121            InstanceStorageResourceType::ContactEvaluations => "CONTACT_EVALUATIONS",
122            InstanceStorageResourceType::ContactTraceRecords => "CONTACT_TRACE_RECORDS",
123            InstanceStorageResourceType::EmailMessages => "EMAIL_MESSAGES",
124            InstanceStorageResourceType::MediaStreams => "MEDIA_STREAMS",
125            InstanceStorageResourceType::RealTimeContactAnalysisChatSegments => "REAL_TIME_CONTACT_ANALYSIS_CHAT_SEGMENTS",
126            InstanceStorageResourceType::RealTimeContactAnalysisSegments => "REAL_TIME_CONTACT_ANALYSIS_SEGMENTS",
127            InstanceStorageResourceType::RealTimeContactAnalysisVoiceSegments => "REAL_TIME_CONTACT_ANALYSIS_VOICE_SEGMENTS",
128            InstanceStorageResourceType::ScheduledReports => "SCHEDULED_REPORTS",
129            InstanceStorageResourceType::ScreenRecordings => "SCREEN_RECORDINGS",
130            InstanceStorageResourceType::Unknown(value) => value.as_str(),
131        }
132    }
133    /// Returns all the `&str` representations of the enum members.
134    pub const fn values() -> &'static [&'static str] {
135        &[
136            "AGENT_EVENTS",
137            "ATTACHMENTS",
138            "CALL_RECORDINGS",
139            "CHAT_TRANSCRIPTS",
140            "CONTACT_EVALUATIONS",
141            "CONTACT_TRACE_RECORDS",
142            "EMAIL_MESSAGES",
143            "MEDIA_STREAMS",
144            "REAL_TIME_CONTACT_ANALYSIS_CHAT_SEGMENTS",
145            "REAL_TIME_CONTACT_ANALYSIS_SEGMENTS",
146            "REAL_TIME_CONTACT_ANALYSIS_VOICE_SEGMENTS",
147            "SCHEDULED_REPORTS",
148            "SCREEN_RECORDINGS",
149        ]
150    }
151}
152impl ::std::convert::AsRef<str> for InstanceStorageResourceType {
153    fn as_ref(&self) -> &str {
154        self.as_str()
155    }
156}
157impl InstanceStorageResourceType {
158    /// Parses the enum value while disallowing unknown variants.
159    ///
160    /// Unknown variants will result in an error.
161    pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
162        match Self::from(value) {
163            #[allow(deprecated)]
164            Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
165            known => Ok(known),
166        }
167    }
168}
169impl ::std::fmt::Display for InstanceStorageResourceType {
170    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
171        match self {
172            InstanceStorageResourceType::AgentEvents => write!(f, "AGENT_EVENTS"),
173            InstanceStorageResourceType::Attachments => write!(f, "ATTACHMENTS"),
174            InstanceStorageResourceType::CallRecordings => write!(f, "CALL_RECORDINGS"),
175            InstanceStorageResourceType::ChatTranscripts => write!(f, "CHAT_TRANSCRIPTS"),
176            InstanceStorageResourceType::ContactEvaluations => write!(f, "CONTACT_EVALUATIONS"),
177            InstanceStorageResourceType::ContactTraceRecords => write!(f, "CONTACT_TRACE_RECORDS"),
178            InstanceStorageResourceType::EmailMessages => write!(f, "EMAIL_MESSAGES"),
179            InstanceStorageResourceType::MediaStreams => write!(f, "MEDIA_STREAMS"),
180            InstanceStorageResourceType::RealTimeContactAnalysisChatSegments => write!(f, "REAL_TIME_CONTACT_ANALYSIS_CHAT_SEGMENTS"),
181            InstanceStorageResourceType::RealTimeContactAnalysisSegments => write!(f, "REAL_TIME_CONTACT_ANALYSIS_SEGMENTS"),
182            InstanceStorageResourceType::RealTimeContactAnalysisVoiceSegments => write!(f, "REAL_TIME_CONTACT_ANALYSIS_VOICE_SEGMENTS"),
183            InstanceStorageResourceType::ScheduledReports => write!(f, "SCHEDULED_REPORTS"),
184            InstanceStorageResourceType::ScreenRecordings => write!(f, "SCREEN_RECORDINGS"),
185            InstanceStorageResourceType::Unknown(value) => write!(f, "{value}"),
186        }
187    }
188}