aws-sdk-iot 1.112.0

AWS SDK for AWS IoT
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::replace_topic_rule::_replace_topic_rule_input::ReplaceTopicRuleInputBuilder;

pub use crate::operation::replace_topic_rule::_replace_topic_rule_output::ReplaceTopicRuleOutputBuilder;

impl crate::operation::replace_topic_rule::builders::ReplaceTopicRuleInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::replace_topic_rule::ReplaceTopicRuleOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::replace_topic_rule::ReplaceTopicRuleError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.replace_topic_rule();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `ReplaceTopicRule`.
///
/// <p>Replaces the rule. You must specify all parameters for the new rule. Creating rules is an administrator-level action. Any user who has permission to create rules will be able to access data processed by the rule.</p>
/// <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">ReplaceTopicRule</a> action.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct ReplaceTopicRuleFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::replace_topic_rule::builders::ReplaceTopicRuleInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::replace_topic_rule::ReplaceTopicRuleOutput,
        crate::operation::replace_topic_rule::ReplaceTopicRuleError,
    > for ReplaceTopicRuleFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::replace_topic_rule::ReplaceTopicRuleOutput,
            crate::operation::replace_topic_rule::ReplaceTopicRuleError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl ReplaceTopicRuleFluentBuilder {
    /// Creates a new `ReplaceTopicRuleFluentBuilder`.
    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 ReplaceTopicRule as a reference.
    pub fn as_input(&self) -> &crate::operation::replace_topic_rule::builders::ReplaceTopicRuleInputBuilder {
        &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::replace_topic_rule::ReplaceTopicRuleOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::replace_topic_rule::ReplaceTopicRuleError,
            ::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::replace_topic_rule::ReplaceTopicRule::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::replace_topic_rule::ReplaceTopicRule::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::replace_topic_rule::ReplaceTopicRuleOutput,
        crate::operation::replace_topic_rule::ReplaceTopicRuleError,
        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 name of the rule.</p>
    pub fn rule_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.rule_name(input.into());
        self
    }
    /// <p>The name of the rule.</p>
    pub fn set_rule_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_rule_name(input);
        self
    }
    /// <p>The name of the rule.</p>
    pub fn get_rule_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_rule_name()
    }
    /// <p>The rule payload.</p>
    pub fn topic_rule_payload(mut self, input: crate::types::TopicRulePayload) -> Self {
        self.inner = self.inner.topic_rule_payload(input);
        self
    }
    /// <p>The rule payload.</p>
    pub fn set_topic_rule_payload(mut self, input: ::std::option::Option<crate::types::TopicRulePayload>) -> Self {
        self.inner = self.inner.set_topic_rule_payload(input);
        self
    }
    /// <p>The rule payload.</p>
    pub fn get_topic_rule_payload(&self) -> &::std::option::Option<crate::types::TopicRulePayload> {
        self.inner.get_topic_rule_payload()
    }
}