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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ListRealtimeContactAnalysisSegmentsV2Output {
    /// <p>The channel of the contact. <code>Voice</code> will not be returned.</p>
    pub channel: crate::types::RealTimeContactAnalysisSupportedChannel,
    /// <p>Status of real-time contact analysis.</p>
    pub status: crate::types::RealTimeContactAnalysisStatus,
    /// <p>An analyzed transcript or category.</p>
    pub segments: ::std::vec::Vec<crate::types::RealtimeContactAnalysisSegment>,
    /// <p>If there are additional results, this is the token for the next set of results.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl ListRealtimeContactAnalysisSegmentsV2Output {
    /// <p>The channel of the contact. <code>Voice</code> will not be returned.</p>
    pub fn channel(&self) -> &crate::types::RealTimeContactAnalysisSupportedChannel {
        &self.channel
    }
    /// <p>Status of real-time contact analysis.</p>
    pub fn status(&self) -> &crate::types::RealTimeContactAnalysisStatus {
        &self.status
    }
    /// <p>An analyzed transcript or category.</p>
    pub fn segments(&self) -> &[crate::types::RealtimeContactAnalysisSegment] {
        use std::ops::Deref;
        self.segments.deref()
    }
    /// <p>If there are additional results, this is the token for the next set of results.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for ListRealtimeContactAnalysisSegmentsV2Output {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl ListRealtimeContactAnalysisSegmentsV2Output {
    /// Creates a new builder-style object to manufacture [`ListRealtimeContactAnalysisSegmentsV2Output`](crate::operation::list_realtime_contact_analysis_segments_v2::ListRealtimeContactAnalysisSegmentsV2Output).
    pub fn builder() -> crate::operation::list_realtime_contact_analysis_segments_v2::builders::ListRealtimeContactAnalysisSegmentsV2OutputBuilder {
        crate::operation::list_realtime_contact_analysis_segments_v2::builders::ListRealtimeContactAnalysisSegmentsV2OutputBuilder::default()
    }
}

/// A builder for [`ListRealtimeContactAnalysisSegmentsV2Output`](crate::operation::list_realtime_contact_analysis_segments_v2::ListRealtimeContactAnalysisSegmentsV2Output).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ListRealtimeContactAnalysisSegmentsV2OutputBuilder {
    pub(crate) channel: ::std::option::Option<crate::types::RealTimeContactAnalysisSupportedChannel>,
    pub(crate) status: ::std::option::Option<crate::types::RealTimeContactAnalysisStatus>,
    pub(crate) segments: ::std::option::Option<::std::vec::Vec<crate::types::RealtimeContactAnalysisSegment>>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl ListRealtimeContactAnalysisSegmentsV2OutputBuilder {
    /// <p>The channel of the contact. <code>Voice</code> will not be returned.</p>
    /// This field is required.
    pub fn channel(mut self, input: crate::types::RealTimeContactAnalysisSupportedChannel) -> Self {
        self.channel = ::std::option::Option::Some(input);
        self
    }
    /// <p>The channel of the contact. <code>Voice</code> will not be returned.</p>
    pub fn set_channel(mut self, input: ::std::option::Option<crate::types::RealTimeContactAnalysisSupportedChannel>) -> Self {
        self.channel = input;
        self
    }
    /// <p>The channel of the contact. <code>Voice</code> will not be returned.</p>
    pub fn get_channel(&self) -> &::std::option::Option<crate::types::RealTimeContactAnalysisSupportedChannel> {
        &self.channel
    }
    /// <p>Status of real-time contact analysis.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::RealTimeContactAnalysisStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>Status of real-time contact analysis.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::RealTimeContactAnalysisStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>Status of real-time contact analysis.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::RealTimeContactAnalysisStatus> {
        &self.status
    }
    /// Appends an item to `segments`.
    ///
    /// To override the contents of this collection use [`set_segments`](Self::set_segments).
    ///
    /// <p>An analyzed transcript or category.</p>
    pub fn segments(mut self, input: crate::types::RealtimeContactAnalysisSegment) -> Self {
        let mut v = self.segments.unwrap_or_default();
        v.push(input);
        self.segments = ::std::option::Option::Some(v);
        self
    }
    /// <p>An analyzed transcript or category.</p>
    pub fn set_segments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RealtimeContactAnalysisSegment>>) -> Self {
        self.segments = input;
        self
    }
    /// <p>An analyzed transcript or category.</p>
    pub fn get_segments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RealtimeContactAnalysisSegment>> {
        &self.segments
    }
    /// <p>If there are additional results, this is the token for the next set of results.</p>
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.next_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>If there are additional results, this is the token for the next set of results.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>If there are additional results, this is the token for the next set of results.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`ListRealtimeContactAnalysisSegmentsV2Output`](crate::operation::list_realtime_contact_analysis_segments_v2::ListRealtimeContactAnalysisSegmentsV2Output).
    /// This method will fail if any of the following fields are not set:
    /// - [`channel`](crate::operation::list_realtime_contact_analysis_segments_v2::builders::ListRealtimeContactAnalysisSegmentsV2OutputBuilder::channel)
    /// - [`status`](crate::operation::list_realtime_contact_analysis_segments_v2::builders::ListRealtimeContactAnalysisSegmentsV2OutputBuilder::status)
    /// - [`segments`](crate::operation::list_realtime_contact_analysis_segments_v2::builders::ListRealtimeContactAnalysisSegmentsV2OutputBuilder::segments)
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::list_realtime_contact_analysis_segments_v2::ListRealtimeContactAnalysisSegmentsV2Output,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(
            crate::operation::list_realtime_contact_analysis_segments_v2::ListRealtimeContactAnalysisSegmentsV2Output {
                channel: self.channel.ok_or_else(|| {
                    ::aws_smithy_types::error::operation::BuildError::missing_field(
                        "channel",
                        "channel was not specified but it is required when building ListRealtimeContactAnalysisSegmentsV2Output",
                    )
                })?,
                status: self.status.ok_or_else(|| {
                    ::aws_smithy_types::error::operation::BuildError::missing_field(
                        "status",
                        "status was not specified but it is required when building ListRealtimeContactAnalysisSegmentsV2Output",
                    )
                })?,
                segments: self.segments.ok_or_else(|| {
                    ::aws_smithy_types::error::operation::BuildError::missing_field(
                        "segments",
                        "segments was not specified but it is required when building ListRealtimeContactAnalysisSegmentsV2Output",
                    )
                })?,
                next_token: self.next_token,
                _request_id: self._request_id,
            },
        )
    }
}