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 CreateTopicRule operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateTopicRuleInput {
    /// <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>,
    /// <p>Metadata which can be used to manage the topic rule.</p><note>
    /// <p>For URI Request parameters use format: ...key1=value1&amp;key2=value2...</p>
    /// <p>For the CLI command-line parameter use format: --tags "key1=value1&amp;key2=value2..."</p>
    /// <p>For the cli-input-json file use format: "tags": "key1=value1&amp;key2=value2..."</p>
    /// </note>
    pub tags: ::std::option::Option<::std::string::String>,
}
impl CreateTopicRuleInput {
    /// <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()
    }
    /// <p>Metadata which can be used to manage the topic rule.</p><note>
    /// <p>For URI Request parameters use format: ...key1=value1&amp;key2=value2...</p>
    /// <p>For the CLI command-line parameter use format: --tags "key1=value1&amp;key2=value2..."</p>
    /// <p>For the cli-input-json file use format: "tags": "key1=value1&amp;key2=value2..."</p>
    /// </note>
    pub fn tags(&self) -> ::std::option::Option<&str> {
        self.tags.as_deref()
    }
}
impl CreateTopicRuleInput {
    /// Creates a new builder-style object to manufacture [`CreateTopicRuleInput`](crate::operation::create_topic_rule::CreateTopicRuleInput).
    pub fn builder() -> crate::operation::create_topic_rule::builders::CreateTopicRuleInputBuilder {
        crate::operation::create_topic_rule::builders::CreateTopicRuleInputBuilder::default()
    }
}

/// A builder for [`CreateTopicRuleInput`](crate::operation::create_topic_rule::CreateTopicRuleInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateTopicRuleInputBuilder {
    pub(crate) rule_name: ::std::option::Option<::std::string::String>,
    pub(crate) topic_rule_payload: ::std::option::Option<crate::types::TopicRulePayload>,
    pub(crate) tags: ::std::option::Option<::std::string::String>,
}
impl CreateTopicRuleInputBuilder {
    /// <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
    }
    /// <p>Metadata which can be used to manage the topic rule.</p><note>
    /// <p>For URI Request parameters use format: ...key1=value1&amp;key2=value2...</p>
    /// <p>For the CLI command-line parameter use format: --tags "key1=value1&amp;key2=value2..."</p>
    /// <p>For the cli-input-json file use format: "tags": "key1=value1&amp;key2=value2..."</p>
    /// </note>
    pub fn tags(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.tags = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Metadata which can be used to manage the topic rule.</p><note>
    /// <p>For URI Request parameters use format: ...key1=value1&amp;key2=value2...</p>
    /// <p>For the CLI command-line parameter use format: --tags "key1=value1&amp;key2=value2..."</p>
    /// <p>For the cli-input-json file use format: "tags": "key1=value1&amp;key2=value2..."</p>
    /// </note>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.tags = input;
        self
    }
    /// <p>Metadata which can be used to manage the topic rule.</p><note>
    /// <p>For URI Request parameters use format: ...key1=value1&amp;key2=value2...</p>
    /// <p>For the CLI command-line parameter use format: --tags "key1=value1&amp;key2=value2..."</p>
    /// <p>For the cli-input-json file use format: "tags": "key1=value1&amp;key2=value2..."</p>
    /// </note>
    pub fn get_tags(&self) -> &::std::option::Option<::std::string::String> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateTopicRuleInput`](crate::operation::create_topic_rule::CreateTopicRuleInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_topic_rule::CreateTopicRuleInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_topic_rule::CreateTopicRuleInput {
            rule_name: self.rule_name,
            topic_rule_payload: self.topic_rule_payload,
            tags: self.tags,
        })
    }
}