aws_sdk_transcribestreaming/operation/start_medical_stream_transcription/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_medical_stream_transcription::_start_medical_stream_transcription_output::StartMedicalStreamTranscriptionOutputBuilder;
3
4pub use crate::operation::start_medical_stream_transcription::_start_medical_stream_transcription_input::StartMedicalStreamTranscriptionInputBuilder;
5
6impl crate::operation::start_medical_stream_transcription::builders::StartMedicalStreamTranscriptionInputBuilder {
7                    /// Sends a request with this input using the given client.
8                    pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result<
9                        crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionOutput,
10                        ::aws_smithy_runtime_api::client::result::SdkError<
11                            crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError,
12                            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse
13                        >
14                    > {
15                        let mut fluent_builder = client.start_medical_stream_transcription();
16                        fluent_builder.inner = self;
17                        fluent_builder.send().await
18                    }
19                }
20/// Fluent builder constructing a request to `StartMedicalStreamTranscription`.
21/// 
22/// <p>Starts a bidirectional HTTP/2 or WebSocket stream where audio is streamed to Amazon Transcribe Medical and the transcription results are streamed to your application.</p>
23/// <p>The following parameters are required:</p>
24/// <ul>
25/// <li>
26/// <p><code>language-code</code></p></li>
27/// <li>
28/// <p><code>media-encoding</code></p></li>
29/// <li>
30/// <p><code>sample-rate</code></p></li>
31/// </ul>
32/// <p>For more information on streaming with Amazon Transcribe Medical, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html">Transcribing streaming audio</a>.</p>
33#[derive(::std::fmt::Debug)]
34pub struct StartMedicalStreamTranscriptionFluentBuilder {
35                handle: ::std::sync::Arc<crate::client::Handle>,
36                inner: crate::operation::start_medical_stream_transcription::builders::StartMedicalStreamTranscriptionInputBuilder,
37config_override: ::std::option::Option<crate::config::Builder>,
38            }
39impl
40                crate::client::customize::internal::CustomizableSend<
41                    crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionOutput,
42                    crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError,
43                > for StartMedicalStreamTranscriptionFluentBuilder
44            {
45                fn send(
46                    self,
47                    config_override: crate::config::Builder,
48                ) -> crate::client::customize::internal::BoxFuture<
49                    crate::client::customize::internal::SendResult<
50                        crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionOutput,
51                        crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError,
52                    >,
53                > {
54                    ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55                }
56            }
57impl StartMedicalStreamTranscriptionFluentBuilder {
58    /// Creates a new `StartMedicalStreamTranscriptionFluentBuilder`.
59                    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60                        Self {
61                            handle,
62                            inner: ::std::default::Default::default(),
63    config_override: ::std::option::Option::None,
64                        }
65                    }
66    /// Access the StartMedicalStreamTranscription as a reference.
67                    pub fn as_input(&self) -> &crate::operation::start_medical_stream_transcription::builders::StartMedicalStreamTranscriptionInputBuilder {
68                        &self.inner
69                    }
70    /// Sends the request and returns the response.
71                    ///
72                    /// If an error occurs, an `SdkError` will be returned with additional details that
73                    /// can be matched against.
74                    ///
75                    /// By default, any retryable failures will be retried twice. Retry behavior
76                    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77                    /// set when configuring the client.
78                    pub async fn send(self) -> ::std::result::Result<crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>> {
79                        let input = self.inner.build().map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
80                        let runtime_plugins = crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscription::operation_runtime_plugins(
81                            self.handle.runtime_plugins.clone(),
82                            &self.handle.conf,
83                            self.config_override,
84                        );
85                        crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscription::orchestrate(&runtime_plugins, input).await
86                    }
87    
88                    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
89                    pub fn customize(
90                        self,
91                    ) -> crate::client::customize::CustomizableOperation<crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionOutput, crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError, Self> {
92                        crate::client::customize::CustomizableOperation::new(self)
93                    }
94    pub(crate) fn config_override(
95                            mut self,
96                            config_override: impl ::std::convert::Into<crate::config::Builder>,
97                        ) -> Self {
98                            self.set_config_override(::std::option::Option::Some(config_override.into()));
99                            self
100                        }
101    
102                        pub(crate) fn set_config_override(
103                            &mut self,
104                            config_override: ::std::option::Option<crate::config::Builder>,
105                        ) -> &mut Self {
106                            self.config_override = config_override;
107                            self
108                        }
109    /// <p>Specify the language code that represents the language spoken in your audio.</p><important>
110    /// <p>Amazon Transcribe Medical only supports US English (<code>en-US</code>).</p>
111    /// </important>
112    pub fn language_code(mut self, input: crate::types::LanguageCode) -> Self {
113                    self.inner = self.inner.language_code(input);
114                    self
115                }
116    /// <p>Specify the language code that represents the language spoken in your audio.</p><important>
117    /// <p>Amazon Transcribe Medical only supports US English (<code>en-US</code>).</p>
118    /// </important>
119    pub fn set_language_code(mut self, input: ::std::option::Option<crate::types::LanguageCode>) -> Self {
120                    self.inner = self.inner.set_language_code(input);
121                    self
122                }
123    /// <p>Specify the language code that represents the language spoken in your audio.</p><important>
124    /// <p>Amazon Transcribe Medical only supports US English (<code>en-US</code>).</p>
125    /// </important>
126    pub fn get_language_code(&self) -> &::std::option::Option<crate::types::LanguageCode> {
127                    self.inner.get_language_code()
128                }
129    /// <p>The sample rate of the input audio (in hertz). Amazon Transcribe Medical supports a range from 16,000 Hz to 48,000 Hz. Note that the sample rate you specify must match that of your audio.</p>
130    pub fn media_sample_rate_hertz(mut self, input: i32) -> Self {
131                    self.inner = self.inner.media_sample_rate_hertz(input);
132                    self
133                }
134    /// <p>The sample rate of the input audio (in hertz). Amazon Transcribe Medical supports a range from 16,000 Hz to 48,000 Hz. Note that the sample rate you specify must match that of your audio.</p>
135    pub fn set_media_sample_rate_hertz(mut self, input: ::std::option::Option<i32>) -> Self {
136                    self.inner = self.inner.set_media_sample_rate_hertz(input);
137                    self
138                }
139    /// <p>The sample rate of the input audio (in hertz). Amazon Transcribe Medical supports a range from 16,000 Hz to 48,000 Hz. Note that the sample rate you specify must match that of your audio.</p>
140    pub fn get_media_sample_rate_hertz(&self) -> &::std::option::Option<i32> {
141                    self.inner.get_media_sample_rate_hertz()
142                }
143    /// <p>Specify the encoding used for the input audio. Supported formats are:</p>
144    /// <ul>
145    /// <li>
146    /// <p>FLAC</p></li>
147    /// <li>
148    /// <p>OPUS-encoded audio in an Ogg container</p></li>
149    /// <li>
150    /// <p>PCM (only signed 16-bit little-endian audio formats, which does not include WAV)</p></li>
151    /// </ul>
152    /// <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio">Media formats</a>.</p>
153    pub fn media_encoding(mut self, input: crate::types::MediaEncoding) -> Self {
154                    self.inner = self.inner.media_encoding(input);
155                    self
156                }
157    /// <p>Specify the encoding used for the input audio. Supported formats are:</p>
158    /// <ul>
159    /// <li>
160    /// <p>FLAC</p></li>
161    /// <li>
162    /// <p>OPUS-encoded audio in an Ogg container</p></li>
163    /// <li>
164    /// <p>PCM (only signed 16-bit little-endian audio formats, which does not include WAV)</p></li>
165    /// </ul>
166    /// <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio">Media formats</a>.</p>
167    pub fn set_media_encoding(mut self, input: ::std::option::Option<crate::types::MediaEncoding>) -> Self {
168                    self.inner = self.inner.set_media_encoding(input);
169                    self
170                }
171    /// <p>Specify the encoding used for the input audio. Supported formats are:</p>
172    /// <ul>
173    /// <li>
174    /// <p>FLAC</p></li>
175    /// <li>
176    /// <p>OPUS-encoded audio in an Ogg container</p></li>
177    /// <li>
178    /// <p>PCM (only signed 16-bit little-endian audio formats, which does not include WAV)</p></li>
179    /// </ul>
180    /// <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio">Media formats</a>.</p>
181    pub fn get_media_encoding(&self) -> &::std::option::Option<crate::types::MediaEncoding> {
182                    self.inner.get_media_encoding()
183                }
184    /// <p>Specify the name of the custom vocabulary that you want to use when processing your transcription. Note that vocabulary names are case sensitive.</p>
185    pub fn vocabulary_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186                    self.inner = self.inner.vocabulary_name(input.into());
187                    self
188                }
189    /// <p>Specify the name of the custom vocabulary that you want to use when processing your transcription. Note that vocabulary names are case sensitive.</p>
190    pub fn set_vocabulary_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191                    self.inner = self.inner.set_vocabulary_name(input);
192                    self
193                }
194    /// <p>Specify the name of the custom vocabulary that you want to use when processing your transcription. Note that vocabulary names are case sensitive.</p>
195    pub fn get_vocabulary_name(&self) -> &::std::option::Option<::std::string::String> {
196                    self.inner.get_vocabulary_name()
197                }
198    /// <p>Specify the medical specialty contained in your audio.</p>
199    pub fn specialty(mut self, input: crate::types::Specialty) -> Self {
200                    self.inner = self.inner.specialty(input);
201                    self
202                }
203    /// <p>Specify the medical specialty contained in your audio.</p>
204    pub fn set_specialty(mut self, input: ::std::option::Option<crate::types::Specialty>) -> Self {
205                    self.inner = self.inner.set_specialty(input);
206                    self
207                }
208    /// <p>Specify the medical specialty contained in your audio.</p>
209    pub fn get_specialty(&self) -> &::std::option::Option<crate::types::Specialty> {
210                    self.inner.get_specialty()
211                }
212    /// <p>Specify the type of input audio. For example, choose <code>DICTATION</code> for a provider dictating patient notes and <code>CONVERSATION</code> for a dialogue between a patient and a medical professional.</p>
213    pub fn r#type(mut self, input: crate::types::Type) -> Self {
214                    self.inner = self.inner.r#type(input);
215                    self
216                }
217    /// <p>Specify the type of input audio. For example, choose <code>DICTATION</code> for a provider dictating patient notes and <code>CONVERSATION</code> for a dialogue between a patient and a medical professional.</p>
218    pub fn set_type(mut self, input: ::std::option::Option<crate::types::Type>) -> Self {
219                    self.inner = self.inner.set_type(input);
220                    self
221                }
222    /// <p>Specify the type of input audio. For example, choose <code>DICTATION</code> for a provider dictating patient notes and <code>CONVERSATION</code> for a dialogue between a patient and a medical professional.</p>
223    pub fn get_type(&self) -> &::std::option::Option<crate::types::Type> {
224                    self.inner.get_type()
225                }
226    /// <p>Enables speaker partitioning (diarization) in your transcription output. Speaker partitioning labels the speech from individual speakers in your media file.</p>
227    /// <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/diarization.html">Partitioning speakers (diarization)</a>.</p>
228    pub fn show_speaker_label(mut self, input: bool) -> Self {
229                    self.inner = self.inner.show_speaker_label(input);
230                    self
231                }
232    /// <p>Enables speaker partitioning (diarization) in your transcription output. Speaker partitioning labels the speech from individual speakers in your media file.</p>
233    /// <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/diarization.html">Partitioning speakers (diarization)</a>.</p>
234    pub fn set_show_speaker_label(mut self, input: ::std::option::Option<bool>) -> Self {
235                    self.inner = self.inner.set_show_speaker_label(input);
236                    self
237                }
238    /// <p>Enables speaker partitioning (diarization) in your transcription output. Speaker partitioning labels the speech from individual speakers in your media file.</p>
239    /// <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/diarization.html">Partitioning speakers (diarization)</a>.</p>
240    pub fn get_show_speaker_label(&self) -> &::std::option::Option<bool> {
241                    self.inner.get_show_speaker_label()
242                }
243    /// <p>Specify a name for your transcription session. If you don't include this parameter in your request, Amazon Transcribe Medical generates an ID and returns it in the response.</p>
244    /// <p>You can use a session ID to retry a streaming session.</p>
245    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
246                    self.inner = self.inner.session_id(input.into());
247                    self
248                }
249    /// <p>Specify a name for your transcription session. If you don't include this parameter in your request, Amazon Transcribe Medical generates an ID and returns it in the response.</p>
250    /// <p>You can use a session ID to retry a streaming session.</p>
251    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
252                    self.inner = self.inner.set_session_id(input);
253                    self
254                }
255    /// <p>Specify a name for your transcription session. If you don't include this parameter in your request, Amazon Transcribe Medical generates an ID and returns it in the response.</p>
256    /// <p>You can use a session ID to retry a streaming session.</p>
257    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
258                    self.inner.get_session_id()
259                }
260    /// <p>An encoded stream of audio blobs. Audio streams are encoded as either HTTP/2 or WebSocket data frames.</p>
261    /// <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html">Transcribing streaming audio</a>.</p>
262    pub fn audio_stream(mut self, input: ::aws_smithy_http::event_stream::EventStreamSender<crate::types::AudioStream, crate::types::error::AudioStreamError>) -> Self {
263                    self.inner = self.inner.audio_stream(input);
264                    self
265                }
266    /// <p>An encoded stream of audio blobs. Audio streams are encoded as either HTTP/2 or WebSocket data frames.</p>
267    /// <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html">Transcribing streaming audio</a>.</p>
268    pub fn set_audio_stream(mut self, input: ::std::option::Option<::aws_smithy_http::event_stream::EventStreamSender<crate::types::AudioStream, crate::types::error::AudioStreamError>>) -> Self {
269                    self.inner = self.inner.set_audio_stream(input);
270                    self
271                }
272    /// <p>An encoded stream of audio blobs. Audio streams are encoded as either HTTP/2 or WebSocket data frames.</p>
273    /// <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html">Transcribing streaming audio</a>.</p>
274    pub fn get_audio_stream(&self) -> &::std::option::Option<::aws_smithy_http::event_stream::EventStreamSender<crate::types::AudioStream, crate::types::error::AudioStreamError>> {
275                    self.inner.get_audio_stream()
276                }
277    /// <p>Enables channel identification in multi-channel audio.</p>
278    /// <p>Channel identification transcribes the audio on each channel independently, then appends the output for each channel into one transcript.</p>
279    /// <p>If you have multi-channel audio and do not enable channel identification, your audio is transcribed in a continuous manner and your transcript is not separated by channel.</p>
280    /// <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/channel-id.html">Transcribing multi-channel audio</a>.</p>
281    pub fn enable_channel_identification(mut self, input: bool) -> Self {
282                    self.inner = self.inner.enable_channel_identification(input);
283                    self
284                }
285    /// <p>Enables channel identification in multi-channel audio.</p>
286    /// <p>Channel identification transcribes the audio on each channel independently, then appends the output for each channel into one transcript.</p>
287    /// <p>If you have multi-channel audio and do not enable channel identification, your audio is transcribed in a continuous manner and your transcript is not separated by channel.</p>
288    /// <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/channel-id.html">Transcribing multi-channel audio</a>.</p>
289    pub fn set_enable_channel_identification(mut self, input: ::std::option::Option<bool>) -> Self {
290                    self.inner = self.inner.set_enable_channel_identification(input);
291                    self
292                }
293    /// <p>Enables channel identification in multi-channel audio.</p>
294    /// <p>Channel identification transcribes the audio on each channel independently, then appends the output for each channel into one transcript.</p>
295    /// <p>If you have multi-channel audio and do not enable channel identification, your audio is transcribed in a continuous manner and your transcript is not separated by channel.</p>
296    /// <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/channel-id.html">Transcribing multi-channel audio</a>.</p>
297    pub fn get_enable_channel_identification(&self) -> &::std::option::Option<bool> {
298                    self.inner.get_enable_channel_identification()
299                }
300    /// <p>Specify the number of channels in your audio stream. Up to two channels are supported.</p>
301    pub fn number_of_channels(mut self, input: i32) -> Self {
302                    self.inner = self.inner.number_of_channels(input);
303                    self
304                }
305    /// <p>Specify the number of channels in your audio stream. Up to two channels are supported.</p>
306    pub fn set_number_of_channels(mut self, input: ::std::option::Option<i32>) -> Self {
307                    self.inner = self.inner.set_number_of_channels(input);
308                    self
309                }
310    /// <p>Specify the number of channels in your audio stream. Up to two channels are supported.</p>
311    pub fn get_number_of_channels(&self) -> &::std::option::Option<i32> {
312                    self.inner.get_number_of_channels()
313                }
314    /// <p>Labels all personal health information (PHI) identified in your transcript.</p>
315    /// <p>Content identification is performed at the segment level; PHI is flagged upon complete transcription of an audio segment.</p>
316    /// <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/phi-id.html">Identifying personal health information (PHI) in a transcription</a>.</p>
317    pub fn content_identification_type(mut self, input: crate::types::MedicalContentIdentificationType) -> Self {
318                    self.inner = self.inner.content_identification_type(input);
319                    self
320                }
321    /// <p>Labels all personal health information (PHI) identified in your transcript.</p>
322    /// <p>Content identification is performed at the segment level; PHI is flagged upon complete transcription of an audio segment.</p>
323    /// <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/phi-id.html">Identifying personal health information (PHI) in a transcription</a>.</p>
324    pub fn set_content_identification_type(mut self, input: ::std::option::Option<crate::types::MedicalContentIdentificationType>) -> Self {
325                    self.inner = self.inner.set_content_identification_type(input);
326                    self
327                }
328    /// <p>Labels all personal health information (PHI) identified in your transcript.</p>
329    /// <p>Content identification is performed at the segment level; PHI is flagged upon complete transcription of an audio segment.</p>
330    /// <p>For more information, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/phi-id.html">Identifying personal health information (PHI) in a transcription</a>.</p>
331    pub fn get_content_identification_type(&self) -> &::std::option::Option<crate::types::MedicalContentIdentificationType> {
332                    self.inner.get_content_identification_type()
333                }
334}
335