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.

/// <p>The input for the ReplaceTopicRule operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ReplaceTopicRuleInput {
    /// <p>The name of the rule.</p>
    pub rule_name: ::std::option::Option<::std::string::String>,
    /// <p>The rule payload.</p>
    pub topic_rule_payload: ::std::option::Option<crate::types::TopicRulePayload>,
}
impl ReplaceTopicRuleInput {
    /// <p>The name of the rule.</p>
    pub fn rule_name(&self) -> ::std::option::Option<&str> {
        self.rule_name.as_deref()
    }
    /// <p>The rule payload.</p>
    pub fn topic_rule_payload(&self) -> ::std::option::Option<&crate::types::TopicRulePayload> {
        self.topic_rule_payload.as_ref()
    }
}
impl ReplaceTopicRuleInput {
    /// Creates a new builder-style object to manufacture [`ReplaceTopicRuleInput`](crate::operation::replace_topic_rule::ReplaceTopicRuleInput).
    pub fn builder() -> crate::operation::replace_topic_rule::builders::ReplaceTopicRuleInputBuilder {
        crate::operation::replace_topic_rule::builders::ReplaceTopicRuleInputBuilder::default()
    }
}

/// A builder for [`ReplaceTopicRuleInput`](crate::operation::replace_topic_rule::ReplaceTopicRuleInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ReplaceTopicRuleInputBuilder {
    pub(crate) rule_name: ::std::option::Option<::std::string::String>,
    pub(crate) topic_rule_payload: ::std::option::Option<crate::types::TopicRulePayload>,
}
impl ReplaceTopicRuleInputBuilder {
    /// <p>The name of the rule.</p>
    /// This field is required.
    pub fn rule_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.rule_name = ::std::option::Option::Some(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.rule_name = input;
        self
    }
    /// <p>The name of the rule.</p>
    pub fn get_rule_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.rule_name
    }
    /// <p>The rule payload.</p>
    /// This field is required.
    pub fn topic_rule_payload(mut self, input: crate::types::TopicRulePayload) -> Self {
        self.topic_rule_payload = ::std::option::Option::Some(input);
        self
    }
    /// <p>The rule payload.</p>
    pub fn set_topic_rule_payload(mut self, input: ::std::option::Option<crate::types::TopicRulePayload>) -> Self {
        self.topic_rule_payload = input;
        self
    }
    /// <p>The rule payload.</p>
    pub fn get_topic_rule_payload(&self) -> &::std::option::Option<crate::types::TopicRulePayload> {
        &self.topic_rule_payload
    }
    /// Consumes the builder and constructs a [`ReplaceTopicRuleInput`](crate::operation::replace_topic_rule::ReplaceTopicRuleInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::replace_topic_rule::ReplaceTopicRuleInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::replace_topic_rule::ReplaceTopicRuleInput {
            rule_name: self.rule_name,
            topic_rule_payload: self.topic_rule_payload,
        })
    }
}