aws-sdk-pinpointsmsvoicev2 1.124.0

AWS SDK for Amazon Pinpoint SMS Voice V2
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_event_destination::_create_event_destination_input::CreateEventDestinationInputBuilder;

pub use crate::operation::create_event_destination::_create_event_destination_output::CreateEventDestinationOutputBuilder;

impl crate::operation::create_event_destination::builders::CreateEventDestinationInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::create_event_destination::CreateEventDestinationOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_event_destination::CreateEventDestinationError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_event_destination();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateEventDestination`.
///
/// <p>Creates a new event destination in a configuration set.</p>
/// <p>An event destination is a location where you send message events. The event options are Amazon CloudWatch, Amazon Data Firehose, or Amazon SNS. For example, when a message is delivered successfully, you can send information about that event to an event destination, or send notifications to endpoints that are subscribed to an Amazon SNS topic.</p>
/// <p>You can only create one event destination at a time. You must provide a value for a single event destination using either <code>CloudWatchLogsDestination</code>, <code>KinesisFirehoseDestination</code> or <code>SnsDestination</code>. If an event destination isn't provided then an exception is returned.</p>
/// <p>Each configuration set can contain between 0 and 5 event destinations. Each event destination can contain a reference to a single destination, such as a CloudWatch or Firehose destination.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateEventDestinationFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_event_destination::builders::CreateEventDestinationInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_event_destination::CreateEventDestinationOutput,
        crate::operation::create_event_destination::CreateEventDestinationError,
    > for CreateEventDestinationFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_event_destination::CreateEventDestinationOutput,
            crate::operation::create_event_destination::CreateEventDestinationError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateEventDestinationFluentBuilder {
    /// Creates a new `CreateEventDestinationFluentBuilder`.
    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 CreateEventDestination as a reference.
    pub fn as_input(&self) -> &crate::operation::create_event_destination::builders::CreateEventDestinationInputBuilder {
        &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::create_event_destination::CreateEventDestinationOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_event_destination::CreateEventDestinationError,
            ::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::create_event_destination::CreateEventDestination::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_event_destination::CreateEventDestination::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::create_event_destination::CreateEventDestinationOutput,
        crate::operation::create_event_destination::CreateEventDestinationError,
        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>Either the name of the configuration set or the configuration set ARN to apply event logging to. The ConfigurateSetName and ConfigurationSetArn can be found using the <code>DescribeConfigurationSets</code> action.</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>Either the name of the configuration set or the configuration set ARN to apply event logging to. The ConfigurateSetName and ConfigurationSetArn can be found using the <code>DescribeConfigurationSets</code> action.</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>Either the name of the configuration set or the configuration set ARN to apply event logging to. The ConfigurateSetName and ConfigurationSetArn can be found using the <code>DescribeConfigurationSets</code> action.</p>
    pub fn get_configuration_set_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_configuration_set_name()
    }
    /// <p>The name that identifies the event destination.</p>
    pub fn event_destination_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.event_destination_name(input.into());
        self
    }
    /// <p>The name that identifies the event destination.</p>
    pub fn set_event_destination_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_event_destination_name(input);
        self
    }
    /// <p>The name that identifies the event destination.</p>
    pub fn get_event_destination_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_event_destination_name()
    }
    ///
    /// Appends an item to `MatchingEventTypes`.
    ///
    /// To override the contents of this collection use [`set_matching_event_types`](Self::set_matching_event_types).
    ///
    /// <p>An array of event types that determine which events to log. If "ALL" is used, then End User Messaging SMS logs every event type.</p><note>
    /// <p>The <code>TEXT_SENT</code> event type is not supported.</p>
    /// </note>
    pub fn matching_event_types(mut self, input: crate::types::EventType) -> Self {
        self.inner = self.inner.matching_event_types(input);
        self
    }
    /// <p>An array of event types that determine which events to log. If "ALL" is used, then End User Messaging SMS logs every event type.</p><note>
    /// <p>The <code>TEXT_SENT</code> event type is not supported.</p>
    /// </note>
    pub fn set_matching_event_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EventType>>) -> Self {
        self.inner = self.inner.set_matching_event_types(input);
        self
    }
    /// <p>An array of event types that determine which events to log. If "ALL" is used, then End User Messaging SMS logs every event type.</p><note>
    /// <p>The <code>TEXT_SENT</code> event type is not supported.</p>
    /// </note>
    pub fn get_matching_event_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EventType>> {
        self.inner.get_matching_event_types()
    }
    /// <p>An object that contains information about an event destination for logging to Amazon CloudWatch Logs.</p>
    pub fn cloud_watch_logs_destination(mut self, input: crate::types::CloudWatchLogsDestination) -> Self {
        self.inner = self.inner.cloud_watch_logs_destination(input);
        self
    }
    /// <p>An object that contains information about an event destination for logging to Amazon CloudWatch Logs.</p>
    pub fn set_cloud_watch_logs_destination(mut self, input: ::std::option::Option<crate::types::CloudWatchLogsDestination>) -> Self {
        self.inner = self.inner.set_cloud_watch_logs_destination(input);
        self
    }
    /// <p>An object that contains information about an event destination for logging to Amazon CloudWatch Logs.</p>
    pub fn get_cloud_watch_logs_destination(&self) -> &::std::option::Option<crate::types::CloudWatchLogsDestination> {
        self.inner.get_cloud_watch_logs_destination()
    }
    /// <p>An object that contains information about an event destination for logging to Amazon Data Firehose.</p>
    pub fn kinesis_firehose_destination(mut self, input: crate::types::KinesisFirehoseDestination) -> Self {
        self.inner = self.inner.kinesis_firehose_destination(input);
        self
    }
    /// <p>An object that contains information about an event destination for logging to Amazon Data Firehose.</p>
    pub fn set_kinesis_firehose_destination(mut self, input: ::std::option::Option<crate::types::KinesisFirehoseDestination>) -> Self {
        self.inner = self.inner.set_kinesis_firehose_destination(input);
        self
    }
    /// <p>An object that contains information about an event destination for logging to Amazon Data Firehose.</p>
    pub fn get_kinesis_firehose_destination(&self) -> &::std::option::Option<crate::types::KinesisFirehoseDestination> {
        self.inner.get_kinesis_firehose_destination()
    }
    /// <p>An object that contains information about an event destination for logging to Amazon SNS.</p>
    pub fn sns_destination(mut self, input: crate::types::SnsDestination) -> Self {
        self.inner = self.inner.sns_destination(input);
        self
    }
    /// <p>An object that contains information about an event destination for logging to Amazon SNS.</p>
    pub fn set_sns_destination(mut self, input: ::std::option::Option<crate::types::SnsDestination>) -> Self {
        self.inner = self.inner.set_sns_destination(input);
        self
    }
    /// <p>An object that contains information about an event destination for logging to Amazon SNS.</p>
    pub fn get_sns_destination(&self) -> &::std::option::Option<crate::types::SnsDestination> {
        self.inner.get_sns_destination()
    }
    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don't specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.client_token(input.into());
        self
    }
    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don't specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_client_token(input);
        self
    }
    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don't specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_client_token()
    }
}