Skip to main content

aws_sdk_iot/operation/list_topic_rules/
_list_topic_rules_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The input for the ListTopicRules operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ListTopicRulesInput {
7    /// <p>The topic.</p>
8    pub topic: ::std::option::Option<::std::string::String>,
9    /// <p>The maximum number of results to return.</p>
10    pub max_results: ::std::option::Option<i32>,
11    /// <p>To retrieve the next set of results, the <code>nextToken</code> value from a previous response; otherwise <b>null</b> to receive the first set of results.</p>
12    pub next_token: ::std::option::Option<::std::string::String>,
13    /// <p>Specifies whether the rule is disabled.</p>
14    pub rule_disabled: ::std::option::Option<bool>,
15}
16impl ListTopicRulesInput {
17    /// <p>The topic.</p>
18    pub fn topic(&self) -> ::std::option::Option<&str> {
19        self.topic.as_deref()
20    }
21    /// <p>The maximum number of results to return.</p>
22    pub fn max_results(&self) -> ::std::option::Option<i32> {
23        self.max_results
24    }
25    /// <p>To retrieve the next set of results, the <code>nextToken</code> value from a previous response; otherwise <b>null</b> to receive the first set of results.</p>
26    pub fn next_token(&self) -> ::std::option::Option<&str> {
27        self.next_token.as_deref()
28    }
29    /// <p>Specifies whether the rule is disabled.</p>
30    pub fn rule_disabled(&self) -> ::std::option::Option<bool> {
31        self.rule_disabled
32    }
33}
34impl ListTopicRulesInput {
35    /// Creates a new builder-style object to manufacture [`ListTopicRulesInput`](crate::operation::list_topic_rules::ListTopicRulesInput).
36    pub fn builder() -> crate::operation::list_topic_rules::builders::ListTopicRulesInputBuilder {
37        crate::operation::list_topic_rules::builders::ListTopicRulesInputBuilder::default()
38    }
39}
40
41/// A builder for [`ListTopicRulesInput`](crate::operation::list_topic_rules::ListTopicRulesInput).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct ListTopicRulesInputBuilder {
45    pub(crate) topic: ::std::option::Option<::std::string::String>,
46    pub(crate) max_results: ::std::option::Option<i32>,
47    pub(crate) next_token: ::std::option::Option<::std::string::String>,
48    pub(crate) rule_disabled: ::std::option::Option<bool>,
49}
50impl ListTopicRulesInputBuilder {
51    /// <p>The topic.</p>
52    pub fn topic(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.topic = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The topic.</p>
57    pub fn set_topic(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.topic = input;
59        self
60    }
61    /// <p>The topic.</p>
62    pub fn get_topic(&self) -> &::std::option::Option<::std::string::String> {
63        &self.topic
64    }
65    /// <p>The maximum number of results to return.</p>
66    pub fn max_results(mut self, input: i32) -> Self {
67        self.max_results = ::std::option::Option::Some(input);
68        self
69    }
70    /// <p>The maximum number of results to return.</p>
71    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
72        self.max_results = input;
73        self
74    }
75    /// <p>The maximum number of results to return.</p>
76    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
77        &self.max_results
78    }
79    /// <p>To retrieve the next set of results, the <code>nextToken</code> value from a previous response; otherwise <b>null</b> to receive the first set of results.</p>
80    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.next_token = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>To retrieve the next set of results, the <code>nextToken</code> value from a previous response; otherwise <b>null</b> to receive the first set of results.</p>
85    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.next_token = input;
87        self
88    }
89    /// <p>To retrieve the next set of results, the <code>nextToken</code> value from a previous response; otherwise <b>null</b> to receive the first set of results.</p>
90    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
91        &self.next_token
92    }
93    /// <p>Specifies whether the rule is disabled.</p>
94    pub fn rule_disabled(mut self, input: bool) -> Self {
95        self.rule_disabled = ::std::option::Option::Some(input);
96        self
97    }
98    /// <p>Specifies whether the rule is disabled.</p>
99    pub fn set_rule_disabled(mut self, input: ::std::option::Option<bool>) -> Self {
100        self.rule_disabled = input;
101        self
102    }
103    /// <p>Specifies whether the rule is disabled.</p>
104    pub fn get_rule_disabled(&self) -> &::std::option::Option<bool> {
105        &self.rule_disabled
106    }
107    /// Consumes the builder and constructs a [`ListTopicRulesInput`](crate::operation::list_topic_rules::ListTopicRulesInput).
108    pub fn build(
109        self,
110    ) -> ::std::result::Result<crate::operation::list_topic_rules::ListTopicRulesInput, ::aws_smithy_types::error::operation::BuildError> {
111        ::std::result::Result::Ok(crate::operation::list_topic_rules::ListTopicRulesInput {
112            topic: self.topic,
113            max_results: self.max_results,
114            next_token: self.next_token,
115            rule_disabled: self.rule_disabled,
116        })
117    }
118}