92 92 | "com.amazonaws.transcribestreaming",
|
93 93 | "UtteranceEvent",
|
94 94 | );
|
95 95 | static UTTERANCEEVENT_MEMBER_UTTERANCE_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
96 96 | ::aws_smithy_schema::ShapeId::from_static(
|
97 97 | "com.amazonaws.transcribestreaming#UtteranceEvent$UtteranceId",
|
98 98 | "com.amazonaws.transcribestreaming",
|
99 99 | "UtteranceEvent",
|
100 100 | ),
|
101 101 | ::aws_smithy_schema::ShapeType::String,
|
102 - | "utterance_id",
|
102 + | "UtteranceId",
|
103 103 | 0,
|
104 104 | );
|
105 105 | static UTTERANCEEVENT_MEMBER_IS_PARTIAL: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
106 106 | ::aws_smithy_schema::ShapeId::from_static(
|
107 107 | "com.amazonaws.transcribestreaming#UtteranceEvent$IsPartial",
|
108 108 | "com.amazonaws.transcribestreaming",
|
109 109 | "UtteranceEvent",
|
110 110 | ),
|
111 111 | ::aws_smithy_schema::ShapeType::Boolean,
|
112 - | "is_partial",
|
112 + | "IsPartial",
|
113 113 | 1,
|
114 114 | );
|
115 115 | static UTTERANCEEVENT_MEMBER_PARTICIPANT_ROLE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
116 116 | ::aws_smithy_schema::ShapeId::from_static(
|
117 117 | "com.amazonaws.transcribestreaming#UtteranceEvent$ParticipantRole",
|
118 118 | "com.amazonaws.transcribestreaming",
|
119 119 | "UtteranceEvent",
|
120 120 | ),
|
121 121 | ::aws_smithy_schema::ShapeType::String,
|
122 - | "participant_role",
|
122 + | "ParticipantRole",
|
123 123 | 2,
|
124 124 | );
|
125 125 | static UTTERANCEEVENT_MEMBER_BEGIN_OFFSET_MILLIS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
126 126 | ::aws_smithy_schema::ShapeId::from_static(
|
127 127 | "com.amazonaws.transcribestreaming#UtteranceEvent$BeginOffsetMillis",
|
128 128 | "com.amazonaws.transcribestreaming",
|
129 129 | "UtteranceEvent",
|
130 130 | ),
|
131 131 | ::aws_smithy_schema::ShapeType::Long,
|
132 - | "begin_offset_millis",
|
132 + | "BeginOffsetMillis",
|
133 133 | 3,
|
134 134 | );
|
135 135 | static UTTERANCEEVENT_MEMBER_END_OFFSET_MILLIS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
136 136 | ::aws_smithy_schema::ShapeId::from_static(
|
137 137 | "com.amazonaws.transcribestreaming#UtteranceEvent$EndOffsetMillis",
|
138 138 | "com.amazonaws.transcribestreaming",
|
139 139 | "UtteranceEvent",
|
140 140 | ),
|
141 141 | ::aws_smithy_schema::ShapeType::Long,
|
142 - | "end_offset_millis",
|
142 + | "EndOffsetMillis",
|
143 143 | 4,
|
144 144 | );
|
145 145 | static UTTERANCEEVENT_MEMBER_TRANSCRIPT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
146 146 | ::aws_smithy_schema::ShapeId::from_static(
|
147 147 | "com.amazonaws.transcribestreaming#UtteranceEvent$Transcript",
|
148 148 | "com.amazonaws.transcribestreaming",
|
149 149 | "UtteranceEvent",
|
150 150 | ),
|
151 151 | ::aws_smithy_schema::ShapeType::String,
|
152 - | "transcript",
|
152 + | "Transcript",
|
153 153 | 5,
|
154 154 | );
|
155 155 | static UTTERANCEEVENT_MEMBER_ITEMS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
156 156 | ::aws_smithy_schema::ShapeId::from_static(
|
157 157 | "com.amazonaws.transcribestreaming#UtteranceEvent$Items",
|
158 158 | "com.amazonaws.transcribestreaming",
|
159 159 | "UtteranceEvent",
|
160 160 | ),
|
161 161 | ::aws_smithy_schema::ShapeType::List,
|
162 - | "items",
|
162 + | "Items",
|
163 163 | 6,
|
164 164 | );
|
165 165 | static UTTERANCEEVENT_MEMBER_ENTITIES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
166 166 | ::aws_smithy_schema::ShapeId::from_static(
|
167 167 | "com.amazonaws.transcribestreaming#UtteranceEvent$Entities",
|
168 168 | "com.amazonaws.transcribestreaming",
|
169 169 | "UtteranceEvent",
|
170 170 | ),
|
171 171 | ::aws_smithy_schema::ShapeType::List,
|
172 - | "entities",
|
172 + | "Entities",
|
173 173 | 7,
|
174 174 | );
|
175 175 | static UTTERANCEEVENT_MEMBER_SENTIMENT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
176 176 | ::aws_smithy_schema::ShapeId::from_static(
|
177 177 | "com.amazonaws.transcribestreaming#UtteranceEvent$Sentiment",
|
178 178 | "com.amazonaws.transcribestreaming",
|
179 179 | "UtteranceEvent",
|
180 180 | ),
|
181 181 | ::aws_smithy_schema::ShapeType::String,
|
182 - | "sentiment",
|
182 + | "Sentiment",
|
183 183 | 8,
|
184 184 | );
|
185 185 | static UTTERANCEEVENT_MEMBER_ISSUES_DETECTED: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
186 186 | ::aws_smithy_schema::ShapeId::from_static(
|
187 187 | "com.amazonaws.transcribestreaming#UtteranceEvent$IssuesDetected",
|
188 188 | "com.amazonaws.transcribestreaming",
|
189 189 | "UtteranceEvent",
|
190 190 | ),
|
191 191 | ::aws_smithy_schema::ShapeType::List,
|
192 - | "issues_detected",
|
192 + | "IssuesDetected",
|
193 193 | 9,
|
194 194 | );
|
195 195 | static UTTERANCEEVENT_MEMBER_LANGUAGE_CODE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
196 196 | ::aws_smithy_schema::ShapeId::from_static(
|
197 197 | "com.amazonaws.transcribestreaming#UtteranceEvent$LanguageCode",
|
198 198 | "com.amazonaws.transcribestreaming",
|
199 199 | "UtteranceEvent",
|
200 200 | ),
|
201 201 | ::aws_smithy_schema::ShapeType::String,
|
202 - | "language_code",
|
202 + | "LanguageCode",
|
203 203 | 10,
|
204 204 | );
|
205 205 | static UTTERANCEEVENT_MEMBER_LANGUAGE_IDENTIFICATION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
206 206 | ::aws_smithy_schema::ShapeId::from_static(
|
207 207 | "com.amazonaws.transcribestreaming#UtteranceEvent$LanguageIdentification",
|
208 208 | "com.amazonaws.transcribestreaming",
|
209 209 | "UtteranceEvent",
|
210 210 | ),
|
211 211 | ::aws_smithy_schema::ShapeType::List,
|
212 - | "language_identification",
|
212 + | "LanguageIdentification",
|
213 213 | 11,
|
214 214 | );
|
215 215 | static UTTERANCEEVENT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
216 216 | UTTERANCEEVENT_SCHEMA_ID,
|
217 217 | ::aws_smithy_schema::ShapeType::Structure,
|
218 218 | &[
|
219 219 | &UTTERANCEEVENT_MEMBER_UTTERANCE_ID,
|
220 220 | &UTTERANCEEVENT_MEMBER_IS_PARTIAL,
|
221 221 | &UTTERANCEEVENT_MEMBER_PARTICIPANT_ROLE,
|
222 222 | &UTTERANCEEVENT_MEMBER_BEGIN_OFFSET_MILLIS,
|
223 223 | &UTTERANCEEVENT_MEMBER_END_OFFSET_MILLIS,
|
224 224 | &UTTERANCEEVENT_MEMBER_TRANSCRIPT,
|
225 225 | &UTTERANCEEVENT_MEMBER_ITEMS,
|
226 226 | &UTTERANCEEVENT_MEMBER_ENTITIES,
|
227 227 | &UTTERANCEEVENT_MEMBER_SENTIMENT,
|
228 228 | &UTTERANCEEVENT_MEMBER_ISSUES_DETECTED,
|
229 229 | &UTTERANCEEVENT_MEMBER_LANGUAGE_CODE,
|
230 230 | &UTTERANCEEVENT_MEMBER_LANGUAGE_IDENTIFICATION,
|
231 231 | ],
|
232 232 | );
|
233 233 | impl UtteranceEvent {
|
234 234 | /// The schema for this shape.
|
235 235 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &UTTERANCEEVENT_SCHEMA;
|
236 236 | }
|
237 237 | impl ::aws_smithy_schema::serde::SerializableStruct for UtteranceEvent {
|
238 238 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
239 239 | fn serialize_members(
|
240 240 | &self,
|
241 241 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
242 242 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
307 307 | }
|
308 308 | Ok(())
|
309 309 | },
|
310 310 | )?;
|
311 311 | }
|
312 312 | Ok(())
|
313 313 | }
|
314 314 | }
|
315 315 | impl UtteranceEvent {
|
316 316 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
317 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
318 - | deserializer: &mut D,
|
317 + | pub fn deserialize(
|
318 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
319 319 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
320 320 | #[allow(unused_variables, unused_mut)]
|
321 321 | let mut builder = Self::builder();
|
322 322 | #[allow(
|
323 323 | unused_variables,
|
324 324 | unreachable_code,
|
325 325 | clippy::single_match,
|
326 326 | clippy::match_single_binding,
|
327 327 | clippy::diverging_sub_expression
|
328 328 | )]
|
329 - | deserializer.read_struct(&UTTERANCEEVENT_SCHEMA, (), |_, member, deser| {
|
329 + | deserializer.read_struct(&UTTERANCEEVENT_SCHEMA, &mut |member, deser| {
|
330 330 | match member.member_index() {
|
331 331 | Some(0) => {
|
332 332 | builder.utterance_id = Some(deser.read_string(member)?);
|
333 333 | }
|
334 334 | Some(1) => {
|
335 335 | builder.is_partial = Some(deser.read_boolean(member)?);
|
336 336 | }
|
337 337 | Some(2) => {
|
338 338 | builder.participant_role = Some(crate::types::ParticipantRole::from(deser.read_string(member)?.as_str()));
|
339 339 | }
|
340 340 | Some(3) => {
|
341 341 | builder.begin_offset_millis = Some(deser.read_long(member)?);
|
342 342 | }
|
343 343 | Some(4) => {
|
344 344 | builder.end_offset_millis = Some(deser.read_long(member)?);
|
345 345 | }
|
346 346 | Some(5) => {
|
347 347 | builder.transcript = Some(deser.read_string(member)?);
|
348 348 | }
|
349 349 | Some(6) => {
|
350 350 | builder.items = Some({
|
351 - | let container = if let Some(cap) = deser.container_size() {
|
352 - | Vec::with_capacity(cap)
|
353 - | } else {
|
354 - | Vec::new()
|
355 - | };
|
356 - | deser.read_list(member, container, |mut list, deser| {
|
357 - | list.push(crate::types::CallAnalyticsItem::deserialize(deser)?);
|
358 - | Ok(list)
|
359 - | })?
|
351 + | let mut container = Vec::new();
|
352 + | deser.read_list(member, &mut |deser| {
|
353 + | container.push(crate::types::CallAnalyticsItem::deserialize(deser)?);
|
354 + | Ok(())
|
355 + | })?;
|
356 + | container
|
360 357 | });
|
361 358 | }
|
362 359 | Some(7) => {
|
363 360 | builder.entities = Some({
|
364 - | let container = if let Some(cap) = deser.container_size() {
|
365 - | Vec::with_capacity(cap)
|
366 - | } else {
|
367 - | Vec::new()
|
368 - | };
|
369 - | deser.read_list(member, container, |mut list, deser| {
|
370 - | list.push(crate::types::CallAnalyticsEntity::deserialize(deser)?);
|
371 - | Ok(list)
|
372 - | })?
|
361 + | let mut container = Vec::new();
|
362 + | deser.read_list(member, &mut |deser| {
|
363 + | container.push(crate::types::CallAnalyticsEntity::deserialize(deser)?);
|
364 + | Ok(())
|
365 + | })?;
|
366 + | container
|
373 367 | });
|
374 368 | }
|
375 369 | Some(8) => {
|
376 370 | builder.sentiment = Some(crate::types::Sentiment::from(deser.read_string(member)?.as_str()));
|
377 371 | }
|
378 372 | Some(9) => {
|
379 373 | builder.issues_detected = Some({
|
380 - | let container = if let Some(cap) = deser.container_size() {
|
381 - | Vec::with_capacity(cap)
|
382 - | } else {
|
383 - | Vec::new()
|
384 - | };
|
385 - | deser.read_list(member, container, |mut list, deser| {
|
386 - | list.push(crate::types::IssueDetected::deserialize(deser)?);
|
387 - | Ok(list)
|
388 - | })?
|
374 + | let mut container = Vec::new();
|
375 + | deser.read_list(member, &mut |deser| {
|
376 + | container.push(crate::types::IssueDetected::deserialize(deser)?);
|
377 + | Ok(())
|
378 + | })?;
|
379 + | container
|
389 380 | });
|
390 381 | }
|
391 382 | Some(10) => {
|
392 383 | builder.language_code = Some(crate::types::CallAnalyticsLanguageCode::from(deser.read_string(member)?.as_str()));
|
393 384 | }
|
394 385 | Some(11) => {
|
395 386 | builder.language_identification = Some({
|
396 - | let container = if let Some(cap) = deser.container_size() {
|
397 - | Vec::with_capacity(cap)
|
398 - | } else {
|
399 - | Vec::new()
|
400 - | };
|
401 - | deser.read_list(member, container, |mut list, deser| {
|
402 - | list.push(crate::types::CallAnalyticsLanguageWithScore::deserialize(deser)?);
|
403 - | Ok(list)
|
404 - | })?
|
387 + | let mut container = Vec::new();
|
388 + | deser.read_list(member, &mut |deser| {
|
389 + | container.push(crate::types::CallAnalyticsLanguageWithScore::deserialize(deser)?);
|
390 + | Ok(())
|
391 + | })?;
|
392 + | container
|
405 393 | });
|
406 394 | }
|
407 395 | _ => {}
|
408 396 | }
|
409 397 | Ok(())
|
410 398 | })?;
|
411 399 | Ok(builder.build())
|
412 400 | }
|
413 401 | }
|
402 + | impl UtteranceEvent {
|
403 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
404 + | pub fn deserialize_with_response(
|
405 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
406 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
407 + | _status: u16,
|
408 + | _body: &[u8],
|
409 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
410 + | Self::deserialize(deserializer)
|
411 + | }
|
412 + | }
|
414 413 | impl UtteranceEvent {
|
415 414 | /// Creates a new builder-style object to manufacture [`UtteranceEvent`](crate::types::UtteranceEvent).
|
416 415 | pub fn builder() -> crate::types::builders::UtteranceEventBuilder {
|
417 416 | crate::types::builders::UtteranceEventBuilder::default()
|
418 417 | }
|
419 418 | }
|
420 419 |
|
421 420 | /// A builder for [`UtteranceEvent`](crate::types::UtteranceEvent).
|
422 421 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
423 422 | #[non_exhaustive]
|
424 423 | pub struct UtteranceEventBuilder {
|
425 424 | pub(crate) utterance_id: ::std::option::Option<::std::string::String>,
|
426 425 | pub(crate) is_partial: ::std::option::Option<bool>,
|
427 426 | pub(crate) participant_role: ::std::option::Option<crate::types::ParticipantRole>,
|
428 427 | pub(crate) begin_offset_millis: ::std::option::Option<i64>,
|
429 428 | pub(crate) end_offset_millis: ::std::option::Option<i64>,
|
430 429 | pub(crate) transcript: ::std::option::Option<::std::string::String>,
|
431 430 | pub(crate) items: ::std::option::Option<::std::vec::Vec<crate::types::CallAnalyticsItem>>,
|
432 431 | pub(crate) entities: ::std::option::Option<::std::vec::Vec<crate::types::CallAnalyticsEntity>>,
|
433 432 | pub(crate) sentiment: ::std::option::Option<crate::types::Sentiment>,
|
434 433 | pub(crate) issues_detected: ::std::option::Option<::std::vec::Vec<crate::types::IssueDetected>>,
|
435 434 | pub(crate) language_code: ::std::option::Option<crate::types::CallAnalyticsLanguageCode>,
|
436 435 | pub(crate) language_identification: ::std::option::Option<::std::vec::Vec<crate::types::CallAnalyticsLanguageWithScore>>,
|
437 436 | }
|
438 437 | impl UtteranceEventBuilder {
|
439 438 | /// <p>The unique identifier that is associated with the specified <code>UtteranceEvent</code>.</p>
|
440 439 | pub fn utterance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
441 440 | self.utterance_id = ::std::option::Option::Some(input.into());
|
442 441 | self
|
443 442 | }
|