aws_sdk_voiceid/types/
_fraud_detection_result.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The fraud detection result produced by Voice ID, processed against the current session state and streamed audio of the speaker.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct FraudDetectionResult {
7    /// <p>The unique identifier for this fraud detection result. Given there can be multiple fraud detections for a given session, this field helps in identifying if the returned result is from previous streaming activity or a new result. Note that in the absence of any new streaming activity or risk threshold changes, Voice ID always returns cached Fraud Detection result for this API.</p>
8    pub fraud_detection_result_id: ::std::option::Option<::std::string::String>,
9    /// <p>A timestamp of when audio aggregation started for this fraud detection result.</p>
10    pub audio_aggregation_started_at: ::std::option::Option<::aws_smithy_types::DateTime>,
11    /// <p>A timestamp of when audio aggregation ended for this fraud detection result.</p>
12    pub audio_aggregation_ended_at: ::std::option::Option<::aws_smithy_types::DateTime>,
13    /// <p>The <code>FraudDetectionConfiguration</code> used to generate this fraud detection result.</p>
14    pub configuration: ::std::option::Option<crate::types::FraudDetectionConfiguration>,
15    /// <p>The fraud detection decision produced by Voice ID, processed against the current session state and streamed audio of the speaker.</p>
16    pub decision: ::std::option::Option<crate::types::FraudDetectionDecision>,
17    /// <p>The reason speaker was flagged by the fraud detection system. This is only be populated if fraud detection Decision is <code>HIGH_RISK</code>, and the following possible values: <code>KNOWN_FRAUDSTER</code> and <code>VOICE_SPOOFING</code>.</p>
18    pub reasons: ::std::option::Option<::std::vec::Vec<crate::types::FraudDetectionReason>>,
19    /// <p>Details about each risk analyzed for this speaker. Currently, this contains KnownFraudsterRisk and VoiceSpoofingRisk details.</p>
20    pub risk_details: ::std::option::Option<crate::types::FraudRiskDetails>,
21}
22impl FraudDetectionResult {
23    /// <p>The unique identifier for this fraud detection result. Given there can be multiple fraud detections for a given session, this field helps in identifying if the returned result is from previous streaming activity or a new result. Note that in the absence of any new streaming activity or risk threshold changes, Voice ID always returns cached Fraud Detection result for this API.</p>
24    pub fn fraud_detection_result_id(&self) -> ::std::option::Option<&str> {
25        self.fraud_detection_result_id.as_deref()
26    }
27    /// <p>A timestamp of when audio aggregation started for this fraud detection result.</p>
28    pub fn audio_aggregation_started_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
29        self.audio_aggregation_started_at.as_ref()
30    }
31    /// <p>A timestamp of when audio aggregation ended for this fraud detection result.</p>
32    pub fn audio_aggregation_ended_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
33        self.audio_aggregation_ended_at.as_ref()
34    }
35    /// <p>The <code>FraudDetectionConfiguration</code> used to generate this fraud detection result.</p>
36    pub fn configuration(&self) -> ::std::option::Option<&crate::types::FraudDetectionConfiguration> {
37        self.configuration.as_ref()
38    }
39    /// <p>The fraud detection decision produced by Voice ID, processed against the current session state and streamed audio of the speaker.</p>
40    pub fn decision(&self) -> ::std::option::Option<&crate::types::FraudDetectionDecision> {
41        self.decision.as_ref()
42    }
43    /// <p>The reason speaker was flagged by the fraud detection system. This is only be populated if fraud detection Decision is <code>HIGH_RISK</code>, and the following possible values: <code>KNOWN_FRAUDSTER</code> and <code>VOICE_SPOOFING</code>.</p>
44    ///
45    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.reasons.is_none()`.
46    pub fn reasons(&self) -> &[crate::types::FraudDetectionReason] {
47        self.reasons.as_deref().unwrap_or_default()
48    }
49    /// <p>Details about each risk analyzed for this speaker. Currently, this contains KnownFraudsterRisk and VoiceSpoofingRisk details.</p>
50    pub fn risk_details(&self) -> ::std::option::Option<&crate::types::FraudRiskDetails> {
51        self.risk_details.as_ref()
52    }
53}
54impl FraudDetectionResult {
55    /// Creates a new builder-style object to manufacture [`FraudDetectionResult`](crate::types::FraudDetectionResult).
56    pub fn builder() -> crate::types::builders::FraudDetectionResultBuilder {
57        crate::types::builders::FraudDetectionResultBuilder::default()
58    }
59}
60
61/// A builder for [`FraudDetectionResult`](crate::types::FraudDetectionResult).
62#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
63#[non_exhaustive]
64pub struct FraudDetectionResultBuilder {
65    pub(crate) fraud_detection_result_id: ::std::option::Option<::std::string::String>,
66    pub(crate) audio_aggregation_started_at: ::std::option::Option<::aws_smithy_types::DateTime>,
67    pub(crate) audio_aggregation_ended_at: ::std::option::Option<::aws_smithy_types::DateTime>,
68    pub(crate) configuration: ::std::option::Option<crate::types::FraudDetectionConfiguration>,
69    pub(crate) decision: ::std::option::Option<crate::types::FraudDetectionDecision>,
70    pub(crate) reasons: ::std::option::Option<::std::vec::Vec<crate::types::FraudDetectionReason>>,
71    pub(crate) risk_details: ::std::option::Option<crate::types::FraudRiskDetails>,
72}
73impl FraudDetectionResultBuilder {
74    /// <p>The unique identifier for this fraud detection result. Given there can be multiple fraud detections for a given session, this field helps in identifying if the returned result is from previous streaming activity or a new result. Note that in the absence of any new streaming activity or risk threshold changes, Voice ID always returns cached Fraud Detection result for this API.</p>
75    pub fn fraud_detection_result_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.fraud_detection_result_id = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// <p>The unique identifier for this fraud detection result. Given there can be multiple fraud detections for a given session, this field helps in identifying if the returned result is from previous streaming activity or a new result. Note that in the absence of any new streaming activity or risk threshold changes, Voice ID always returns cached Fraud Detection result for this API.</p>
80    pub fn set_fraud_detection_result_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.fraud_detection_result_id = input;
82        self
83    }
84    /// <p>The unique identifier for this fraud detection result. Given there can be multiple fraud detections for a given session, this field helps in identifying if the returned result is from previous streaming activity or a new result. Note that in the absence of any new streaming activity or risk threshold changes, Voice ID always returns cached Fraud Detection result for this API.</p>
85    pub fn get_fraud_detection_result_id(&self) -> &::std::option::Option<::std::string::String> {
86        &self.fraud_detection_result_id
87    }
88    /// <p>A timestamp of when audio aggregation started for this fraud detection result.</p>
89    pub fn audio_aggregation_started_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
90        self.audio_aggregation_started_at = ::std::option::Option::Some(input);
91        self
92    }
93    /// <p>A timestamp of when audio aggregation started for this fraud detection result.</p>
94    pub fn set_audio_aggregation_started_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
95        self.audio_aggregation_started_at = input;
96        self
97    }
98    /// <p>A timestamp of when audio aggregation started for this fraud detection result.</p>
99    pub fn get_audio_aggregation_started_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
100        &self.audio_aggregation_started_at
101    }
102    /// <p>A timestamp of when audio aggregation ended for this fraud detection result.</p>
103    pub fn audio_aggregation_ended_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
104        self.audio_aggregation_ended_at = ::std::option::Option::Some(input);
105        self
106    }
107    /// <p>A timestamp of when audio aggregation ended for this fraud detection result.</p>
108    pub fn set_audio_aggregation_ended_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
109        self.audio_aggregation_ended_at = input;
110        self
111    }
112    /// <p>A timestamp of when audio aggregation ended for this fraud detection result.</p>
113    pub fn get_audio_aggregation_ended_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
114        &self.audio_aggregation_ended_at
115    }
116    /// <p>The <code>FraudDetectionConfiguration</code> used to generate this fraud detection result.</p>
117    pub fn configuration(mut self, input: crate::types::FraudDetectionConfiguration) -> Self {
118        self.configuration = ::std::option::Option::Some(input);
119        self
120    }
121    /// <p>The <code>FraudDetectionConfiguration</code> used to generate this fraud detection result.</p>
122    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::FraudDetectionConfiguration>) -> Self {
123        self.configuration = input;
124        self
125    }
126    /// <p>The <code>FraudDetectionConfiguration</code> used to generate this fraud detection result.</p>
127    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::FraudDetectionConfiguration> {
128        &self.configuration
129    }
130    /// <p>The fraud detection decision produced by Voice ID, processed against the current session state and streamed audio of the speaker.</p>
131    pub fn decision(mut self, input: crate::types::FraudDetectionDecision) -> Self {
132        self.decision = ::std::option::Option::Some(input);
133        self
134    }
135    /// <p>The fraud detection decision produced by Voice ID, processed against the current session state and streamed audio of the speaker.</p>
136    pub fn set_decision(mut self, input: ::std::option::Option<crate::types::FraudDetectionDecision>) -> Self {
137        self.decision = input;
138        self
139    }
140    /// <p>The fraud detection decision produced by Voice ID, processed against the current session state and streamed audio of the speaker.</p>
141    pub fn get_decision(&self) -> &::std::option::Option<crate::types::FraudDetectionDecision> {
142        &self.decision
143    }
144    /// Appends an item to `reasons`.
145    ///
146    /// To override the contents of this collection use [`set_reasons`](Self::set_reasons).
147    ///
148    /// <p>The reason speaker was flagged by the fraud detection system. This is only be populated if fraud detection Decision is <code>HIGH_RISK</code>, and the following possible values: <code>KNOWN_FRAUDSTER</code> and <code>VOICE_SPOOFING</code>.</p>
149    pub fn reasons(mut self, input: crate::types::FraudDetectionReason) -> Self {
150        let mut v = self.reasons.unwrap_or_default();
151        v.push(input);
152        self.reasons = ::std::option::Option::Some(v);
153        self
154    }
155    /// <p>The reason speaker was flagged by the fraud detection system. This is only be populated if fraud detection Decision is <code>HIGH_RISK</code>, and the following possible values: <code>KNOWN_FRAUDSTER</code> and <code>VOICE_SPOOFING</code>.</p>
156    pub fn set_reasons(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FraudDetectionReason>>) -> Self {
157        self.reasons = input;
158        self
159    }
160    /// <p>The reason speaker was flagged by the fraud detection system. This is only be populated if fraud detection Decision is <code>HIGH_RISK</code>, and the following possible values: <code>KNOWN_FRAUDSTER</code> and <code>VOICE_SPOOFING</code>.</p>
161    pub fn get_reasons(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FraudDetectionReason>> {
162        &self.reasons
163    }
164    /// <p>Details about each risk analyzed for this speaker. Currently, this contains KnownFraudsterRisk and VoiceSpoofingRisk details.</p>
165    pub fn risk_details(mut self, input: crate::types::FraudRiskDetails) -> Self {
166        self.risk_details = ::std::option::Option::Some(input);
167        self
168    }
169    /// <p>Details about each risk analyzed for this speaker. Currently, this contains KnownFraudsterRisk and VoiceSpoofingRisk details.</p>
170    pub fn set_risk_details(mut self, input: ::std::option::Option<crate::types::FraudRiskDetails>) -> Self {
171        self.risk_details = input;
172        self
173    }
174    /// <p>Details about each risk analyzed for this speaker. Currently, this contains KnownFraudsterRisk and VoiceSpoofingRisk details.</p>
175    pub fn get_risk_details(&self) -> &::std::option::Option<crate::types::FraudRiskDetails> {
176        &self.risk_details
177    }
178    /// Consumes the builder and constructs a [`FraudDetectionResult`](crate::types::FraudDetectionResult).
179    pub fn build(self) -> crate::types::FraudDetectionResult {
180        crate::types::FraudDetectionResult {
181            fraud_detection_result_id: self.fraud_detection_result_id,
182            audio_aggregation_started_at: self.audio_aggregation_started_at,
183            audio_aggregation_ended_at: self.audio_aggregation_ended_at,
184            configuration: self.configuration,
185            decision: self.decision,
186            reasons: self.reasons,
187            risk_details: self.risk_details,
188        }
189    }
190}