aws_sdk_datazone/operation/create_rule/
_create_rule_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CreateRuleInput {
6    /// <p>The ID of the domain where the rule is created.</p>
7    pub domain_identifier: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the rule.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>The target of the rule.</p>
11    pub target: ::std::option::Option<crate::types::RuleTarget>,
12    /// <p>The action of the rule.</p>
13    pub action: ::std::option::Option<crate::types::RuleAction>,
14    /// <p>The scope of the rule.</p>
15    pub scope: ::std::option::Option<crate::types::RuleScope>,
16    /// <p>The detail of the rule.</p>
17    pub detail: ::std::option::Option<crate::types::RuleDetail>,
18    /// <p>The description of the rule.</p>
19    pub description: ::std::option::Option<::std::string::String>,
20    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
21    pub client_token: ::std::option::Option<::std::string::String>,
22}
23impl CreateRuleInput {
24    /// <p>The ID of the domain where the rule is created.</p>
25    pub fn domain_identifier(&self) -> ::std::option::Option<&str> {
26        self.domain_identifier.as_deref()
27    }
28    /// <p>The name of the rule.</p>
29    pub fn name(&self) -> ::std::option::Option<&str> {
30        self.name.as_deref()
31    }
32    /// <p>The target of the rule.</p>
33    pub fn target(&self) -> ::std::option::Option<&crate::types::RuleTarget> {
34        self.target.as_ref()
35    }
36    /// <p>The action of the rule.</p>
37    pub fn action(&self) -> ::std::option::Option<&crate::types::RuleAction> {
38        self.action.as_ref()
39    }
40    /// <p>The scope of the rule.</p>
41    pub fn scope(&self) -> ::std::option::Option<&crate::types::RuleScope> {
42        self.scope.as_ref()
43    }
44    /// <p>The detail of the rule.</p>
45    pub fn detail(&self) -> ::std::option::Option<&crate::types::RuleDetail> {
46        self.detail.as_ref()
47    }
48    /// <p>The description of the rule.</p>
49    pub fn description(&self) -> ::std::option::Option<&str> {
50        self.description.as_deref()
51    }
52    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
53    pub fn client_token(&self) -> ::std::option::Option<&str> {
54        self.client_token.as_deref()
55    }
56}
57impl ::std::fmt::Debug for CreateRuleInput {
58    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
59        let mut formatter = f.debug_struct("CreateRuleInput");
60        formatter.field("domain_identifier", &self.domain_identifier);
61        formatter.field("name", &"*** Sensitive Data Redacted ***");
62        formatter.field("target", &self.target);
63        formatter.field("action", &self.action);
64        formatter.field("scope", &self.scope);
65        formatter.field("detail", &self.detail);
66        formatter.field("description", &"*** Sensitive Data Redacted ***");
67        formatter.field("client_token", &self.client_token);
68        formatter.finish()
69    }
70}
71impl CreateRuleInput {
72    /// Creates a new builder-style object to manufacture [`CreateRuleInput`](crate::operation::create_rule::CreateRuleInput).
73    pub fn builder() -> crate::operation::create_rule::builders::CreateRuleInputBuilder {
74        crate::operation::create_rule::builders::CreateRuleInputBuilder::default()
75    }
76}
77
78/// A builder for [`CreateRuleInput`](crate::operation::create_rule::CreateRuleInput).
79#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
80#[non_exhaustive]
81pub struct CreateRuleInputBuilder {
82    pub(crate) domain_identifier: ::std::option::Option<::std::string::String>,
83    pub(crate) name: ::std::option::Option<::std::string::String>,
84    pub(crate) target: ::std::option::Option<crate::types::RuleTarget>,
85    pub(crate) action: ::std::option::Option<crate::types::RuleAction>,
86    pub(crate) scope: ::std::option::Option<crate::types::RuleScope>,
87    pub(crate) detail: ::std::option::Option<crate::types::RuleDetail>,
88    pub(crate) description: ::std::option::Option<::std::string::String>,
89    pub(crate) client_token: ::std::option::Option<::std::string::String>,
90}
91impl CreateRuleInputBuilder {
92    /// <p>The ID of the domain where the rule is created.</p>
93    /// This field is required.
94    pub fn domain_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.domain_identifier = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>The ID of the domain where the rule is created.</p>
99    pub fn set_domain_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.domain_identifier = input;
101        self
102    }
103    /// <p>The ID of the domain where the rule is created.</p>
104    pub fn get_domain_identifier(&self) -> &::std::option::Option<::std::string::String> {
105        &self.domain_identifier
106    }
107    /// <p>The name of the rule.</p>
108    /// This field is required.
109    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110        self.name = ::std::option::Option::Some(input.into());
111        self
112    }
113    /// <p>The name of the rule.</p>
114    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115        self.name = input;
116        self
117    }
118    /// <p>The name of the rule.</p>
119    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
120        &self.name
121    }
122    /// <p>The target of the rule.</p>
123    /// This field is required.
124    pub fn target(mut self, input: crate::types::RuleTarget) -> Self {
125        self.target = ::std::option::Option::Some(input);
126        self
127    }
128    /// <p>The target of the rule.</p>
129    pub fn set_target(mut self, input: ::std::option::Option<crate::types::RuleTarget>) -> Self {
130        self.target = input;
131        self
132    }
133    /// <p>The target of the rule.</p>
134    pub fn get_target(&self) -> &::std::option::Option<crate::types::RuleTarget> {
135        &self.target
136    }
137    /// <p>The action of the rule.</p>
138    /// This field is required.
139    pub fn action(mut self, input: crate::types::RuleAction) -> Self {
140        self.action = ::std::option::Option::Some(input);
141        self
142    }
143    /// <p>The action of the rule.</p>
144    pub fn set_action(mut self, input: ::std::option::Option<crate::types::RuleAction>) -> Self {
145        self.action = input;
146        self
147    }
148    /// <p>The action of the rule.</p>
149    pub fn get_action(&self) -> &::std::option::Option<crate::types::RuleAction> {
150        &self.action
151    }
152    /// <p>The scope of the rule.</p>
153    /// This field is required.
154    pub fn scope(mut self, input: crate::types::RuleScope) -> Self {
155        self.scope = ::std::option::Option::Some(input);
156        self
157    }
158    /// <p>The scope of the rule.</p>
159    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::RuleScope>) -> Self {
160        self.scope = input;
161        self
162    }
163    /// <p>The scope of the rule.</p>
164    pub fn get_scope(&self) -> &::std::option::Option<crate::types::RuleScope> {
165        &self.scope
166    }
167    /// <p>The detail of the rule.</p>
168    /// This field is required.
169    pub fn detail(mut self, input: crate::types::RuleDetail) -> Self {
170        self.detail = ::std::option::Option::Some(input);
171        self
172    }
173    /// <p>The detail of the rule.</p>
174    pub fn set_detail(mut self, input: ::std::option::Option<crate::types::RuleDetail>) -> Self {
175        self.detail = input;
176        self
177    }
178    /// <p>The detail of the rule.</p>
179    pub fn get_detail(&self) -> &::std::option::Option<crate::types::RuleDetail> {
180        &self.detail
181    }
182    /// <p>The description of the rule.</p>
183    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184        self.description = ::std::option::Option::Some(input.into());
185        self
186    }
187    /// <p>The description of the rule.</p>
188    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189        self.description = input;
190        self
191    }
192    /// <p>The description of the rule.</p>
193    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
194        &self.description
195    }
196    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
197    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
198        self.client_token = ::std::option::Option::Some(input.into());
199        self
200    }
201    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
202    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
203        self.client_token = input;
204        self
205    }
206    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
207    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
208        &self.client_token
209    }
210    /// Consumes the builder and constructs a [`CreateRuleInput`](crate::operation::create_rule::CreateRuleInput).
211    pub fn build(self) -> ::std::result::Result<crate::operation::create_rule::CreateRuleInput, ::aws_smithy_types::error::operation::BuildError> {
212        ::std::result::Result::Ok(crate::operation::create_rule::CreateRuleInput {
213            domain_identifier: self.domain_identifier,
214            name: self.name,
215            target: self.target,
216            action: self.action,
217            scope: self.scope,
218            detail: self.detail,
219            description: self.description,
220            client_token: self.client_token,
221        })
222    }
223}
224impl ::std::fmt::Debug for CreateRuleInputBuilder {
225    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
226        let mut formatter = f.debug_struct("CreateRuleInputBuilder");
227        formatter.field("domain_identifier", &self.domain_identifier);
228        formatter.field("name", &"*** Sensitive Data Redacted ***");
229        formatter.field("target", &self.target);
230        formatter.field("action", &self.action);
231        formatter.field("scope", &self.scope);
232        formatter.field("detail", &self.detail);
233        formatter.field("description", &"*** Sensitive Data Redacted ***");
234        formatter.field("client_token", &self.client_token);
235        formatter.finish()
236    }
237}