aws-sdk-endusermessaging 1.0.0

AWS SDK for AWS End User Messaging
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::send_notify_code_verification::_send_notify_code_verification_input::SendNotifyCodeVerificationInputBuilder;

pub use crate::operation::send_notify_code_verification::_send_notify_code_verification_output::SendNotifyCodeVerificationOutputBuilder;

impl crate::operation::send_notify_code_verification::builders::SendNotifyCodeVerificationInputBuilder {
    /// 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_notify_code_verification::SendNotifyCodeVerificationOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::send_notify_code_verification::SendNotifyCodeVerificationError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.send_notify_code_verification();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `SendNotifyCodeVerification`.
///
/// <p>Generates a one-time passcode and delivers it to a recipient over the requested channel. The passcode policy is captured from the referenced notify code configuration at the time of the request, so later updates to the configuration do not affect verifications that are already in progress.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct SendNotifyCodeVerificationFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::send_notify_code_verification::builders::SendNotifyCodeVerificationInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::send_notify_code_verification::SendNotifyCodeVerificationOutput,
        crate::operation::send_notify_code_verification::SendNotifyCodeVerificationError,
    > for SendNotifyCodeVerificationFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::send_notify_code_verification::SendNotifyCodeVerificationOutput,
            crate::operation::send_notify_code_verification::SendNotifyCodeVerificationError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl SendNotifyCodeVerificationFluentBuilder {
    /// Creates a new `SendNotifyCodeVerificationFluentBuilder`.
    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 SendNotifyCodeVerification as a reference.
    pub fn as_input(&self) -> &crate::operation::send_notify_code_verification::builders::SendNotifyCodeVerificationInputBuilder {
        &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_notify_code_verification::SendNotifyCodeVerificationOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::send_notify_code_verification::SendNotifyCodeVerificationError,
            ::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_notify_code_verification::SendNotifyCodeVerification::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::send_notify_code_verification::SendNotifyCodeVerification::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_notify_code_verification::SendNotifyCodeVerificationOutput,
        crate::operation::send_notify_code_verification::SendNotifyCodeVerificationError,
        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>The channel used to deliver the one-time passcode to the recipient.</p>
    pub fn channel(mut self, input: crate::types::NotifyChannel) -> Self {
        self.inner = self.inner.channel(input);
        self
    }
    /// <p>The channel used to deliver the one-time passcode to the recipient.</p>
    pub fn set_channel(mut self, input: ::std::option::Option<crate::types::NotifyChannel>) -> Self {
        self.inner = self.inner.set_channel(input);
        self
    }
    /// <p>The channel used to deliver the one-time passcode to the recipient.</p>
    pub fn get_channel(&self) -> &::std::option::Option<crate::types::NotifyChannel> {
        self.inner.get_channel()
    }
    /// <p>The recipient identifier. For the TEXT and VOICE channels, specify an E.164 phone number. For the WhatsApp channel, specify a WhatsApp address.</p>
    pub fn destination_identity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.destination_identity(input.into());
        self
    }
    /// <p>The recipient identifier. For the TEXT and VOICE channels, specify an E.164 phone number. For the WhatsApp channel, specify a WhatsApp address.</p>
    pub fn set_destination_identity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_destination_identity(input);
        self
    }
    /// <p>The recipient identifier. For the TEXT and VOICE channels, specify an E.164 phone number. For the WhatsApp channel, specify a WhatsApp address.</p>
    pub fn get_destination_identity(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_destination_identity()
    }
    /// <p>The identity used to send the message, such as a phone number, sender ID, or pool that is owned by your account.</p>
    pub fn origination_identity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.origination_identity(input.into());
        self
    }
    /// <p>The identity used to send the message, such as a phone number, sender ID, or pool that is owned by your account.</p>
    pub fn set_origination_identity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_origination_identity(input);
        self
    }
    /// <p>The identity used to send the message, such as a phone number, sender ID, or pool that is owned by your account.</p>
    pub fn get_origination_identity(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_origination_identity()
    }
    /// <p>The identifier or Amazon Resource Name (ARN) of the notify code configuration that supplies the passcode policy and template defaults. When you do not specify a configuration, you must supply the template in the request.</p>
    pub fn notify_code_configuration(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.notify_code_configuration(input.into());
        self
    }
    /// <p>The identifier or Amazon Resource Name (ARN) of the notify code configuration that supplies the passcode policy and template defaults. When you do not specify a configuration, you must supply the template in the request.</p>
    pub fn set_notify_code_configuration(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_notify_code_configuration(input);
        self
    }
    /// <p>The identifier or Amazon Resource Name (ARN) of the notify code configuration that supplies the passcode policy and template defaults. When you do not specify a configuration, you must supply the template in the request.</p>
    pub fn get_notify_code_configuration(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_notify_code_configuration()
    }
    /// <p>The channel-specific parameters used to render and deliver the one-time passcode for this request. The route that is derived from the channel and the origination identity selects the matching channel. When you do not specify channel parameters, the service uses the parameters from the referenced notify code configuration.</p>
    pub fn override_channel_parameters(mut self, input: crate::types::ChannelParameters) -> Self {
        self.inner = self.inner.override_channel_parameters(input);
        self
    }
    /// <p>The channel-specific parameters used to render and deliver the one-time passcode for this request. The route that is derived from the channel and the origination identity selects the matching channel. When you do not specify channel parameters, the service uses the parameters from the referenced notify code configuration.</p>
    pub fn set_override_channel_parameters(mut self, input: ::std::option::Option<crate::types::ChannelParameters>) -> Self {
        self.inner = self.inner.set_override_channel_parameters(input);
        self
    }
    /// <p>The channel-specific parameters used to render and deliver the one-time passcode for this request. The route that is derived from the channel and the origination identity selects the matching channel. When you do not specify channel parameters, the service uses the parameters from the referenced notify code configuration.</p>
    pub fn get_override_channel_parameters(&self) -> &::std::option::Option<crate::types::ChannelParameters> {
        self.inner.get_override_channel_parameters()
    }
    /// <p>The per-send overrides for the passcode policy parameters, including the code type, length, validity period, and maximum number of attempts. These values override the values from the referenced notify code configuration. When you do not specify a value, the value from the configuration is used, and if neither is set, the service default applies.</p>
    pub fn override_code_configuration_parameters(mut self, input: crate::types::CodeConfigurationParameters) -> Self {
        self.inner = self.inner.override_code_configuration_parameters(input);
        self
    }
    /// <p>The per-send overrides for the passcode policy parameters, including the code type, length, validity period, and maximum number of attempts. These values override the values from the referenced notify code configuration. When you do not specify a value, the value from the configuration is used, and if neither is set, the service default applies.</p>
    pub fn set_override_code_configuration_parameters(mut self, input: ::std::option::Option<crate::types::CodeConfigurationParameters>) -> Self {
        self.inner = self.inner.set_override_code_configuration_parameters(input);
        self
    }
    /// <p>The per-send overrides for the passcode policy parameters, including the code type, length, validity period, and maximum number of attempts. These values override the values from the referenced notify code configuration. When you do not specify a value, the value from the configuration is used, and if neither is set, the service default applies.</p>
    pub fn get_override_code_configuration_parameters(&self) -> &::std::option::Option<crate::types::CodeConfigurationParameters> {
        self.inner.get_override_code_configuration_parameters()
    }
    /// <p>The name of the configuration set used to control how delivery events for the message are handled.</p>
    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
    }
    /// <p>The name of the configuration set used to control how delivery events for the message are handled.</p>
    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
    }
    /// <p>The name of the configuration set used to control how delivery events for the message are handled.</p>
    pub fn get_configuration_set_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_configuration_set_name()
    }
    ///
    /// Adds a key-value pair to `context`.
    ///
    /// To override the contents of this collection use [`set_context`](Self::set_context).
    ///
    /// <p>A map of custom key and value pairs that are propagated to the delivery events for this verification.</p>
    pub fn context(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.context(k.into(), v.into());
        self
    }
    /// <p>A map of custom key and value pairs that are propagated to the delivery events for this verification.</p>
    pub fn set_context(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.inner = self.inner.set_context(input);
        self
    }
    /// <p>A map of custom key and value pairs that are propagated to the delivery events for this verification.</p>
    pub fn get_context(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.inner.get_context()
    }
    /// <p>A caller-supplied reference identifier that binds a send request to a later validate request. Specify the same value in both requests.</p>
    pub fn reference_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.reference_id(input.into());
        self
    }
    /// <p>A caller-supplied reference identifier that binds a send request to a later validate request. Specify the same value in both requests.</p>
    pub fn set_reference_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_reference_id(input);
        self
    }
    /// <p>A caller-supplied reference identifier that binds a send request to a later validate request. Specify the same value in both requests.</p>
    pub fn get_reference_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_reference_id()
    }
}