aws_sdk_transcribestreaming/operation/start_medical_scribe_stream/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_medical_scribe_stream::_start_medical_scribe_stream_output::StartMedicalScribeStreamOutputBuilder;
3
4pub use crate::operation::start_medical_scribe_stream::_start_medical_scribe_stream_input::StartMedicalScribeStreamInputBuilder;
5
6impl crate::operation::start_medical_scribe_stream::builders::StartMedicalScribeStreamInputBuilder {
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_scribe_stream::StartMedicalScribeStreamOutput,
10                        ::aws_smithy_runtime_api::client::result::SdkError<
11                            crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError,
12                            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse
13                        >
14                    > {
15                        let mut fluent_builder = client.start_medical_scribe_stream();
16                        fluent_builder.inner = self;
17                        fluent_builder.send().await
18                    }
19                }
20/// Fluent builder constructing a request to `StartMedicalScribeStream`.
21/// 
22/// <p>Starts a bidirectional HTTP/2 stream, where audio is streamed to Amazon Web Services HealthScribe and the transcription results are streamed to your application.</p>
23/// <p>When you start a stream, you first specify the stream configuration in a <code>MedicalScribeConfigurationEvent</code>. This event includes channel definitions, encryption settings, medical scribe context, and post-stream analytics settings, such as the output configuration for aggregated transcript and clinical note generation. These are additional streaming session configurations beyond those provided in your initial start request headers. Whether you are starting a new session or resuming an existing session, your first event must be a <code>MedicalScribeConfigurationEvent</code>.</p>
24/// <p>After you send a <code>MedicalScribeConfigurationEvent</code>, you start <code>AudioEvents</code> and Amazon Web Services HealthScribe responds with real-time transcription results. When you are finished, to start processing the results with the post-stream analytics, send a <code>MedicalScribeSessionControlEvent</code> with a <code>Type</code> of <code>END_OF_SESSION</code> and Amazon Web Services HealthScribe starts the analytics.</p>
25/// <p>You can pause or resume streaming. To pause streaming, complete the input stream without sending the <code>MedicalScribeSessionControlEvent</code>. To resume streaming, call the <code>StartMedicalScribeStream</code> and specify the same SessionId you used to start the stream.</p>
26/// <p>The following parameters are required:</p>
27/// <ul>
28/// <li>
29/// <p><code>language-code</code></p></li>
30/// <li>
31/// <p><code>media-encoding</code></p></li>
32/// <li>
33/// <p><code>media-sample-rate-hertz</code></p></li>
34/// </ul>
35/// <p></p>
36/// <p>For more information on streaming with Amazon Web Services HealthScribe, see <a href="https://docs.aws.amazon.com/transcribe/latest/dg/health-scribe-streaming.html">Amazon Web Services HealthScribe</a>.</p>
37#[derive(::std::fmt::Debug)]
38pub struct StartMedicalScribeStreamFluentBuilder {
39                handle: ::std::sync::Arc<crate::client::Handle>,
40                inner: crate::operation::start_medical_scribe_stream::builders::StartMedicalScribeStreamInputBuilder,
41config_override: ::std::option::Option<crate::config::Builder>,
42            }
43impl
44                crate::client::customize::internal::CustomizableSend<
45                    crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamOutput,
46                    crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError,
47                > for StartMedicalScribeStreamFluentBuilder
48            {
49                fn send(
50                    self,
51                    config_override: crate::config::Builder,
52                ) -> crate::client::customize::internal::BoxFuture<
53                    crate::client::customize::internal::SendResult<
54                        crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamOutput,
55                        crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError,
56                    >,
57                > {
58                    ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
59                }
60            }
61impl StartMedicalScribeStreamFluentBuilder {
62    /// Creates a new `StartMedicalScribeStreamFluentBuilder`.
63                    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
64                        Self {
65                            handle,
66                            inner: ::std::default::Default::default(),
67    config_override: ::std::option::Option::None,
68                        }
69                    }
70    /// Access the StartMedicalScribeStream as a reference.
71                    pub fn as_input(&self) -> &crate::operation::start_medical_scribe_stream::builders::StartMedicalScribeStreamInputBuilder {
72                        &self.inner
73                    }
74    /// Sends the request and returns the response.
75                    ///
76                    /// If an error occurs, an `SdkError` will be returned with additional details that
77                    /// can be matched against.
78                    ///
79                    /// By default, any retryable failures will be retried twice. Retry behavior
80                    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
81                    /// set when configuring the client.
82                    pub async fn send(self) -> ::std::result::Result<crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>> {
83                        let input = self.inner.build().map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84                        let runtime_plugins = crate::operation::start_medical_scribe_stream::StartMedicalScribeStream::operation_runtime_plugins(
85                            self.handle.runtime_plugins.clone(),
86                            &self.handle.conf,
87                            self.config_override,
88                        );
89                        crate::operation::start_medical_scribe_stream::StartMedicalScribeStream::orchestrate(&runtime_plugins, input).await
90                    }
91    
92                    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93                    pub fn customize(
94                        self,
95                    ) -> crate::client::customize::CustomizableOperation<crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamOutput, crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError, Self> {
96                        crate::client::customize::CustomizableOperation::new(self)
97                    }
98    pub(crate) fn config_override(
99                            mut self,
100                            config_override: impl ::std::convert::Into<crate::config::Builder>,
101                        ) -> Self {
102                            self.set_config_override(::std::option::Option::Some(config_override.into()));
103                            self
104                        }
105    
106                        pub(crate) fn set_config_override(
107                            &mut self,
108                            config_override: ::std::option::Option<crate::config::Builder>,
109                        ) -> &mut Self {
110                            self.config_override = config_override;
111                            self
112                        }
113    /// <p>Specify an identifier for your streaming session (in UUID format). If you don't include a SessionId in your request, Amazon Web Services HealthScribe generates an ID and returns it in the response.</p>
114    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115                    self.inner = self.inner.session_id(input.into());
116                    self
117                }
118    /// <p>Specify an identifier for your streaming session (in UUID format). If you don't include a SessionId in your request, Amazon Web Services HealthScribe generates an ID and returns it in the response.</p>
119    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120                    self.inner = self.inner.set_session_id(input);
121                    self
122                }
123    /// <p>Specify an identifier for your streaming session (in UUID format). If you don't include a SessionId in your request, Amazon Web Services HealthScribe generates an ID and returns it in the response.</p>
124    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
125                    self.inner.get_session_id()
126                }
127    /// <p>Specify the language code for your HealthScribe streaming session.</p>
128    pub fn language_code(mut self, input: crate::types::MedicalScribeLanguageCode) -> Self {
129                    self.inner = self.inner.language_code(input);
130                    self
131                }
132    /// <p>Specify the language code for your HealthScribe streaming session.</p>
133    pub fn set_language_code(mut self, input: ::std::option::Option<crate::types::MedicalScribeLanguageCode>) -> Self {
134                    self.inner = self.inner.set_language_code(input);
135                    self
136                }
137    /// <p>Specify the language code for your HealthScribe streaming session.</p>
138    pub fn get_language_code(&self) -> &::std::option::Option<crate::types::MedicalScribeLanguageCode> {
139                    self.inner.get_language_code()
140                }
141    /// <p>Specify the sample rate of the input audio (in hertz). Amazon Web Services HealthScribe supports a range from 16,000 Hz to 48,000 Hz. The sample rate you specify must match that of your audio.</p>
142    pub fn media_sample_rate_hertz(mut self, input: i32) -> Self {
143                    self.inner = self.inner.media_sample_rate_hertz(input);
144                    self
145                }
146    /// <p>Specify the sample rate of the input audio (in hertz). Amazon Web Services HealthScribe supports a range from 16,000 Hz to 48,000 Hz. The sample rate you specify must match that of your audio.</p>
147    pub fn set_media_sample_rate_hertz(mut self, input: ::std::option::Option<i32>) -> Self {
148                    self.inner = self.inner.set_media_sample_rate_hertz(input);
149                    self
150                }
151    /// <p>Specify the sample rate of the input audio (in hertz). Amazon Web Services HealthScribe supports a range from 16,000 Hz to 48,000 Hz. The sample rate you specify must match that of your audio.</p>
152    pub fn get_media_sample_rate_hertz(&self) -> &::std::option::Option<i32> {
153                    self.inner.get_media_sample_rate_hertz()
154                }
155    /// <p>Specify the encoding used for the input audio.</p>
156    /// <p>Supported formats are:</p>
157    /// <ul>
158    /// <li>
159    /// <p>FLAC</p></li>
160    /// <li>
161    /// <p>OPUS-encoded audio in an Ogg container</p></li>
162    /// <li>
163    /// <p>PCM (only signed 16-bit little-endian audio formats, which does not include WAV)</p></li>
164    /// </ul>
165    /// <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>
166    pub fn media_encoding(mut self, input: crate::types::MedicalScribeMediaEncoding) -> Self {
167                    self.inner = self.inner.media_encoding(input);
168                    self
169                }
170    /// <p>Specify the encoding used for the input audio.</p>
171    /// <p>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 set_media_encoding(mut self, input: ::std::option::Option<crate::types::MedicalScribeMediaEncoding>) -> Self {
182                    self.inner = self.inner.set_media_encoding(input);
183                    self
184                }
185    /// <p>Specify the encoding used for the input audio.</p>
186    /// <p>Supported formats are:</p>
187    /// <ul>
188    /// <li>
189    /// <p>FLAC</p></li>
190    /// <li>
191    /// <p>OPUS-encoded audio in an Ogg container</p></li>
192    /// <li>
193    /// <p>PCM (only signed 16-bit little-endian audio formats, which does not include WAV)</p></li>
194    /// </ul>
195    /// <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>
196    pub fn get_media_encoding(&self) -> &::std::option::Option<crate::types::MedicalScribeMediaEncoding> {
197                    self.inner.get_media_encoding()
198                }
199    /// <p>Specify the input stream where you will send events in real time.</p>
200    /// <p>The first element of the input stream must be a <code>MedicalScribeConfigurationEvent</code>.</p>
201    pub fn input_stream(mut self, input: ::aws_smithy_http::event_stream::EventStreamSender<crate::types::MedicalScribeInputStream, crate::types::error::MedicalScribeInputStreamError>) -> Self {
202                    self.inner = self.inner.input_stream(input);
203                    self
204                }
205    /// <p>Specify the input stream where you will send events in real time.</p>
206    /// <p>The first element of the input stream must be a <code>MedicalScribeConfigurationEvent</code>.</p>
207    pub fn set_input_stream(mut self, input: ::std::option::Option<::aws_smithy_http::event_stream::EventStreamSender<crate::types::MedicalScribeInputStream, crate::types::error::MedicalScribeInputStreamError>>) -> Self {
208                    self.inner = self.inner.set_input_stream(input);
209                    self
210                }
211    /// <p>Specify the input stream where you will send events in real time.</p>
212    /// <p>The first element of the input stream must be a <code>MedicalScribeConfigurationEvent</code>.</p>
213    pub fn get_input_stream(&self) -> &::std::option::Option<::aws_smithy_http::event_stream::EventStreamSender<crate::types::MedicalScribeInputStream, crate::types::error::MedicalScribeInputStreamError>> {
214                    self.inner.get_input_stream()
215                }
216}
217