Debian Codegraph @

service/transcribestreamingservice/api.go

raw
1 // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
2
3 package transcribestreamingservice
4
5 import (
6 "bytes"
7 "fmt"
8 "io"
9 "sync"
10 "time"
11
12 "github.com/aws/aws-sdk-go/aws"
13 "github.com/aws/aws-sdk-go/aws/awserr"
14 "github.com/aws/aws-sdk-go/aws/awsutil"
15 "github.com/aws/aws-sdk-go/aws/client"
16 "github.com/aws/aws-sdk-go/aws/request"
17 "github.com/aws/aws-sdk-go/aws/signer/v4"
18 "github.com/aws/aws-sdk-go/private/protocol"
19 "github.com/aws/aws-sdk-go/private/protocol/eventstream"
20 "github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi"
21 "github.com/aws/aws-sdk-go/private/protocol/rest"
22 "github.com/aws/aws-sdk-go/private/protocol/restjson"
23 )
24
25 const opStartCallAnalyticsStreamTranscription = "StartCallAnalyticsStreamTranscription"
26
27 // StartCallAnalyticsStreamTranscriptionRequest generates a "aws/request.Request" representing the
28 // client's request for the StartCallAnalyticsStreamTranscription operation. The "output" return
29 // value will be populated with the request's response once the request completes
30 // successfully.
31 //
32 // Use "Send" method on the returned Request to send the API call to the service.
33 // the "output" return value is not valid until after Send returns without error.
34 //
35 // See StartCallAnalyticsStreamTranscription for more information on using the StartCallAnalyticsStreamTranscription
36 // API call, and error handling.
37 //
38 // This method is useful when you want to inject custom logic or configuration
39 // into the SDK's request lifecycle. Such as custom headers, or retry logic.
40 //
41 // // Example sending a request using the StartCallAnalyticsStreamTranscriptionRequest method.
42 // req, resp := client.StartCallAnalyticsStreamTranscriptionRequest(params)
43 //
44 // err := req.Send()
45 // if err == nil { // resp is now filled
46 // fmt.Println(resp)
47 // }
48 //
49 // See also, https://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/StartCallAnalyticsStreamTranscription
50 func (c *TranscribeStreamingService) StartCallAnalyticsStreamTranscriptionRequest(input *StartCallAnalyticsStreamTranscriptionInput) (req *request.Request, output *StartCallAnalyticsStreamTranscriptionOutput) {
51 op := &request.Operation{
52 Name: opStartCallAnalyticsStreamTranscription,
53 HTTPMethod: "POST",
54 HTTPPath: "/call-analytics-stream-transcription",
55 }
56
57 if input == nil {
58 input = &StartCallAnalyticsStreamTranscriptionInput{}
59 }
60
61 output = &StartCallAnalyticsStreamTranscriptionOutput{}
62 req = c.newRequest(op, input, output)
63 req.Handlers.UnmarshalMeta.PushBack(
64 protocol.RequireHTTPMinProtocol{Major: 2}.Handler,
65 )
66
67 es := NewStartCallAnalyticsStreamTranscriptionEventStream()
68 output.eventStream = es
69
70 req.Handlers.Sign.PushFront(es.setupInputPipe)
71 req.Handlers.UnmarshalError.PushBackNamed(request.NamedHandler{
72 Name: "InputPipeCloser",
73 Fn: func(r *request.Request) {
74 err := es.closeInputPipe()
75 if err != nil {
76 r.Error = awserr.New(eventstreamapi.InputWriterCloseErrorCode, err.Error(), r.Error)
77 }
78 },
79 })
80 req.Handlers.Build.PushBack(request.WithSetRequestHeaders(map[string]string{
81 "Content-Type": "application/vnd.amazon.eventstream",
82 "X-Amz-Content-Sha256": "STREAMING-AWS4-HMAC-SHA256-EVENTS",
83 }))
84 req.Handlers.Build.Swap(restjson.BuildHandler.Name, rest.BuildHandler)
85 eventstreamapi.ApplyHTTPTransportFixes(req)
86 req.Handlers.Send.Swap(client.LogHTTPRequestHandler.Name, client.LogHTTPRequestHeaderHandler)
87 req.Handlers.Unmarshal.PushBack(es.runInputStream)
88
89 req.Handlers.Send.Swap(client.LogHTTPResponseHandler.Name, client.LogHTTPResponseHeaderHandler)
90 req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, rest.UnmarshalHandler)
91 req.Handlers.Unmarshal.PushBack(es.runOutputStream)
92 req.Handlers.Unmarshal.PushBack(es.runOnStreamPartClose)
93 return
94 }
95
96 // StartCallAnalyticsStreamTranscription API operation for Amazon Transcribe Streaming Service.
97 //
98 // Starts a bidirectional HTTP/2 or WebSocket stream where audio is streamed
99 // to Amazon Transcribe and the transcription results are streamed to your application.
100 // Use this operation for Call Analytics (https://docs.aws.amazon.com/transcribe/latest/dg/call-analytics.html)
101 // transcriptions.
102 //
103 // The following parameters are required:
104 //
105 // - language-code
106 //
107 // - media-encoding
108 //
109 // - sample-rate
110 //
111 // For more information on streaming with Amazon Transcribe, see Transcribing
112 // streaming audio (https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html).
113 //
114 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
115 // with awserr.Error's Code and Message methods to get detailed information about
116 // the error.
117 //
118 // See the AWS API reference guide for Amazon Transcribe Streaming Service's
119 // API operation StartCallAnalyticsStreamTranscription for usage and error information.
120 //
121 // Returned Error Types:
122 //
123 // - BadRequestException
124 // One or more arguments to the StartStreamTranscription, StartMedicalStreamTranscription,
125 // or StartCallAnalyticsStreamTranscription operation was not valid. For example,
126 // MediaEncoding or LanguageCode used not valid values. Check the specified
127 // parameters and try your request again.
128 //
129 // - LimitExceededException
130 // Your client has exceeded one of the Amazon Transcribe limits. This is typically
131 // the audio length limit. Break your audio stream into smaller chunks and try
132 // your request again.
133 //
134 // - InternalFailureException
135 // A problem occurred while processing the audio. Amazon Transcribe terminated
136 // processing.
137 //
138 // - ConflictException
139 // A new stream started with the same session ID. The current stream has been
140 // terminated.
141 //
142 // - ServiceUnavailableException
143 // The service is currently unavailable. Try your request later.
144 //
145 // See also, https://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/StartCallAnalyticsStreamTranscription
146 func (c *TranscribeStreamingService) StartCallAnalyticsStreamTranscription(input *StartCallAnalyticsStreamTranscriptionInput) (*StartCallAnalyticsStreamTranscriptionOutput, error) {
147 req, out := c.StartCallAnalyticsStreamTranscriptionRequest(input)
148 return out, req.Send()
149 }
150
151 // StartCallAnalyticsStreamTranscriptionWithContext is the same as StartCallAnalyticsStreamTranscription with the addition of
152 // the ability to pass a context and additional request options.
153 //
154 // See StartCallAnalyticsStreamTranscription for details on how to use this API operation.
155 //
156 // The context must be non-nil and will be used for request cancellation. If
157 // the context is nil a panic will occur. In the future the SDK may create
158 // sub-contexts for http.Requests. See https://golang.org/pkg/context/
159 // for more information on using Contexts.
160 func (c *TranscribeStreamingService) StartCallAnalyticsStreamTranscriptionWithContext(ctx aws.Context, input *StartCallAnalyticsStreamTranscriptionInput, opts ...request.Option) (*StartCallAnalyticsStreamTranscriptionOutput, error) {
161 req, out := c.StartCallAnalyticsStreamTranscriptionRequest(input)
162 req.SetContext(ctx)
163 req.ApplyOptions(opts...)
164 return out, req.Send()
165 }
166
167 var _ awserr.Error
168 var _ time.Time
169
170 // StartCallAnalyticsStreamTranscriptionEventStream provides the event stream handling for the StartCallAnalyticsStreamTranscription.
171 //
172 // For testing and mocking the event stream this type should be initialized via
173 // the NewStartCallAnalyticsStreamTranscriptionEventStream constructor function. Using the functional options
174 // to pass in nested mock behavior.
175 type StartCallAnalyticsStreamTranscriptionEventStream struct {
176
177 // Writer is the EventStream writer for the AudioStream
178 // events. This value is automatically set by the SDK when the API call is made
179 // Use this member when unit testing your code with the SDK to mock out the
180 // EventStream Writer.
181 //
182 // Must not be nil.
183 Writer AudioStreamWriter
184
185 inputWriter io.WriteCloser
186
187 // Reader is the EventStream reader for the CallAnalyticsTranscriptResultStream
188 // events. This value is automatically set by the SDK when the API call is made
189 // Use this member when unit testing your code with the SDK to mock out the
190 // EventStream Reader.
191 //
192 // Must not be nil.
193 Reader CallAnalyticsTranscriptResultStreamReader
194
195 outputReader io.ReadCloser
196
197 done chan struct{}
198 closeOnce sync.Once
199 err *eventstreamapi.OnceError
200 }
201
202 // NewStartCallAnalyticsStreamTranscriptionEventStream initializes an StartCallAnalyticsStreamTranscriptionEventStream.
203 // This function should only be used for testing and mocking the StartCallAnalyticsStreamTranscriptionEventStream
204 // stream within your application.
205 //
206 // The Writer member must be set before writing events to the stream.
207 //
208 // The Reader member must be set before reading events from the stream.
209 //
210 // es := NewStartCallAnalyticsStreamTranscriptionEventStream(func(o *StartCallAnalyticsStreamTranscriptionEventStream){
211 // es.Writer = myMockStreamWriter
212 // es.Reader = myMockStreamReader
213 // })
214 func NewStartCallAnalyticsStreamTranscriptionEventStream(opts ...func(*StartCallAnalyticsStreamTranscriptionEventStream)) *StartCallAnalyticsStreamTranscriptionEventStream {
215 es := &StartCallAnalyticsStreamTranscriptionEventStream{
216 done: make(chan struct{}),
217 err: eventstreamapi.NewOnceError(),
218 }
219
220 for _, fn := range opts {
221 fn(es)
222 }
223
224 return es
225 }
226
227 func (es *StartCallAnalyticsStreamTranscriptionEventStream) runOnStreamPartClose(r *request.Request) {
228 if es.done == nil {
229 return
230 }
231 go es.waitStreamPartClose()
232
233 }
234
235 func (es *StartCallAnalyticsStreamTranscriptionEventStream) waitStreamPartClose() {
236 var inputErrCh <-chan struct{}
237 if v, ok := es.Writer.(interface{ ErrorSet() <-chan struct{} }); ok {
238 inputErrCh = v.ErrorSet()
239 }
240 var outputErrCh <-chan struct{}
241 if v, ok := es.Reader.(interface{ ErrorSet() <-chan struct{} }); ok {
242 outputErrCh = v.ErrorSet()
243 }
244 var outputClosedCh <-chan struct{}
245 if v, ok := es.Reader.(interface{ Closed() <-chan struct{} }); ok {
246 outputClosedCh = v.Closed()
247 }
248
249 select {
250 case <-es.done:
251 case <-inputErrCh:
252 es.err.SetError(es.Writer.Err())
253 es.Close()
254 case <-outputErrCh:
255 es.err.SetError(es.Reader.Err())
256 es.Close()
257 case <-outputClosedCh:
258 if err := es.Reader.Err(); err != nil {
259 es.err.SetError(es.Reader.Err())
260 }
261 es.Close()
262 }
263 }
264
265 func (es *StartCallAnalyticsStreamTranscriptionEventStream) setupInputPipe(r *request.Request) {
266 inputReader, inputWriter := io.Pipe()
267 r.SetStreamingBody(inputReader)
268 es.inputWriter = inputWriter
269 }
270
271 // Closes the input-pipe writer
272 func (es *StartCallAnalyticsStreamTranscriptionEventStream) closeInputPipe() error {
273 if es.inputWriter != nil {
274 return es.inputWriter.Close()
275 }
276 return nil
277 }
278
279 // Send writes the event to the stream blocking until the event is written.
280 // Returns an error if the event was not written.
281 //
282 // These events are:
283 //
284 // - AudioEvent
285 // - ConfigurationEvent
286 func (es *StartCallAnalyticsStreamTranscriptionEventStream) Send(ctx aws.Context, event AudioStreamEvent) error {
287 return es.Writer.Send(ctx, event)
288 }
289
290 func (es *StartCallAnalyticsStreamTranscriptionEventStream) runInputStream(r *request.Request) {
291 var opts []func(*eventstream.Encoder)
292 if r.Config.Logger != nil && r.Config.LogLevel.Matches(aws.LogDebugWithEventStreamBody) {
293 opts = append(opts, eventstream.EncodeWithLogger(r.Config.Logger))
294 }
295 var encoder eventstreamapi.Encoder = eventstream.NewEncoder(es.inputWriter, opts...)
296
297 var closer aws.MultiCloser
298 sigSeed, err := v4.GetSignedRequestSignature(r.HTTPRequest)
299 if err != nil {
300 r.Error = awserr.New(request.ErrCodeSerialization,
301 "unable to get initial request's signature", err)
302 return
303 }
304 signer := eventstreamapi.NewSignEncoder(
305 v4.NewStreamSigner(r.ClientInfo.SigningRegion, r.ClientInfo.SigningName,
306 sigSeed, r.Config.Credentials),
307 encoder,
308 )
309 encoder = signer
310 closer = append(closer, signer)
311 closer = append(closer, es.inputWriter)
312
313 eventWriter := eventstreamapi.NewEventWriter(encoder,
314 protocol.HandlerPayloadMarshal{
315 Marshalers: r.Handlers.BuildStream,
316 },
317 eventTypeForAudioStreamEvent,
318 )
319
320 es.Writer = &writeAudioStream{
321 StreamWriter: eventstreamapi.NewStreamWriter(eventWriter, closer),
322 }
323 }
324
325 // Events returns a channel to read events from.
326 //
327 // These events are:
328 //
329 // - CategoryEvent
330 // - UtteranceEvent
331 // - CallAnalyticsTranscriptResultStreamUnknownEvent
332 func (es *StartCallAnalyticsStreamTranscriptionEventStream) Events() <-chan CallAnalyticsTranscriptResultStreamEvent {
333 return es.Reader.Events()
334 }
335
336 func (es *StartCallAnalyticsStreamTranscriptionEventStream) runOutputStream(r *request.Request) {
337 var opts []func(*eventstream.Decoder)
338 if r.Config.Logger != nil && r.Config.LogLevel.Matches(aws.LogDebugWithEventStreamBody) {
339 opts = append(opts, eventstream.DecodeWithLogger(r.Config.Logger))
340 }
341
342 unmarshalerForEvent := unmarshalerForCallAnalyticsTranscriptResultStreamEvent{
343 metadata: protocol.ResponseMetadata{
344 StatusCode: r.HTTPResponse.StatusCode,
345 RequestID: r.RequestID,
346 },
347 }.UnmarshalerForEventName
348
349 decoder := eventstream.NewDecoder(r.HTTPResponse.Body, opts...)
350 eventReader := eventstreamapi.NewEventReader(decoder,
351 protocol.HandlerPayloadUnmarshal{
352 Unmarshalers: r.Handlers.UnmarshalStream,
353 },
354 unmarshalerForEvent,
355 )
356
357 es.outputReader = r.HTTPResponse.Body
358 es.Reader = newReadCallAnalyticsTranscriptResultStream(eventReader)
359 }
360
361 // Close closes the stream. This will also cause the stream to be closed.
362 // Close must be called when done using the stream API. Not calling Close
363 // may result in resource leaks.
364 //
365 // Will close the underlying EventStream writer, and no more events can be
366 // sent.
367 //
368 // You can use the closing of the Reader's Events channel to terminate your
369 // application's read from the API's stream.
370 func (es *StartCallAnalyticsStreamTranscriptionEventStream) Close() (err error) {
371 es.closeOnce.Do(es.safeClose)
372 return es.Err()
373 }
374
375 func (es *StartCallAnalyticsStreamTranscriptionEventStream) safeClose() {
376 if es.done != nil {
377 close(es.done)
378 }
379
380 t := time.NewTicker(time.Second)
381 defer t.Stop()
382 writeCloseDone := make(chan error)
383 go func() {
384 if err := es.Writer.Close(); err != nil {
385 es.err.SetError(err)
386 }
387 close(writeCloseDone)
388 }()
389 select {
390 case <-t.C:
391 case <-writeCloseDone:
392 }
393 if err := es.closeInputPipe(); err != nil {
394 es.err.SetError(err)
395 }
396
397 es.Reader.Close()
398 if es.outputReader != nil {
399 es.outputReader.Close()
400 }
401 }
402
403 // Err returns any error that occurred while reading or writing EventStream
404 // Events from the service API's response. Returns nil if there were no errors.
405 func (es *StartCallAnalyticsStreamTranscriptionEventStream) Err() error {
406 if err := es.err.Err(); err != nil {
407 return err
408 }
409 if err := es.Writer.Err(); err != nil {
410 return err
411 }
412 if err := es.Reader.Err(); err != nil {
413 return err
414 }
415
416 return nil
417 }
418
419 const opStartMedicalStreamTranscription = "StartMedicalStreamTranscription"
420
421 // StartMedicalStreamTranscriptionRequest generates a "aws/request.Request" representing the
422 // client's request for the StartMedicalStreamTranscription operation. The "output" return
423 // value will be populated with the request's response once the request completes
424 // successfully.
425 //
426 // Use "Send" method on the returned Request to send the API call to the service.
427 // the "output" return value is not valid until after Send returns without error.
428 //
429 // See StartMedicalStreamTranscription for more information on using the StartMedicalStreamTranscription
430 // API call, and error handling.
431 //
432 // This method is useful when you want to inject custom logic or configuration
433 // into the SDK's request lifecycle. Such as custom headers, or retry logic.
434 //
435 // // Example sending a request using the StartMedicalStreamTranscriptionRequest method.
436 // req, resp := client.StartMedicalStreamTranscriptionRequest(params)
437 //
438 // err := req.Send()
439 // if err == nil { // resp is now filled
440 // fmt.Println(resp)
441 // }
442 //
443 // See also, https://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/StartMedicalStreamTranscription
444 func (c *TranscribeStreamingService) StartMedicalStreamTranscriptionRequest(input *StartMedicalStreamTranscriptionInput) (req *request.Request, output *StartMedicalStreamTranscriptionOutput) {
445 op := &request.Operation{
446 Name: opStartMedicalStreamTranscription,
447 HTTPMethod: "POST",
448 HTTPPath: "/medical-stream-transcription",
449 }
450
451 if input == nil {
452 input = &StartMedicalStreamTranscriptionInput{}
453 }
454
455 output = &StartMedicalStreamTranscriptionOutput{}
456 req = c.newRequest(op, input, output)
457 req.Handlers.UnmarshalMeta.PushBack(
458 protocol.RequireHTTPMinProtocol{Major: 2}.Handler,
459 )
460
461 es := NewStartMedicalStreamTranscriptionEventStream()
462 output.eventStream = es
463
464 req.Handlers.Sign.PushFront(es.setupInputPipe)
465 req.Handlers.UnmarshalError.PushBackNamed(request.NamedHandler{
466 Name: "InputPipeCloser",
467 Fn: func(r *request.Request) {
468 err := es.closeInputPipe()
469 if err != nil {
470 r.Error = awserr.New(eventstreamapi.InputWriterCloseErrorCode, err.Error(), r.Error)
471 }
472 },
473 })
474 req.Handlers.Build.PushBack(request.WithSetRequestHeaders(map[string]string{
475 "Content-Type": "application/vnd.amazon.eventstream",
476 "X-Amz-Content-Sha256": "STREAMING-AWS4-HMAC-SHA256-EVENTS",
477 }))
478 req.Handlers.Build.Swap(restjson.BuildHandler.Name, rest.BuildHandler)
479 eventstreamapi.ApplyHTTPTransportFixes(req)
480 req.Handlers.Send.Swap(client.LogHTTPRequestHandler.Name, client.LogHTTPRequestHeaderHandler)
481 req.Handlers.Unmarshal.PushBack(es.runInputStream)
482
483 req.Handlers.Send.Swap(client.LogHTTPResponseHandler.Name, client.LogHTTPResponseHeaderHandler)
484 req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, rest.UnmarshalHandler)
485 req.Handlers.Unmarshal.PushBack(es.runOutputStream)
486 req.Handlers.Unmarshal.PushBack(es.runOnStreamPartClose)
487 return
488 }
489
490 // StartMedicalStreamTranscription API operation for Amazon Transcribe Streaming Service.
491 //
492 // Starts a bidirectional HTTP/2 or WebSocket stream where audio is streamed
493 // to Amazon Transcribe Medical and the transcription results are streamed to
494 // your application.
495 //
496 // The following parameters are required:
497 //
498 // - language-code
499 //
500 // - media-encoding
501 //
502 // - sample-rate
503 //
504 // For more information on streaming with Amazon Transcribe Medical, see Transcribing
505 // streaming audio (https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html).
506 //
507 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
508 // with awserr.Error's Code and Message methods to get detailed information about
509 // the error.
510 //
511 // See the AWS API reference guide for Amazon Transcribe Streaming Service's
512 // API operation StartMedicalStreamTranscription for usage and error information.
513 //
514 // Returned Error Types:
515 //
516 // - BadRequestException
517 // One or more arguments to the StartStreamTranscription, StartMedicalStreamTranscription,
518 // or StartCallAnalyticsStreamTranscription operation was not valid. For example,
519 // MediaEncoding or LanguageCode used not valid values. Check the specified
520 // parameters and try your request again.
521 //
522 // - LimitExceededException
523 // Your client has exceeded one of the Amazon Transcribe limits. This is typically
524 // the audio length limit. Break your audio stream into smaller chunks and try
525 // your request again.
526 //
527 // - InternalFailureException
528 // A problem occurred while processing the audio. Amazon Transcribe terminated
529 // processing.
530 //
531 // - ConflictException
532 // A new stream started with the same session ID. The current stream has been
533 // terminated.
534 //
535 // - ServiceUnavailableException
536 // The service is currently unavailable. Try your request later.
537 //
538 // See also, https://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/StartMedicalStreamTranscription
539 func (c *TranscribeStreamingService) StartMedicalStreamTranscription(input *StartMedicalStreamTranscriptionInput) (*StartMedicalStreamTranscriptionOutput, error) {
540 req, out := c.StartMedicalStreamTranscriptionRequest(input)
541 return out, req.Send()
542 }
543
544 // StartMedicalStreamTranscriptionWithContext is the same as StartMedicalStreamTranscription with the addition of
545 // the ability to pass a context and additional request options.
546 //
547 // See StartMedicalStreamTranscription for details on how to use this API operation.
548 //
549 // The context must be non-nil and will be used for request cancellation. If
550 // the context is nil a panic will occur. In the future the SDK may create
551 // sub-contexts for http.Requests. See https://golang.org/pkg/context/
552 // for more information on using Contexts.
553 func (c *TranscribeStreamingService) StartMedicalStreamTranscriptionWithContext(ctx aws.Context, input *StartMedicalStreamTranscriptionInput, opts ...request.Option) (*StartMedicalStreamTranscriptionOutput, error) {
554 req, out := c.StartMedicalStreamTranscriptionRequest(input)
555 req.SetContext(ctx)
556 req.ApplyOptions(opts...)
557 return out, req.Send()
558 }
559
560 var _ awserr.Error
561 var _ time.Time
562
563 // StartMedicalStreamTranscriptionEventStream provides the event stream handling for the StartMedicalStreamTranscription.
564 //
565 // For testing and mocking the event stream this type should be initialized via
566 // the NewStartMedicalStreamTranscriptionEventStream constructor function. Using the functional options
567 // to pass in nested mock behavior.
568 type StartMedicalStreamTranscriptionEventStream struct {
569
570 // Writer is the EventStream writer for the AudioStream
571 // events. This value is automatically set by the SDK when the API call is made
572 // Use this member when unit testing your code with the SDK to mock out the
573 // EventStream Writer.
574 //
575 // Must not be nil.
576 Writer AudioStreamWriter
577
578 inputWriter io.WriteCloser
579
580 // Reader is the EventStream reader for the MedicalTranscriptResultStream
581 // events. This value is automatically set by the SDK when the API call is made
582 // Use this member when unit testing your code with the SDK to mock out the
583 // EventStream Reader.
584 //
585 // Must not be nil.
586 Reader MedicalTranscriptResultStreamReader
587
588 outputReader io.ReadCloser
589
590 done chan struct{}
591 closeOnce sync.Once
592 err *eventstreamapi.OnceError
593 }
594
595 // NewStartMedicalStreamTranscriptionEventStream initializes an StartMedicalStreamTranscriptionEventStream.
596 // This function should only be used for testing and mocking the StartMedicalStreamTranscriptionEventStream
597 // stream within your application.
598 //
599 // The Writer member must be set before writing events to the stream.
600 //
601 // The Reader member must be set before reading events from the stream.
602 //
603 // es := NewStartMedicalStreamTranscriptionEventStream(func(o *StartMedicalStreamTranscriptionEventStream){
604 // es.Writer = myMockStreamWriter
605 // es.Reader = myMockStreamReader
606 // })
607 func NewStartMedicalStreamTranscriptionEventStream(opts ...func(*StartMedicalStreamTranscriptionEventStream)) *StartMedicalStreamTranscriptionEventStream {
608 es := &StartMedicalStreamTranscriptionEventStream{
609 done: make(chan struct{}),
610 err: eventstreamapi.NewOnceError(),
611 }
612
613 for _, fn := range opts {
614 fn(es)
615 }
616
617 return es
618 }
619
620 func (es *StartMedicalStreamTranscriptionEventStream) runOnStreamPartClose(r *request.Request) {
621 if es.done == nil {
622 return
623 }
624 go es.waitStreamPartClose()
625
626 }
627
628 func (es *StartMedicalStreamTranscriptionEventStream) waitStreamPartClose() {
629 var inputErrCh <-chan struct{}
630 if v, ok := es.Writer.(interface{ ErrorSet() <-chan struct{} }); ok {
631 inputErrCh = v.ErrorSet()
632 }
633 var outputErrCh <-chan struct{}
634 if v, ok := es.Reader.(interface{ ErrorSet() <-chan struct{} }); ok {
635 outputErrCh = v.ErrorSet()
636 }
637 var outputClosedCh <-chan struct{}
638 if v, ok := es.Reader.(interface{ Closed() <-chan struct{} }); ok {
639 outputClosedCh = v.Closed()
640 }
641
642 select {
643 case <-es.done:
644 case <-inputErrCh:
645 es.err.SetError(es.Writer.Err())
646 es.Close()
647 case <-outputErrCh:
648 es.err.SetError(es.Reader.Err())
649 es.Close()
650 case <-outputClosedCh:
651 if err := es.Reader.Err(); err != nil {
652 es.err.SetError(es.Reader.Err())
653 }
654 es.Close()
655 }
656 }
657
658 func (es *StartMedicalStreamTranscriptionEventStream) setupInputPipe(r *request.Request) {
659 inputReader, inputWriter := io.Pipe()
660 r.SetStreamingBody(inputReader)
661 es.inputWriter = inputWriter
662 }
663
664 // Closes the input-pipe writer
665 func (es *StartMedicalStreamTranscriptionEventStream) closeInputPipe() error {
666 if es.inputWriter != nil {
667 return es.inputWriter.Close()
668 }
669 return nil
670 }
671
672 // Send writes the event to the stream blocking until the event is written.
673 // Returns an error if the event was not written.
674 //
675 // These events are:
676 //
677 // - AudioEvent
678 // - ConfigurationEvent
679 func (es *StartMedicalStreamTranscriptionEventStream) Send(ctx aws.Context, event AudioStreamEvent) error {
680 return es.Writer.Send(ctx, event)
681 }
682
683 func (es *StartMedicalStreamTranscriptionEventStream) runInputStream(r *request.Request) {
684 var opts []func(*eventstream.Encoder)
685 if r.Config.Logger != nil && r.Config.LogLevel.Matches(aws.LogDebugWithEventStreamBody) {
686 opts = append(opts, eventstream.EncodeWithLogger(r.Config.Logger))
687 }
688 var encoder eventstreamapi.Encoder = eventstream.NewEncoder(es.inputWriter, opts...)
689
690 var closer aws.MultiCloser
691 sigSeed, err := v4.GetSignedRequestSignature(r.HTTPRequest)
692 if err != nil {
693 r.Error = awserr.New(request.ErrCodeSerialization,
694 "unable to get initial request's signature", err)
695 return
696 }
697 signer := eventstreamapi.NewSignEncoder(
698 v4.NewStreamSigner(r.ClientInfo.SigningRegion, r.ClientInfo.SigningName,
699 sigSeed, r.Config.Credentials),
700 encoder,
701 )
702 encoder = signer
703 closer = append(closer, signer)
704 closer = append(closer, es.inputWriter)
705
706 eventWriter := eventstreamapi.NewEventWriter(encoder,
707 protocol.HandlerPayloadMarshal{
708 Marshalers: r.Handlers.BuildStream,
709 },
710 eventTypeForAudioStreamEvent,
711 )
712
713 es.Writer = &writeAudioStream{
714 StreamWriter: eventstreamapi.NewStreamWriter(eventWriter, closer),
715 }
716 }
717
718 // Events returns a channel to read events from.
719 //
720 // These events are:
721 //
722 // - MedicalTranscriptEvent
723 // - MedicalTranscriptResultStreamUnknownEvent
724 func (es *StartMedicalStreamTranscriptionEventStream) Events() <-chan MedicalTranscriptResultStreamEvent {
725 return es.Reader.Events()
726 }
727
728 func (es *StartMedicalStreamTranscriptionEventStream) runOutputStream(r *request.Request) {
729 var opts []func(*eventstream.Decoder)
730 if r.Config.Logger != nil && r.Config.LogLevel.Matches(aws.LogDebugWithEventStreamBody) {
731 opts = append(opts, eventstream.DecodeWithLogger(r.Config.Logger))
732 }
733
734 unmarshalerForEvent := unmarshalerForMedicalTranscriptResultStreamEvent{
735 metadata: protocol.ResponseMetadata{
736 StatusCode: r.HTTPResponse.StatusCode,
737 RequestID: r.RequestID,
738 },
739 }.UnmarshalerForEventName
740
741 decoder := eventstream.NewDecoder(r.HTTPResponse.Body, opts...)
742 eventReader := eventstreamapi.NewEventReader(decoder,
743 protocol.HandlerPayloadUnmarshal{
744 Unmarshalers: r.Handlers.UnmarshalStream,
745 },
746 unmarshalerForEvent,
747 )
748
749 es.outputReader = r.HTTPResponse.Body
750 es.Reader = newReadMedicalTranscriptResultStream(eventReader)
751 }
752
753 // Close closes the stream. This will also cause the stream to be closed.
754 // Close must be called when done using the stream API. Not calling Close
755 // may result in resource leaks.
756 //
757 // Will close the underlying EventStream writer, and no more events can be
758 // sent.
759 //
760 // You can use the closing of the Reader's Events channel to terminate your
761 // application's read from the API's stream.
762 func (es *StartMedicalStreamTranscriptionEventStream) Close() (err error) {
763 es.closeOnce.Do(es.safeClose)
764 return es.Err()
765 }
766
767 func (es *StartMedicalStreamTranscriptionEventStream) safeClose() {
768 if es.done != nil {
769 close(es.done)
770 }
771
772 t := time.NewTicker(time.Second)
773 defer t.Stop()
774 writeCloseDone := make(chan error)
775 go func() {
776 if err := es.Writer.Close(); err != nil {
777 es.err.SetError(err)
778 }
779 close(writeCloseDone)
780 }()
781 select {
782 case <-t.C:
783 case <-writeCloseDone:
784 }
785 if err := es.closeInputPipe(); err != nil {
786 es.err.SetError(err)
787 }
788
789 es.Reader.Close()
790 if es.outputReader != nil {
791 es.outputReader.Close()
792 }
793 }
794
795 // Err returns any error that occurred while reading or writing EventStream
796 // Events from the service API's response. Returns nil if there were no errors.
797 func (es *StartMedicalStreamTranscriptionEventStream) Err() error {
798 if err := es.err.Err(); err != nil {
799 return err
800 }
801 if err := es.Writer.Err(); err != nil {
802 return err
803 }
804 if err := es.Reader.Err(); err != nil {
805 return err
806 }
807
808 return nil
809 }
810
811 const opStartStreamTranscription = "StartStreamTranscription"
812
813 // StartStreamTranscriptionRequest generates a "aws/request.Request" representing the
814 // client's request for the StartStreamTranscription operation. The "output" return
815 // value will be populated with the request's response once the request completes
816 // successfully.
817 //
818 // Use "Send" method on the returned Request to send the API call to the service.
819 // the "output" return value is not valid until after Send returns without error.
820 //
821 // See StartStreamTranscription for more information on using the StartStreamTranscription
822 // API call, and error handling.
823 //
824 // This method is useful when you want to inject custom logic or configuration
825 // into the SDK's request lifecycle. Such as custom headers, or retry logic.
826 //
827 // // Example sending a request using the StartStreamTranscriptionRequest method.
828 // req, resp := client.StartStreamTranscriptionRequest(params)
829 //
830 // err := req.Send()
831 // if err == nil { // resp is now filled
832 // fmt.Println(resp)
833 // }
834 //
835 // See also, https://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/StartStreamTranscription
836 func (c *TranscribeStreamingService) StartStreamTranscriptionRequest(input *StartStreamTranscriptionInput) (req *request.Request, output *StartStreamTranscriptionOutput) {
837 op := &request.Operation{
838 Name: opStartStreamTranscription,
839 HTTPMethod: "POST",
840 HTTPPath: "/stream-transcription",
841 }
842
843 if input == nil {
844 input = &StartStreamTranscriptionInput{}
845 }
846
847 output = &StartStreamTranscriptionOutput{}
848 req = c.newRequest(op, input, output)
849 req.Handlers.UnmarshalMeta.PushBack(
850 protocol.RequireHTTPMinProtocol{Major: 2}.Handler,
851 )
852
853 es := NewStartStreamTranscriptionEventStream()
854 output.eventStream = es
855
856 req.Handlers.Sign.PushFront(es.setupInputPipe)
857 req.Handlers.UnmarshalError.PushBackNamed(request.NamedHandler{
858 Name: "InputPipeCloser",
859 Fn: func(r *request.Request) {
860 err := es.closeInputPipe()
861 if err != nil {
862 r.Error = awserr.New(eventstreamapi.InputWriterCloseErrorCode, err.Error(), r.Error)
863 }
864 },
865 })
866 req.Handlers.Build.PushBack(request.WithSetRequestHeaders(map[string]string{
867 "Content-Type": "application/vnd.amazon.eventstream",
868 "X-Amz-Content-Sha256": "STREAMING-AWS4-HMAC-SHA256-EVENTS",
869 }))
870 req.Handlers.Build.Swap(restjson.BuildHandler.Name, rest.BuildHandler)
871 eventstreamapi.ApplyHTTPTransportFixes(req)
872 req.Handlers.Send.Swap(client.LogHTTPRequestHandler.Name, client.LogHTTPRequestHeaderHandler)
873 req.Handlers.Unmarshal.PushBack(es.runInputStream)
874
875 req.Handlers.Send.Swap(client.LogHTTPResponseHandler.Name, client.LogHTTPResponseHeaderHandler)
876 req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, rest.UnmarshalHandler)
877 req.Handlers.Unmarshal.PushBack(es.runOutputStream)
878 req.Handlers.Unmarshal.PushBack(es.runOnStreamPartClose)
879 return
880 }
881
882 // StartStreamTranscription API operation for Amazon Transcribe Streaming Service.
883 //
884 // Starts a bidirectional HTTP/2 or WebSocket stream where audio is streamed
885 // to Amazon Transcribe and the transcription results are streamed to your application.
886 //
887 // The following parameters are required:
888 //
889 // - language-code or identify-language or identify-multiple-language
890 //
891 // - media-encoding
892 //
893 // - sample-rate
894 //
895 // For more information on streaming with Amazon Transcribe, see Transcribing
896 // streaming audio (https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html).
897 //
898 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
899 // with awserr.Error's Code and Message methods to get detailed information about
900 // the error.
901 //
902 // See the AWS API reference guide for Amazon Transcribe Streaming Service's
903 // API operation StartStreamTranscription for usage and error information.
904 //
905 // Returned Error Types:
906 //
907 // - BadRequestException
908 // One or more arguments to the StartStreamTranscription, StartMedicalStreamTranscription,
909 // or StartCallAnalyticsStreamTranscription operation was not valid. For example,
910 // MediaEncoding or LanguageCode used not valid values. Check the specified
911 // parameters and try your request again.
912 //
913 // - LimitExceededException
914 // Your client has exceeded one of the Amazon Transcribe limits. This is typically
915 // the audio length limit. Break your audio stream into smaller chunks and try
916 // your request again.
917 //
918 // - InternalFailureException
919 // A problem occurred while processing the audio. Amazon Transcribe terminated
920 // processing.
921 //
922 // - ConflictException
923 // A new stream started with the same session ID. The current stream has been
924 // terminated.
925 //
926 // - ServiceUnavailableException
927 // The service is currently unavailable. Try your request later.
928 //
929 // See also, https://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/StartStreamTranscription
930 func (c *TranscribeStreamingService) StartStreamTranscription(input *StartStreamTranscriptionInput) (*StartStreamTranscriptionOutput, error) {
931 req, out := c.StartStreamTranscriptionRequest(input)
932 return out, req.Send()
933 }
934
935 // StartStreamTranscriptionWithContext is the same as StartStreamTranscription with the addition of
936 // the ability to pass a context and additional request options.
937 //
938 // See StartStreamTranscription for details on how to use this API operation.
939 //
940 // The context must be non-nil and will be used for request cancellation. If
941 // the context is nil a panic will occur. In the future the SDK may create
942 // sub-contexts for http.Requests. See https://golang.org/pkg/context/
943 // for more information on using Contexts.
944 func (c *TranscribeStreamingService) StartStreamTranscriptionWithContext(ctx aws.Context, input *StartStreamTranscriptionInput, opts ...request.Option) (*StartStreamTranscriptionOutput, error) {
945 req, out := c.StartStreamTranscriptionRequest(input)
946 req.SetContext(ctx)
947 req.ApplyOptions(opts...)
948 return out, req.Send()
949 }
950
951 var _ awserr.Error
952 var _ time.Time
953
954 // StartStreamTranscriptionEventStream provides the event stream handling for the StartStreamTranscription.
955 //
956 // For testing and mocking the event stream this type should be initialized via
957 // the NewStartStreamTranscriptionEventStream constructor function. Using the functional options
958 // to pass in nested mock behavior.
959 type StartStreamTranscriptionEventStream struct {
960
961 // Writer is the EventStream writer for the AudioStream
962 // events. This value is automatically set by the SDK when the API call is made
963 // Use this member when unit testing your code with the SDK to mock out the
964 // EventStream Writer.
965 //
966 // Must not be nil.
967 Writer AudioStreamWriter
968
969 inputWriter io.WriteCloser
970
971 // Reader is the EventStream reader for the TranscriptResultStream
972 // events. This value is automatically set by the SDK when the API call is made
973 // Use this member when unit testing your code with the SDK to mock out the
974 // EventStream Reader.
975 //
976 // Must not be nil.
977 Reader TranscriptResultStreamReader
978
979 outputReader io.ReadCloser
980
981 done chan struct{}
982 closeOnce sync.Once
983 err *eventstreamapi.OnceError
984 }
985
986 // NewStartStreamTranscriptionEventStream initializes an StartStreamTranscriptionEventStream.
987 // This function should only be used for testing and mocking the StartStreamTranscriptionEventStream
988 // stream within your application.
989 //
990 // The Writer member must be set before writing events to the stream.
991 //
992 // The Reader member must be set before reading events from the stream.
993 //
994 // es := NewStartStreamTranscriptionEventStream(func(o *StartStreamTranscriptionEventStream){
995 // es.Writer = myMockStreamWriter
996 // es.Reader = myMockStreamReader
997 // })
998 func NewStartStreamTranscriptionEventStream(opts ...func(*StartStreamTranscriptionEventStream)) *StartStreamTranscriptionEventStream {
999 es := &StartStreamTranscriptionEventStream{
1000 done: make(chan struct{}),
1001 err: eventstreamapi.NewOnceError(),
1002 }
1003
1004 for _, fn := range opts {
1005 fn(es)
1006 }
1007
1008 return es
1009 }
1010
1011 func (es *StartStreamTranscriptionEventStream) runOnStreamPartClose(r *request.Request) {
1012 if es.done == nil {
1013 return
1014 }
1015 go es.waitStreamPartClose()
1016
1017 }
1018
1019 func (es *StartStreamTranscriptionEventStream) waitStreamPartClose() {
1020 var inputErrCh <-chan struct{}
1021 if v, ok := es.Writer.(interface{ ErrorSet() <-chan struct{} }); ok {
1022 inputErrCh = v.ErrorSet()
1023 }
1024 var outputErrCh <-chan struct{}
1025 if v, ok := es.Reader.(interface{ ErrorSet() <-chan struct{} }); ok {
1026 outputErrCh = v.ErrorSet()
1027 }
1028 var outputClosedCh <-chan struct{}
1029 if v, ok := es.Reader.(interface{ Closed() <-chan struct{} }); ok {
1030 outputClosedCh = v.Closed()
1031 }
1032
1033 select {
1034 case <-es.done:
1035 case <-inputErrCh:
1036 es.err.SetError(es.Writer.Err())
1037 es.Close()
1038 case <-outputErrCh:
1039 es.err.SetError(es.Reader.Err())
1040 es.Close()
1041 case <-outputClosedCh:
1042 if err := es.Reader.Err(); err != nil {
1043 es.err.SetError(es.Reader.Err())
1044 }
1045 es.Close()
1046 }
1047 }
1048
1049 func (es *StartStreamTranscriptionEventStream) setupInputPipe(r *request.Request) {
1050 inputReader, inputWriter := io.Pipe()
1051 r.SetStreamingBody(inputReader)
1052 es.inputWriter = inputWriter
1053 }
1054
1055 // Closes the input-pipe writer
1056 func (es *StartStreamTranscriptionEventStream) closeInputPipe() error {
1057 if es.inputWriter != nil {
1058 return es.inputWriter.Close()
1059 }
1060 return nil
1061 }
1062
1063 // Send writes the event to the stream blocking until the event is written.
1064 // Returns an error if the event was not written.
1065 //
1066 // These events are:
1067 //
1068 // - AudioEvent
1069 // - ConfigurationEvent
1070 func (es *StartStreamTranscriptionEventStream) Send(ctx aws.Context, event AudioStreamEvent) error {
1071 return es.Writer.Send(ctx, event)
1072 }
1073
1074 func (es *StartStreamTranscriptionEventStream) runInputStream(r *request.Request) {
1075 var opts []func(*eventstream.Encoder)
1076 if r.Config.Logger != nil && r.Config.LogLevel.Matches(aws.LogDebugWithEventStreamBody) {
1077 opts = append(opts, eventstream.EncodeWithLogger(r.Config.Logger))
1078 }
1079 var encoder eventstreamapi.Encoder = eventstream.NewEncoder(es.inputWriter, opts...)
1080
1081 var closer aws.MultiCloser
1082 sigSeed, err := v4.GetSignedRequestSignature(r.HTTPRequest)
1083 if err != nil {
1084 r.Error = awserr.New(request.ErrCodeSerialization,
1085 "unable to get initial request's signature", err)
1086 return
1087 }
1088 signer := eventstreamapi.NewSignEncoder(
1089 v4.NewStreamSigner(r.ClientInfo.SigningRegion, r.ClientInfo.SigningName,
1090 sigSeed, r.Config.Credentials),
1091 encoder,
1092 )
1093 encoder = signer
1094 closer = append(closer, signer)
1095 closer = append(closer, es.inputWriter)
1096
1097 eventWriter := eventstreamapi.NewEventWriter(encoder,
1098 protocol.HandlerPayloadMarshal{
1099 Marshalers: r.Handlers.BuildStream,
1100 },
1101 eventTypeForAudioStreamEvent,
1102 )
1103
1104 es.Writer = &writeAudioStream{
1105 StreamWriter: eventstreamapi.NewStreamWriter(eventWriter, closer),
1106 }
1107 }
1108
1109 // Events returns a channel to read events from.
1110 //
1111 // These events are:
1112 //
1113 // - TranscriptEvent
1114 // - TranscriptResultStreamUnknownEvent
1115 func (es *StartStreamTranscriptionEventStream) Events() <-chan TranscriptResultStreamEvent {
1116 return es.Reader.Events()
1117 }
1118
1119 func (es *StartStreamTranscriptionEventStream) runOutputStream(r *request.Request) {
1120 var opts []func(*eventstream.Decoder)
1121 if r.Config.Logger != nil && r.Config.LogLevel.Matches(aws.LogDebugWithEventStreamBody) {
1122 opts = append(opts, eventstream.DecodeWithLogger(r.Config.Logger))
1123 }
1124
1125 unmarshalerForEvent := unmarshalerForTranscriptResultStreamEvent{
1126 metadata: protocol.ResponseMetadata{
1127 StatusCode: r.HTTPResponse.StatusCode,
1128 RequestID: r.RequestID,
1129 },
1130 }.UnmarshalerForEventName
1131
1132 decoder := eventstream.NewDecoder(r.HTTPResponse.Body, opts...)
1133 eventReader := eventstreamapi.NewEventReader(decoder,
1134 protocol.HandlerPayloadUnmarshal{
1135 Unmarshalers: r.Handlers.UnmarshalStream,
1136 },
1137 unmarshalerForEvent,
1138 )
1139
1140 es.outputReader = r.HTTPResponse.Body
1141 es.Reader = newReadTranscriptResultStream(eventReader)
1142 }
1143
1144 // Close closes the stream. This will also cause the stream to be closed.
1145 // Close must be called when done using the stream API. Not calling Close
1146 // may result in resource leaks.
1147 //
1148 // Will close the underlying EventStream writer, and no more events can be
1149 // sent.
1150 //
1151 // You can use the closing of the Reader's Events channel to terminate your
1152 // application's read from the API's stream.
1153 func (es *StartStreamTranscriptionEventStream) Close() (err error) {
1154 es.closeOnce.Do(es.safeClose)
1155 return es.Err()
1156 }
1157
1158 func (es *StartStreamTranscriptionEventStream) safeClose() {
1159 if es.done != nil {
1160 close(es.done)
1161 }
1162
1163 t := time.NewTicker(time.Second)
1164 defer t.Stop()
1165 writeCloseDone := make(chan error)
1166 go func() {
1167 if err := es.Writer.Close(); err != nil {
1168 es.err.SetError(err)
1169 }
1170 close(writeCloseDone)
1171 }()
1172 select {
1173 case <-t.C:
1174 case <-writeCloseDone:
1175 }
1176 if err := es.closeInputPipe(); err != nil {
1177 es.err.SetError(err)
1178 }
1179
1180 es.Reader.Close()
1181 if es.outputReader != nil {
1182 es.outputReader.Close()
1183 }
1184 }
1185
1186 // Err returns any error that occurred while reading or writing EventStream
1187 // Events from the service API's response. Returns nil if there were no errors.
1188 func (es *StartStreamTranscriptionEventStream) Err() error {
1189 if err := es.err.Err(); err != nil {
1190 return err
1191 }
1192 if err := es.Writer.Err(); err != nil {
1193 return err
1194 }
1195 if err := es.Reader.Err(); err != nil {
1196 return err
1197 }
1198
1199 return nil
1200 }
1201
1202 // A list of possible alternative transcriptions for the input audio. Each alternative
1203 // may contain one or more of Items, Entities, or Transcript.
1204 type Alternative struct {
1205 _ struct{} `type:"structure"`
1206
1207 // Contains entities identified as personally identifiable information (PII)
1208 // in your transcription output.
1209 Entities []*Entity `type:"list"`
1210
1211 // Contains words, phrases, or punctuation marks in your transcription output.
1212 Items []*Item `type:"list"`
1213
1214 // Contains transcribed text.
1215 Transcript *string `type:"string"`
1216 }
1217
1218 // String returns the string representation.
1219 //
1220 // API parameter values that are decorated as "sensitive" in the API will not
1221 // be included in the string output. The member name will be present, but the
1222 // value will be replaced with "sensitive".
1223 func (s Alternative) String() string {
1224 return awsutil.Prettify(s)
1225 }
1226
1227 // GoString returns the string representation.
1228 //
1229 // API parameter values that are decorated as "sensitive" in the API will not
1230 // be included in the string output. The member name will be present, but the
1231 // value will be replaced with "sensitive".
1232 func (s Alternative) GoString() string {
1233 return s.String()
1234 }
1235
1236 // SetEntities sets the Entities field's value.
1237 func (s *Alternative) SetEntities(v []*Entity) *Alternative {
1238 s.Entities = v
1239 return s
1240 }
1241
1242 // SetItems sets the Items field's value.
1243 func (s *Alternative) SetItems(v []*Item) *Alternative {
1244 s.Items = v
1245 return s
1246 }
1247
1248 // SetTranscript sets the Transcript field's value.
1249 func (s *Alternative) SetTranscript(v string) *Alternative {
1250 s.Transcript = &v
1251 return s
1252 }
1253
1254 // A wrapper for your audio chunks. Your audio stream consists of one or more
1255 // audio events, which consist of one or more audio chunks.
1256 //
1257 // For more information, see Event stream encoding (https://docs.aws.amazon.com/transcribe/latest/dg/event-stream.html).
1258 type AudioEvent struct {
1259 _ struct{} `type:"structure" payload:"AudioChunk"`
1260
1261 // An audio blob that contains the next part of the audio that you want to transcribe.
1262 // The maximum audio chunk size is 32 KB.
1263 // AudioChunk is automatically base64 encoded/decoded by the SDK.
1264 AudioChunk []byte `type:"blob"`
1265 }
1266
1267 // String returns the string representation.
1268 //
1269 // API parameter values that are decorated as "sensitive" in the API will not
1270 // be included in the string output. The member name will be present, but the
1271 // value will be replaced with "sensitive".
1272 func (s AudioEvent) String() string {
1273 return awsutil.Prettify(s)
1274 }
1275
1276 // GoString returns the string representation.
1277 //
1278 // API parameter values that are decorated as "sensitive" in the API will not
1279 // be included in the string output. The member name will be present, but the
1280 // value will be replaced with "sensitive".
1281 func (s AudioEvent) GoString() string {
1282 return s.String()
1283 }
1284
1285 // SetAudioChunk sets the AudioChunk field's value.
1286 func (s *AudioEvent) SetAudioChunk(v []byte) *AudioEvent {
1287 s.AudioChunk = v
1288 return s
1289 }
1290
1291 // The AudioEvent is and event in the AudioStream group of events.
1292 func (s *AudioEvent) eventAudioStream() {}
1293
1294 // UnmarshalEvent unmarshals the EventStream Message into the AudioEvent value.
1295 // This method is only used internally within the SDK's EventStream handling.
1296 func (s *AudioEvent) UnmarshalEvent(
1297 payloadUnmarshaler protocol.PayloadUnmarshaler,
1298 msg eventstream.Message,
1299 ) error {
1300 s.AudioChunk = make([]byte, len(msg.Payload))
1301 copy(s.AudioChunk, msg.Payload)
1302 return nil
1303 }
1304
1305 // MarshalEvent marshals the type into an stream event value. This method
1306 // should only used internally within the SDK's EventStream handling.
1307 func (s *AudioEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) {
1308 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType))
1309 msg.Headers.Set(":content-type", eventstream.StringValue("application/octet-stream"))
1310 msg.Payload = s.AudioChunk
1311 return msg, err
1312 }
1313
1314 // AudioStreamEvent groups together all EventStream
1315 // events writes for AudioStream.
1316 //
1317 // These events are:
1318 //
1319 // - AudioEvent
1320 // - ConfigurationEvent
1321 type AudioStreamEvent interface {
1322 eventAudioStream()
1323 eventstreamapi.Marshaler
1324 eventstreamapi.Unmarshaler
1325 }
1326
1327 // AudioStreamWriter provides the interface for writing events to the stream.
1328 // The default implementation for this interface will be AudioStream.
1329 //
1330 // The writer's Close method must allow multiple concurrent calls.
1331 //
1332 // These events are:
1333 //
1334 // - AudioEvent
1335 // - ConfigurationEvent
1336 type AudioStreamWriter interface {
1337 // Sends writes events to the stream blocking until the event has been
1338 // written. An error is returned if the write fails.
1339 Send(aws.Context, AudioStreamEvent) error
1340
1341 // Close will stop the writer writing to the event stream.
1342 Close() error
1343
1344 // Returns any error that has occurred while writing to the event stream.
1345 Err() error
1346 }
1347
1348 type writeAudioStream struct {
1349 *eventstreamapi.StreamWriter
1350 }
1351
1352 func (w *writeAudioStream) Send(ctx aws.Context, event AudioStreamEvent) error {
1353 return w.StreamWriter.Send(ctx, event)
1354 }
1355
1356 func eventTypeForAudioStreamEvent(event eventstreamapi.Marshaler) (string, error) {
1357 switch event.(type) {
1358 case *AudioEvent:
1359 return "AudioEvent", nil
1360 case *ConfigurationEvent:
1361 return "ConfigurationEvent", nil
1362 default:
1363 return "", awserr.New(
1364 request.ErrCodeSerialization,
1365 fmt.Sprintf("unknown event type, %T, for AudioStream", event),
1366 nil,
1367 )
1368 }
1369 }
1370
1371 // One or more arguments to the StartStreamTranscription, StartMedicalStreamTranscription,
1372 // or StartCallAnalyticsStreamTranscription operation was not valid. For example,
1373 // MediaEncoding or LanguageCode used not valid values. Check the specified
1374 // parameters and try your request again.
1375 type BadRequestException struct {
1376 _ struct{} `type:"structure"`
1377 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
1378
1379 Message_ *string `locationName:"Message" type:"string"`
1380 }
1381
1382 // String returns the string representation.
1383 //
1384 // API parameter values that are decorated as "sensitive" in the API will not
1385 // be included in the string output. The member name will be present, but the
1386 // value will be replaced with "sensitive".
1387 func (s BadRequestException) String() string {
1388 return awsutil.Prettify(s)
1389 }
1390
1391 // GoString returns the string representation.
1392 //
1393 // API parameter values that are decorated as "sensitive" in the API will not
1394 // be included in the string output. The member name will be present, but the
1395 // value will be replaced with "sensitive".
1396 func (s BadRequestException) GoString() string {
1397 return s.String()
1398 }
1399
1400 // The BadRequestException is and event in the CallAnalyticsTranscriptResultStream group of events.
1401 func (s *BadRequestException) eventCallAnalyticsTranscriptResultStream() {}
1402
1403 // The BadRequestException is and event in the MedicalTranscriptResultStream group of events.
1404 func (s *BadRequestException) eventMedicalTranscriptResultStream() {}
1405
1406 // The BadRequestException is and event in the TranscriptResultStream group of events.
1407 func (s *BadRequestException) eventTranscriptResultStream() {}
1408
1409 // UnmarshalEvent unmarshals the EventStream Message into the BadRequestException value.
1410 // This method is only used internally within the SDK's EventStream handling.
1411 func (s *BadRequestException) UnmarshalEvent(
1412 payloadUnmarshaler protocol.PayloadUnmarshaler,
1413 msg eventstream.Message,
1414 ) error {
1415 if err := payloadUnmarshaler.UnmarshalPayload(
1416 bytes.NewReader(msg.Payload), s,
1417 ); err != nil {
1418 return err
1419 }
1420 return nil
1421 }
1422
1423 // MarshalEvent marshals the type into an stream event value. This method
1424 // should only used internally within the SDK's EventStream handling.
1425 func (s *BadRequestException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) {
1426 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType))
1427 var buf bytes.Buffer
1428 if err = pm.MarshalPayload(&buf, s); err != nil {
1429 return eventstream.Message{}, err
1430 }
1431 msg.Payload = buf.Bytes()
1432 return msg, err
1433 }
1434
1435 func newErrorBadRequestException(v protocol.ResponseMetadata) error {
1436 return &BadRequestException{
1437 RespMetadata: v,
1438 }
1439 }
1440
1441 // Code returns the exception type name.
1442 func (s *BadRequestException) Code() string {
1443 return "BadRequestException"
1444 }
1445
1446 // Message returns the exception's message.
1447 func (s *BadRequestException) Message() string {
1448 if s.Message_ != nil {
1449 return *s.Message_
1450 }
1451 return ""
1452 }
1453
1454 // OrigErr always returns nil, satisfies awserr.Error interface.
1455 func (s *BadRequestException) OrigErr() error {
1456 return nil
1457 }
1458
1459 func (s *BadRequestException) Error() string {
1460 return fmt.Sprintf("%s: %s", s.Code(), s.Message())
1461 }
1462
1463 // Status code returns the HTTP status code for the request's response error.
1464 func (s *BadRequestException) StatusCode() int {
1465 return s.RespMetadata.StatusCode
1466 }
1467
1468 // RequestID returns the service's response RequestID for request.
1469 func (s *BadRequestException) RequestID() string {
1470 return s.RespMetadata.RequestID
1471 }
1472
1473 // Contains entities identified as personally identifiable information (PII)
1474 // in your transcription output, along with various associated attributes. Examples
1475 // include category, confidence score, content, type, and start and end times.
1476 type CallAnalyticsEntity struct {
1477 _ struct{} `type:"structure"`
1478
1479 // The time, in milliseconds, from the beginning of the audio stream to the
1480 // start of the identified entity.
1481 BeginOffsetMillis *int64 `type:"long"`
1482
1483 // The category of information identified. For example, PII.
1484 Category *string `type:"string"`
1485
1486 // The confidence score associated with the identification of an entity in your
1487 // transcript.
1488 //
1489 // Confidence scores are values between 0 and 1. A larger value indicates a
1490 // higher probability that the identified entity correctly matches the entity
1491 // spoken in your media.
1492 Confidence *float64 `type:"double"`
1493
1494 // The word or words that represent the identified entity.
1495 Content *string `type:"string"`
1496
1497 // The time, in milliseconds, from the beginning of the audio stream to the
1498 // end of the identified entity.
1499 EndOffsetMillis *int64 `type:"long"`
1500
1501 // The type of PII identified. For example, NAME or CREDIT_DEBIT_NUMBER.
1502 Type *string `type:"string"`
1503 }
1504
1505 // String returns the string representation.
1506 //
1507 // API parameter values that are decorated as "sensitive" in the API will not
1508 // be included in the string output. The member name will be present, but the
1509 // value will be replaced with "sensitive".
1510 func (s CallAnalyticsEntity) String() string {
1511 return awsutil.Prettify(s)
1512 }
1513
1514 // GoString returns the string representation.
1515 //
1516 // API parameter values that are decorated as "sensitive" in the API will not
1517 // be included in the string output. The member name will be present, but the
1518 // value will be replaced with "sensitive".
1519 func (s CallAnalyticsEntity) GoString() string {
1520 return s.String()
1521 }
1522
1523 // SetBeginOffsetMillis sets the BeginOffsetMillis field's value.
1524 func (s *CallAnalyticsEntity) SetBeginOffsetMillis(v int64) *CallAnalyticsEntity {
1525 s.BeginOffsetMillis = &v
1526 return s
1527 }
1528
1529 // SetCategory sets the Category field's value.
1530 func (s *CallAnalyticsEntity) SetCategory(v string) *CallAnalyticsEntity {
1531 s.Category = &v
1532 return s
1533 }
1534
1535 // SetConfidence sets the Confidence field's value.
1536 func (s *CallAnalyticsEntity) SetConfidence(v float64) *CallAnalyticsEntity {
1537 s.Confidence = &v
1538 return s
1539 }
1540
1541 // SetContent sets the Content field's value.
1542 func (s *CallAnalyticsEntity) SetContent(v string) *CallAnalyticsEntity {
1543 s.Content = &v
1544 return s
1545 }
1546
1547 // SetEndOffsetMillis sets the EndOffsetMillis field's value.
1548 func (s *CallAnalyticsEntity) SetEndOffsetMillis(v int64) *CallAnalyticsEntity {
1549 s.EndOffsetMillis = &v
1550 return s
1551 }
1552
1553 // SetType sets the Type field's value.
1554 func (s *CallAnalyticsEntity) SetType(v string) *CallAnalyticsEntity {
1555 s.Type = &v
1556 return s
1557 }
1558
1559 // A word, phrase, or punctuation mark in your Call Analytics transcription
1560 // output, along with various associated attributes, such as confidence score,
1561 // type, and start and end times.
1562 type CallAnalyticsItem struct {
1563 _ struct{} `type:"structure"`
1564
1565 // The time, in milliseconds, from the beginning of the audio stream to the
1566 // start of the identified item.
1567 BeginOffsetMillis *int64 `type:"long"`
1568
1569 // The confidence score associated with a word or phrase in your transcript.
1570 //
1571 // Confidence scores are values between 0 and 1. A larger value indicates a
1572 // higher probability that the identified item correctly matches the item spoken
1573 // in your media.
1574 Confidence *float64 `type:"double"`
1575
1576 // The word or punctuation that was transcribed.
1577 Content *string `type:"string"`
1578
1579 // The time, in milliseconds, from the beginning of the audio stream to the
1580 // end of the identified item.
1581 EndOffsetMillis *int64 `type:"long"`
1582
1583 // If partial result stabilization is enabled, Stable indicates whether the
1584 // specified item is stable (true) or if it may change when the segment is complete
1585 // (false).
1586 Stable *bool `type:"boolean"`
1587
1588 // The type of item identified. Options are: PRONUNCIATION (spoken words) and
1589 // PUNCTUATION.
1590 Type *string `type:"string" enum:"ItemType"`
1591
1592 // Indicates whether the specified item matches a word in the vocabulary filter
1593 // included in your Call Analytics request. If true, there is a vocabulary filter
1594 // match.
1595 VocabularyFilterMatch *bool `type:"boolean"`
1596 }
1597
1598 // String returns the string representation.
1599 //
1600 // API parameter values that are decorated as "sensitive" in the API will not
1601 // be included in the string output. The member name will be present, but the
1602 // value will be replaced with "sensitive".
1603 func (s CallAnalyticsItem) String() string {
1604 return awsutil.Prettify(s)
1605 }
1606
1607 // GoString returns the string representation.
1608 //
1609 // API parameter values that are decorated as "sensitive" in the API will not
1610 // be included in the string output. The member name will be present, but the
1611 // value will be replaced with "sensitive".
1612 func (s CallAnalyticsItem) GoString() string {
1613 return s.String()
1614 }
1615
1616 // SetBeginOffsetMillis sets the BeginOffsetMillis field's value.
1617 func (s *CallAnalyticsItem) SetBeginOffsetMillis(v int64) *CallAnalyticsItem {
1618 s.BeginOffsetMillis = &v
1619 return s
1620 }
1621
1622 // SetConfidence sets the Confidence field's value.
1623 func (s *CallAnalyticsItem) SetConfidence(v float64) *CallAnalyticsItem {
1624 s.Confidence = &v
1625 return s
1626 }
1627
1628 // SetContent sets the Content field's value.
1629 func (s *CallAnalyticsItem) SetContent(v string) *CallAnalyticsItem {
1630 s.Content = &v
1631 return s
1632 }
1633
1634 // SetEndOffsetMillis sets the EndOffsetMillis field's value.
1635 func (s *CallAnalyticsItem) SetEndOffsetMillis(v int64) *CallAnalyticsItem {
1636 s.EndOffsetMillis = &v
1637 return s
1638 }
1639
1640 // SetStable sets the Stable field's value.
1641 func (s *CallAnalyticsItem) SetStable(v bool) *CallAnalyticsItem {
1642 s.Stable = &v
1643 return s
1644 }
1645
1646 // SetType sets the Type field's value.
1647 func (s *CallAnalyticsItem) SetType(v string) *CallAnalyticsItem {
1648 s.Type = &v
1649 return s
1650 }
1651
1652 // SetVocabularyFilterMatch sets the VocabularyFilterMatch field's value.
1653 func (s *CallAnalyticsItem) SetVocabularyFilterMatch(v bool) *CallAnalyticsItem {
1654 s.VocabularyFilterMatch = &v
1655 return s
1656 }
1657
1658 // CallAnalyticsTranscriptResultStreamEvent groups together all EventStream
1659 // events writes for CallAnalyticsTranscriptResultStream.
1660 //
1661 // These events are:
1662 //
1663 // - CategoryEvent
1664 // - UtteranceEvent
1665 type CallAnalyticsTranscriptResultStreamEvent interface {
1666 eventCallAnalyticsTranscriptResultStream()
1667 eventstreamapi.Marshaler
1668 eventstreamapi.Unmarshaler
1669 }
1670
1671 // CallAnalyticsTranscriptResultStreamReader provides the interface for reading to the stream. The
1672 // default implementation for this interface will be CallAnalyticsTranscriptResultStream.
1673 //
1674 // The reader's Close method must allow multiple concurrent calls.
1675 //
1676 // These events are:
1677 //
1678 // - CategoryEvent
1679 // - UtteranceEvent
1680 // - CallAnalyticsTranscriptResultStreamUnknownEvent
1681 type CallAnalyticsTranscriptResultStreamReader interface {
1682 // Returns a channel of events as they are read from the event stream.
1683 Events() <-chan CallAnalyticsTranscriptResultStreamEvent
1684
1685 // Close will stop the reader reading events from the stream.
1686 Close() error
1687
1688 // Returns any error that has occurred while reading from the event stream.
1689 Err() error
1690 }
1691
1692 type readCallAnalyticsTranscriptResultStream struct {
1693 eventReader *eventstreamapi.EventReader
1694 stream chan CallAnalyticsTranscriptResultStreamEvent
1695 err *eventstreamapi.OnceError
1696
1697 done chan struct{}
1698 closeOnce sync.Once
1699 }
1700
1701 func newReadCallAnalyticsTranscriptResultStream(eventReader *eventstreamapi.EventReader) *readCallAnalyticsTranscriptResultStream {
1702 r := &readCallAnalyticsTranscriptResultStream{
1703 eventReader: eventReader,
1704 stream: make(chan CallAnalyticsTranscriptResultStreamEvent),
1705 done: make(chan struct{}),
1706 err: eventstreamapi.NewOnceError(),
1707 }
1708 go r.readEventStream()
1709
1710 return r
1711 }
1712
1713 // Close will close the underlying event stream reader.
1714 func (r *readCallAnalyticsTranscriptResultStream) Close() error {
1715 r.closeOnce.Do(r.safeClose)
1716 return r.Err()
1717 }
1718
1719 func (r *readCallAnalyticsTranscriptResultStream) ErrorSet() <-chan struct{} {
1720 return r.err.ErrorSet()
1721 }
1722
1723 func (r *readCallAnalyticsTranscriptResultStream) Closed() <-chan struct{} {
1724 return r.done
1725 }
1726
1727 func (r *readCallAnalyticsTranscriptResultStream) safeClose() {
1728 close(r.done)
1729 }
1730
1731 func (r *readCallAnalyticsTranscriptResultStream) Err() error {
1732 return r.err.Err()
1733 }
1734
1735 func (r *readCallAnalyticsTranscriptResultStream) Events() <-chan CallAnalyticsTranscriptResultStreamEvent {
1736 return r.stream
1737 }
1738
1739 func (r *readCallAnalyticsTranscriptResultStream) readEventStream() {
1740 defer r.Close()
1741 defer close(r.stream)
1742
1743 for {
1744 event, err := r.eventReader.ReadEvent()
1745 if err != nil {
1746 if err == io.EOF {
1747 return
1748 }
1749 select {
1750 case <-r.done:
1751 // If closed already ignore the error
1752 return
1753 default:
1754 }
1755 if _, ok := err.(*eventstreamapi.UnknownMessageTypeError); ok {
1756 continue
1757 }
1758 r.err.SetError(err)
1759 return
1760 }
1761
1762 select {
1763 case r.stream <- event.(CallAnalyticsTranscriptResultStreamEvent):
1764 case <-r.done:
1765 return
1766 }
1767 }
1768 }
1769
1770 type unmarshalerForCallAnalyticsTranscriptResultStreamEvent struct {
1771 metadata protocol.ResponseMetadata
1772 }
1773
1774 func (u unmarshalerForCallAnalyticsTranscriptResultStreamEvent) UnmarshalerForEventName(eventType string) (eventstreamapi.Unmarshaler, error) {
1775 switch eventType {
1776 case "CategoryEvent":
1777 return &CategoryEvent{}, nil
1778 case "UtteranceEvent":
1779 return &UtteranceEvent{}, nil
1780 case "BadRequestException":
1781 return newErrorBadRequestException(u.metadata).(eventstreamapi.Unmarshaler), nil
1782 case "ConflictException":
1783 return newErrorConflictException(u.metadata).(eventstreamapi.Unmarshaler), nil
1784 case "InternalFailureException":
1785 return newErrorInternalFailureException(u.metadata).(eventstreamapi.Unmarshaler), nil
1786 case "LimitExceededException":
1787 return newErrorLimitExceededException(u.metadata).(eventstreamapi.Unmarshaler), nil
1788 case "ServiceUnavailableException":
1789 return newErrorServiceUnavailableException(u.metadata).(eventstreamapi.Unmarshaler), nil
1790 default:
1791 return &CallAnalyticsTranscriptResultStreamUnknownEvent{Type: eventType}, nil
1792 }
1793 }
1794
1795 // CallAnalyticsTranscriptResultStreamUnknownEvent provides a failsafe event for the
1796 // CallAnalyticsTranscriptResultStream group of events when an unknown event is received.
1797 type CallAnalyticsTranscriptResultStreamUnknownEvent struct {
1798 Type string
1799 Message eventstream.Message
1800 }
1801
1802 // The CallAnalyticsTranscriptResultStreamUnknownEvent is and event in the CallAnalyticsTranscriptResultStream
1803 // group of events.
1804 func (s *CallAnalyticsTranscriptResultStreamUnknownEvent) eventCallAnalyticsTranscriptResultStream() {
1805 }
1806
1807 // MarshalEvent marshals the type into an stream event value. This method
1808 // should only used internally within the SDK's EventStream handling.
1809 func (e *CallAnalyticsTranscriptResultStreamUnknownEvent) MarshalEvent(pm protocol.PayloadMarshaler) (
1810 msg eventstream.Message, err error,
1811 ) {
1812 return e.Message.Clone(), nil
1813 }
1814
1815 // UnmarshalEvent unmarshals the EventStream Message into the CallAnalyticsTranscriptResultStream value.
1816 // This method is only used internally within the SDK's EventStream handling.
1817 func (e *CallAnalyticsTranscriptResultStreamUnknownEvent) UnmarshalEvent(
1818 payloadUnmarshaler protocol.PayloadUnmarshaler,
1819 msg eventstream.Message,
1820 ) error {
1821 e.Message = msg.Clone()
1822 return nil
1823 }
1824
1825 // Provides information on any TranscriptFilterType categories that matched
1826 // your transcription output. Matches are identified for each segment upon completion
1827 // of that segment.
1828 type CategoryEvent struct {
1829 _ struct{} `type:"structure"`
1830
1831 // Lists the categories that were matched in your audio segment.
1832 MatchedCategories []*string `type:"list"`
1833
1834 // Contains information about the matched categories, including category names
1835 // and timestamps.
1836 MatchedDetails map[string]*PointsOfInterest `type:"map"`
1837 }
1838
1839 // String returns the string representation.
1840 //
1841 // API parameter values that are decorated as "sensitive" in the API will not
1842 // be included in the string output. The member name will be present, but the
1843 // value will be replaced with "sensitive".
1844 func (s CategoryEvent) String() string {
1845 return awsutil.Prettify(s)
1846 }
1847
1848 // GoString returns the string representation.
1849 //
1850 // API parameter values that are decorated as "sensitive" in the API will not
1851 // be included in the string output. The member name will be present, but the
1852 // value will be replaced with "sensitive".
1853 func (s CategoryEvent) GoString() string {
1854 return s.String()
1855 }
1856
1857 // SetMatchedCategories sets the MatchedCategories field's value.
1858 func (s *CategoryEvent) SetMatchedCategories(v []*string) *CategoryEvent {
1859 s.MatchedCategories = v
1860 return s
1861 }
1862
1863 // SetMatchedDetails sets the MatchedDetails field's value.
1864 func (s *CategoryEvent) SetMatchedDetails(v map[string]*PointsOfInterest) *CategoryEvent {
1865 s.MatchedDetails = v
1866 return s
1867 }
1868
1869 // The CategoryEvent is and event in the CallAnalyticsTranscriptResultStream group of events.
1870 func (s *CategoryEvent) eventCallAnalyticsTranscriptResultStream() {}
1871
1872 // UnmarshalEvent unmarshals the EventStream Message into the CategoryEvent value.
1873 // This method is only used internally within the SDK's EventStream handling.
1874 func (s *CategoryEvent) UnmarshalEvent(
1875 payloadUnmarshaler protocol.PayloadUnmarshaler,
1876 msg eventstream.Message,
1877 ) error {
1878 if err := payloadUnmarshaler.UnmarshalPayload(
1879 bytes.NewReader(msg.Payload), s,
1880 ); err != nil {
1881 return err
1882 }
1883 return nil
1884 }
1885
1886 // MarshalEvent marshals the type into an stream event value. This method
1887 // should only used internally within the SDK's EventStream handling.
1888 func (s *CategoryEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) {
1889 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType))
1890 var buf bytes.Buffer
1891 if err = pm.MarshalPayload(&buf, s); err != nil {
1892 return eventstream.Message{}, err
1893 }
1894 msg.Payload = buf.Bytes()
1895 return msg, err
1896 }
1897
1898 // Makes it possible to specify which speaker is on which audio channel. For
1899 // example, if your agent is the first participant to speak, you would set ChannelId
1900 // to 0 (to indicate the first channel) and ParticipantRole to AGENT (to indicate
1901 // that it's the agent speaking).
1902 type ChannelDefinition struct {
1903 _ struct{} `type:"structure"`
1904
1905 // Specify the audio channel you want to define.
1906 //
1907 // ChannelId is a required field
1908 ChannelId *int64 `type:"integer" required:"true"`
1909
1910 // Specify the speaker you want to define. Omitting this parameter is equivalent
1911 // to specifying both participants.
1912 //
1913 // ParticipantRole is a required field
1914 ParticipantRole *string `type:"string" required:"true" enum:"ParticipantRole"`
1915 }
1916
1917 // String returns the string representation.
1918 //
1919 // API parameter values that are decorated as "sensitive" in the API will not
1920 // be included in the string output. The member name will be present, but the
1921 // value will be replaced with "sensitive".
1922 func (s ChannelDefinition) String() string {
1923 return awsutil.Prettify(s)
1924 }
1925
1926 // GoString returns the string representation.
1927 //
1928 // API parameter values that are decorated as "sensitive" in the API will not
1929 // be included in the string output. The member name will be present, but the
1930 // value will be replaced with "sensitive".
1931 func (s ChannelDefinition) GoString() string {
1932 return s.String()
1933 }
1934
1935 // SetChannelId sets the ChannelId field's value.
1936 func (s *ChannelDefinition) SetChannelId(v int64) *ChannelDefinition {
1937 s.ChannelId = &v
1938 return s
1939 }
1940
1941 // SetParticipantRole sets the ParticipantRole field's value.
1942 func (s *ChannelDefinition) SetParticipantRole(v string) *ChannelDefinition {
1943 s.ParticipantRole = &v
1944 return s
1945 }
1946
1947 // Provides the location, using character count, in your transcript where a
1948 // match is identified. For example, the location of an issue or a category
1949 // match within a segment.
1950 type CharacterOffsets struct {
1951 _ struct{} `type:"structure"`
1952
1953 // Provides the character count of the first character where a match is identified.
1954 // For example, the first character associated with an issue or a category match
1955 // in a segment transcript.
1956 Begin *int64 `type:"integer"`
1957
1958 // Provides the character count of the last character where a match is identified.
1959 // For example, the last character associated with an issue or a category match
1960 // in a segment transcript.
1961 End *int64 `type:"integer"`
1962 }
1963
1964 // String returns the string representation.
1965 //
1966 // API parameter values that are decorated as "sensitive" in the API will not
1967 // be included in the string output. The member name will be present, but the
1968 // value will be replaced with "sensitive".
1969 func (s CharacterOffsets) String() string {
1970 return awsutil.Prettify(s)
1971 }
1972
1973 // GoString returns the string representation.
1974 //
1975 // API parameter values that are decorated as "sensitive" in the API will not
1976 // be included in the string output. The member name will be present, but the
1977 // value will be replaced with "sensitive".
1978 func (s CharacterOffsets) GoString() string {
1979 return s.String()
1980 }
1981
1982 // SetBegin sets the Begin field's value.
1983 func (s *CharacterOffsets) SetBegin(v int64) *CharacterOffsets {
1984 s.Begin = &v
1985 return s
1986 }
1987
1988 // SetEnd sets the End field's value.
1989 func (s *CharacterOffsets) SetEnd(v int64) *CharacterOffsets {
1990 s.End = &v
1991 return s
1992 }
1993
1994 // Allows you to set audio channel definitions and post-call analytics settings.
1995 type ConfigurationEvent struct {
1996 _ struct{} `type:"structure"`
1997
1998 // Indicates which speaker is on which audio channel.
1999 ChannelDefinitions []*ChannelDefinition `min:"2" type:"list"`
2000
2001 // Provides additional optional settings for your Call Analytics post-call request,
2002 // including encryption and output locations for your redacted and unredacted
2003 // transcript.
2004 PostCallAnalyticsSettings *PostCallAnalyticsSettings `type:"structure"`
2005 }
2006
2007 // String returns the string representation.
2008 //
2009 // API parameter values that are decorated as "sensitive" in the API will not
2010 // be included in the string output. The member name will be present, but the
2011 // value will be replaced with "sensitive".
2012 func (s ConfigurationEvent) String() string {
2013 return awsutil.Prettify(s)
2014 }
2015
2016 // GoString returns the string representation.
2017 //
2018 // API parameter values that are decorated as "sensitive" in the API will not
2019 // be included in the string output. The member name will be present, but the
2020 // value will be replaced with "sensitive".
2021 func (s ConfigurationEvent) GoString() string {
2022 return s.String()
2023 }
2024
2025 // SetChannelDefinitions sets the ChannelDefinitions field's value.
2026 func (s *ConfigurationEvent) SetChannelDefinitions(v []*ChannelDefinition) *ConfigurationEvent {
2027 s.ChannelDefinitions = v
2028 return s
2029 }
2030
2031 // SetPostCallAnalyticsSettings sets the PostCallAnalyticsSettings field's value.
2032 func (s *ConfigurationEvent) SetPostCallAnalyticsSettings(v *PostCallAnalyticsSettings) *ConfigurationEvent {
2033 s.PostCallAnalyticsSettings = v
2034 return s
2035 }
2036
2037 // The ConfigurationEvent is and event in the AudioStream group of events.
2038 func (s *ConfigurationEvent) eventAudioStream() {}
2039
2040 // UnmarshalEvent unmarshals the EventStream Message into the ConfigurationEvent value.
2041 // This method is only used internally within the SDK's EventStream handling.
2042 func (s *ConfigurationEvent) UnmarshalEvent(
2043 payloadUnmarshaler protocol.PayloadUnmarshaler,
2044 msg eventstream.Message,
2045 ) error {
2046 if err := payloadUnmarshaler.UnmarshalPayload(
2047 bytes.NewReader(msg.Payload), s,
2048 ); err != nil {
2049 return err
2050 }
2051 return nil
2052 }
2053
2054 // MarshalEvent marshals the type into an stream event value. This method
2055 // should only used internally within the SDK's EventStream handling.
2056 func (s *ConfigurationEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) {
2057 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType))
2058 var buf bytes.Buffer
2059 if err = pm.MarshalPayload(&buf, s); err != nil {
2060 return eventstream.Message{}, err
2061 }
2062 msg.Payload = buf.Bytes()
2063 return msg, err
2064 }
2065
2066 // A new stream started with the same session ID. The current stream has been
2067 // terminated.
2068 type ConflictException struct {
2069 _ struct{} `type:"structure"`
2070 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
2071
2072 Message_ *string `locationName:"Message" type:"string"`
2073 }
2074
2075 // String returns the string representation.
2076 //
2077 // API parameter values that are decorated as "sensitive" in the API will not
2078 // be included in the string output. The member name will be present, but the
2079 // value will be replaced with "sensitive".
2080 func (s ConflictException) String() string {
2081 return awsutil.Prettify(s)
2082 }
2083
2084 // GoString returns the string representation.
2085 //
2086 // API parameter values that are decorated as "sensitive" in the API will not
2087 // be included in the string output. The member name will be present, but the
2088 // value will be replaced with "sensitive".
2089 func (s ConflictException) GoString() string {
2090 return s.String()
2091 }
2092
2093 // The ConflictException is and event in the CallAnalyticsTranscriptResultStream group of events.
2094 func (s *ConflictException) eventCallAnalyticsTranscriptResultStream() {}
2095
2096 // The ConflictException is and event in the MedicalTranscriptResultStream group of events.
2097 func (s *ConflictException) eventMedicalTranscriptResultStream() {}
2098
2099 // The ConflictException is and event in the TranscriptResultStream group of events.
2100 func (s *ConflictException) eventTranscriptResultStream() {}
2101
2102 // UnmarshalEvent unmarshals the EventStream Message into the ConflictException value.
2103 // This method is only used internally within the SDK's EventStream handling.
2104 func (s *ConflictException) UnmarshalEvent(
2105 payloadUnmarshaler protocol.PayloadUnmarshaler,
2106 msg eventstream.Message,
2107 ) error {
2108 if err := payloadUnmarshaler.UnmarshalPayload(
2109 bytes.NewReader(msg.Payload), s,
2110 ); err != nil {
2111 return err
2112 }
2113 return nil
2114 }
2115
2116 // MarshalEvent marshals the type into an stream event value. This method
2117 // should only used internally within the SDK's EventStream handling.
2118 func (s *ConflictException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) {
2119 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType))
2120 var buf bytes.Buffer
2121 if err = pm.MarshalPayload(&buf, s); err != nil {
2122 return eventstream.Message{}, err
2123 }
2124 msg.Payload = buf.Bytes()
2125 return msg, err
2126 }
2127
2128 func newErrorConflictException(v protocol.ResponseMetadata) error {
2129 return &ConflictException{
2130 RespMetadata: v,
2131 }
2132 }
2133
2134 // Code returns the exception type name.
2135 func (s *ConflictException) Code() string {
2136 return "ConflictException"
2137 }
2138
2139 // Message returns the exception's message.
2140 func (s *ConflictException) Message() string {
2141 if s.Message_ != nil {
2142 return *s.Message_
2143 }
2144 return ""
2145 }
2146
2147 // OrigErr always returns nil, satisfies awserr.Error interface.
2148 func (s *ConflictException) OrigErr() error {
2149 return nil
2150 }
2151
2152 func (s *ConflictException) Error() string {
2153 return fmt.Sprintf("%s: %s", s.Code(), s.Message())
2154 }
2155
2156 // Status code returns the HTTP status code for the request's response error.
2157 func (s *ConflictException) StatusCode() int {
2158 return s.RespMetadata.StatusCode
2159 }
2160
2161 // RequestID returns the service's response RequestID for request.
2162 func (s *ConflictException) RequestID() string {
2163 return s.RespMetadata.RequestID
2164 }
2165
2166 // Contains entities identified as personally identifiable information (PII)
2167 // in your transcription output, along with various associated attributes. Examples
2168 // include category, confidence score, type, stability score, and start and
2169 // end times.
2170 type Entity struct {
2171 _ struct{} `type:"structure"`
2172
2173 // The category of information identified. The only category is PII.
2174 Category *string `type:"string"`
2175
2176 // The confidence score associated with the identified PII entity in your audio.
2177 //
2178 // Confidence scores are values between 0 and 1. A larger value indicates a
2179 // higher probability that the identified entity correctly matches the entity
2180 // spoken in your media.
2181 Confidence *float64 `type:"double"`
2182
2183 // The word or words identified as PII.
2184 Content *string `type:"string"`
2185
2186 // The end time, in milliseconds, of the utterance that was identified as PII.
2187 EndTime *float64 `type:"double"`
2188
2189 // The start time, in milliseconds, of the utterance that was identified as
2190 // PII.
2191 StartTime *float64 `type:"double"`
2192
2193 // The type of PII identified. For example, NAME or CREDIT_DEBIT_NUMBER.
2194 Type *string `type:"string"`
2195 }
2196
2197 // String returns the string representation.
2198 //
2199 // API parameter values that are decorated as "sensitive" in the API will not
2200 // be included in the string output. The member name will be present, but the
2201 // value will be replaced with "sensitive".
2202 func (s Entity) String() string {
2203 return awsutil.Prettify(s)
2204 }
2205
2206 // GoString returns the string representation.
2207 //
2208 // API parameter values that are decorated as "sensitive" in the API will not
2209 // be included in the string output. The member name will be present, but the
2210 // value will be replaced with "sensitive".
2211 func (s Entity) GoString() string {
2212 return s.String()
2213 }
2214
2215 // SetCategory sets the Category field's value.
2216 func (s *Entity) SetCategory(v string) *Entity {
2217 s.Category = &v
2218 return s
2219 }
2220
2221 // SetConfidence sets the Confidence field's value.
2222 func (s *Entity) SetConfidence(v float64) *Entity {
2223 s.Confidence = &v
2224 return s
2225 }
2226
2227 // SetContent sets the Content field's value.
2228 func (s *Entity) SetContent(v string) *Entity {
2229 s.Content = &v
2230 return s
2231 }
2232
2233 // SetEndTime sets the EndTime field's value.
2234 func (s *Entity) SetEndTime(v float64) *Entity {
2235 s.EndTime = &v
2236 return s
2237 }
2238
2239 // SetStartTime sets the StartTime field's value.
2240 func (s *Entity) SetStartTime(v float64) *Entity {
2241 s.StartTime = &v
2242 return s
2243 }
2244
2245 // SetType sets the Type field's value.
2246 func (s *Entity) SetType(v string) *Entity {
2247 s.Type = &v
2248 return s
2249 }
2250
2251 // A problem occurred while processing the audio. Amazon Transcribe terminated
2252 // processing.
2253 type InternalFailureException struct {
2254 _ struct{} `type:"structure"`
2255 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
2256
2257 Message_ *string `locationName:"Message" type:"string"`
2258 }
2259
2260 // String returns the string representation.
2261 //
2262 // API parameter values that are decorated as "sensitive" in the API will not
2263 // be included in the string output. The member name will be present, but the
2264 // value will be replaced with "sensitive".
2265 func (s InternalFailureException) String() string {
2266 return awsutil.Prettify(s)
2267 }
2268
2269 // GoString returns the string representation.
2270 //
2271 // API parameter values that are decorated as "sensitive" in the API will not
2272 // be included in the string output. The member name will be present, but the
2273 // value will be replaced with "sensitive".
2274 func (s InternalFailureException) GoString() string {
2275 return s.String()
2276 }
2277
2278 // The InternalFailureException is and event in the CallAnalyticsTranscriptResultStream group of events.
2279 func (s *InternalFailureException) eventCallAnalyticsTranscriptResultStream() {}
2280
2281 // The InternalFailureException is and event in the MedicalTranscriptResultStream group of events.
2282 func (s *InternalFailureException) eventMedicalTranscriptResultStream() {}
2283
2284 // The InternalFailureException is and event in the TranscriptResultStream group of events.
2285 func (s *InternalFailureException) eventTranscriptResultStream() {}
2286
2287 // UnmarshalEvent unmarshals the EventStream Message into the InternalFailureException value.
2288 // This method is only used internally within the SDK's EventStream handling.
2289 func (s *InternalFailureException) UnmarshalEvent(
2290 payloadUnmarshaler protocol.PayloadUnmarshaler,
2291 msg eventstream.Message,
2292 ) error {
2293 if err := payloadUnmarshaler.UnmarshalPayload(
2294 bytes.NewReader(msg.Payload), s,
2295 ); err != nil {
2296 return err
2297 }
2298 return nil
2299 }
2300
2301 // MarshalEvent marshals the type into an stream event value. This method
2302 // should only used internally within the SDK's EventStream handling.
2303 func (s *InternalFailureException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) {
2304 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType))
2305 var buf bytes.Buffer
2306 if err = pm.MarshalPayload(&buf, s); err != nil {
2307 return eventstream.Message{}, err
2308 }
2309 msg.Payload = buf.Bytes()
2310 return msg, err
2311 }
2312
2313 func newErrorInternalFailureException(v protocol.ResponseMetadata) error {
2314 return &InternalFailureException{
2315 RespMetadata: v,
2316 }
2317 }
2318
2319 // Code returns the exception type name.
2320 func (s *InternalFailureException) Code() string {
2321 return "InternalFailureException"
2322 }
2323
2324 // Message returns the exception's message.
2325 func (s *InternalFailureException) Message() string {
2326 if s.Message_ != nil {
2327 return *s.Message_
2328 }
2329 return ""
2330 }
2331
2332 // OrigErr always returns nil, satisfies awserr.Error interface.
2333 func (s *InternalFailureException) OrigErr() error {
2334 return nil
2335 }
2336
2337 func (s *InternalFailureException) Error() string {
2338 return fmt.Sprintf("%s: %s", s.Code(), s.Message())
2339 }
2340
2341 // Status code returns the HTTP status code for the request's response error.
2342 func (s *InternalFailureException) StatusCode() int {
2343 return s.RespMetadata.StatusCode
2344 }
2345
2346 // RequestID returns the service's response RequestID for request.
2347 func (s *InternalFailureException) RequestID() string {
2348 return s.RespMetadata.RequestID
2349 }
2350
2351 // Lists the issues that were identified in your audio segment.
2352 type IssueDetected struct {
2353 _ struct{} `type:"structure"`
2354
2355 // Provides the timestamps that identify when in an audio segment the specified
2356 // issue occurs.
2357 CharacterOffsets *CharacterOffsets `type:"structure"`
2358 }
2359
2360 // String returns the string representation.
2361 //
2362 // API parameter values that are decorated as "sensitive" in the API will not
2363 // be included in the string output. The member name will be present, but the
2364 // value will be replaced with "sensitive".
2365 func (s IssueDetected) String() string {
2366 return awsutil.Prettify(s)
2367 }
2368
2369 // GoString returns the string representation.
2370 //
2371 // API parameter values that are decorated as "sensitive" in the API will not
2372 // be included in the string output. The member name will be present, but the
2373 // value will be replaced with "sensitive".
2374 func (s IssueDetected) GoString() string {
2375 return s.String()
2376 }
2377
2378 // SetCharacterOffsets sets the CharacterOffsets field's value.
2379 func (s *IssueDetected) SetCharacterOffsets(v *CharacterOffsets) *IssueDetected {
2380 s.CharacterOffsets = v
2381 return s
2382 }
2383
2384 // A word, phrase, or punctuation mark in your transcription output, along with
2385 // various associated attributes, such as confidence score, type, and start
2386 // and end times.
2387 type Item struct {
2388 _ struct{} `type:"structure"`
2389
2390 // The confidence score associated with a word or phrase in your transcript.
2391 //
2392 // Confidence scores are values between 0 and 1. A larger value indicates a
2393 // higher probability that the identified item correctly matches the item spoken
2394 // in your media.
2395 Confidence *float64 `type:"double"`
2396
2397 // The word or punctuation that was transcribed.
2398 Content *string `type:"string"`
2399
2400 // The end time, in milliseconds, of the transcribed item.
2401 EndTime *float64 `type:"double"`
2402
2403 // If speaker partitioning is enabled, Speaker labels the speaker of the specified
2404 // item.
2405 Speaker *string `type:"string"`
2406
2407 // If partial result stabilization is enabled, Stable indicates whether the
2408 // specified item is stable (true) or if it may change when the segment is complete
2409 // (false).
2410 Stable *bool `type:"boolean"`
2411
2412 // The start time, in milliseconds, of the transcribed item.
2413 StartTime *float64 `type:"double"`
2414
2415 // The type of item identified. Options are: PRONUNCIATION (spoken words) and
2416 // PUNCTUATION.
2417 Type *string `type:"string" enum:"ItemType"`
2418
2419 // Indicates whether the specified item matches a word in the vocabulary filter
2420 // included in your request. If true, there is a vocabulary filter match.
2421 VocabularyFilterMatch *bool `type:"boolean"`
2422 }
2423
2424 // String returns the string representation.
2425 //
2426 // API parameter values that are decorated as "sensitive" in the API will not
2427 // be included in the string output. The member name will be present, but the
2428 // value will be replaced with "sensitive".
2429 func (s Item) String() string {
2430 return awsutil.Prettify(s)
2431 }
2432
2433 // GoString returns the string representation.
2434 //
2435 // API parameter values that are decorated as "sensitive" in the API will not
2436 // be included in the string output. The member name will be present, but the
2437 // value will be replaced with "sensitive".
2438 func (s Item) GoString() string {
2439 return s.String()
2440 }
2441
2442 // SetConfidence sets the Confidence field's value.
2443 func (s *Item) SetConfidence(v float64) *Item {
2444 s.Confidence = &v
2445 return s
2446 }
2447
2448 // SetContent sets the Content field's value.
2449 func (s *Item) SetContent(v string) *Item {
2450 s.Content = &v
2451 return s
2452 }
2453
2454 // SetEndTime sets the EndTime field's value.
2455 func (s *Item) SetEndTime(v float64) *Item {
2456 s.EndTime = &v
2457 return s
2458 }
2459
2460 // SetSpeaker sets the Speaker field's value.
2461 func (s *Item) SetSpeaker(v string) *Item {
2462 s.Speaker = &v
2463 return s
2464 }
2465
2466 // SetStable sets the Stable field's value.
2467 func (s *Item) SetStable(v bool) *Item {
2468 s.Stable = &v
2469 return s
2470 }
2471
2472 // SetStartTime sets the StartTime field's value.
2473 func (s *Item) SetStartTime(v float64) *Item {
2474 s.StartTime = &v
2475 return s
2476 }
2477
2478 // SetType sets the Type field's value.
2479 func (s *Item) SetType(v string) *Item {
2480 s.Type = &v
2481 return s
2482 }
2483
2484 // SetVocabularyFilterMatch sets the VocabularyFilterMatch field's value.
2485 func (s *Item) SetVocabularyFilterMatch(v bool) *Item {
2486 s.VocabularyFilterMatch = &v
2487 return s
2488 }
2489
2490 // The language code that represents the language identified in your audio,
2491 // including the associated confidence score. If you enabled channel identification
2492 // in your request and each channel contained a different language, you will
2493 // have more than one LanguageWithScore result.
2494 type LanguageWithScore struct {
2495 _ struct{} `type:"structure"`
2496
2497 // The language code of the identified language.
2498 LanguageCode *string `type:"string" enum:"LanguageCode"`
2499
2500 // The confidence score associated with the identified language code. Confidence
2501 // scores are values between zero and one; larger values indicate a higher confidence
2502 // in the identified language.
2503 Score *float64 `type:"double"`
2504 }
2505
2506 // String returns the string representation.
2507 //
2508 // API parameter values that are decorated as "sensitive" in the API will not
2509 // be included in the string output. The member name will be present, but the
2510 // value will be replaced with "sensitive".
2511 func (s LanguageWithScore) String() string {
2512 return awsutil.Prettify(s)
2513 }
2514
2515 // GoString returns the string representation.
2516 //
2517 // API parameter values that are decorated as "sensitive" in the API will not
2518 // be included in the string output. The member name will be present, but the
2519 // value will be replaced with "sensitive".
2520 func (s LanguageWithScore) GoString() string {
2521 return s.String()
2522 }
2523
2524 // SetLanguageCode sets the LanguageCode field's value.
2525 func (s *LanguageWithScore) SetLanguageCode(v string) *LanguageWithScore {
2526 s.LanguageCode = &v
2527 return s
2528 }
2529
2530 // SetScore sets the Score field's value.
2531 func (s *LanguageWithScore) SetScore(v float64) *LanguageWithScore {
2532 s.Score = &v
2533 return s
2534 }
2535
2536 // Your client has exceeded one of the Amazon Transcribe limits. This is typically
2537 // the audio length limit. Break your audio stream into smaller chunks and try
2538 // your request again.
2539 type LimitExceededException struct {
2540 _ struct{} `type:"structure"`
2541 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
2542
2543 Message_ *string `locationName:"Message" type:"string"`
2544 }
2545
2546 // String returns the string representation.
2547 //
2548 // API parameter values that are decorated as "sensitive" in the API will not
2549 // be included in the string output. The member name will be present, but the
2550 // value will be replaced with "sensitive".
2551 func (s LimitExceededException) String() string {
2552 return awsutil.Prettify(s)
2553 }
2554
2555 // GoString returns the string representation.
2556 //
2557 // API parameter values that are decorated as "sensitive" in the API will not
2558 // be included in the string output. The member name will be present, but the
2559 // value will be replaced with "sensitive".
2560 func (s LimitExceededException) GoString() string {
2561 return s.String()
2562 }
2563
2564 // The LimitExceededException is and event in the CallAnalyticsTranscriptResultStream group of events.
2565 func (s *LimitExceededException) eventCallAnalyticsTranscriptResultStream() {}
2566
2567 // The LimitExceededException is and event in the MedicalTranscriptResultStream group of events.
2568 func (s *LimitExceededException) eventMedicalTranscriptResultStream() {}
2569
2570 // The LimitExceededException is and event in the TranscriptResultStream group of events.
2571 func (s *LimitExceededException) eventTranscriptResultStream() {}
2572
2573 // UnmarshalEvent unmarshals the EventStream Message into the LimitExceededException value.
2574 // This method is only used internally within the SDK's EventStream handling.
2575 func (s *LimitExceededException) UnmarshalEvent(
2576 payloadUnmarshaler protocol.PayloadUnmarshaler,
2577 msg eventstream.Message,
2578 ) error {
2579 if err := payloadUnmarshaler.UnmarshalPayload(
2580 bytes.NewReader(msg.Payload), s,
2581 ); err != nil {
2582 return err
2583 }
2584 return nil
2585 }
2586
2587 // MarshalEvent marshals the type into an stream event value. This method
2588 // should only used internally within the SDK's EventStream handling.
2589 func (s *LimitExceededException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) {
2590 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType))
2591 var buf bytes.Buffer
2592 if err = pm.MarshalPayload(&buf, s); err != nil {
2593 return eventstream.Message{}, err
2594 }
2595 msg.Payload = buf.Bytes()
2596 return msg, err
2597 }
2598
2599 func newErrorLimitExceededException(v protocol.ResponseMetadata) error {
2600 return &LimitExceededException{
2601 RespMetadata: v,
2602 }
2603 }
2604
2605 // Code returns the exception type name.
2606 func (s *LimitExceededException) Code() string {
2607 return "LimitExceededException"
2608 }
2609
2610 // Message returns the exception's message.
2611 func (s *LimitExceededException) Message() string {
2612 if s.Message_ != nil {
2613 return *s.Message_
2614 }
2615 return ""
2616 }
2617
2618 // OrigErr always returns nil, satisfies awserr.Error interface.
2619 func (s *LimitExceededException) OrigErr() error {
2620 return nil
2621 }
2622
2623 func (s *LimitExceededException) Error() string {
2624 return fmt.Sprintf("%s: %s", s.Code(), s.Message())
2625 }
2626
2627 // Status code returns the HTTP status code for the request's response error.
2628 func (s *LimitExceededException) StatusCode() int {
2629 return s.RespMetadata.StatusCode
2630 }
2631
2632 // RequestID returns the service's response RequestID for request.
2633 func (s *LimitExceededException) RequestID() string {
2634 return s.RespMetadata.RequestID
2635 }
2636
2637 // A list of possible alternative transcriptions for the input audio. Each alternative
2638 // may contain one or more of Items, Entities, or Transcript.
2639 type MedicalAlternative struct {
2640 _ struct{} `type:"structure"`
2641
2642 // Contains entities identified as personal health information (PHI) in your
2643 // transcription output.
2644 Entities []*MedicalEntity `type:"list"`
2645
2646 // Contains words, phrases, or punctuation marks in your transcription output.
2647 Items []*MedicalItem `type:"list"`
2648
2649 // Contains transcribed text.
2650 Transcript *string `type:"string"`
2651 }
2652
2653 // String returns the string representation.
2654 //
2655 // API parameter values that are decorated as "sensitive" in the API will not
2656 // be included in the string output. The member name will be present, but the
2657 // value will be replaced with "sensitive".
2658 func (s MedicalAlternative) String() string {
2659 return awsutil.Prettify(s)
2660 }
2661
2662 // GoString returns the string representation.
2663 //
2664 // API parameter values that are decorated as "sensitive" in the API will not
2665 // be included in the string output. The member name will be present, but the
2666 // value will be replaced with "sensitive".
2667 func (s MedicalAlternative) GoString() string {
2668 return s.String()
2669 }
2670
2671 // SetEntities sets the Entities field's value.
2672 func (s *MedicalAlternative) SetEntities(v []*MedicalEntity) *MedicalAlternative {
2673 s.Entities = v
2674 return s
2675 }
2676
2677 // SetItems sets the Items field's value.
2678 func (s *MedicalAlternative) SetItems(v []*MedicalItem) *MedicalAlternative {
2679 s.Items = v
2680 return s
2681 }
2682
2683 // SetTranscript sets the Transcript field's value.
2684 func (s *MedicalAlternative) SetTranscript(v string) *MedicalAlternative {
2685 s.Transcript = &v
2686 return s
2687 }
2688
2689 // Contains entities identified as personal health information (PHI) in your
2690 // transcription output, along with various associated attributes. Examples
2691 // include category, confidence score, type, stability score, and start and
2692 // end times.
2693 type MedicalEntity struct {
2694 _ struct{} `type:"structure"`
2695
2696 // The category of information identified. The only category is PHI.
2697 Category *string `type:"string"`
2698
2699 // The confidence score associated with the identified PHI entity in your audio.
2700 //
2701 // Confidence scores are values between 0 and 1. A larger value indicates a
2702 // higher probability that the identified entity correctly matches the entity
2703 // spoken in your media.
2704 Confidence *float64 `type:"double"`
2705
2706 // The word or words identified as PHI.
2707 Content *string `type:"string"`
2708
2709 // The end time, in milliseconds, of the utterance that was identified as PHI.
2710 EndTime *float64 `type:"double"`
2711
2712 // The start time, in milliseconds, of the utterance that was identified as
2713 // PHI.
2714 StartTime *float64 `type:"double"`
2715 }
2716
2717 // String returns the string representation.
2718 //
2719 // API parameter values that are decorated as "sensitive" in the API will not
2720 // be included in the string output. The member name will be present, but the
2721 // value will be replaced with "sensitive".
2722 func (s MedicalEntity) String() string {
2723 return awsutil.Prettify(s)
2724 }
2725
2726 // GoString returns the string representation.
2727 //
2728 // API parameter values that are decorated as "sensitive" in the API will not
2729 // be included in the string output. The member name will be present, but the
2730 // value will be replaced with "sensitive".
2731 func (s MedicalEntity) GoString() string {
2732 return s.String()
2733 }
2734
2735 // SetCategory sets the Category field's value.
2736 func (s *MedicalEntity) SetCategory(v string) *MedicalEntity {
2737 s.Category = &v
2738 return s
2739 }
2740
2741 // SetConfidence sets the Confidence field's value.
2742 func (s *MedicalEntity) SetConfidence(v float64) *MedicalEntity {
2743 s.Confidence = &v
2744 return s
2745 }
2746
2747 // SetContent sets the Content field's value.
2748 func (s *MedicalEntity) SetContent(v string) *MedicalEntity {
2749 s.Content = &v
2750 return s
2751 }
2752
2753 // SetEndTime sets the EndTime field's value.
2754 func (s *MedicalEntity) SetEndTime(v float64) *MedicalEntity {
2755 s.EndTime = &v
2756 return s
2757 }
2758
2759 // SetStartTime sets the StartTime field's value.
2760 func (s *MedicalEntity) SetStartTime(v float64) *MedicalEntity {
2761 s.StartTime = &v
2762 return s
2763 }
2764
2765 // A word, phrase, or punctuation mark in your transcription output, along with
2766 // various associated attributes, such as confidence score, type, and start
2767 // and end times.
2768 type MedicalItem struct {
2769 _ struct{} `type:"structure"`
2770
2771 // The confidence score associated with a word or phrase in your transcript.
2772 //
2773 // Confidence scores are values between 0 and 1. A larger value indicates a
2774 // higher probability that the identified item correctly matches the item spoken
2775 // in your media.
2776 Confidence *float64 `type:"double"`
2777
2778 // The word or punctuation that was transcribed.
2779 Content *string `type:"string"`
2780
2781 // The end time, in milliseconds, of the transcribed item.
2782 EndTime *float64 `type:"double"`
2783
2784 // If speaker partitioning is enabled, Speaker labels the speaker of the specified
2785 // item.
2786 Speaker *string `type:"string"`
2787
2788 // The start time, in milliseconds, of the transcribed item.
2789 StartTime *float64 `type:"double"`
2790
2791 // The type of item identified. Options are: PRONUNCIATION (spoken words) and
2792 // PUNCTUATION.
2793 Type *string `type:"string" enum:"ItemType"`
2794 }
2795
2796 // String returns the string representation.
2797 //
2798 // API parameter values that are decorated as "sensitive" in the API will not
2799 // be included in the string output. The member name will be present, but the
2800 // value will be replaced with "sensitive".
2801 func (s MedicalItem) String() string {
2802 return awsutil.Prettify(s)
2803 }
2804
2805 // GoString returns the string representation.
2806 //
2807 // API parameter values that are decorated as "sensitive" in the API will not
2808 // be included in the string output. The member name will be present, but the
2809 // value will be replaced with "sensitive".
2810 func (s MedicalItem) GoString() string {
2811 return s.String()
2812 }
2813
2814 // SetConfidence sets the Confidence field's value.
2815 func (s *MedicalItem) SetConfidence(v float64) *MedicalItem {
2816 s.Confidence = &v
2817 return s
2818 }
2819
2820 // SetContent sets the Content field's value.
2821 func (s *MedicalItem) SetContent(v string) *MedicalItem {
2822 s.Content = &v
2823 return s
2824 }
2825
2826 // SetEndTime sets the EndTime field's value.
2827 func (s *MedicalItem) SetEndTime(v float64) *MedicalItem {
2828 s.EndTime = &v
2829 return s
2830 }
2831
2832 // SetSpeaker sets the Speaker field's value.
2833 func (s *MedicalItem) SetSpeaker(v string) *MedicalItem {
2834 s.Speaker = &v
2835 return s
2836 }
2837
2838 // SetStartTime sets the StartTime field's value.
2839 func (s *MedicalItem) SetStartTime(v float64) *MedicalItem {
2840 s.StartTime = &v
2841 return s
2842 }
2843
2844 // SetType sets the Type field's value.
2845 func (s *MedicalItem) SetType(v string) *MedicalItem {
2846 s.Type = &v
2847 return s
2848 }
2849
2850 // The Result associated with a .
2851 //
2852 // Contains a set of transcription results from one or more audio segments,
2853 // along with additional information per your request parameters. This can include
2854 // information relating to alternative transcriptions, channel identification,
2855 // partial result stabilization, language identification, and other transcription-related
2856 // data.
2857 type MedicalResult struct {
2858 _ struct{} `type:"structure"`
2859
2860 // A list of possible alternative transcriptions for the input audio. Each alternative
2861 // may contain one or more of Items, Entities, or Transcript.
2862 Alternatives []*MedicalAlternative `type:"list"`
2863
2864 // Indicates the channel identified for the Result.
2865 ChannelId *string `type:"string"`
2866
2867 // The end time, in milliseconds, of the Result.
2868 EndTime *float64 `type:"double"`
2869
2870 // Indicates if the segment is complete.
2871 //
2872 // If IsPartial is true, the segment is not complete. If IsPartial is false,
2873 // the segment is complete.
2874 IsPartial *bool `type:"boolean"`
2875
2876 // Provides a unique identifier for the Result.
2877 ResultId *string `type:"string"`
2878
2879 // The start time, in milliseconds, of the Result.
2880 StartTime *float64 `type:"double"`
2881 }
2882
2883 // String returns the string representation.
2884 //
2885 // API parameter values that are decorated as "sensitive" in the API will not
2886 // be included in the string output. The member name will be present, but the
2887 // value will be replaced with "sensitive".
2888 func (s MedicalResult) String() string {
2889 return awsutil.Prettify(s)
2890 }
2891
2892 // GoString returns the string representation.
2893 //
2894 // API parameter values that are decorated as "sensitive" in the API will not
2895 // be included in the string output. The member name will be present, but the
2896 // value will be replaced with "sensitive".
2897 func (s MedicalResult) GoString() string {
2898 return s.String()
2899 }
2900
2901 // SetAlternatives sets the Alternatives field's value.
2902 func (s *MedicalResult) SetAlternatives(v []*MedicalAlternative) *MedicalResult {
2903 s.Alternatives = v
2904 return s
2905 }
2906
2907 // SetChannelId sets the ChannelId field's value.
2908 func (s *MedicalResult) SetChannelId(v string) *MedicalResult {
2909 s.ChannelId = &v
2910 return s
2911 }
2912
2913 // SetEndTime sets the EndTime field's value.
2914 func (s *MedicalResult) SetEndTime(v float64) *MedicalResult {
2915 s.EndTime = &v
2916 return s
2917 }
2918
2919 // SetIsPartial sets the IsPartial field's value.
2920 func (s *MedicalResult) SetIsPartial(v bool) *MedicalResult {
2921 s.IsPartial = &v
2922 return s
2923 }
2924
2925 // SetResultId sets the ResultId field's value.
2926 func (s *MedicalResult) SetResultId(v string) *MedicalResult {
2927 s.ResultId = &v
2928 return s
2929 }
2930
2931 // SetStartTime sets the StartTime field's value.
2932 func (s *MedicalResult) SetStartTime(v float64) *MedicalResult {
2933 s.StartTime = &v
2934 return s
2935 }
2936
2937 // The MedicalTranscript associated with a .
2938 //
2939 // MedicalTranscript contains Results, which contains a set of transcription
2940 // results from one or more audio segments, along with additional information
2941 // per your request parameters.
2942 type MedicalTranscript struct {
2943 _ struct{} `type:"structure"`
2944
2945 // Contains a set of transcription results from one or more audio segments,
2946 // along with additional information per your request parameters. This can include
2947 // information relating to alternative transcriptions, channel identification,
2948 // partial result stabilization, language identification, and other transcription-related
2949 // data.
2950 Results []*MedicalResult `type:"list"`
2951 }
2952
2953 // String returns the string representation.
2954 //
2955 // API parameter values that are decorated as "sensitive" in the API will not
2956 // be included in the string output. The member name will be present, but the
2957 // value will be replaced with "sensitive".
2958 func (s MedicalTranscript) String() string {
2959 return awsutil.Prettify(s)
2960 }
2961
2962 // GoString returns the string representation.
2963 //
2964 // API parameter values that are decorated as "sensitive" in the API will not
2965 // be included in the string output. The member name will be present, but the
2966 // value will be replaced with "sensitive".
2967 func (s MedicalTranscript) GoString() string {
2968 return s.String()
2969 }
2970
2971 // SetResults sets the Results field's value.
2972 func (s *MedicalTranscript) SetResults(v []*MedicalResult) *MedicalTranscript {
2973 s.Results = v
2974 return s
2975 }
2976
2977 // The MedicalTranscriptEvent associated with a MedicalTranscriptResultStream.
2978 //
2979 // Contains a set of transcription results from one or more audio segments,
2980 // along with additional information per your request parameters.
2981 type MedicalTranscriptEvent struct {
2982 _ struct{} `type:"structure"`
2983
2984 // Contains Results, which contains a set of transcription results from one
2985 // or more audio segments, along with additional information per your request
2986 // parameters. This can include information relating to alternative transcriptions,
2987 // channel identification, partial result stabilization, language identification,
2988 // and other transcription-related data.
2989 Transcript *MedicalTranscript `type:"structure"`
2990 }
2991
2992 // String returns the string representation.
2993 //
2994 // API parameter values that are decorated as "sensitive" in the API will not
2995 // be included in the string output. The member name will be present, but the
2996 // value will be replaced with "sensitive".
2997 func (s MedicalTranscriptEvent) String() string {
2998 return awsutil.Prettify(s)
2999 }
3000
3001 // GoString returns the string representation.
3002 //
3003 // API parameter values that are decorated as "sensitive" in the API will not
3004 // be included in the string output. The member name will be present, but the
3005 // value will be replaced with "sensitive".
3006 func (s MedicalTranscriptEvent) GoString() string {
3007 return s.String()
3008 }
3009
3010 // SetTranscript sets the Transcript field's value.
3011 func (s *MedicalTranscriptEvent) SetTranscript(v *MedicalTranscript) *MedicalTranscriptEvent {
3012 s.Transcript = v
3013 return s
3014 }
3015
3016 // The MedicalTranscriptEvent is and event in the MedicalTranscriptResultStream group of events.
3017 func (s *MedicalTranscriptEvent) eventMedicalTranscriptResultStream() {}
3018
3019 // UnmarshalEvent unmarshals the EventStream Message into the MedicalTranscriptEvent value.
3020 // This method is only used internally within the SDK's EventStream handling.
3021 func (s *MedicalTranscriptEvent) UnmarshalEvent(
3022 payloadUnmarshaler protocol.PayloadUnmarshaler,
3023 msg eventstream.Message,
3024 ) error {
3025 if err := payloadUnmarshaler.UnmarshalPayload(
3026 bytes.NewReader(msg.Payload), s,
3027 ); err != nil {
3028 return err
3029 }
3030 return nil
3031 }
3032
3033 // MarshalEvent marshals the type into an stream event value. This method
3034 // should only used internally within the SDK's EventStream handling.
3035 func (s *MedicalTranscriptEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) {
3036 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType))
3037 var buf bytes.Buffer
3038 if err = pm.MarshalPayload(&buf, s); err != nil {
3039 return eventstream.Message{}, err
3040 }
3041 msg.Payload = buf.Bytes()
3042 return msg, err
3043 }
3044
3045 // MedicalTranscriptResultStreamEvent groups together all EventStream
3046 // events writes for MedicalTranscriptResultStream.
3047 //
3048 // These events are:
3049 //
3050 // - MedicalTranscriptEvent
3051 type MedicalTranscriptResultStreamEvent interface {
3052 eventMedicalTranscriptResultStream()
3053 eventstreamapi.Marshaler
3054 eventstreamapi.Unmarshaler
3055 }
3056
3057 // MedicalTranscriptResultStreamReader provides the interface for reading to the stream. The
3058 // default implementation for this interface will be MedicalTranscriptResultStream.
3059 //
3060 // The reader's Close method must allow multiple concurrent calls.
3061 //
3062 // These events are:
3063 //
3064 // - MedicalTranscriptEvent
3065 // - MedicalTranscriptResultStreamUnknownEvent
3066 type MedicalTranscriptResultStreamReader interface {
3067 // Returns a channel of events as they are read from the event stream.
3068 Events() <-chan MedicalTranscriptResultStreamEvent
3069
3070 // Close will stop the reader reading events from the stream.
3071 Close() error
3072
3073 // Returns any error that has occurred while reading from the event stream.
3074 Err() error
3075 }
3076
3077 type readMedicalTranscriptResultStream struct {
3078 eventReader *eventstreamapi.EventReader
3079 stream chan MedicalTranscriptResultStreamEvent
3080 err *eventstreamapi.OnceError
3081
3082 done chan struct{}
3083 closeOnce sync.Once
3084 }
3085
3086 func newReadMedicalTranscriptResultStream(eventReader *eventstreamapi.EventReader) *readMedicalTranscriptResultStream {
3087 r := &readMedicalTranscriptResultStream{
3088 eventReader: eventReader,
3089 stream: make(chan MedicalTranscriptResultStreamEvent),
3090 done: make(chan struct{}),
3091 err: eventstreamapi.NewOnceError(),
3092 }
3093 go r.readEventStream()
3094
3095 return r
3096 }
3097
3098 // Close will close the underlying event stream reader.
3099 func (r *readMedicalTranscriptResultStream) Close() error {
3100 r.closeOnce.Do(r.safeClose)
3101 return r.Err()
3102 }
3103
3104 func (r *readMedicalTranscriptResultStream) ErrorSet() <-chan struct{} {
3105 return r.err.ErrorSet()
3106 }
3107
3108 func (r *readMedicalTranscriptResultStream) Closed() <-chan struct{} {
3109 return r.done
3110 }
3111
3112 func (r *readMedicalTranscriptResultStream) safeClose() {
3113 close(r.done)
3114 }
3115
3116 func (r *readMedicalTranscriptResultStream) Err() error {
3117 return r.err.Err()
3118 }
3119
3120 func (r *readMedicalTranscriptResultStream) Events() <-chan MedicalTranscriptResultStreamEvent {
3121 return r.stream
3122 }
3123
3124 func (r *readMedicalTranscriptResultStream) readEventStream() {
3125 defer r.Close()
3126 defer close(r.stream)
3127
3128 for {
3129 event, err := r.eventReader.ReadEvent()
3130 if err != nil {
3131 if err == io.EOF {
3132 return
3133 }
3134 select {
3135 case <-r.done:
3136 // If closed already ignore the error
3137 return
3138 default:
3139 }
3140 if _, ok := err.(*eventstreamapi.UnknownMessageTypeError); ok {
3141 continue
3142 }
3143 r.err.SetError(err)
3144 return
3145 }
3146
3147 select {
3148 case r.stream <- event.(MedicalTranscriptResultStreamEvent):
3149 case <-r.done:
3150 return
3151 }
3152 }
3153 }
3154
3155 type unmarshalerForMedicalTranscriptResultStreamEvent struct {
3156 metadata protocol.ResponseMetadata
3157 }
3158
3159 func (u unmarshalerForMedicalTranscriptResultStreamEvent) UnmarshalerForEventName(eventType string) (eventstreamapi.Unmarshaler, error) {
3160 switch eventType {
3161 case "TranscriptEvent":
3162 return &MedicalTranscriptEvent{}, nil
3163 case "BadRequestException":
3164 return newErrorBadRequestException(u.metadata).(eventstreamapi.Unmarshaler), nil
3165 case "ConflictException":
3166 return newErrorConflictException(u.metadata).(eventstreamapi.Unmarshaler), nil
3167 case "InternalFailureException":
3168 return newErrorInternalFailureException(u.metadata).(eventstreamapi.Unmarshaler), nil
3169 case "LimitExceededException":
3170 return newErrorLimitExceededException(u.metadata).(eventstreamapi.Unmarshaler), nil
3171 case "ServiceUnavailableException":
3172 return newErrorServiceUnavailableException(u.metadata).(eventstreamapi.Unmarshaler), nil
3173 default:
3174 return &MedicalTranscriptResultStreamUnknownEvent{Type: eventType}, nil
3175 }
3176 }
3177
3178 // MedicalTranscriptResultStreamUnknownEvent provides a failsafe event for the
3179 // MedicalTranscriptResultStream group of events when an unknown event is received.
3180 type MedicalTranscriptResultStreamUnknownEvent struct {
3181 Type string
3182 Message eventstream.Message
3183 }
3184
3185 // The MedicalTranscriptResultStreamUnknownEvent is and event in the MedicalTranscriptResultStream
3186 // group of events.
3187 func (s *MedicalTranscriptResultStreamUnknownEvent) eventMedicalTranscriptResultStream() {}
3188
3189 // MarshalEvent marshals the type into an stream event value. This method
3190 // should only used internally within the SDK's EventStream handling.
3191 func (e *MedicalTranscriptResultStreamUnknownEvent) MarshalEvent(pm protocol.PayloadMarshaler) (
3192 msg eventstream.Message, err error,
3193 ) {
3194 return e.Message.Clone(), nil
3195 }
3196
3197 // UnmarshalEvent unmarshals the EventStream Message into the MedicalTranscriptResultStream value.
3198 // This method is only used internally within the SDK's EventStream handling.
3199 func (e *MedicalTranscriptResultStreamUnknownEvent) UnmarshalEvent(
3200 payloadUnmarshaler protocol.PayloadUnmarshaler,
3201 msg eventstream.Message,
3202 ) error {
3203 e.Message = msg.Clone()
3204 return nil
3205 }
3206
3207 // Contains the timestamps of matched categories.
3208 type PointsOfInterest struct {
3209 _ struct{} `type:"structure"`
3210
3211 // Contains the timestamp ranges (start time through end time) of matched categories
3212 // and rules.
3213 TimestampRanges []*TimestampRange `type:"list"`
3214 }
3215
3216 // String returns the string representation.
3217 //
3218 // API parameter values that are decorated as "sensitive" in the API will not
3219 // be included in the string output. The member name will be present, but the
3220 // value will be replaced with "sensitive".
3221 func (s PointsOfInterest) String() string {
3222 return awsutil.Prettify(s)
3223 }
3224
3225 // GoString returns the string representation.
3226 //
3227 // API parameter values that are decorated as "sensitive" in the API will not
3228 // be included in the string output. The member name will be present, but the
3229 // value will be replaced with "sensitive".
3230 func (s PointsOfInterest) GoString() string {
3231 return s.String()
3232 }
3233
3234 // SetTimestampRanges sets the TimestampRanges field's value.
3235 func (s *PointsOfInterest) SetTimestampRanges(v []*TimestampRange) *PointsOfInterest {
3236 s.TimestampRanges = v
3237 return s
3238 }
3239
3240 // Allows you to specify additional settings for your streaming Call Analytics
3241 // post-call request, including output locations for your redacted and unredacted
3242 // transcript, which IAM role to use, and, optionally, which encryption key
3243 // to use.
3244 //
3245 // ContentRedactionOutput, DataAccessRoleArn, and OutputLocation are required
3246 // fields.
3247 type PostCallAnalyticsSettings struct {
3248 _ struct{} `type:"structure"`
3249
3250 // Specify whether you want only a redacted transcript or both a redacted and
3251 // an unredacted transcript. If you choose redacted and unredacted, two JSON
3252 // files are generated and stored in the Amazon S3 output location you specify.
3253 //
3254 // Note that to include ContentRedactionOutput in your request, you must enable
3255 // content redaction (ContentRedactionType).
3256 ContentRedactionOutput *string `type:"string" enum:"ContentRedactionOutput_"`
3257
3258 // The Amazon Resource Name (ARN) of an IAM role that has permissions to access
3259 // the Amazon S3 bucket that contains your input files. If the role that you
3260 // specify doesn’t have the appropriate permissions to access the specified
3261 // Amazon S3 location, your request fails.
3262 //
3263 // IAM role ARNs have the format arn:partition:iam::account:role/role-name-with-path.
3264 // For example: arn:aws:iam::111122223333:role/Admin. For more information,
3265 // see IAM ARNs (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns).
3266 //
3267 // DataAccessRoleArn is a required field
3268 DataAccessRoleArn *string `type:"string" required:"true"`
3269
3270 // The KMS key you want to use to encrypt your Call Analytics post-call output.
3271 //
3272 // If using a key located in the current Amazon Web Services account, you can
3273 // specify your KMS key in one of four ways:
3274 //
3275 // Use the KMS key ID itself. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.
3276 //
3277 // Use an alias for the KMS key ID. For example, alias/ExampleAlias.
3278 //
3279 // Use the Amazon Resource Name (ARN) for the KMS key ID. For example, arn:aws:kms:region:account-ID:key/1234abcd-12ab-34cd-56ef-1234567890ab.
3280 //
3281 // Use the ARN for the KMS key alias. For example, arn:aws:kms:region:account-ID:alias/ExampleAlias.
3282 //
3283 // If using a key located in a different Amazon Web Services account than the
3284 // current Amazon Web Services account, you can specify your KMS key in one
3285 // of two ways:
3286 //
3287 // Use the ARN for the KMS key ID. For example, arn:aws:kms:region:account-ID:key/1234abcd-12ab-34cd-56ef-1234567890ab.
3288 //
3289 // Use the ARN for the KMS key alias. For example, arn:aws:kms:region:account-ID:alias/ExampleAlias.
3290 //
3291 // Note that the user making the request must have permission to use the specified
3292 // KMS key.
3293 OutputEncryptionKMSKeyId *string `type:"string"`
3294
3295 // The Amazon S3 location where you want your Call Analytics post-call transcription
3296 // output stored. You can use any of the following formats to specify the output
3297 // location:
3298 //
3299 // s3://DOC-EXAMPLE-BUCKET
3300 //
3301 // s3://DOC-EXAMPLE-BUCKET/my-output-folder/
3302 //
3303 // s3://DOC-EXAMPLE-BUCKET/my-output-folder/my-call-analytics-job.json
3304 //
3305 // OutputLocation is a required field
3306 OutputLocation *string `type:"string" required:"true"`
3307 }
3308
3309 // String returns the string representation.
3310 //
3311 // API parameter values that are decorated as "sensitive" in the API will not
3312 // be included in the string output. The member name will be present, but the
3313 // value will be replaced with "sensitive".
3314 func (s PostCallAnalyticsSettings) String() string {
3315 return awsutil.Prettify(s)
3316 }
3317
3318 // GoString returns the string representation.
3319 //
3320 // API parameter values that are decorated as "sensitive" in the API will not
3321 // be included in the string output. The member name will be present, but the
3322 // value will be replaced with "sensitive".
3323 func (s PostCallAnalyticsSettings) GoString() string {
3324 return s.String()
3325 }
3326
3327 // SetContentRedactionOutput sets the ContentRedactionOutput field's value.
3328 func (s *PostCallAnalyticsSettings) SetContentRedactionOutput(v string) *PostCallAnalyticsSettings {
3329 s.ContentRedactionOutput = &v
3330 return s
3331 }
3332
3333 // SetDataAccessRoleArn sets the DataAccessRoleArn field's value.
3334 func (s *PostCallAnalyticsSettings) SetDataAccessRoleArn(v string) *PostCallAnalyticsSettings {
3335 s.DataAccessRoleArn = &v
3336 return s
3337 }
3338
3339 // SetOutputEncryptionKMSKeyId sets the OutputEncryptionKMSKeyId field's value.
3340 func (s *PostCallAnalyticsSettings) SetOutputEncryptionKMSKeyId(v string) *PostCallAnalyticsSettings {
3341 s.OutputEncryptionKMSKeyId = &v
3342 return s
3343 }
3344
3345 // SetOutputLocation sets the OutputLocation field's value.
3346 func (s *PostCallAnalyticsSettings) SetOutputLocation(v string) *PostCallAnalyticsSettings {
3347 s.OutputLocation = &v
3348 return s
3349 }
3350
3351 // The Result associated with a .
3352 //
3353 // Contains a set of transcription results from one or more audio segments,
3354 // along with additional information per your request parameters. This can include
3355 // information relating to alternative transcriptions, channel identification,
3356 // partial result stabilization, language identification, and other transcription-related
3357 // data.
3358 type Result struct {
3359 _ struct{} `type:"structure"`
3360
3361 // A list of possible alternative transcriptions for the input audio. Each alternative
3362 // may contain one or more of Items, Entities, or Transcript.
3363 Alternatives []*Alternative `type:"list"`
3364
3365 // Indicates which audio channel is associated with the Result.
3366 ChannelId *string `type:"string"`
3367
3368 // The end time, in milliseconds, of the Result.
3369 EndTime *float64 `type:"double"`
3370
3371 // Indicates if the segment is complete.
3372 //
3373 // If IsPartial is true, the segment is not complete. If IsPartial is false,
3374 // the segment is complete.
3375 IsPartial *bool `type:"boolean"`
3376
3377 // The language code that represents the language spoken in your audio stream.
3378 LanguageCode *string `type:"string" enum:"LanguageCode"`
3379
3380 // The language code of the dominant language identified in your stream.
3381 //
3382 // If you enabled channel identification and each channel of your audio contains
3383 // a different language, you may have more than one result.
3384 LanguageIdentification []*LanguageWithScore `type:"list"`
3385
3386 // Provides a unique identifier for the Result.
3387 ResultId *string `type:"string"`
3388
3389 // The start time, in milliseconds, of the Result.
3390 StartTime *float64 `type:"double"`
3391 }
3392
3393 // String returns the string representation.
3394 //
3395 // API parameter values that are decorated as "sensitive" in the API will not
3396 // be included in the string output. The member name will be present, but the
3397 // value will be replaced with "sensitive".
3398 func (s Result) String() string {
3399 return awsutil.Prettify(s)
3400 }
3401
3402 // GoString returns the string representation.
3403 //
3404 // API parameter values that are decorated as "sensitive" in the API will not
3405 // be included in the string output. The member name will be present, but the
3406 // value will be replaced with "sensitive".
3407 func (s Result) GoString() string {
3408 return s.String()
3409 }
3410
3411 // SetAlternatives sets the Alternatives field's value.
3412 func (s *Result) SetAlternatives(v []*Alternative) *Result {
3413 s.Alternatives = v
3414 return s
3415 }
3416
3417 // SetChannelId sets the ChannelId field's value.
3418 func (s *Result) SetChannelId(v string) *Result {
3419 s.ChannelId = &v
3420 return s
3421 }
3422
3423 // SetEndTime sets the EndTime field's value.
3424 func (s *Result) SetEndTime(v float64) *Result {
3425 s.EndTime = &v
3426 return s
3427 }
3428
3429 // SetIsPartial sets the IsPartial field's value.
3430 func (s *Result) SetIsPartial(v bool) *Result {
3431 s.IsPartial = &v
3432 return s
3433 }
3434
3435 // SetLanguageCode sets the LanguageCode field's value.
3436 func (s *Result) SetLanguageCode(v string) *Result {
3437 s.LanguageCode = &v
3438 return s
3439 }
3440
3441 // SetLanguageIdentification sets the LanguageIdentification field's value.
3442 func (s *Result) SetLanguageIdentification(v []*LanguageWithScore) *Result {
3443 s.LanguageIdentification = v
3444 return s
3445 }
3446
3447 // SetResultId sets the ResultId field's value.
3448 func (s *Result) SetResultId(v string) *Result {
3449 s.ResultId = &v
3450 return s
3451 }
3452
3453 // SetStartTime sets the StartTime field's value.
3454 func (s *Result) SetStartTime(v float64) *Result {
3455 s.StartTime = &v
3456 return s
3457 }
3458
3459 // The service is currently unavailable. Try your request later.
3460 type ServiceUnavailableException struct {
3461 _ struct{} `type:"structure"`
3462 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
3463
3464 Message_ *string `locationName:"Message" type:"string"`
3465 }
3466
3467 // String returns the string representation.
3468 //
3469 // API parameter values that are decorated as "sensitive" in the API will not
3470 // be included in the string output. The member name will be present, but the
3471 // value will be replaced with "sensitive".
3472 func (s ServiceUnavailableException) String() string {
3473 return awsutil.Prettify(s)
3474 }
3475
3476 // GoString returns the string representation.
3477 //
3478 // API parameter values that are decorated as "sensitive" in the API will not
3479 // be included in the string output. The member name will be present, but the
3480 // value will be replaced with "sensitive".
3481 func (s ServiceUnavailableException) GoString() string {
3482 return s.String()
3483 }
3484
3485 // The ServiceUnavailableException is and event in the CallAnalyticsTranscriptResultStream group of events.
3486 func (s *ServiceUnavailableException) eventCallAnalyticsTranscriptResultStream() {}
3487
3488 // The ServiceUnavailableException is and event in the MedicalTranscriptResultStream group of events.
3489 func (s *ServiceUnavailableException) eventMedicalTranscriptResultStream() {}
3490
3491 // The ServiceUnavailableException is and event in the TranscriptResultStream group of events.
3492 func (s *ServiceUnavailableException) eventTranscriptResultStream() {}
3493
3494 // UnmarshalEvent unmarshals the EventStream Message into the ServiceUnavailableException value.
3495 // This method is only used internally within the SDK's EventStream handling.
3496 func (s *ServiceUnavailableException) UnmarshalEvent(
3497 payloadUnmarshaler protocol.PayloadUnmarshaler,
3498 msg eventstream.Message,
3499 ) error {
3500 if err := payloadUnmarshaler.UnmarshalPayload(
3501 bytes.NewReader(msg.Payload), s,
3502 ); err != nil {
3503 return err
3504 }
3505 return nil
3506 }
3507
3508 // MarshalEvent marshals the type into an stream event value. This method
3509 // should only used internally within the SDK's EventStream handling.
3510 func (s *ServiceUnavailableException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) {
3511 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType))
3512 var buf bytes.Buffer
3513 if err = pm.MarshalPayload(&buf, s); err != nil {
3514 return eventstream.Message{}, err
3515 }
3516 msg.Payload = buf.Bytes()
3517 return msg, err
3518 }
3519
3520 func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error {
3521 return &ServiceUnavailableException{
3522 RespMetadata: v,
3523 }
3524 }
3525
3526 // Code returns the exception type name.
3527 func (s *ServiceUnavailableException) Code() string {
3528 return "ServiceUnavailableException"
3529 }
3530
3531 // Message returns the exception's message.
3532 func (s *ServiceUnavailableException) Message() string {
3533 if s.Message_ != nil {
3534 return *s.Message_
3535 }
3536 return ""
3537 }
3538
3539 // OrigErr always returns nil, satisfies awserr.Error interface.
3540 func (s *ServiceUnavailableException) OrigErr() error {
3541 return nil
3542 }
3543
3544 func (s *ServiceUnavailableException) Error() string {
3545 return fmt.Sprintf("%s: %s", s.Code(), s.Message())
3546 }
3547
3548 // Status code returns the HTTP status code for the request's response error.
3549 func (s *ServiceUnavailableException) StatusCode() int {
3550 return s.RespMetadata.StatusCode
3551 }
3552
3553 // RequestID returns the service's response RequestID for request.
3554 func (s *ServiceUnavailableException) RequestID() string {
3555 return s.RespMetadata.RequestID
3556 }
3557
3558 type StartCallAnalyticsStreamTranscriptionInput struct {
3559 _ struct{} `type:"structure" payload:"AudioStream"`
3560
3561 // Labels all personally identifiable information (PII) identified in your transcript.
3562 //
3563 // Content identification is performed at the segment level; PII specified in
3564 // PiiEntityTypes is flagged upon complete transcription of an audio segment.
3565 //
3566 // You can’t set ContentIdentificationType and ContentRedactionType in the
3567 // same request. If you set both, your request returns a BadRequestException.
3568 //
3569 // For more information, see Redacting or identifying personally identifiable
3570 // information (https://docs.aws.amazon.com/transcribe/latest/dg/pii-redaction.html).
3571 ContentIdentificationType *string `location:"header" locationName:"x-amzn-transcribe-content-identification-type" type:"string" enum:"ContentIdentificationType"`
3572
3573 // Redacts all personally identifiable information (PII) identified in your
3574 // transcript.
3575 //
3576 // Content redaction is performed at the segment level; PII specified in PiiEntityTypes
3577 // is redacted upon complete transcription of an audio segment.
3578 //
3579 // You can’t set ContentRedactionType and ContentIdentificationType in the
3580 // same request. If you set both, your request returns a BadRequestException.
3581 //
3582 // For more information, see Redacting or identifying personally identifiable
3583 // information (https://docs.aws.amazon.com/transcribe/latest/dg/pii-redaction.html).
3584 ContentRedactionType *string `location:"header" locationName:"x-amzn-transcribe-content-redaction-type" type:"string" enum:"ContentRedactionType"`
3585
3586 // Enables partial result stabilization for your transcription. Partial result
3587 // stabilization can reduce latency in your output, but may impact accuracy.
3588 // For more information, see Partial-result stabilization (https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#streaming-partial-result-stabilization).
3589 EnablePartialResultsStabilization *bool `location:"header" locationName:"x-amzn-transcribe-enable-partial-results-stabilization" type:"boolean"`
3590
3591 // Specify the language code that represents the language spoken in your audio.
3592 //
3593 // If you're unsure of the language spoken in your audio, consider using IdentifyLanguage
3594 // to enable automatic language identification.
3595 //
3596 // For a list of languages supported with streaming Call Analytics, refer to
3597 // the Supported languages (https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html)
3598 // table.
3599 //
3600 // LanguageCode is a required field
3601 LanguageCode *string `location:"header" locationName:"x-amzn-transcribe-language-code" type:"string" required:"true" enum:"CallAnalyticsLanguageCode"`
3602
3603 // Specify the name of the custom language model that you want to use when processing
3604 // your transcription. Note that language model names are case sensitive.
3605 //
3606 // The language of the specified language model must match the language code
3607 // you specify in your transcription request. If the languages don't match,
3608 // the custom language model isn't applied. There are no errors or warnings
3609 // associated with a language mismatch.
3610 //
3611 // For more information, see Custom language models (https://docs.aws.amazon.com/transcribe/latest/dg/custom-language-models.html).
3612 LanguageModelName *string `location:"header" locationName:"x-amzn-transcribe-language-model-name" min:"1" type:"string"`
3613
3614 // Specify the encoding of your input audio. Supported formats are:
3615 //
3616 // * FLAC
3617 //
3618 // * OPUS-encoded audio in an Ogg container
3619 //
3620 // * PCM (only signed 16-bit little-endian audio formats, which does not
3621 // include WAV)
3622 //
3623 // For more information, see Media formats (https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio).
3624 //
3625 // MediaEncoding is a required field
3626 MediaEncoding *string `location:"header" locationName:"x-amzn-transcribe-media-encoding" type:"string" required:"true" enum:"MediaEncoding"`
3627
3628 // The sample rate of the input audio (in hertz). Low-quality audio, such as
3629 // telephone audio, is typically around 8,000 Hz. High-quality audio typically
3630 // ranges from 16,000 Hz to 48,000 Hz. Note that the sample rate you specify
3631 // must match that of your audio.
3632 //
3633 // MediaSampleRateHertz is a required field
3634 MediaSampleRateHertz *int64 `location:"header" locationName:"x-amzn-transcribe-sample-rate" min:"8000" type:"integer" required:"true"`
3635
3636 // Specify the level of stability to use when you enable partial results stabilization
3637 // (EnablePartialResultsStabilization).
3638 //
3639 // Low stability provides the highest accuracy. High stability transcribes faster,
3640 // but with slightly lower accuracy.
3641 //
3642 // For more information, see Partial-result stabilization (https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#streaming-partial-result-stabilization).
3643 PartialResultsStability *string `location:"header" locationName:"x-amzn-transcribe-partial-results-stability" type:"string" enum:"PartialResultsStability"`
3644
3645 // Specify which types of personally identifiable information (PII) you want
3646 // to redact in your transcript. You can include as many types as you'd like,
3647 // or you can select ALL.
3648 //
3649 // To include PiiEntityTypes in your Call Analytics request, you must also include
3650 // either ContentIdentificationType or ContentRedactionType.
3651 //
3652 // Values must be comma-separated and can include: BANK_ACCOUNT_NUMBER, BANK_ROUTING,
3653 // CREDIT_DEBIT_NUMBER, CREDIT_DEBIT_CVV, CREDIT_DEBIT_EXPIRY, PIN, EMAIL, ADDRESS,
3654 // NAME, PHONE, SSN, or ALL.
3655 PiiEntityTypes *string `location:"header" locationName:"x-amzn-transcribe-pii-entity-types" min:"1" type:"string"`
3656
3657 // Specify a name for your Call Analytics transcription session. If you don't
3658 // include this parameter in your request, Amazon Transcribe generates an ID
3659 // and returns it in the response.
3660 //
3661 // You can use a session ID to retry a streaming session.
3662 SessionId *string `location:"header" locationName:"x-amzn-transcribe-session-id" min:"36" type:"string"`
3663
3664 // Specify how you want your vocabulary filter applied to your transcript.
3665 //
3666 // To replace words with ***, choose mask.
3667 //
3668 // To delete words, choose remove.
3669 //
3670 // To flag words without changing them, choose tag.
3671 VocabularyFilterMethod *string `location:"header" locationName:"x-amzn-transcribe-vocabulary-filter-method" type:"string" enum:"VocabularyFilterMethod"`
3672
3673 // Specify the name of the custom vocabulary filter that you want to use when
3674 // processing your transcription. Note that vocabulary filter names are case
3675 // sensitive.
3676 //
3677 // If the language of the specified custom vocabulary filter doesn't match the
3678 // language identified in your media, the vocabulary filter is not applied to
3679 // your transcription.
3680 //
3681 // For more information, see Using vocabulary filtering with unwanted words
3682 // (https://docs.aws.amazon.com/transcribe/latest/dg/vocabulary-filtering.html).
3683 VocabularyFilterName *string `location:"header" locationName:"x-amzn-transcribe-vocabulary-filter-name" min:"1" type:"string"`
3684
3685 // Specify the name of the custom vocabulary that you want to use when processing
3686 // your transcription. Note that vocabulary names are case sensitive.
3687 //
3688 // If the language of the specified custom vocabulary doesn't match the language
3689 // identified in your media, the custom vocabulary is not applied to your transcription.
3690 //
3691 // For more information, see Custom vocabularies (https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html).
3692 VocabularyName *string `location:"header" locationName:"x-amzn-transcribe-vocabulary-name" min:"1" type:"string"`
3693 }
3694
3695 // String returns the string representation.
3696 //
3697 // API parameter values that are decorated as "sensitive" in the API will not
3698 // be included in the string output. The member name will be present, but the
3699 // value will be replaced with "sensitive".
3700 func (s StartCallAnalyticsStreamTranscriptionInput) String() string {
3701 return awsutil.Prettify(s)
3702 }
3703
3704 // GoString returns the string representation.
3705 //
3706 // API parameter values that are decorated as "sensitive" in the API will not
3707 // be included in the string output. The member name will be present, but the
3708 // value will be replaced with "sensitive".
3709 func (s StartCallAnalyticsStreamTranscriptionInput) GoString() string {
3710 return s.String()
3711 }
3712
3713 // Validate inspects the fields of the type to determine if they are valid.
3714 func (s *StartCallAnalyticsStreamTranscriptionInput) Validate() error {
3715 invalidParams := request.ErrInvalidParams{Context: "StartCallAnalyticsStreamTranscriptionInput"}
3716 if s.LanguageCode == nil {
3717 invalidParams.Add(request.NewErrParamRequired("LanguageCode"))
3718 }
3719 if s.LanguageModelName != nil && len(*s.LanguageModelName) < 1 {
3720 invalidParams.Add(request.NewErrParamMinLen("LanguageModelName", 1))
3721 }
3722 if s.MediaEncoding == nil {
3723 invalidParams.Add(request.NewErrParamRequired("MediaEncoding"))
3724 }
3725 if s.MediaSampleRateHertz == nil {
3726 invalidParams.Add(request.NewErrParamRequired("MediaSampleRateHertz"))
3727 }
3728 if s.MediaSampleRateHertz != nil && *s.MediaSampleRateHertz < 8000 {
3729 invalidParams.Add(request.NewErrParamMinValue("MediaSampleRateHertz", 8000))
3730 }
3731 if s.PiiEntityTypes != nil && len(*s.PiiEntityTypes) < 1 {
3732 invalidParams.Add(request.NewErrParamMinLen("PiiEntityTypes", 1))
3733 }
3734 if s.SessionId != nil && len(*s.SessionId) < 36 {
3735 invalidParams.Add(request.NewErrParamMinLen("SessionId", 36))
3736 }
3737 if s.VocabularyFilterName != nil && len(*s.VocabularyFilterName) < 1 {
3738 invalidParams.Add(request.NewErrParamMinLen("VocabularyFilterName", 1))
3739 }
3740 if s.VocabularyName != nil && len(*s.VocabularyName) < 1 {
3741 invalidParams.Add(request.NewErrParamMinLen("VocabularyName", 1))
3742 }
3743
3744 if invalidParams.Len() > 0 {
3745 return invalidParams
3746 }
3747 return nil
3748 }
3749
3750 // SetContentIdentificationType sets the ContentIdentificationType field's value.
3751 func (s *StartCallAnalyticsStreamTranscriptionInput) SetContentIdentificationType(v string) *StartCallAnalyticsStreamTranscriptionInput {
3752 s.ContentIdentificationType = &v
3753 return s
3754 }
3755
3756 // SetContentRedactionType sets the ContentRedactionType field's value.
3757 func (s *StartCallAnalyticsStreamTranscriptionInput) SetContentRedactionType(v string) *StartCallAnalyticsStreamTranscriptionInput {
3758 s.ContentRedactionType = &v
3759 return s
3760 }
3761
3762 // SetEnablePartialResultsStabilization sets the EnablePartialResultsStabilization field's value.
3763 func (s *StartCallAnalyticsStreamTranscriptionInput) SetEnablePartialResultsStabilization(v bool) *StartCallAnalyticsStreamTranscriptionInput {
3764 s.EnablePartialResultsStabilization = &v
3765 return s
3766 }
3767
3768 // SetLanguageCode sets the LanguageCode field's value.
3769 func (s *StartCallAnalyticsStreamTranscriptionInput) SetLanguageCode(v string) *StartCallAnalyticsStreamTranscriptionInput {
3770 s.LanguageCode = &v
3771 return s
3772 }
3773
3774 // SetLanguageModelName sets the LanguageModelName field's value.
3775 func (s *StartCallAnalyticsStreamTranscriptionInput) SetLanguageModelName(v string) *StartCallAnalyticsStreamTranscriptionInput {
3776 s.LanguageModelName = &v
3777 return s
3778 }
3779
3780 // SetMediaEncoding sets the MediaEncoding field's value.
3781 func (s *StartCallAnalyticsStreamTranscriptionInput) SetMediaEncoding(v string) *StartCallAnalyticsStreamTranscriptionInput {
3782 s.MediaEncoding = &v
3783 return s
3784 }
3785
3786 // SetMediaSampleRateHertz sets the MediaSampleRateHertz field's value.
3787 func (s *StartCallAnalyticsStreamTranscriptionInput) SetMediaSampleRateHertz(v int64) *StartCallAnalyticsStreamTranscriptionInput {
3788 s.MediaSampleRateHertz = &v
3789 return s
3790 }
3791
3792 // SetPartialResultsStability sets the PartialResultsStability field's value.
3793 func (s *StartCallAnalyticsStreamTranscriptionInput) SetPartialResultsStability(v string) *StartCallAnalyticsStreamTranscriptionInput {
3794 s.PartialResultsStability = &v
3795 return s
3796 }
3797
3798 // SetPiiEntityTypes sets the PiiEntityTypes field's value.
3799 func (s *StartCallAnalyticsStreamTranscriptionInput) SetPiiEntityTypes(v string) *StartCallAnalyticsStreamTranscriptionInput {
3800 s.PiiEntityTypes = &v
3801 return s
3802 }
3803
3804 // SetSessionId sets the SessionId field's value.
3805 func (s *StartCallAnalyticsStreamTranscriptionInput) SetSessionId(v string) *StartCallAnalyticsStreamTranscriptionInput {
3806 s.SessionId = &v
3807 return s
3808 }
3809
3810 // SetVocabularyFilterMethod sets the VocabularyFilterMethod field's value.
3811 func (s *StartCallAnalyticsStreamTranscriptionInput) SetVocabularyFilterMethod(v string) *StartCallAnalyticsStreamTranscriptionInput {
3812 s.VocabularyFilterMethod = &v
3813 return s
3814 }
3815
3816 // SetVocabularyFilterName sets the VocabularyFilterName field's value.
3817 func (s *StartCallAnalyticsStreamTranscriptionInput) SetVocabularyFilterName(v string) *StartCallAnalyticsStreamTranscriptionInput {
3818 s.VocabularyFilterName = &v
3819 return s
3820 }
3821
3822 // SetVocabularyName sets the VocabularyName field's value.
3823 func (s *StartCallAnalyticsStreamTranscriptionInput) SetVocabularyName(v string) *StartCallAnalyticsStreamTranscriptionInput {
3824 s.VocabularyName = &v
3825 return s
3826 }
3827
3828 type StartCallAnalyticsStreamTranscriptionOutput struct {
3829 _ struct{} `type:"structure" payload:"CallAnalyticsTranscriptResultStream"`
3830
3831 eventStream *StartCallAnalyticsStreamTranscriptionEventStream
3832
3833 // Shows whether content identification was enabled for your Call Analytics
3834 // transcription.
3835 ContentIdentificationType *string `location:"header" locationName:"x-amzn-transcribe-content-identification-type" type:"string" enum:"ContentIdentificationType"`
3836
3837 // Shows whether content redaction was enabled for your Call Analytics transcription.
3838 ContentRedactionType *string `location:"header" locationName:"x-amzn-transcribe-content-redaction-type" type:"string" enum:"ContentRedactionType"`
3839
3840 // Shows whether partial results stabilization was enabled for your Call Analytics
3841 // transcription.
3842 EnablePartialResultsStabilization *bool `location:"header" locationName:"x-amzn-transcribe-enable-partial-results-stabilization" type:"boolean"`
3843
3844 // Provides the language code that you specified in your Call Analytics request.
3845 LanguageCode *string `location:"header" locationName:"x-amzn-transcribe-language-code" type:"string" enum:"CallAnalyticsLanguageCode"`
3846
3847 // Provides the name of the custom language model that you specified in your
3848 // Call Analytics request.
3849 LanguageModelName *string `location:"header" locationName:"x-amzn-transcribe-language-model-name" min:"1" type:"string"`
3850
3851 // Provides the media encoding you specified in your Call Analytics request.
3852 MediaEncoding *string `location:"header" locationName:"x-amzn-transcribe-media-encoding" type:"string" enum:"MediaEncoding"`
3853
3854 // Provides the sample rate that you specified in your Call Analytics request.
3855 MediaSampleRateHertz *int64 `location:"header" locationName:"x-amzn-transcribe-sample-rate" min:"8000" type:"integer"`
3856
3857 // Provides the stabilization level used for your transcription.
3858 PartialResultsStability *string `location:"header" locationName:"x-amzn-transcribe-partial-results-stability" type:"string" enum:"PartialResultsStability"`
3859
3860 // Lists the PII entity types you specified in your Call Analytics request.
3861 PiiEntityTypes *string `location:"header" locationName:"x-amzn-transcribe-pii-entity-types" min:"1" type:"string"`
3862
3863 // Provides the identifier for your Call Analytics streaming request.
3864 RequestId *string `location:"header" locationName:"x-amzn-request-id" type:"string"`
3865
3866 // Provides the identifier for your Call Analytics transcription session.
3867 SessionId *string `location:"header" locationName:"x-amzn-transcribe-session-id" min:"36" type:"string"`
3868
3869 // Provides the vocabulary filtering method used in your Call Analytics transcription.
3870 VocabularyFilterMethod *string `location:"header" locationName:"x-amzn-transcribe-vocabulary-filter-method" type:"string" enum:"VocabularyFilterMethod"`
3871
3872 // Provides the name of the custom vocabulary filter that you specified in your
3873 // Call Analytics request.
3874 VocabularyFilterName *string `location:"header" locationName:"x-amzn-transcribe-vocabulary-filter-name" min:"1" type:"string"`
3875
3876 // Provides the name of the custom vocabulary that you specified in your Call
3877 // Analytics request.
3878 VocabularyName *string `location:"header" locationName:"x-amzn-transcribe-vocabulary-name" min:"1" type:"string"`
3879 }
3880
3881 // String returns the string representation.
3882 //
3883 // API parameter values that are decorated as "sensitive" in the API will not
3884 // be included in the string output. The member name will be present, but the
3885 // value will be replaced with "sensitive".
3886 func (s StartCallAnalyticsStreamTranscriptionOutput) String() string {
3887 return awsutil.Prettify(s)
3888 }
3889
3890 // GoString returns the string representation.
3891 //
3892 // API parameter values that are decorated as "sensitive" in the API will not
3893 // be included in the string output. The member name will be present, but the
3894 // value will be replaced with "sensitive".
3895 func (s StartCallAnalyticsStreamTranscriptionOutput) GoString() string {
3896 return s.String()
3897 }
3898
3899 // SetContentIdentificationType sets the ContentIdentificationType field's value.
3900 func (s *StartCallAnalyticsStreamTranscriptionOutput) SetContentIdentificationType(v string) *StartCallAnalyticsStreamTranscriptionOutput {
3901 s.ContentIdentificationType = &v
3902 return s
3903 }
3904
3905 // SetContentRedactionType sets the ContentRedactionType field's value.
3906 func (s *StartCallAnalyticsStreamTranscriptionOutput) SetContentRedactionType(v string) *StartCallAnalyticsStreamTranscriptionOutput {
3907 s.ContentRedactionType = &v
3908 return s
3909 }
3910
3911 // SetEnablePartialResultsStabilization sets the EnablePartialResultsStabilization field's value.
3912 func (s *StartCallAnalyticsStreamTranscriptionOutput) SetEnablePartialResultsStabilization(v bool) *StartCallAnalyticsStreamTranscriptionOutput {
3913 s.EnablePartialResultsStabilization = &v
3914 return s
3915 }
3916
3917 // SetLanguageCode sets the LanguageCode field's value.
3918 func (s *StartCallAnalyticsStreamTranscriptionOutput) SetLanguageCode(v string) *StartCallAnalyticsStreamTranscriptionOutput {
3919 s.LanguageCode = &v
3920 return s
3921 }
3922
3923 // SetLanguageModelName sets the LanguageModelName field's value.
3924 func (s *StartCallAnalyticsStreamTranscriptionOutput) SetLanguageModelName(v string) *StartCallAnalyticsStreamTranscriptionOutput {
3925 s.LanguageModelName = &v
3926 return s
3927 }
3928
3929 // SetMediaEncoding sets the MediaEncoding field's value.
3930 func (s *StartCallAnalyticsStreamTranscriptionOutput) SetMediaEncoding(v string) *StartCallAnalyticsStreamTranscriptionOutput {
3931 s.MediaEncoding = &v
3932 return s
3933 }
3934
3935 // SetMediaSampleRateHertz sets the MediaSampleRateHertz field's value.
3936 func (s *StartCallAnalyticsStreamTranscriptionOutput) SetMediaSampleRateHertz(v int64) *StartCallAnalyticsStreamTranscriptionOutput {
3937 s.MediaSampleRateHertz = &v
3938 return s
3939 }
3940
3941 // SetPartialResultsStability sets the PartialResultsStability field's value.
3942 func (s *StartCallAnalyticsStreamTranscriptionOutput) SetPartialResultsStability(v string) *StartCallAnalyticsStreamTranscriptionOutput {
3943 s.PartialResultsStability = &v
3944 return s
3945 }
3946
3947 // SetPiiEntityTypes sets the PiiEntityTypes field's value.
3948 func (s *StartCallAnalyticsStreamTranscriptionOutput) SetPiiEntityTypes(v string) *StartCallAnalyticsStreamTranscriptionOutput {
3949 s.PiiEntityTypes = &v
3950 return s
3951 }
3952
3953 // SetRequestId sets the RequestId field's value.
3954 func (s *StartCallAnalyticsStreamTranscriptionOutput) SetRequestId(v string) *StartCallAnalyticsStreamTranscriptionOutput {
3955 s.RequestId = &v
3956 return s
3957 }
3958
3959 // SetSessionId sets the SessionId field's value.
3960 func (s *StartCallAnalyticsStreamTranscriptionOutput) SetSessionId(v string) *StartCallAnalyticsStreamTranscriptionOutput {
3961 s.SessionId = &v
3962 return s
3963 }
3964
3965 // SetVocabularyFilterMethod sets the VocabularyFilterMethod field's value.
3966 func (s *StartCallAnalyticsStreamTranscriptionOutput) SetVocabularyFilterMethod(v string) *StartCallAnalyticsStreamTranscriptionOutput {
3967 s.VocabularyFilterMethod = &v
3968 return s
3969 }
3970
3971 // SetVocabularyFilterName sets the VocabularyFilterName field's value.
3972 func (s *StartCallAnalyticsStreamTranscriptionOutput) SetVocabularyFilterName(v string) *StartCallAnalyticsStreamTranscriptionOutput {
3973 s.VocabularyFilterName = &v
3974 return s
3975 }
3976
3977 // SetVocabularyName sets the VocabularyName field's value.
3978 func (s *StartCallAnalyticsStreamTranscriptionOutput) SetVocabularyName(v string) *StartCallAnalyticsStreamTranscriptionOutput {
3979 s.VocabularyName = &v
3980 return s
3981 }
3982
3983 // GetStream returns the type to interact with the event stream.
3984 func (s *StartCallAnalyticsStreamTranscriptionOutput) GetStream() *StartCallAnalyticsStreamTranscriptionEventStream {
3985 return s.eventStream
3986 }
3987
3988 type StartMedicalStreamTranscriptionInput struct {
3989 _ struct{} `type:"structure" payload:"AudioStream"`
3990
3991 // Labels all personal health information (PHI) identified in your transcript.
3992 //
3993 // Content identification is performed at the segment level; PHI is flagged
3994 // upon complete transcription of an audio segment.
3995 //
3996 // For more information, see Identifying personal health information (PHI) in
3997 // a transcription (https://docs.aws.amazon.com/transcribe/latest/dg/phi-id.html).
3998 ContentIdentificationType *string `location:"header" locationName:"x-amzn-transcribe-content-identification-type" type:"string" enum:"MedicalContentIdentificationType"`
3999
4000 // Enables channel identification in multi-channel audio.
4001 //
4002 // Channel identification transcribes the audio on each channel independently,
4003 // then appends the output for each channel into one transcript.
4004 //
4005 // If you have multi-channel audio and do not enable channel identification,
4006 // your audio is transcribed in a continuous manner and your transcript is not
4007 // separated by channel.
4008 //
4009 // For more information, see Transcribing multi-channel audio (https://docs.aws.amazon.com/transcribe/latest/dg/channel-id.html).
4010 EnableChannelIdentification *bool `location:"header" locationName:"x-amzn-transcribe-enable-channel-identification" type:"boolean"`
4011
4012 // Specify the language code that represents the language spoken in your audio.
4013 //
4014 // Amazon Transcribe Medical only supports US English (en-US).
4015 //
4016 // LanguageCode is a required field
4017 LanguageCode *string `location:"header" locationName:"x-amzn-transcribe-language-code" type:"string" required:"true" enum:"LanguageCode"`
4018
4019 // Specify the encoding used for the input audio. Supported formats are:
4020 //
4021 // * FLAC
4022 //
4023 // * OPUS-encoded audio in an Ogg container
4024 //
4025 // * PCM (only signed 16-bit little-endian audio formats, which does not
4026 // include WAV)
4027 //
4028 // For more information, see Media formats (https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio).
4029 //
4030 // MediaEncoding is a required field
4031 MediaEncoding *string `location:"header" locationName:"x-amzn-transcribe-media-encoding" type:"string" required:"true" enum:"MediaEncoding"`
4032
4033 // The sample rate of the input audio (in hertz). Amazon Transcribe Medical
4034 // supports a range from 16,000 Hz to 48,000 Hz. Note that the sample rate you
4035 // specify must match that of your audio.
4036 //
4037 // MediaSampleRateHertz is a required field
4038 MediaSampleRateHertz *int64 `location:"header" locationName:"x-amzn-transcribe-sample-rate" min:"8000" type:"integer" required:"true"`
4039
4040 // Specify the number of channels in your audio stream. Up to two channels are
4041 // supported.
4042 NumberOfChannels *int64 `location:"header" locationName:"x-amzn-transcribe-number-of-channels" min:"2" type:"integer"`
4043
4044 // Specify a name for your transcription session. If you don't include this
4045 // parameter in your request, Amazon Transcribe Medical generates an ID and
4046 // returns it in the response.
4047 //
4048 // You can use a session ID to retry a streaming session.
4049 SessionId *string `location:"header" locationName:"x-amzn-transcribe-session-id" min:"36" type:"string"`
4050
4051 // Enables speaker partitioning (diarization) in your transcription output.
4052 // Speaker partitioning labels the speech from individual speakers in your media
4053 // file.
4054 //
4055 // For more information, see Partitioning speakers (diarization) (https://docs.aws.amazon.com/transcribe/latest/dg/diarization.html).
4056 ShowSpeakerLabel *bool `location:"header" locationName:"x-amzn-transcribe-show-speaker-label" type:"boolean"`
4057
4058 // Specify the medical specialty contained in your audio.
4059 //
4060 // Specialty is a required field
4061 Specialty *string `location:"header" locationName:"x-amzn-transcribe-specialty" type:"string" required:"true" enum:"Specialty"`
4062
4063 // Specify the type of input audio. For example, choose DICTATION for a provider
4064 // dictating patient notes and CONVERSATION for a dialogue between a patient
4065 // and a medical professional.
4066 //
4067 // Type is a required field
4068 Type *string `location:"header" locationName:"x-amzn-transcribe-type" type:"string" required:"true" enum:"Type"`
4069
4070 // Specify the name of the custom vocabulary that you want to use when processing
4071 // your transcription. Note that vocabulary names are case sensitive.
4072 VocabularyName *string `location:"header" locationName:"x-amzn-transcribe-vocabulary-name" min:"1" type:"string"`
4073 }
4074
4075 // String returns the string representation.
4076 //
4077 // API parameter values that are decorated as "sensitive" in the API will not
4078 // be included in the string output. The member name will be present, but the
4079 // value will be replaced with "sensitive".
4080 func (s StartMedicalStreamTranscriptionInput) String() string {
4081 return awsutil.Prettify(s)
4082 }
4083
4084 // GoString returns the string representation.
4085 //
4086 // API parameter values that are decorated as "sensitive" in the API will not
4087 // be included in the string output. The member name will be present, but the
4088 // value will be replaced with "sensitive".
4089 func (s StartMedicalStreamTranscriptionInput) GoString() string {
4090 return s.String()
4091 }
4092
4093 // Validate inspects the fields of the type to determine if they are valid.
4094 func (s *StartMedicalStreamTranscriptionInput) Validate() error {
4095 invalidParams := request.ErrInvalidParams{Context: "StartMedicalStreamTranscriptionInput"}
4096 if s.LanguageCode == nil {
4097 invalidParams.Add(request.NewErrParamRequired("LanguageCode"))
4098 }
4099 if s.MediaEncoding == nil {
4100 invalidParams.Add(request.NewErrParamRequired("MediaEncoding"))
4101 }
4102 if s.MediaSampleRateHertz == nil {
4103 invalidParams.Add(request.NewErrParamRequired("MediaSampleRateHertz"))
4104 }
4105 if s.MediaSampleRateHertz != nil && *s.MediaSampleRateHertz < 8000 {
4106 invalidParams.Add(request.NewErrParamMinValue("MediaSampleRateHertz", 8000))
4107 }
4108 if s.NumberOfChannels != nil && *s.NumberOfChannels < 2 {
4109 invalidParams.Add(request.NewErrParamMinValue("NumberOfChannels", 2))
4110 }
4111 if s.SessionId != nil && len(*s.SessionId) < 36 {
4112 invalidParams.Add(request.NewErrParamMinLen("SessionId", 36))
4113 }
4114 if s.Specialty == nil {
4115 invalidParams.Add(request.NewErrParamRequired("Specialty"))
4116 }
4117 if s.Type == nil {
4118 invalidParams.Add(request.NewErrParamRequired("Type"))
4119 }
4120 if s.VocabularyName != nil && len(*s.VocabularyName) < 1 {
4121 invalidParams.Add(request.NewErrParamMinLen("VocabularyName", 1))
4122 }
4123
4124 if invalidParams.Len() > 0 {
4125 return invalidParams
4126 }
4127 return nil
4128 }
4129
4130 // SetContentIdentificationType sets the ContentIdentificationType field's value.
4131 func (s *StartMedicalStreamTranscriptionInput) SetContentIdentificationType(v string) *StartMedicalStreamTranscriptionInput {
4132 s.ContentIdentificationType = &v
4133 return s
4134 }
4135
4136 // SetEnableChannelIdentification sets the EnableChannelIdentification field's value.
4137 func (s *StartMedicalStreamTranscriptionInput) SetEnableChannelIdentification(v bool) *StartMedicalStreamTranscriptionInput {
4138 s.EnableChannelIdentification = &v
4139 return s
4140 }
4141
4142 // SetLanguageCode sets the LanguageCode field's value.
4143 func (s *StartMedicalStreamTranscriptionInput) SetLanguageCode(v string) *StartMedicalStreamTranscriptionInput {
4144 s.LanguageCode = &v
4145 return s
4146 }
4147
4148 // SetMediaEncoding sets the MediaEncoding field's value.
4149 func (s *StartMedicalStreamTranscriptionInput) SetMediaEncoding(v string) *StartMedicalStreamTranscriptionInput {
4150 s.MediaEncoding = &v
4151 return s
4152 }
4153
4154 // SetMediaSampleRateHertz sets the MediaSampleRateHertz field's value.
4155 func (s *StartMedicalStreamTranscriptionInput) SetMediaSampleRateHertz(v int64) *StartMedicalStreamTranscriptionInput {
4156 s.MediaSampleRateHertz = &v
4157 return s
4158 }
4159
4160 // SetNumberOfChannels sets the NumberOfChannels field's value.
4161 func (s *StartMedicalStreamTranscriptionInput) SetNumberOfChannels(v int64) *StartMedicalStreamTranscriptionInput {
4162 s.NumberOfChannels = &v
4163 return s
4164 }
4165
4166 // SetSessionId sets the SessionId field's value.
4167 func (s *StartMedicalStreamTranscriptionInput) SetSessionId(v string) *StartMedicalStreamTranscriptionInput {
4168 s.SessionId = &v
4169 return s
4170 }
4171
4172 // SetShowSpeakerLabel sets the ShowSpeakerLabel field's value.
4173 func (s *StartMedicalStreamTranscriptionInput) SetShowSpeakerLabel(v bool) *StartMedicalStreamTranscriptionInput {
4174 s.ShowSpeakerLabel = &v
4175 return s
4176 }
4177
4178 // SetSpecialty sets the Specialty field's value.
4179 func (s *StartMedicalStreamTranscriptionInput) SetSpecialty(v string) *StartMedicalStreamTranscriptionInput {
4180 s.Specialty = &v
4181 return s
4182 }
4183
4184 // SetType sets the Type field's value.
4185 func (s *StartMedicalStreamTranscriptionInput) SetType(v string) *StartMedicalStreamTranscriptionInput {
4186 s.Type = &v
4187 return s
4188 }
4189
4190 // SetVocabularyName sets the VocabularyName field's value.
4191 func (s *StartMedicalStreamTranscriptionInput) SetVocabularyName(v string) *StartMedicalStreamTranscriptionInput {
4192 s.VocabularyName = &v
4193 return s
4194 }
4195
4196 type StartMedicalStreamTranscriptionOutput struct {
4197 _ struct{} `type:"structure" payload:"TranscriptResultStream"`
4198
4199 eventStream *StartMedicalStreamTranscriptionEventStream
4200
4201 // Shows whether content identification was enabled for your transcription.
4202 ContentIdentificationType *string `location:"header" locationName:"x-amzn-transcribe-content-identification-type" type:"string" enum:"MedicalContentIdentificationType"`
4203
4204 // Shows whether channel identification was enabled for your transcription.
4205 EnableChannelIdentification *bool `location:"header" locationName:"x-amzn-transcribe-enable-channel-identification" type:"boolean"`
4206
4207 // Provides the language code that you specified in your request. This must
4208 // be en-US.
4209 LanguageCode *string `location:"header" locationName:"x-amzn-transcribe-language-code" type:"string" enum:"LanguageCode"`
4210
4211 // Provides the media encoding you specified in your request.
4212 MediaEncoding *string `location:"header" locationName:"x-amzn-transcribe-media-encoding" type:"string" enum:"MediaEncoding"`
4213
4214 // Provides the sample rate that you specified in your request.
4215 MediaSampleRateHertz *int64 `location:"header" locationName:"x-amzn-transcribe-sample-rate" min:"8000" type:"integer"`
4216
4217 // Provides the number of channels that you specified in your request.
4218 NumberOfChannels *int64 `location:"header" locationName:"x-amzn-transcribe-number-of-channels" min:"2" type:"integer"`
4219
4220 // Provides the identifier for your streaming request.
4221 RequestId *string `location:"header" locationName:"x-amzn-request-id" type:"string"`
4222
4223 // Provides the identifier for your transcription session.
4224 SessionId *string `location:"header" locationName:"x-amzn-transcribe-session-id" min:"36" type:"string"`
4225
4226 // Shows whether speaker partitioning was enabled for your transcription.
4227 ShowSpeakerLabel *bool `location:"header" locationName:"x-amzn-transcribe-show-speaker-label" type:"boolean"`
4228
4229 // Provides the medical specialty that you specified in your request.
4230 Specialty *string `location:"header" locationName:"x-amzn-transcribe-specialty" type:"string" enum:"Specialty"`
4231
4232 // Provides the type of audio you specified in your request.
4233 Type *string `location:"header" locationName:"x-amzn-transcribe-type" type:"string" enum:"Type"`
4234
4235 // Provides the name of the custom vocabulary that you specified in your request.
4236 VocabularyName *string `location:"header" locationName:"x-amzn-transcribe-vocabulary-name" min:"1" type:"string"`
4237 }
4238
4239 // String returns the string representation.
4240 //
4241 // API parameter values that are decorated as "sensitive" in the API will not
4242 // be included in the string output. The member name will be present, but the
4243 // value will be replaced with "sensitive".
4244 func (s StartMedicalStreamTranscriptionOutput) String() string {
4245 return awsutil.Prettify(s)
4246 }
4247
4248 // GoString returns the string representation.
4249 //
4250 // API parameter values that are decorated as "sensitive" in the API will not
4251 // be included in the string output. The member name will be present, but the
4252 // value will be replaced with "sensitive".
4253 func (s StartMedicalStreamTranscriptionOutput) GoString() string {
4254 return s.String()
4255 }
4256
4257 // SetContentIdentificationType sets the ContentIdentificationType field's value.
4258 func (s *StartMedicalStreamTranscriptionOutput) SetContentIdentificationType(v string) *StartMedicalStreamTranscriptionOutput {
4259 s.ContentIdentificationType = &v
4260 return s
4261 }
4262
4263 // SetEnableChannelIdentification sets the EnableChannelIdentification field's value.
4264 func (s *StartMedicalStreamTranscriptionOutput) SetEnableChannelIdentification(v bool) *StartMedicalStreamTranscriptionOutput {
4265 s.EnableChannelIdentification = &v
4266 return s
4267 }
4268
4269 // SetLanguageCode sets the LanguageCode field's value.
4270 func (s *StartMedicalStreamTranscriptionOutput) SetLanguageCode(v string) *StartMedicalStreamTranscriptionOutput {
4271 s.LanguageCode = &v
4272 return s
4273 }
4274
4275 // SetMediaEncoding sets the MediaEncoding field's value.
4276 func (s *StartMedicalStreamTranscriptionOutput) SetMediaEncoding(v string) *StartMedicalStreamTranscriptionOutput {
4277 s.MediaEncoding = &v
4278 return s
4279 }
4280
4281 // SetMediaSampleRateHertz sets the MediaSampleRateHertz field's value.
4282 func (s *StartMedicalStreamTranscriptionOutput) SetMediaSampleRateHertz(v int64) *StartMedicalStreamTranscriptionOutput {
4283 s.MediaSampleRateHertz = &v
4284 return s
4285 }
4286
4287 // SetNumberOfChannels sets the NumberOfChannels field's value.
4288 func (s *StartMedicalStreamTranscriptionOutput) SetNumberOfChannels(v int64) *StartMedicalStreamTranscriptionOutput {
4289 s.NumberOfChannels = &v
4290 return s
4291 }
4292
4293 // SetRequestId sets the RequestId field's value.
4294 func (s *StartMedicalStreamTranscriptionOutput) SetRequestId(v string) *StartMedicalStreamTranscriptionOutput {
4295 s.RequestId = &v
4296 return s
4297 }
4298
4299 // SetSessionId sets the SessionId field's value.
4300 func (s *StartMedicalStreamTranscriptionOutput) SetSessionId(v string) *StartMedicalStreamTranscriptionOutput {
4301 s.SessionId = &v
4302 return s
4303 }
4304
4305 // SetShowSpeakerLabel sets the ShowSpeakerLabel field's value.
4306 func (s *StartMedicalStreamTranscriptionOutput) SetShowSpeakerLabel(v bool) *StartMedicalStreamTranscriptionOutput {
4307 s.ShowSpeakerLabel = &v
4308 return s
4309 }
4310
4311 // SetSpecialty sets the Specialty field's value.
4312 func (s *StartMedicalStreamTranscriptionOutput) SetSpecialty(v string) *StartMedicalStreamTranscriptionOutput {
4313 s.Specialty = &v
4314 return s
4315 }
4316
4317 // SetType sets the Type field's value.
4318 func (s *StartMedicalStreamTranscriptionOutput) SetType(v string) *StartMedicalStreamTranscriptionOutput {
4319 s.Type = &v
4320 return s
4321 }
4322
4323 // SetVocabularyName sets the VocabularyName field's value.
4324 func (s *StartMedicalStreamTranscriptionOutput) SetVocabularyName(v string) *StartMedicalStreamTranscriptionOutput {
4325 s.VocabularyName = &v
4326 return s
4327 }
4328
4329 // GetStream returns the type to interact with the event stream.
4330 func (s *StartMedicalStreamTranscriptionOutput) GetStream() *StartMedicalStreamTranscriptionEventStream {
4331 return s.eventStream
4332 }
4333
4334 type StartStreamTranscriptionInput struct {
4335 _ struct{} `type:"structure" payload:"AudioStream"`
4336
4337 // Labels all personally identifiable information (PII) identified in your transcript.
4338 //
4339 // Content identification is performed at the segment level; PII specified in
4340 // PiiEntityTypes is flagged upon complete transcription of an audio segment.
4341 //
4342 // You can’t set ContentIdentificationType and ContentRedactionType in the
4343 // same request. If you set both, your request returns a BadRequestException.
4344 //
4345 // For more information, see Redacting or identifying personally identifiable
4346 // information (https://docs.aws.amazon.com/transcribe/latest/dg/pii-redaction.html).
4347 ContentIdentificationType *string `location:"header" locationName:"x-amzn-transcribe-content-identification-type" type:"string" enum:"ContentIdentificationType"`
4348
4349 // Redacts all personally identifiable information (PII) identified in your
4350 // transcript.
4351 //
4352 // Content redaction is performed at the segment level; PII specified in PiiEntityTypes
4353 // is redacted upon complete transcription of an audio segment.
4354 //
4355 // You can’t set ContentRedactionType and ContentIdentificationType in the
4356 // same request. If you set both, your request returns a BadRequestException.
4357 //
4358 // For more information, see Redacting or identifying personally identifiable
4359 // information (https://docs.aws.amazon.com/transcribe/latest/dg/pii-redaction.html).
4360 ContentRedactionType *string `location:"header" locationName:"x-amzn-transcribe-content-redaction-type" type:"string" enum:"ContentRedactionType"`
4361
4362 // Enables channel identification in multi-channel audio.
4363 //
4364 // Channel identification transcribes the audio on each channel independently,
4365 // then appends the output for each channel into one transcript.
4366 //
4367 // If you have multi-channel audio and do not enable channel identification,
4368 // your audio is transcribed in a continuous manner and your transcript is not
4369 // separated by channel.
4370 //
4371 // For more information, see Transcribing multi-channel audio (https://docs.aws.amazon.com/transcribe/latest/dg/channel-id.html).
4372 EnableChannelIdentification *bool `location:"header" locationName:"x-amzn-transcribe-enable-channel-identification" type:"boolean"`
4373
4374 // Enables partial result stabilization for your transcription. Partial result
4375 // stabilization can reduce latency in your output, but may impact accuracy.
4376 // For more information, see Partial-result stabilization (https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#streaming-partial-result-stabilization).
4377 EnablePartialResultsStabilization *bool `location:"header" locationName:"x-amzn-transcribe-enable-partial-results-stabilization" type:"boolean"`
4378
4379 // Enables automatic language identification for your transcription.
4380 //
4381 // If you include IdentifyLanguage, you can optionally include a list of language
4382 // codes, using LanguageOptions, that you think may be present in your audio
4383 // stream. Including language options can improve transcription accuracy.
4384 //
4385 // You can also include a preferred language using PreferredLanguage. Adding
4386 // a preferred language can help Amazon Transcribe identify the language faster
4387 // than if you omit this parameter.
4388 //
4389 // If you have multi-channel audio that contains different languages on each
4390 // channel, and you've enabled channel identification, automatic language identification
4391 // identifies the dominant language on each audio channel.
4392 //
4393 // Note that you must include either LanguageCode or IdentifyLanguage or IdentifyMultipleLanguages
4394 // in your request. If you include more than one of these parameters, your transcription
4395 // job fails.
4396 //
4397 // Streaming language identification can't be combined with custom language
4398 // models or redaction.
4399 IdentifyLanguage *bool `location:"header" locationName:"x-amzn-transcribe-identify-language" type:"boolean"`
4400
4401 // Enables automatic multi-language identification in your transcription job
4402 // request. Use this parameter if your stream contains more than one language.
4403 // If your stream contains only one language, use IdentifyLanguage instead.
4404 //
4405 // If you include IdentifyMultipleLanguages, you can optionally include a list
4406 // of language codes, using LanguageOptions, that you think may be present in
4407 // your stream. Including LanguageOptions restricts IdentifyMultipleLanguages
4408 // to only the language options that you specify, which can improve transcription
4409 // accuracy.
4410 //
4411 // If you want to apply a custom vocabulary or a custom vocabulary filter to
4412 // your automatic multiple language identification request, include VocabularyNames
4413 // or VocabularyFilterNames.
4414 //
4415 // Note that you must include one of LanguageCode, IdentifyLanguage, or IdentifyMultipleLanguages
4416 // in your request. If you include more than one of these parameters, your transcription
4417 // job fails.
4418 IdentifyMultipleLanguages *bool `location:"header" locationName:"x-amzn-transcribe-identify-multiple-languages" type:"boolean"`
4419
4420 // Specify the language code that represents the language spoken in your audio.
4421 //
4422 // If you're unsure of the language spoken in your audio, consider using IdentifyLanguage
4423 // to enable automatic language identification.
4424 //
4425 // For a list of languages supported with Amazon Transcribe streaming, refer
4426 // to the Supported languages (https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html)
4427 // table.
4428 LanguageCode *string `location:"header" locationName:"x-amzn-transcribe-language-code" type:"string" enum:"LanguageCode"`
4429
4430 // Specify the name of the custom language model that you want to use when processing
4431 // your transcription. Note that language model names are case sensitive.
4432 //
4433 // The language of the specified language model must match the language code
4434 // you specify in your transcription request. If the languages don't match,
4435 // the custom language model isn't applied. There are no errors or warnings
4436 // associated with a language mismatch.
4437 //
4438 // For more information, see Custom language models (https://docs.aws.amazon.com/transcribe/latest/dg/custom-language-models.html).
4439 LanguageModelName *string `location:"header" locationName:"x-amzn-transcribe-language-model-name" min:"1" type:"string"`
4440
4441 // Specify two or more language codes that represent the languages you think
4442 // may be present in your media; including more than five is not recommended.
4443 // If you're unsure what languages are present, do not include this parameter.
4444 //
4445 // Including language options can improve the accuracy of language identification.
4446 //
4447 // If you include LanguageOptions in your request, you must also include IdentifyLanguage.
4448 //
4449 // For a list of languages supported with Amazon Transcribe streaming, refer
4450 // to the Supported languages (https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html)
4451 // table.
4452 //
4453 // You can only include one language dialect per language per stream. For example,
4454 // you cannot include en-US and en-AU in the same request.
4455 LanguageOptions *string `location:"header" locationName:"x-amzn-transcribe-language-options" min:"1" type:"string"`
4456
4457 // Specify the encoding of your input audio. Supported formats are:
4458 //
4459 // * FLAC
4460 //
4461 // * OPUS-encoded audio in an Ogg container
4462 //
4463 // * PCM (only signed 16-bit little-endian audio formats, which does not
4464 // include WAV)
4465 //
4466 // For more information, see Media formats (https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio).
4467 //
4468 // MediaEncoding is a required field
4469 MediaEncoding *string `location:"header" locationName:"x-amzn-transcribe-media-encoding" type:"string" required:"true" enum:"MediaEncoding"`
4470
4471 // The sample rate of the input audio (in hertz). Low-quality audio, such as
4472 // telephone audio, is typically around 8,000 Hz. High-quality audio typically
4473 // ranges from 16,000 Hz to 48,000 Hz. Note that the sample rate you specify
4474 // must match that of your audio.
4475 //
4476 // MediaSampleRateHertz is a required field
4477 MediaSampleRateHertz *int64 `location:"header" locationName:"x-amzn-transcribe-sample-rate" min:"8000" type:"integer" required:"true"`
4478
4479 // Specify the number of channels in your audio stream. Up to two channels are
4480 // supported.
4481 NumberOfChannels *int64 `location:"header" locationName:"x-amzn-transcribe-number-of-channels" min:"2" type:"integer"`
4482
4483 // Specify the level of stability to use when you enable partial results stabilization
4484 // (EnablePartialResultsStabilization).
4485 //
4486 // Low stability provides the highest accuracy. High stability transcribes faster,
4487 // but with slightly lower accuracy.
4488 //
4489 // For more information, see Partial-result stabilization (https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#streaming-partial-result-stabilization).
4490 PartialResultsStability *string `location:"header" locationName:"x-amzn-transcribe-partial-results-stability" type:"string" enum:"PartialResultsStability"`
4491
4492 // Specify which types of personally identifiable information (PII) you want
4493 // to redact in your transcript. You can include as many types as you'd like,
4494 // or you can select ALL.
4495 //
4496 // To include PiiEntityTypes in your request, you must also include either ContentIdentificationType
4497 // or ContentRedactionType.
4498 //
4499 // Values must be comma-separated and can include: BANK_ACCOUNT_NUMBER, BANK_ROUTING,
4500 // CREDIT_DEBIT_NUMBER, CREDIT_DEBIT_CVV, CREDIT_DEBIT_EXPIRY, PIN, EMAIL, ADDRESS,
4501 // NAME, PHONE, SSN, or ALL.
4502 PiiEntityTypes *string `location:"header" locationName:"x-amzn-transcribe-pii-entity-types" min:"1" type:"string"`
4503
4504 // Specify a preferred language from the subset of languages codes you specified
4505 // in LanguageOptions.
4506 //
4507 // You can only use this parameter if you've included IdentifyLanguage and LanguageOptions
4508 // in your request.
4509 PreferredLanguage *string `location:"header" locationName:"x-amzn-transcribe-preferred-language" type:"string" enum:"LanguageCode"`
4510
4511 // Specify a name for your transcription session. If you don't include this
4512 // parameter in your request, Amazon Transcribe generates an ID and returns
4513 // it in the response.
4514 //
4515 // You can use a session ID to retry a streaming session.
4516 SessionId *string `location:"header" locationName:"x-amzn-transcribe-session-id" min:"36" type:"string"`
4517
4518 // Enables speaker partitioning (diarization) in your transcription output.
4519 // Speaker partitioning labels the speech from individual speakers in your media
4520 // file.
4521 //
4522 // For more information, see Partitioning speakers (diarization) (https://docs.aws.amazon.com/transcribe/latest/dg/diarization.html).
4523 ShowSpeakerLabel *bool `location:"header" locationName:"x-amzn-transcribe-show-speaker-label" type:"boolean"`
4524
4525 // Specify how you want your vocabulary filter applied to your transcript.
4526 //
4527 // To replace words with ***, choose mask.
4528 //
4529 // To delete words, choose remove.
4530 //
4531 // To flag words without changing them, choose tag.
4532 VocabularyFilterMethod *string `location:"header" locationName:"x-amzn-transcribe-vocabulary-filter-method" type:"string" enum:"VocabularyFilterMethod"`
4533
4534 // Specify the name of the custom vocabulary filter that you want to use when
4535 // processing your transcription. Note that vocabulary filter names are case
4536 // sensitive.
4537 //
4538 // If the language of the specified custom vocabulary filter doesn't match the
4539 // language identified in your media, the vocabulary filter is not applied to
4540 // your transcription.
4541 //
4542 // This parameter is not intended for use with the IdentifyLanguage parameter.
4543 // If you're including IdentifyLanguage in your request and want to use one
4544 // or more vocabulary filters with your transcription, use the VocabularyFilterNames
4545 // parameter instead.
4546 //
4547 // For more information, see Using vocabulary filtering with unwanted words
4548 // (https://docs.aws.amazon.com/transcribe/latest/dg/vocabulary-filtering.html).
4549 VocabularyFilterName *string `location:"header" locationName:"x-amzn-transcribe-vocabulary-filter-name" min:"1" type:"string"`
4550
4551 // Specify the names of the custom vocabulary filters that you want to use when
4552 // processing your transcription. Note that vocabulary filter names are case
4553 // sensitive.
4554 //
4555 // If none of the languages of the specified custom vocabulary filters match
4556 // the language identified in your media, your job fails.
4557 //
4558 // This parameter is only intended for use with the IdentifyLanguage parameter.
4559 // If you're not including IdentifyLanguage in your request and want to use
4560 // a custom vocabulary filter with your transcription, use the VocabularyFilterName
4561 // parameter instead.
4562 //
4563 // For more information, see Using vocabulary filtering with unwanted words
4564 // (https://docs.aws.amazon.com/transcribe/latest/dg/vocabulary-filtering.html).
4565 VocabularyFilterNames *string `location:"header" locationName:"x-amzn-transcribe-vocabulary-filter-names" min:"1" type:"string"`
4566
4567 // Specify the name of the custom vocabulary that you want to use when processing
4568 // your transcription. Note that vocabulary names are case sensitive.
4569 //
4570 // If the language of the specified custom vocabulary doesn't match the language
4571 // identified in your media, the custom vocabulary is not applied to your transcription.
4572 //
4573 // This parameter is not intended for use with the IdentifyLanguage parameter.
4574 // If you're including IdentifyLanguage in your request and want to use one
4575 // or more custom vocabularies with your transcription, use the VocabularyNames
4576 // parameter instead.
4577 //
4578 // For more information, see Custom vocabularies (https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html).
4579 VocabularyName *string `location:"header" locationName:"x-amzn-transcribe-vocabulary-name" min:"1" type:"string"`
4580
4581 // Specify the names of the custom vocabularies that you want to use when processing
4582 // your transcription. Note that vocabulary names are case sensitive.
4583 //
4584 // If none of the languages of the specified custom vocabularies match the language
4585 // identified in your media, your job fails.
4586 //
4587 // This parameter is only intended for use with the IdentifyLanguage parameter.
4588 // If you're not including IdentifyLanguage in your request and want to use
4589 // a custom vocabulary with your transcription, use the VocabularyName parameter
4590 // instead.
4591 //
4592 // For more information, see Custom vocabularies (https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html).
4593 VocabularyNames *string `location:"header" locationName:"x-amzn-transcribe-vocabulary-names" min:"1" type:"string"`
4594 }
4595
4596 // String returns the string representation.
4597 //
4598 // API parameter values that are decorated as "sensitive" in the API will not
4599 // be included in the string output. The member name will be present, but the
4600 // value will be replaced with "sensitive".
4601 func (s StartStreamTranscriptionInput) String() string {
4602 return awsutil.Prettify(s)
4603 }
4604
4605 // GoString returns the string representation.
4606 //
4607 // API parameter values that are decorated as "sensitive" in the API will not
4608 // be included in the string output. The member name will be present, but the
4609 // value will be replaced with "sensitive".
4610 func (s StartStreamTranscriptionInput) GoString() string {
4611 return s.String()
4612 }
4613
4614 // Validate inspects the fields of the type to determine if they are valid.
4615 func (s *StartStreamTranscriptionInput) Validate() error {
4616 invalidParams := request.ErrInvalidParams{Context: "StartStreamTranscriptionInput"}
4617 if s.LanguageModelName != nil && len(*s.LanguageModelName) < 1 {
4618 invalidParams.Add(request.NewErrParamMinLen("LanguageModelName", 1))
4619 }
4620 if s.LanguageOptions != nil && len(*s.LanguageOptions) < 1 {
4621 invalidParams.Add(request.NewErrParamMinLen("LanguageOptions", 1))
4622 }
4623 if s.MediaEncoding == nil {
4624 invalidParams.Add(request.NewErrParamRequired("MediaEncoding"))
4625 }
4626 if s.MediaSampleRateHertz == nil {
4627 invalidParams.Add(request.NewErrParamRequired("MediaSampleRateHertz"))
4628 }
4629 if s.MediaSampleRateHertz != nil && *s.MediaSampleRateHertz < 8000 {
4630 invalidParams.Add(request.NewErrParamMinValue("MediaSampleRateHertz", 8000))
4631 }
4632 if s.NumberOfChannels != nil && *s.NumberOfChannels < 2 {
4633 invalidParams.Add(request.NewErrParamMinValue("NumberOfChannels", 2))
4634 }
4635 if s.PiiEntityTypes != nil && len(*s.PiiEntityTypes) < 1 {
4636 invalidParams.Add(request.NewErrParamMinLen("PiiEntityTypes", 1))
4637 }
4638 if s.SessionId != nil && len(*s.SessionId) < 36 {
4639 invalidParams.Add(request.NewErrParamMinLen("SessionId", 36))
4640 }
4641 if s.VocabularyFilterName != nil && len(*s.VocabularyFilterName) < 1 {
4642 invalidParams.Add(request.NewErrParamMinLen("VocabularyFilterName", 1))
4643 }
4644 if s.VocabularyFilterNames != nil && len(*s.VocabularyFilterNames) < 1 {
4645 invalidParams.Add(request.NewErrParamMinLen("VocabularyFilterNames", 1))
4646 }
4647 if s.VocabularyName != nil && len(*s.VocabularyName) < 1 {
4648 invalidParams.Add(request.NewErrParamMinLen("VocabularyName", 1))
4649 }
4650 if s.VocabularyNames != nil && len(*s.VocabularyNames) < 1 {
4651 invalidParams.Add(request.NewErrParamMinLen("VocabularyNames", 1))
4652 }
4653
4654 if invalidParams.Len() > 0 {
4655 return invalidParams
4656 }
4657 return nil
4658 }
4659
4660 // SetContentIdentificationType sets the ContentIdentificationType field's value.
4661 func (s *StartStreamTranscriptionInput) SetContentIdentificationType(v string) *StartStreamTranscriptionInput {
4662 s.ContentIdentificationType = &v
4663 return s
4664 }
4665
4666 // SetContentRedactionType sets the ContentRedactionType field's value.
4667 func (s *StartStreamTranscriptionInput) SetContentRedactionType(v string) *StartStreamTranscriptionInput {
4668 s.ContentRedactionType = &v
4669 return s
4670 }
4671
4672 // SetEnableChannelIdentification sets the EnableChannelIdentification field's value.
4673 func (s *StartStreamTranscriptionInput) SetEnableChannelIdentification(v bool) *StartStreamTranscriptionInput {
4674 s.EnableChannelIdentification = &v
4675 return s
4676 }
4677
4678 // SetEnablePartialResultsStabilization sets the EnablePartialResultsStabilization field's value.
4679 func (s *StartStreamTranscriptionInput) SetEnablePartialResultsStabilization(v bool) *StartStreamTranscriptionInput {
4680 s.EnablePartialResultsStabilization = &v
4681 return s
4682 }
4683
4684 // SetIdentifyLanguage sets the IdentifyLanguage field's value.
4685 func (s *StartStreamTranscriptionInput) SetIdentifyLanguage(v bool) *StartStreamTranscriptionInput {
4686 s.IdentifyLanguage = &v
4687 return s
4688 }
4689
4690 // SetIdentifyMultipleLanguages sets the IdentifyMultipleLanguages field's value.
4691 func (s *StartStreamTranscriptionInput) SetIdentifyMultipleLanguages(v bool) *StartStreamTranscriptionInput {
4692 s.IdentifyMultipleLanguages = &v
4693 return s
4694 }
4695
4696 // SetLanguageCode sets the LanguageCode field's value.
4697 func (s *StartStreamTranscriptionInput) SetLanguageCode(v string) *StartStreamTranscriptionInput {
4698 s.LanguageCode = &v
4699 return s
4700 }
4701
4702 // SetLanguageModelName sets the LanguageModelName field's value.
4703 func (s *StartStreamTranscriptionInput) SetLanguageModelName(v string) *StartStreamTranscriptionInput {
4704 s.LanguageModelName = &v
4705 return s
4706 }
4707
4708 // SetLanguageOptions sets the LanguageOptions field's value.
4709 func (s *StartStreamTranscriptionInput) SetLanguageOptions(v string) *StartStreamTranscriptionInput {
4710 s.LanguageOptions = &v
4711 return s
4712 }
4713
4714 // SetMediaEncoding sets the MediaEncoding field's value.
4715 func (s *StartStreamTranscriptionInput) SetMediaEncoding(v string) *StartStreamTranscriptionInput {
4716 s.MediaEncoding = &v
4717 return s
4718 }
4719
4720 // SetMediaSampleRateHertz sets the MediaSampleRateHertz field's value.
4721 func (s *StartStreamTranscriptionInput) SetMediaSampleRateHertz(v int64) *StartStreamTranscriptionInput {
4722 s.MediaSampleRateHertz = &v
4723 return s
4724 }
4725
4726 // SetNumberOfChannels sets the NumberOfChannels field's value.
4727 func (s *StartStreamTranscriptionInput) SetNumberOfChannels(v int64) *StartStreamTranscriptionInput {
4728 s.NumberOfChannels = &v
4729 return s
4730 }
4731
4732 // SetPartialResultsStability sets the PartialResultsStability field's value.
4733 func (s *StartStreamTranscriptionInput) SetPartialResultsStability(v string) *StartStreamTranscriptionInput {
4734 s.PartialResultsStability = &v
4735 return s
4736 }
4737
4738 // SetPiiEntityTypes sets the PiiEntityTypes field's value.
4739 func (s *StartStreamTranscriptionInput) SetPiiEntityTypes(v string) *StartStreamTranscriptionInput {
4740 s.PiiEntityTypes = &v
4741 return s
4742 }
4743
4744 // SetPreferredLanguage sets the PreferredLanguage field's value.
4745 func (s *StartStreamTranscriptionInput) SetPreferredLanguage(v string) *StartStreamTranscriptionInput {
4746 s.PreferredLanguage = &v
4747 return s
4748 }
4749
4750 // SetSessionId sets the SessionId field's value.
4751 func (s *StartStreamTranscriptionInput) SetSessionId(v string) *StartStreamTranscriptionInput {
4752 s.SessionId = &v
4753 return s
4754 }
4755
4756 // SetShowSpeakerLabel sets the ShowSpeakerLabel field's value.
4757 func (s *StartStreamTranscriptionInput) SetShowSpeakerLabel(v bool) *StartStreamTranscriptionInput {
4758 s.ShowSpeakerLabel = &v
4759 return s
4760 }
4761
4762 // SetVocabularyFilterMethod sets the VocabularyFilterMethod field's value.
4763 func (s *StartStreamTranscriptionInput) SetVocabularyFilterMethod(v string) *StartStreamTranscriptionInput {
4764 s.VocabularyFilterMethod = &v
4765 return s
4766 }
4767
4768 // SetVocabularyFilterName sets the VocabularyFilterName field's value.
4769 func (s *StartStreamTranscriptionInput) SetVocabularyFilterName(v string) *StartStreamTranscriptionInput {
4770 s.VocabularyFilterName = &v
4771 return s
4772 }
4773
4774 // SetVocabularyFilterNames sets the VocabularyFilterNames field's value.
4775 func (s *StartStreamTranscriptionInput) SetVocabularyFilterNames(v string) *StartStreamTranscriptionInput {
4776 s.VocabularyFilterNames = &v
4777 return s
4778 }
4779
4780 // SetVocabularyName sets the VocabularyName field's value.
4781 func (s *StartStreamTranscriptionInput) SetVocabularyName(v string) *StartStreamTranscriptionInput {
4782 s.VocabularyName = &v
4783 return s
4784 }
4785
4786 // SetVocabularyNames sets the VocabularyNames field's value.
4787 func (s *StartStreamTranscriptionInput) SetVocabularyNames(v string) *StartStreamTranscriptionInput {
4788 s.VocabularyNames = &v
4789 return s
4790 }
4791
4792 type StartStreamTranscriptionOutput struct {
4793 _ struct{} `type:"structure" payload:"TranscriptResultStream"`
4794
4795 eventStream *StartStreamTranscriptionEventStream
4796
4797 // Shows whether content identification was enabled for your transcription.
4798 ContentIdentificationType *string `location:"header" locationName:"x-amzn-transcribe-content-identification-type" type:"string" enum:"ContentIdentificationType"`
4799
4800 // Shows whether content redaction was enabled for your transcription.
4801 ContentRedactionType *string `location:"header" locationName:"x-amzn-transcribe-content-redaction-type" type:"string" enum:"ContentRedactionType"`
4802
4803 // Shows whether channel identification was enabled for your transcription.
4804 EnableChannelIdentification *bool `location:"header" locationName:"x-amzn-transcribe-enable-channel-identification" type:"boolean"`
4805
4806 // Shows whether partial results stabilization was enabled for your transcription.
4807 EnablePartialResultsStabilization *bool `location:"header" locationName:"x-amzn-transcribe-enable-partial-results-stabilization" type:"boolean"`
4808
4809 // Shows whether automatic language identification was enabled for your transcription.
4810 IdentifyLanguage *bool `location:"header" locationName:"x-amzn-transcribe-identify-language" type:"boolean"`
4811
4812 // Shows whether automatic multi-language identification was enabled for your
4813 // transcription.
4814 IdentifyMultipleLanguages *bool `location:"header" locationName:"x-amzn-transcribe-identify-multiple-languages" type:"boolean"`
4815
4816 // Provides the language code that you specified in your request.
4817 LanguageCode *string `location:"header" locationName:"x-amzn-transcribe-language-code" type:"string" enum:"LanguageCode"`
4818
4819 // Provides the name of the custom language model that you specified in your
4820 // request.
4821 LanguageModelName *string `location:"header" locationName:"x-amzn-transcribe-language-model-name" min:"1" type:"string"`
4822
4823 // Provides the language codes that you specified in your request.
4824 LanguageOptions *string `location:"header" locationName:"x-amzn-transcribe-language-options" min:"1" type:"string"`
4825
4826 // Provides the media encoding you specified in your request.
4827 MediaEncoding *string `location:"header" locationName:"x-amzn-transcribe-media-encoding" type:"string" enum:"MediaEncoding"`
4828
4829 // Provides the sample rate that you specified in your request.
4830 MediaSampleRateHertz *int64 `location:"header" locationName:"x-amzn-transcribe-sample-rate" min:"8000" type:"integer"`
4831
4832 // Provides the number of channels that you specified in your request.
4833 NumberOfChannels *int64 `location:"header" locationName:"x-amzn-transcribe-number-of-channels" min:"2" type:"integer"`
4834
4835 // Provides the stabilization level used for your transcription.
4836 PartialResultsStability *string `location:"header" locationName:"x-amzn-transcribe-partial-results-stability" type:"string" enum:"PartialResultsStability"`
4837
4838 // Lists the PII entity types you specified in your request.
4839 PiiEntityTypes *string `location:"header" locationName:"x-amzn-transcribe-pii-entity-types" min:"1" type:"string"`
4840
4841 // Provides the preferred language that you specified in your request.
4842 PreferredLanguage *string `location:"header" locationName:"x-amzn-transcribe-preferred-language" type:"string" enum:"LanguageCode"`
4843
4844 // Provides the identifier for your streaming request.
4845 RequestId *string `location:"header" locationName:"x-amzn-request-id" type:"string"`
4846
4847 // Provides the identifier for your transcription session.
4848 SessionId *string `location:"header" locationName:"x-amzn-transcribe-session-id" min:"36" type:"string"`
4849
4850 // Shows whether speaker partitioning was enabled for your transcription.
4851 ShowSpeakerLabel *bool `location:"header" locationName:"x-amzn-transcribe-show-speaker-label" type:"boolean"`
4852
4853 // Provides the vocabulary filtering method used in your transcription.
4854 VocabularyFilterMethod *string `location:"header" locationName:"x-amzn-transcribe-vocabulary-filter-method" type:"string" enum:"VocabularyFilterMethod"`
4855
4856 // Provides the name of the custom vocabulary filter that you specified in your
4857 // request.
4858 VocabularyFilterName *string `location:"header" locationName:"x-amzn-transcribe-vocabulary-filter-name" min:"1" type:"string"`
4859
4860 // Provides the names of the custom vocabulary filters that you specified in
4861 // your request.
4862 VocabularyFilterNames *string `location:"header" locationName:"x-amzn-transcribe-vocabulary-filter-names" min:"1" type:"string"`
4863
4864 // Provides the name of the custom vocabulary that you specified in your request.
4865 VocabularyName *string `location:"header" locationName:"x-amzn-transcribe-vocabulary-name" min:"1" type:"string"`
4866
4867 // Provides the names of the custom vocabularies that you specified in your
4868 // request.
4869 VocabularyNames *string `location:"header" locationName:"x-amzn-transcribe-vocabulary-names" min:"1" type:"string"`
4870 }
4871
4872 // String returns the string representation.
4873 //
4874 // API parameter values that are decorated as "sensitive" in the API will not
4875 // be included in the string output. The member name will be present, but the
4876 // value will be replaced with "sensitive".
4877 func (s StartStreamTranscriptionOutput) String() string {
4878 return awsutil.Prettify(s)
4879 }
4880
4881 // GoString returns the string representation.
4882 //
4883 // API parameter values that are decorated as "sensitive" in the API will not
4884 // be included in the string output. The member name will be present, but the
4885 // value will be replaced with "sensitive".
4886 func (s StartStreamTranscriptionOutput) GoString() string {
4887 return s.String()
4888 }
4889
4890 // SetContentIdentificationType sets the ContentIdentificationType field's value.
4891 func (s *StartStreamTranscriptionOutput) SetContentIdentificationType(v string) *StartStreamTranscriptionOutput {
4892 s.ContentIdentificationType = &v
4893 return s
4894 }
4895
4896 // SetContentRedactionType sets the ContentRedactionType field's value.
4897 func (s *StartStreamTranscriptionOutput) SetContentRedactionType(v string) *StartStreamTranscriptionOutput {
4898 s.ContentRedactionType = &v
4899 return s
4900 }
4901
4902 // SetEnableChannelIdentification sets the EnableChannelIdentification field's value.
4903 func (s *StartStreamTranscriptionOutput) SetEnableChannelIdentification(v bool) *StartStreamTranscriptionOutput {
4904 s.EnableChannelIdentification = &v
4905 return s
4906 }
4907
4908 // SetEnablePartialResultsStabilization sets the EnablePartialResultsStabilization field's value.
4909 func (s *StartStreamTranscriptionOutput) SetEnablePartialResultsStabilization(v bool) *StartStreamTranscriptionOutput {
4910 s.EnablePartialResultsStabilization = &v
4911 return s
4912 }
4913
4914 // SetIdentifyLanguage sets the IdentifyLanguage field's value.
4915 func (s *StartStreamTranscriptionOutput) SetIdentifyLanguage(v bool) *StartStreamTranscriptionOutput {
4916 s.IdentifyLanguage = &v
4917 return s
4918 }
4919
4920 // SetIdentifyMultipleLanguages sets the IdentifyMultipleLanguages field's value.
4921 func (s *StartStreamTranscriptionOutput) SetIdentifyMultipleLanguages(v bool) *StartStreamTranscriptionOutput {
4922 s.IdentifyMultipleLanguages = &v
4923 return s
4924 }
4925
4926 // SetLanguageCode sets the LanguageCode field's value.
4927 func (s *StartStreamTranscriptionOutput) SetLanguageCode(v string) *StartStreamTranscriptionOutput {
4928 s.LanguageCode = &v
4929 return s
4930 }
4931
4932 // SetLanguageModelName sets the LanguageModelName field's value.
4933 func (s *StartStreamTranscriptionOutput) SetLanguageModelName(v string) *StartStreamTranscriptionOutput {
4934 s.LanguageModelName = &v
4935 return s
4936 }
4937
4938 // SetLanguageOptions sets the LanguageOptions field's value.
4939 func (s *StartStreamTranscriptionOutput) SetLanguageOptions(v string) *StartStreamTranscriptionOutput {
4940 s.LanguageOptions = &v
4941 return s
4942 }
4943
4944 // SetMediaEncoding sets the MediaEncoding field's value.
4945 func (s *StartStreamTranscriptionOutput) SetMediaEncoding(v string) *StartStreamTranscriptionOutput {
4946 s.MediaEncoding = &v
4947 return s
4948 }
4949
4950 // SetMediaSampleRateHertz sets the MediaSampleRateHertz field's value.
4951 func (s *StartStreamTranscriptionOutput) SetMediaSampleRateHertz(v int64) *StartStreamTranscriptionOutput {
4952 s.MediaSampleRateHertz = &v
4953 return s
4954 }
4955
4956 // SetNumberOfChannels sets the NumberOfChannels field's value.
4957 func (s *StartStreamTranscriptionOutput) SetNumberOfChannels(v int64) *StartStreamTranscriptionOutput {
4958 s.NumberOfChannels = &v
4959 return s
4960 }
4961
4962 // SetPartialResultsStability sets the PartialResultsStability field's value.
4963 func (s *StartStreamTranscriptionOutput) SetPartialResultsStability(v string) *StartStreamTranscriptionOutput {
4964 s.PartialResultsStability = &v
4965 return s
4966 }
4967
4968 // SetPiiEntityTypes sets the PiiEntityTypes field's value.
4969 func (s *StartStreamTranscriptionOutput) SetPiiEntityTypes(v string) *StartStreamTranscriptionOutput {
4970 s.PiiEntityTypes = &v
4971 return s
4972 }
4973
4974 // SetPreferredLanguage sets the PreferredLanguage field's value.
4975 func (s *StartStreamTranscriptionOutput) SetPreferredLanguage(v string) *StartStreamTranscriptionOutput {
4976 s.PreferredLanguage = &v
4977 return s
4978 }
4979
4980 // SetRequestId sets the RequestId field's value.
4981 func (s *StartStreamTranscriptionOutput) SetRequestId(v string) *StartStreamTranscriptionOutput {
4982 s.RequestId = &v
4983 return s
4984 }
4985
4986 // SetSessionId sets the SessionId field's value.
4987 func (s *StartStreamTranscriptionOutput) SetSessionId(v string) *StartStreamTranscriptionOutput {
4988 s.SessionId = &v
4989 return s
4990 }
4991
4992 // SetShowSpeakerLabel sets the ShowSpeakerLabel field's value.
4993 func (s *StartStreamTranscriptionOutput) SetShowSpeakerLabel(v bool) *StartStreamTranscriptionOutput {
4994 s.ShowSpeakerLabel = &v
4995 return s
4996 }
4997
4998 // SetVocabularyFilterMethod sets the VocabularyFilterMethod field's value.
4999 func (s *StartStreamTranscriptionOutput) SetVocabularyFilterMethod(v string) *StartStreamTranscriptionOutput {
5000 s.VocabularyFilterMethod = &v
5001 return s
5002 }
5003
5004 // SetVocabularyFilterName sets the VocabularyFilterName field's value.
5005 func (s *StartStreamTranscriptionOutput) SetVocabularyFilterName(v string) *StartStreamTranscriptionOutput {
5006 s.VocabularyFilterName = &v
5007 return s
5008 }
5009
5010 // SetVocabularyFilterNames sets the VocabularyFilterNames field's value.
5011 func (s *StartStreamTranscriptionOutput) SetVocabularyFilterNames(v string) *StartStreamTranscriptionOutput {
5012 s.VocabularyFilterNames = &v
5013 return s
5014 }
5015
5016 // SetVocabularyName sets the VocabularyName field's value.
5017 func (s *StartStreamTranscriptionOutput) SetVocabularyName(v string) *StartStreamTranscriptionOutput {
5018 s.VocabularyName = &v
5019 return s
5020 }
5021
5022 // SetVocabularyNames sets the VocabularyNames field's value.
5023 func (s *StartStreamTranscriptionOutput) SetVocabularyNames(v string) *StartStreamTranscriptionOutput {
5024 s.VocabularyNames = &v
5025 return s
5026 }
5027
5028 // GetStream returns the type to interact with the event stream.
5029 func (s *StartStreamTranscriptionOutput) GetStream() *StartStreamTranscriptionEventStream {
5030 return s.eventStream
5031 }
5032
5033 // Contains the timestamp range (start time through end time) of a matched category.
5034 type TimestampRange struct {
5035 _ struct{} `type:"structure"`
5036
5037 // The time, in milliseconds, from the beginning of the audio stream to the
5038 // start of the category match.
5039 BeginOffsetMillis *int64 `type:"long"`
5040
5041 // The time, in milliseconds, from the beginning of the audio stream to the
5042 // end of the category match.
5043 EndOffsetMillis *int64 `type:"long"`
5044 }
5045
5046 // String returns the string representation.
5047 //
5048 // API parameter values that are decorated as "sensitive" in the API will not
5049 // be included in the string output. The member name will be present, but the
5050 // value will be replaced with "sensitive".
5051 func (s TimestampRange) String() string {
5052 return awsutil.Prettify(s)
5053 }
5054
5055 // GoString returns the string representation.
5056 //
5057 // API parameter values that are decorated as "sensitive" in the API will not
5058 // be included in the string output. The member name will be present, but the
5059 // value will be replaced with "sensitive".
5060 func (s TimestampRange) GoString() string {
5061 return s.String()
5062 }
5063
5064 // SetBeginOffsetMillis sets the BeginOffsetMillis field's value.
5065 func (s *TimestampRange) SetBeginOffsetMillis(v int64) *TimestampRange {
5066 s.BeginOffsetMillis = &v
5067 return s
5068 }
5069
5070 // SetEndOffsetMillis sets the EndOffsetMillis field's value.
5071 func (s *TimestampRange) SetEndOffsetMillis(v int64) *TimestampRange {
5072 s.EndOffsetMillis = &v
5073 return s
5074 }
5075
5076 // The Transcript associated with a .
5077 //
5078 // Transcript contains Results, which contains a set of transcription results
5079 // from one or more audio segments, along with additional information per your
5080 // request parameters.
5081 type Transcript struct {
5082 _ struct{} `type:"structure"`
5083
5084 // Contains a set of transcription results from one or more audio segments,
5085 // along with additional information per your request parameters. This can include
5086 // information relating to alternative transcriptions, channel identification,
5087 // partial result stabilization, language identification, and other transcription-related
5088 // data.
5089 Results []*Result `type:"list"`
5090 }
5091
5092 // String returns the string representation.
5093 //
5094 // API parameter values that are decorated as "sensitive" in the API will not
5095 // be included in the string output. The member name will be present, but the
5096 // value will be replaced with "sensitive".
5097 func (s Transcript) String() string {
5098 return awsutil.Prettify(s)
5099 }
5100
5101 // GoString returns the string representation.
5102 //
5103 // API parameter values that are decorated as "sensitive" in the API will not
5104 // be included in the string output. The member name will be present, but the
5105 // value will be replaced with "sensitive".
5106 func (s Transcript) GoString() string {
5107 return s.String()
5108 }
5109
5110 // SetResults sets the Results field's value.
5111 func (s *Transcript) SetResults(v []*Result) *Transcript {
5112 s.Results = v
5113 return s
5114 }
5115
5116 // The TranscriptEvent associated with a TranscriptResultStream.
5117 //
5118 // Contains a set of transcription results from one or more audio segments,
5119 // along with additional information per your request parameters.
5120 type TranscriptEvent struct {
5121 _ struct{} `type:"structure"`
5122
5123 // Contains Results, which contains a set of transcription results from one
5124 // or more audio segments, along with additional information per your request
5125 // parameters. This can include information relating to alternative transcriptions,
5126 // channel identification, partial result stabilization, language identification,
5127 // and other transcription-related data.
5128 Transcript *Transcript `type:"structure"`
5129 }
5130
5131 // String returns the string representation.
5132 //
5133 // API parameter values that are decorated as "sensitive" in the API will not
5134 // be included in the string output. The member name will be present, but the
5135 // value will be replaced with "sensitive".
5136 func (s TranscriptEvent) String() string {
5137 return awsutil.Prettify(s)
5138 }
5139
5140 // GoString returns the string representation.
5141 //
5142 // API parameter values that are decorated as "sensitive" in the API will not
5143 // be included in the string output. The member name will be present, but the
5144 // value will be replaced with "sensitive".
5145 func (s TranscriptEvent) GoString() string {
5146 return s.String()
5147 }
5148
5149 // SetTranscript sets the Transcript field's value.
5150 func (s *TranscriptEvent) SetTranscript(v *Transcript) *TranscriptEvent {
5151 s.Transcript = v
5152 return s
5153 }
5154
5155 // The TranscriptEvent is and event in the TranscriptResultStream group of events.
5156 func (s *TranscriptEvent) eventTranscriptResultStream() {}
5157
5158 // UnmarshalEvent unmarshals the EventStream Message into the TranscriptEvent value.
5159 // This method is only used internally within the SDK's EventStream handling.
5160 func (s *TranscriptEvent) UnmarshalEvent(
5161 payloadUnmarshaler protocol.PayloadUnmarshaler,
5162 msg eventstream.Message,
5163 ) error {
5164 if err := payloadUnmarshaler.UnmarshalPayload(
5165 bytes.NewReader(msg.Payload), s,
5166 ); err != nil {
5167 return err
5168 }
5169 return nil
5170 }
5171
5172 // MarshalEvent marshals the type into an stream event value. This method
5173 // should only used internally within the SDK's EventStream handling.
5174 func (s *TranscriptEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) {
5175 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType))
5176 var buf bytes.Buffer
5177 if err = pm.MarshalPayload(&buf, s); err != nil {
5178 return eventstream.Message{}, err
5179 }
5180 msg.Payload = buf.Bytes()
5181 return msg, err
5182 }
5183
5184 // TranscriptResultStreamEvent groups together all EventStream
5185 // events writes for TranscriptResultStream.
5186 //
5187 // These events are:
5188 //
5189 // - TranscriptEvent
5190 type TranscriptResultStreamEvent interface {
5191 eventTranscriptResultStream()
5192 eventstreamapi.Marshaler
5193 eventstreamapi.Unmarshaler
5194 }
5195
5196 // TranscriptResultStreamReader provides the interface for reading to the stream. The
5197 // default implementation for this interface will be TranscriptResultStream.
5198 //
5199 // The reader's Close method must allow multiple concurrent calls.
5200 //
5201 // These events are:
5202 //
5203 // - TranscriptEvent
5204 // - TranscriptResultStreamUnknownEvent
5205 type TranscriptResultStreamReader interface {
5206 // Returns a channel of events as they are read from the event stream.
5207 Events() <-chan TranscriptResultStreamEvent
5208
5209 // Close will stop the reader reading events from the stream.
5210 Close() error
5211
5212 // Returns any error that has occurred while reading from the event stream.
5213 Err() error
5214 }
5215
5216 type readTranscriptResultStream struct {
5217 eventReader *eventstreamapi.EventReader
5218 stream chan TranscriptResultStreamEvent
5219 err *eventstreamapi.OnceError
5220
5221 done chan struct{}
5222 closeOnce sync.Once
5223 }
5224
5225 func newReadTranscriptResultStream(eventReader *eventstreamapi.EventReader) *readTranscriptResultStream {
5226 r := &readTranscriptResultStream{
5227 eventReader: eventReader,
5228 stream: make(chan TranscriptResultStreamEvent),
5229 done: make(chan struct{}),
5230 err: eventstreamapi.NewOnceError(),
5231 }
5232 go r.readEventStream()
5233
5234 return r
5235 }
5236
5237 // Close will close the underlying event stream reader.
5238 func (r *readTranscriptResultStream) Close() error {
5239 r.closeOnce.Do(r.safeClose)
5240 return r.Err()
5241 }
5242
5243 func (r *readTranscriptResultStream) ErrorSet() <-chan struct{} {
5244 return r.err.ErrorSet()
5245 }
5246
5247 func (r *readTranscriptResultStream) Closed() <-chan struct{} {
5248 return r.done
5249 }
5250
5251 func (r *readTranscriptResultStream) safeClose() {
5252 close(r.done)
5253 }
5254
5255 func (r *readTranscriptResultStream) Err() error {
5256 return r.err.Err()
5257 }
5258
5259 func (r *readTranscriptResultStream) Events() <-chan TranscriptResultStreamEvent {
5260 return r.stream
5261 }
5262
5263 func (r *readTranscriptResultStream) readEventStream() {
5264 defer r.Close()
5265 defer close(r.stream)
5266
5267 for {
5268 event, err := r.eventReader.ReadEvent()
5269 if err != nil {
5270 if err == io.EOF {
5271 return
5272 }
5273 select {
5274 case <-r.done:
5275 // If closed already ignore the error
5276 return
5277 default:
5278 }
5279 if _, ok := err.(*eventstreamapi.UnknownMessageTypeError); ok {
5280 continue
5281 }
5282 r.err.SetError(err)
5283 return
5284 }
5285
5286 select {
5287 case r.stream <- event.(TranscriptResultStreamEvent):
5288 case <-r.done:
5289 return
5290 }
5291 }
5292 }
5293
5294 type unmarshalerForTranscriptResultStreamEvent struct {
5295 metadata protocol.ResponseMetadata
5296 }
5297
5298 func (u unmarshalerForTranscriptResultStreamEvent) UnmarshalerForEventName(eventType string) (eventstreamapi.Unmarshaler, error) {
5299 switch eventType {
5300 case "TranscriptEvent":
5301 return &TranscriptEvent{}, nil
5302 case "BadRequestException":
5303 return newErrorBadRequestException(u.metadata).(eventstreamapi.Unmarshaler), nil
5304 case "ConflictException":
5305 return newErrorConflictException(u.metadata).(eventstreamapi.Unmarshaler), nil
5306 case "InternalFailureException":
5307 return newErrorInternalFailureException(u.metadata).(eventstreamapi.Unmarshaler), nil
5308 case "LimitExceededException":
5309 return newErrorLimitExceededException(u.metadata).(eventstreamapi.Unmarshaler), nil
5310 case "ServiceUnavailableException":
5311 return newErrorServiceUnavailableException(u.metadata).(eventstreamapi.Unmarshaler), nil
5312 default:
5313 return &TranscriptResultStreamUnknownEvent{Type: eventType}, nil
5314 }
5315 }
5316
5317 // TranscriptResultStreamUnknownEvent provides a failsafe event for the
5318 // TranscriptResultStream group of events when an unknown event is received.
5319 type TranscriptResultStreamUnknownEvent struct {
5320 Type string
5321 Message eventstream.Message
5322 }
5323
5324 // The TranscriptResultStreamUnknownEvent is and event in the TranscriptResultStream
5325 // group of events.
5326 func (s *TranscriptResultStreamUnknownEvent) eventTranscriptResultStream() {}
5327
5328 // MarshalEvent marshals the type into an stream event value. This method
5329 // should only used internally within the SDK's EventStream handling.
5330 func (e *TranscriptResultStreamUnknownEvent) MarshalEvent(pm protocol.PayloadMarshaler) (
5331 msg eventstream.Message, err error,
5332 ) {
5333 return e.Message.Clone(), nil
5334 }
5335
5336 // UnmarshalEvent unmarshals the EventStream Message into the TranscriptResultStream value.
5337 // This method is only used internally within the SDK's EventStream handling.
5338 func (e *TranscriptResultStreamUnknownEvent) UnmarshalEvent(
5339 payloadUnmarshaler protocol.PayloadUnmarshaler,
5340 msg eventstream.Message,
5341 ) error {
5342 e.Message = msg.Clone()
5343 return nil
5344 }
5345
5346 // Contains set of transcription results from one or more audio segments, along
5347 // with additional information about the parameters included in your request.
5348 // For example, channel definitions, partial result stabilization, sentiment,
5349 // and issue detection.
5350 type UtteranceEvent struct {
5351 _ struct{} `type:"structure"`
5352
5353 // The time, in milliseconds, from the beginning of the audio stream to the
5354 // start of the UtteranceEvent.
5355 BeginOffsetMillis *int64 `type:"long"`
5356
5357 // The time, in milliseconds, from the beginning of the audio stream to the
5358 // start of the UtteranceEvent.
5359 EndOffsetMillis *int64 `type:"long"`
5360
5361 // Contains entities identified as personally identifiable information (PII)
5362 // in your transcription output.
5363 Entities []*CallAnalyticsEntity `type:"list"`
5364
5365 // Indicates whether the segment in the UtteranceEvent is complete (FALSE) or
5366 // partial (TRUE).
5367 IsPartial *bool `type:"boolean"`
5368
5369 // Provides the issue that was detected in the specified segment.
5370 IssuesDetected []*IssueDetected `type:"list"`
5371
5372 // Contains words, phrases, or punctuation marks that are associated with the
5373 // specified UtteranceEvent.
5374 Items []*CallAnalyticsItem `type:"list"`
5375
5376 // Provides the role of the speaker for each audio channel, either CUSTOMER
5377 // or AGENT.
5378 ParticipantRole *string `type:"string" enum:"ParticipantRole"`
5379
5380 // Provides the sentiment that was detected in the specified segment.
5381 Sentiment *string `type:"string" enum:"Sentiment"`
5382
5383 // Contains transcribed text.
5384 Transcript *string `type:"string"`
5385
5386 // The unique identifier that is associated with the specified UtteranceEvent.
5387 UtteranceId *string `type:"string"`
5388 }
5389
5390 // String returns the string representation.
5391 //
5392 // API parameter values that are decorated as "sensitive" in the API will not
5393 // be included in the string output. The member name will be present, but the
5394 // value will be replaced with "sensitive".
5395 func (s UtteranceEvent) String() string {
5396 return awsutil.Prettify(s)
5397 }
5398
5399 // GoString returns the string representation.
5400 //
5401 // API parameter values that are decorated as "sensitive" in the API will not
5402 // be included in the string output. The member name will be present, but the
5403 // value will be replaced with "sensitive".
5404 func (s UtteranceEvent) GoString() string {
5405 return s.String()
5406 }
5407
5408 // SetBeginOffsetMillis sets the BeginOffsetMillis field's value.
5409 func (s *UtteranceEvent) SetBeginOffsetMillis(v int64) *UtteranceEvent {
5410 s.BeginOffsetMillis = &v
5411 return s
5412 }
5413
5414 // SetEndOffsetMillis sets the EndOffsetMillis field's value.
5415 func (s *UtteranceEvent) SetEndOffsetMillis(v int64) *UtteranceEvent {
5416 s.EndOffsetMillis = &v
5417 return s
5418 }
5419
5420 // SetEntities sets the Entities field's value.
5421 func (s *UtteranceEvent) SetEntities(v []*CallAnalyticsEntity) *UtteranceEvent {
5422 s.Entities = v
5423 return s
5424 }
5425
5426 // SetIsPartial sets the IsPartial field's value.
5427 func (s *UtteranceEvent) SetIsPartial(v bool) *UtteranceEvent {
5428 s.IsPartial = &v
5429 return s
5430 }
5431
5432 // SetIssuesDetected sets the IssuesDetected field's value.
5433 func (s *UtteranceEvent) SetIssuesDetected(v []*IssueDetected) *UtteranceEvent {
5434 s.IssuesDetected = v
5435 return s
5436 }
5437
5438 // SetItems sets the Items field's value.
5439 func (s *UtteranceEvent) SetItems(v []*CallAnalyticsItem) *UtteranceEvent {
5440 s.Items = v
5441 return s
5442 }
5443
5444 // SetParticipantRole sets the ParticipantRole field's value.
5445 func (s *UtteranceEvent) SetParticipantRole(v string) *UtteranceEvent {
5446 s.ParticipantRole = &v
5447 return s
5448 }
5449
5450 // SetSentiment sets the Sentiment field's value.
5451 func (s *UtteranceEvent) SetSentiment(v string) *UtteranceEvent {
5452 s.Sentiment = &v
5453 return s
5454 }
5455
5456 // SetTranscript sets the Transcript field's value.
5457 func (s *UtteranceEvent) SetTranscript(v string) *UtteranceEvent {
5458 s.Transcript = &v
5459 return s
5460 }
5461
5462 // SetUtteranceId sets the UtteranceId field's value.
5463 func (s *UtteranceEvent) SetUtteranceId(v string) *UtteranceEvent {
5464 s.UtteranceId = &v
5465 return s
5466 }
5467
5468 // The UtteranceEvent is and event in the CallAnalyticsTranscriptResultStream group of events.
5469 func (s *UtteranceEvent) eventCallAnalyticsTranscriptResultStream() {}
5470
5471 // UnmarshalEvent unmarshals the EventStream Message into the UtteranceEvent value.
5472 // This method is only used internally within the SDK's EventStream handling.
5473 func (s *UtteranceEvent) UnmarshalEvent(
5474 payloadUnmarshaler protocol.PayloadUnmarshaler,
5475 msg eventstream.Message,
5476 ) error {
5477 if err := payloadUnmarshaler.UnmarshalPayload(
5478 bytes.NewReader(msg.Payload), s,
5479 ); err != nil {
5480 return err
5481 }
5482 return nil
5483 }
5484
5485 // MarshalEvent marshals the type into an stream event value. This method
5486 // should only used internally within the SDK's EventStream handling.
5487 func (s *UtteranceEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) {
5488 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType))
5489 var buf bytes.Buffer
5490 if err = pm.MarshalPayload(&buf, s); err != nil {
5491 return eventstream.Message{}, err
5492 }
5493 msg.Payload = buf.Bytes()
5494 return msg, err
5495 }
5496
5497 const (
5498 // CallAnalyticsLanguageCodeEnUs is a CallAnalyticsLanguageCode enum value
5499 CallAnalyticsLanguageCodeEnUs = "en-US"
5500
5501 // CallAnalyticsLanguageCodeEnGb is a CallAnalyticsLanguageCode enum value
5502 CallAnalyticsLanguageCodeEnGb = "en-GB"
5503
5504 // CallAnalyticsLanguageCodeEsUs is a CallAnalyticsLanguageCode enum value
5505 CallAnalyticsLanguageCodeEsUs = "es-US"
5506
5507 // CallAnalyticsLanguageCodeFrCa is a CallAnalyticsLanguageCode enum value
5508 CallAnalyticsLanguageCodeFrCa = "fr-CA"
5509
5510 // CallAnalyticsLanguageCodeFrFr is a CallAnalyticsLanguageCode enum value
5511 CallAnalyticsLanguageCodeFrFr = "fr-FR"
5512
5513 // CallAnalyticsLanguageCodeEnAu is a CallAnalyticsLanguageCode enum value
5514 CallAnalyticsLanguageCodeEnAu = "en-AU"
5515
5516 // CallAnalyticsLanguageCodeItIt is a CallAnalyticsLanguageCode enum value
5517 CallAnalyticsLanguageCodeItIt = "it-IT"
5518
5519 // CallAnalyticsLanguageCodeDeDe is a CallAnalyticsLanguageCode enum value
5520 CallAnalyticsLanguageCodeDeDe = "de-DE"
5521
5522 // CallAnalyticsLanguageCodePtBr is a CallAnalyticsLanguageCode enum value
5523 CallAnalyticsLanguageCodePtBr = "pt-BR"
5524 )
5525
5526 // CallAnalyticsLanguageCode_Values returns all elements of the CallAnalyticsLanguageCode enum
5527 func CallAnalyticsLanguageCode_Values() []string {
5528 return []string{
5529 CallAnalyticsLanguageCodeEnUs,
5530 CallAnalyticsLanguageCodeEnGb,
5531 CallAnalyticsLanguageCodeEsUs,
5532 CallAnalyticsLanguageCodeFrCa,
5533 CallAnalyticsLanguageCodeFrFr,
5534 CallAnalyticsLanguageCodeEnAu,
5535 CallAnalyticsLanguageCodeItIt,
5536 CallAnalyticsLanguageCodeDeDe,
5537 CallAnalyticsLanguageCodePtBr,
5538 }
5539 }
5540
5541 const (
5542 // ContentIdentificationTypePii is a ContentIdentificationType enum value
5543 ContentIdentificationTypePii = "PII"
5544 )
5545
5546 // ContentIdentificationType_Values returns all elements of the ContentIdentificationType enum
5547 func ContentIdentificationType_Values() []string {
5548 return []string{
5549 ContentIdentificationTypePii,
5550 }
5551 }
5552
5553 const (
5554 // ContentRedactionOutputRedacted is a ContentRedactionOutput_ enum value
5555 ContentRedactionOutputRedacted = "redacted"
5556
5557 // ContentRedactionOutputRedactedAndUnredacted is a ContentRedactionOutput_ enum value
5558 ContentRedactionOutputRedactedAndUnredacted = "redacted_and_unredacted"
5559 )
5560
5561 // ContentRedactionOutput__Values returns all elements of the ContentRedactionOutput_ enum
5562 func ContentRedactionOutput__Values() []string {
5563 return []string{
5564 ContentRedactionOutputRedacted,
5565 ContentRedactionOutputRedactedAndUnredacted,
5566 }
5567 }
5568
5569 const (
5570 // ContentRedactionTypePii is a ContentRedactionType enum value
5571 ContentRedactionTypePii = "PII"
5572 )
5573
5574 // ContentRedactionType_Values returns all elements of the ContentRedactionType enum
5575 func ContentRedactionType_Values() []string {
5576 return []string{
5577 ContentRedactionTypePii,
5578 }
5579 }
5580
5581 const (
5582 // ItemTypePronunciation is a ItemType enum value
5583 ItemTypePronunciation = "pronunciation"
5584
5585 // ItemTypePunctuation is a ItemType enum value
5586 ItemTypePunctuation = "punctuation"
5587 )
5588
5589 // ItemType_Values returns all elements of the ItemType enum
5590 func ItemType_Values() []string {
5591 return []string{
5592 ItemTypePronunciation,
5593 ItemTypePunctuation,
5594 }
5595 }
5596
5597 const (
5598 // LanguageCodeEnUs is a LanguageCode enum value
5599 LanguageCodeEnUs = "en-US"
5600
5601 // LanguageCodeEnGb is a LanguageCode enum value
5602 LanguageCodeEnGb = "en-GB"
5603
5604 // LanguageCodeEsUs is a LanguageCode enum value
5605 LanguageCodeEsUs = "es-US"
5606
5607 // LanguageCodeFrCa is a LanguageCode enum value
5608 LanguageCodeFrCa = "fr-CA"
5609
5610 // LanguageCodeFrFr is a LanguageCode enum value
5611 LanguageCodeFrFr = "fr-FR"
5612
5613 // LanguageCodeEnAu is a LanguageCode enum value
5614 LanguageCodeEnAu = "en-AU"
5615
5616 // LanguageCodeItIt is a LanguageCode enum value
5617 LanguageCodeItIt = "it-IT"
5618
5619 // LanguageCodeDeDe is a LanguageCode enum value
5620 LanguageCodeDeDe = "de-DE"
5621
5622 // LanguageCodePtBr is a LanguageCode enum value
5623 LanguageCodePtBr = "pt-BR"
5624
5625 // LanguageCodeJaJp is a LanguageCode enum value
5626 LanguageCodeJaJp = "ja-JP"
5627
5628 // LanguageCodeKoKr is a LanguageCode enum value
5629 LanguageCodeKoKr = "ko-KR"
5630
5631 // LanguageCodeZhCn is a LanguageCode enum value
5632 LanguageCodeZhCn = "zh-CN"
5633
5634 // LanguageCodeHiIn is a LanguageCode enum value
5635 LanguageCodeHiIn = "hi-IN"
5636
5637 // LanguageCodeThTh is a LanguageCode enum value
5638 LanguageCodeThTh = "th-TH"
5639 )
5640
5641 // LanguageCode_Values returns all elements of the LanguageCode enum
5642 func LanguageCode_Values() []string {
5643 return []string{
5644 LanguageCodeEnUs,
5645 LanguageCodeEnGb,
5646 LanguageCodeEsUs,
5647 LanguageCodeFrCa,
5648 LanguageCodeFrFr,
5649 LanguageCodeEnAu,
5650 LanguageCodeItIt,
5651 LanguageCodeDeDe,
5652 LanguageCodePtBr,
5653 LanguageCodeJaJp,
5654 LanguageCodeKoKr,
5655 LanguageCodeZhCn,
5656 LanguageCodeHiIn,
5657 LanguageCodeThTh,
5658 }
5659 }
5660
5661 const (
5662 // MediaEncodingPcm is a MediaEncoding enum value
5663 MediaEncodingPcm = "pcm"
5664
5665 // MediaEncodingOggOpus is a MediaEncoding enum value
5666 MediaEncodingOggOpus = "ogg-opus"
5667
5668 // MediaEncodingFlac is a MediaEncoding enum value
5669 MediaEncodingFlac = "flac"
5670 )
5671
5672 // MediaEncoding_Values returns all elements of the MediaEncoding enum
5673 func MediaEncoding_Values() []string {
5674 return []string{
5675 MediaEncodingPcm,
5676 MediaEncodingOggOpus,
5677 MediaEncodingFlac,
5678 }
5679 }
5680
5681 const (
5682 // MedicalContentIdentificationTypePhi is a MedicalContentIdentificationType enum value
5683 MedicalContentIdentificationTypePhi = "PHI"
5684 )
5685
5686 // MedicalContentIdentificationType_Values returns all elements of the MedicalContentIdentificationType enum
5687 func MedicalContentIdentificationType_Values() []string {
5688 return []string{
5689 MedicalContentIdentificationTypePhi,
5690 }
5691 }
5692
5693 const (
5694 // PartialResultsStabilityHigh is a PartialResultsStability enum value
5695 PartialResultsStabilityHigh = "high"
5696
5697 // PartialResultsStabilityMedium is a PartialResultsStability enum value
5698 PartialResultsStabilityMedium = "medium"
5699
5700 // PartialResultsStabilityLow is a PartialResultsStability enum value
5701 PartialResultsStabilityLow = "low"
5702 )
5703
5704 // PartialResultsStability_Values returns all elements of the PartialResultsStability enum
5705 func PartialResultsStability_Values() []string {
5706 return []string{
5707 PartialResultsStabilityHigh,
5708 PartialResultsStabilityMedium,
5709 PartialResultsStabilityLow,
5710 }
5711 }
5712
5713 const (
5714 // ParticipantRoleAgent is a ParticipantRole enum value
5715 ParticipantRoleAgent = "AGENT"
5716
5717 // ParticipantRoleCustomer is a ParticipantRole enum value
5718 ParticipantRoleCustomer = "CUSTOMER"
5719 )
5720
5721 // ParticipantRole_Values returns all elements of the ParticipantRole enum
5722 func ParticipantRole_Values() []string {
5723 return []string{
5724 ParticipantRoleAgent,
5725 ParticipantRoleCustomer,
5726 }
5727 }
5728
5729 const (
5730 // SentimentPositive is a Sentiment enum value
5731 SentimentPositive = "POSITIVE"
5732
5733 // SentimentNegative is a Sentiment enum value
5734 SentimentNegative = "NEGATIVE"
5735
5736 // SentimentMixed is a Sentiment enum value
5737 SentimentMixed = "MIXED"
5738
5739 // SentimentNeutral is a Sentiment enum value
5740 SentimentNeutral = "NEUTRAL"
5741 )
5742
5743 // Sentiment_Values returns all elements of the Sentiment enum
5744 func Sentiment_Values() []string {
5745 return []string{
5746 SentimentPositive,
5747 SentimentNegative,
5748 SentimentMixed,
5749 SentimentNeutral,
5750 }
5751 }
5752
5753 const (
5754 // SpecialtyPrimarycare is a Specialty enum value
5755 SpecialtyPrimarycare = "PRIMARYCARE"
5756
5757 // SpecialtyCardiology is a Specialty enum value
5758 SpecialtyCardiology = "CARDIOLOGY"
5759
5760 // SpecialtyNeurology is a Specialty enum value
5761 SpecialtyNeurology = "NEUROLOGY"
5762
5763 // SpecialtyOncology is a Specialty enum value
5764 SpecialtyOncology = "ONCOLOGY"
5765
5766 // SpecialtyRadiology is a Specialty enum value
5767 SpecialtyRadiology = "RADIOLOGY"
5768
5769 // SpecialtyUrology is a Specialty enum value
5770 SpecialtyUrology = "UROLOGY"
5771 )
5772
5773 // Specialty_Values returns all elements of the Specialty enum
5774 func Specialty_Values() []string {
5775 return []string{
5776 SpecialtyPrimarycare,
5777 SpecialtyCardiology,
5778 SpecialtyNeurology,
5779 SpecialtyOncology,
5780 SpecialtyRadiology,
5781 SpecialtyUrology,
5782 }
5783 }
5784
5785 const (
5786 // TypeConversation is a Type enum value
5787 TypeConversation = "CONVERSATION"
5788
5789 // TypeDictation is a Type enum value
5790 TypeDictation = "DICTATION"
5791 )
5792
5793 // Type_Values returns all elements of the Type enum
5794 func Type_Values() []string {
5795 return []string{
5796 TypeConversation,
5797 TypeDictation,
5798 }
5799 }
5800
5801 const (
5802 // VocabularyFilterMethodRemove is a VocabularyFilterMethod enum value
5803 VocabularyFilterMethodRemove = "remove"
5804
5805 // VocabularyFilterMethodMask is a VocabularyFilterMethod enum value
5806 VocabularyFilterMethodMask = "mask"
5807
5808 // VocabularyFilterMethodTag is a VocabularyFilterMethod enum value
5809 VocabularyFilterMethodTag = "tag"
5810 )
5811
5812 // VocabularyFilterMethod_Values returns all elements of the VocabularyFilterMethod enum
5813 func VocabularyFilterMethod_Values() []string {
5814 return []string{
5815 VocabularyFilterMethodRemove,
5816 VocabularyFilterMethodMask,
5817 VocabularyFilterMethodTag,
5818 }
5819 }