aws-sdk-pinpointsmsvoice 1.23.0

AWS SDK for Amazon Pinpoint SMS and Voice Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::send_voice_message::_send_voice_message_output::SendVoiceMessageOutputBuilder;

pub use crate::operation::send_voice_message::_send_voice_message_input::SendVoiceMessageInputBuilder;

impl crate::operation::send_voice_message::builders::SendVoiceMessageInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::send_voice_message::SendVoiceMessageOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::send_voice_message::SendVoiceMessageError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.send_voice_message();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `SendVoiceMessage`.
///
/// Create a new voice message and send it to a recipient's phone number.
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct SendVoiceMessageFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::send_voice_message::builders::SendVoiceMessageInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::send_voice_message::SendVoiceMessageOutput,
        crate::operation::send_voice_message::SendVoiceMessageError,
    > for SendVoiceMessageFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::send_voice_message::SendVoiceMessageOutput,
            crate::operation::send_voice_message::SendVoiceMessageError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl SendVoiceMessageFluentBuilder {
    /// Creates a new `SendVoiceMessageFluentBuilder`.
    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 SendVoiceMessage as a reference.
    pub fn as_input(&self) -> &crate::operation::send_voice_message::builders::SendVoiceMessageInputBuilder {
        &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::send_voice_message::SendVoiceMessageOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::send_voice_message::SendVoiceMessageError,
            ::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::send_voice_message::SendVoiceMessage::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::send_voice_message::SendVoiceMessage::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::send_voice_message::SendVoiceMessageOutput,
        crate::operation::send_voice_message::SendVoiceMessageError,
        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
    }
    /// The phone number that appears on recipients' devices when they receive the message.
    pub fn caller_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.caller_id(input.into());
        self
    }
    /// The phone number that appears on recipients' devices when they receive the message.
    pub fn set_caller_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_caller_id(input);
        self
    }
    /// The phone number that appears on recipients' devices when they receive the message.
    pub fn get_caller_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_caller_id()
    }
    /// The name of the configuration set that you want to use to send the message.
    pub fn configuration_set_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.configuration_set_name(input.into());
        self
    }
    /// The name of the configuration set that you want to use to send the message.
    pub fn set_configuration_set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_configuration_set_name(input);
        self
    }
    /// The name of the configuration set that you want to use to send the message.
    pub fn get_configuration_set_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_configuration_set_name()
    }
    /// An object that contains a voice message and information about the recipient that you want to send it to.
    pub fn content(mut self, input: crate::types::VoiceMessageContent) -> Self {
        self.inner = self.inner.content(input);
        self
    }
    /// An object that contains a voice message and information about the recipient that you want to send it to.
    pub fn set_content(mut self, input: ::std::option::Option<crate::types::VoiceMessageContent>) -> Self {
        self.inner = self.inner.set_content(input);
        self
    }
    /// An object that contains a voice message and information about the recipient that you want to send it to.
    pub fn get_content(&self) -> &::std::option::Option<crate::types::VoiceMessageContent> {
        self.inner.get_content()
    }
    /// The phone number that you want to send the voice message to.
    pub fn destination_phone_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.destination_phone_number(input.into());
        self
    }
    /// The phone number that you want to send the voice message to.
    pub fn set_destination_phone_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_destination_phone_number(input);
        self
    }
    /// The phone number that you want to send the voice message to.
    pub fn get_destination_phone_number(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_destination_phone_number()
    }
    /// The phone number that Amazon Pinpoint should use to send the voice message. This isn't necessarily the phone number that appears on recipients' devices when they receive the message, because you can specify a CallerId parameter in the request.
    pub fn origination_phone_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.origination_phone_number(input.into());
        self
    }
    /// The phone number that Amazon Pinpoint should use to send the voice message. This isn't necessarily the phone number that appears on recipients' devices when they receive the message, because you can specify a CallerId parameter in the request.
    pub fn set_origination_phone_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_origination_phone_number(input);
        self
    }
    /// The phone number that Amazon Pinpoint should use to send the voice message. This isn't necessarily the phone number that appears on recipients' devices when they receive the message, because you can specify a CallerId parameter in the request.
    pub fn get_origination_phone_number(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_origination_phone_number()
    }
}