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