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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A rule is a set of criteria that you can specify to flag an attribute in your Call Analytics output. Rules define a Call Analytics category.</p>
/// <p>Rules can include these parameters: , , , and .</p>
/// <p>To learn more about Call Analytics rules and categories, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/tca-categories-batch.html">Creating categories for post-call transcriptions</a> and <a href="https://docs.aws.amazon.com/transcribe/latest/dg/tca-categories-stream.html">Creating categories for real-time transcriptions</a>.</p>
/// <p>To learn more about Call Analytics, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/call-analytics.html">Analyzing call center audio with Call Analytics</a>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub enum Rule {
/// <p>Flag the presence or absence of interruptions in your Call Analytics transcription output. Refer to for more detail.</p>
InterruptionFilter(crate::types::InterruptionFilter),
/// <p>Flag the presence or absence of periods of silence in your Call Analytics transcription output. Refer to for more detail.</p>
NonTalkTimeFilter(crate::types::NonTalkTimeFilter),
/// <p>Flag the presence or absence of specific sentiments in your Call Analytics transcription output. Refer to for more detail.</p>
SentimentFilter(crate::types::SentimentFilter),
/// <p>Flag the presence or absence of specific words or phrases in your Call Analytics transcription output. Refer to for more detail.</p>
TranscriptFilter(crate::types::TranscriptFilter),
/// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
/// An unknown enum variant
///
/// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
/// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
/// by the client. This can happen when the server adds new functionality, but the client has not been updated.
/// To investigate this, consider turning on debug logging to print the raw HTTP response.
#[non_exhaustive]
Unknown,
}
impl Rule {
/// Tries to convert the enum instance into [`InterruptionFilter`](crate::types::Rule::InterruptionFilter), extracting the inner [`InterruptionFilter`](crate::types::InterruptionFilter).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_interruption_filter(&self) -> ::std::result::Result<&crate::types::InterruptionFilter, &Self> {
if let Rule::InterruptionFilter(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`InterruptionFilter`](crate::types::Rule::InterruptionFilter).
pub fn is_interruption_filter(&self) -> bool {
self.as_interruption_filter().is_ok()
}
/// Tries to convert the enum instance into [`NonTalkTimeFilter`](crate::types::Rule::NonTalkTimeFilter), extracting the inner [`NonTalkTimeFilter`](crate::types::NonTalkTimeFilter).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_non_talk_time_filter(&self) -> ::std::result::Result<&crate::types::NonTalkTimeFilter, &Self> {
if let Rule::NonTalkTimeFilter(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`NonTalkTimeFilter`](crate::types::Rule::NonTalkTimeFilter).
pub fn is_non_talk_time_filter(&self) -> bool {
self.as_non_talk_time_filter().is_ok()
}
/// Tries to convert the enum instance into [`SentimentFilter`](crate::types::Rule::SentimentFilter), extracting the inner [`SentimentFilter`](crate::types::SentimentFilter).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_sentiment_filter(&self) -> ::std::result::Result<&crate::types::SentimentFilter, &Self> {
if let Rule::SentimentFilter(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`SentimentFilter`](crate::types::Rule::SentimentFilter).
pub fn is_sentiment_filter(&self) -> bool {
self.as_sentiment_filter().is_ok()
}
/// Tries to convert the enum instance into [`TranscriptFilter`](crate::types::Rule::TranscriptFilter), extracting the inner [`TranscriptFilter`](crate::types::TranscriptFilter).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_transcript_filter(&self) -> ::std::result::Result<&crate::types::TranscriptFilter, &Self> {
if let Rule::TranscriptFilter(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`TranscriptFilter`](crate::types::Rule::TranscriptFilter).
pub fn is_transcript_filter(&self) -> bool {
self.as_transcript_filter().is_ok()
}
/// Returns true if the enum instance is the `Unknown` variant.
pub fn is_unknown(&self) -> bool {
matches!(self, Self::Unknown)
}
}