aws_sdk_datazone/operation/create_rule/
_create_rule_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CreateRuleInput {
6 pub domain_identifier: ::std::option::Option<::std::string::String>,
8 pub name: ::std::option::Option<::std::string::String>,
10 pub target: ::std::option::Option<crate::types::RuleTarget>,
12 pub action: ::std::option::Option<crate::types::RuleAction>,
14 pub scope: ::std::option::Option<crate::types::RuleScope>,
16 pub detail: ::std::option::Option<crate::types::RuleDetail>,
18 pub description: ::std::option::Option<::std::string::String>,
20 pub client_token: ::std::option::Option<::std::string::String>,
22}
23impl CreateRuleInput {
24 pub fn domain_identifier(&self) -> ::std::option::Option<&str> {
26 self.domain_identifier.as_deref()
27 }
28 pub fn name(&self) -> ::std::option::Option<&str> {
30 self.name.as_deref()
31 }
32 pub fn target(&self) -> ::std::option::Option<&crate::types::RuleTarget> {
34 self.target.as_ref()
35 }
36 pub fn action(&self) -> ::std::option::Option<&crate::types::RuleAction> {
38 self.action.as_ref()
39 }
40 pub fn scope(&self) -> ::std::option::Option<&crate::types::RuleScope> {
42 self.scope.as_ref()
43 }
44 pub fn detail(&self) -> ::std::option::Option<&crate::types::RuleDetail> {
46 self.detail.as_ref()
47 }
48 pub fn description(&self) -> ::std::option::Option<&str> {
50 self.description.as_deref()
51 }
52 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 pub fn builder() -> crate::operation::create_rule::builders::CreateRuleInputBuilder {
74 crate::operation::create_rule::builders::CreateRuleInputBuilder::default()
75 }
76}
77
78#[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 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 pub fn set_domain_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100 self.domain_identifier = input;
101 self
102 }
103 pub fn get_domain_identifier(&self) -> &::std::option::Option<::std::string::String> {
105 &self.domain_identifier
106 }
107 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 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115 self.name = input;
116 self
117 }
118 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
120 &self.name
121 }
122 pub fn target(mut self, input: crate::types::RuleTarget) -> Self {
125 self.target = ::std::option::Option::Some(input);
126 self
127 }
128 pub fn set_target(mut self, input: ::std::option::Option<crate::types::RuleTarget>) -> Self {
130 self.target = input;
131 self
132 }
133 pub fn get_target(&self) -> &::std::option::Option<crate::types::RuleTarget> {
135 &self.target
136 }
137 pub fn action(mut self, input: crate::types::RuleAction) -> Self {
140 self.action = ::std::option::Option::Some(input);
141 self
142 }
143 pub fn set_action(mut self, input: ::std::option::Option<crate::types::RuleAction>) -> Self {
145 self.action = input;
146 self
147 }
148 pub fn get_action(&self) -> &::std::option::Option<crate::types::RuleAction> {
150 &self.action
151 }
152 pub fn scope(mut self, input: crate::types::RuleScope) -> Self {
155 self.scope = ::std::option::Option::Some(input);
156 self
157 }
158 pub fn set_scope(mut self, input: ::std::option::Option<crate::types::RuleScope>) -> Self {
160 self.scope = input;
161 self
162 }
163 pub fn get_scope(&self) -> &::std::option::Option<crate::types::RuleScope> {
165 &self.scope
166 }
167 pub fn detail(mut self, input: crate::types::RuleDetail) -> Self {
170 self.detail = ::std::option::Option::Some(input);
171 self
172 }
173 pub fn set_detail(mut self, input: ::std::option::Option<crate::types::RuleDetail>) -> Self {
175 self.detail = input;
176 self
177 }
178 pub fn get_detail(&self) -> &::std::option::Option<crate::types::RuleDetail> {
180 &self.detail
181 }
182 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 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189 self.description = input;
190 self
191 }
192 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
194 &self.description
195 }
196 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 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
203 self.client_token = input;
204 self
205 }
206 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
208 &self.client_token
209 }
210 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}