aws_sdk_datazone/operation/get_rule/
_get_rule_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct GetRuleOutput {
6 pub identifier: ::std::string::String,
8 pub revision: ::std::string::String,
10 pub name: ::std::string::String,
12 pub rule_type: crate::types::RuleType,
14 pub target: ::std::option::Option<crate::types::RuleTarget>,
16 pub action: crate::types::RuleAction,
18 pub scope: ::std::option::Option<crate::types::RuleScope>,
20 pub detail: ::std::option::Option<crate::types::RuleDetail>,
22 pub target_type: ::std::option::Option<crate::types::RuleTargetType>,
24 pub description: ::std::option::Option<::std::string::String>,
26 pub created_at: ::aws_smithy_types::DateTime,
28 pub updated_at: ::aws_smithy_types::DateTime,
30 pub created_by: ::std::string::String,
32 pub last_updated_by: ::std::string::String,
34 _request_id: Option<String>,
35}
36impl GetRuleOutput {
37 pub fn identifier(&self) -> &str {
39 use std::ops::Deref;
40 self.identifier.deref()
41 }
42 pub fn revision(&self) -> &str {
44 use std::ops::Deref;
45 self.revision.deref()
46 }
47 pub fn name(&self) -> &str {
49 use std::ops::Deref;
50 self.name.deref()
51 }
52 pub fn rule_type(&self) -> &crate::types::RuleType {
54 &self.rule_type
55 }
56 pub fn target(&self) -> ::std::option::Option<&crate::types::RuleTarget> {
58 self.target.as_ref()
59 }
60 pub fn action(&self) -> &crate::types::RuleAction {
62 &self.action
63 }
64 pub fn scope(&self) -> ::std::option::Option<&crate::types::RuleScope> {
66 self.scope.as_ref()
67 }
68 pub fn detail(&self) -> ::std::option::Option<&crate::types::RuleDetail> {
70 self.detail.as_ref()
71 }
72 pub fn target_type(&self) -> ::std::option::Option<&crate::types::RuleTargetType> {
74 self.target_type.as_ref()
75 }
76 pub fn description(&self) -> ::std::option::Option<&str> {
78 self.description.as_deref()
79 }
80 pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
82 &self.created_at
83 }
84 pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
86 &self.updated_at
87 }
88 pub fn created_by(&self) -> &str {
90 use std::ops::Deref;
91 self.created_by.deref()
92 }
93 pub fn last_updated_by(&self) -> &str {
95 use std::ops::Deref;
96 self.last_updated_by.deref()
97 }
98}
99impl ::std::fmt::Debug for GetRuleOutput {
100 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
101 let mut formatter = f.debug_struct("GetRuleOutput");
102 formatter.field("identifier", &self.identifier);
103 formatter.field("revision", &self.revision);
104 formatter.field("name", &"*** Sensitive Data Redacted ***");
105 formatter.field("rule_type", &self.rule_type);
106 formatter.field("target", &self.target);
107 formatter.field("action", &self.action);
108 formatter.field("scope", &self.scope);
109 formatter.field("detail", &self.detail);
110 formatter.field("target_type", &self.target_type);
111 formatter.field("description", &"*** Sensitive Data Redacted ***");
112 formatter.field("created_at", &self.created_at);
113 formatter.field("updated_at", &self.updated_at);
114 formatter.field("created_by", &self.created_by);
115 formatter.field("last_updated_by", &self.last_updated_by);
116 formatter.field("_request_id", &self._request_id);
117 formatter.finish()
118 }
119}
120impl ::aws_types::request_id::RequestId for GetRuleOutput {
121 fn request_id(&self) -> Option<&str> {
122 self._request_id.as_deref()
123 }
124}
125impl GetRuleOutput {
126 pub fn builder() -> crate::operation::get_rule::builders::GetRuleOutputBuilder {
128 crate::operation::get_rule::builders::GetRuleOutputBuilder::default()
129 }
130}
131
132#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
134#[non_exhaustive]
135pub struct GetRuleOutputBuilder {
136 pub(crate) identifier: ::std::option::Option<::std::string::String>,
137 pub(crate) revision: ::std::option::Option<::std::string::String>,
138 pub(crate) name: ::std::option::Option<::std::string::String>,
139 pub(crate) rule_type: ::std::option::Option<crate::types::RuleType>,
140 pub(crate) target: ::std::option::Option<crate::types::RuleTarget>,
141 pub(crate) action: ::std::option::Option<crate::types::RuleAction>,
142 pub(crate) scope: ::std::option::Option<crate::types::RuleScope>,
143 pub(crate) detail: ::std::option::Option<crate::types::RuleDetail>,
144 pub(crate) target_type: ::std::option::Option<crate::types::RuleTargetType>,
145 pub(crate) description: ::std::option::Option<::std::string::String>,
146 pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
147 pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
148 pub(crate) created_by: ::std::option::Option<::std::string::String>,
149 pub(crate) last_updated_by: ::std::option::Option<::std::string::String>,
150 _request_id: Option<String>,
151}
152impl GetRuleOutputBuilder {
153 pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156 self.identifier = ::std::option::Option::Some(input.into());
157 self
158 }
159 pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
161 self.identifier = input;
162 self
163 }
164 pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
166 &self.identifier
167 }
168 pub fn revision(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171 self.revision = ::std::option::Option::Some(input.into());
172 self
173 }
174 pub fn set_revision(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176 self.revision = input;
177 self
178 }
179 pub fn get_revision(&self) -> &::std::option::Option<::std::string::String> {
181 &self.revision
182 }
183 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186 self.name = ::std::option::Option::Some(input.into());
187 self
188 }
189 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191 self.name = input;
192 self
193 }
194 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
196 &self.name
197 }
198 pub fn rule_type(mut self, input: crate::types::RuleType) -> Self {
201 self.rule_type = ::std::option::Option::Some(input);
202 self
203 }
204 pub fn set_rule_type(mut self, input: ::std::option::Option<crate::types::RuleType>) -> Self {
206 self.rule_type = input;
207 self
208 }
209 pub fn get_rule_type(&self) -> &::std::option::Option<crate::types::RuleType> {
211 &self.rule_type
212 }
213 pub fn target(mut self, input: crate::types::RuleTarget) -> Self {
216 self.target = ::std::option::Option::Some(input);
217 self
218 }
219 pub fn set_target(mut self, input: ::std::option::Option<crate::types::RuleTarget>) -> Self {
221 self.target = input;
222 self
223 }
224 pub fn get_target(&self) -> &::std::option::Option<crate::types::RuleTarget> {
226 &self.target
227 }
228 pub fn action(mut self, input: crate::types::RuleAction) -> Self {
231 self.action = ::std::option::Option::Some(input);
232 self
233 }
234 pub fn set_action(mut self, input: ::std::option::Option<crate::types::RuleAction>) -> Self {
236 self.action = input;
237 self
238 }
239 pub fn get_action(&self) -> &::std::option::Option<crate::types::RuleAction> {
241 &self.action
242 }
243 pub fn scope(mut self, input: crate::types::RuleScope) -> Self {
246 self.scope = ::std::option::Option::Some(input);
247 self
248 }
249 pub fn set_scope(mut self, input: ::std::option::Option<crate::types::RuleScope>) -> Self {
251 self.scope = input;
252 self
253 }
254 pub fn get_scope(&self) -> &::std::option::Option<crate::types::RuleScope> {
256 &self.scope
257 }
258 pub fn detail(mut self, input: crate::types::RuleDetail) -> Self {
261 self.detail = ::std::option::Option::Some(input);
262 self
263 }
264 pub fn set_detail(mut self, input: ::std::option::Option<crate::types::RuleDetail>) -> Self {
266 self.detail = input;
267 self
268 }
269 pub fn get_detail(&self) -> &::std::option::Option<crate::types::RuleDetail> {
271 &self.detail
272 }
273 pub fn target_type(mut self, input: crate::types::RuleTargetType) -> Self {
275 self.target_type = ::std::option::Option::Some(input);
276 self
277 }
278 pub fn set_target_type(mut self, input: ::std::option::Option<crate::types::RuleTargetType>) -> Self {
280 self.target_type = input;
281 self
282 }
283 pub fn get_target_type(&self) -> &::std::option::Option<crate::types::RuleTargetType> {
285 &self.target_type
286 }
287 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
289 self.description = ::std::option::Option::Some(input.into());
290 self
291 }
292 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
294 self.description = input;
295 self
296 }
297 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
299 &self.description
300 }
301 pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
304 self.created_at = ::std::option::Option::Some(input);
305 self
306 }
307 pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
309 self.created_at = input;
310 self
311 }
312 pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
314 &self.created_at
315 }
316 pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
319 self.updated_at = ::std::option::Option::Some(input);
320 self
321 }
322 pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
324 self.updated_at = input;
325 self
326 }
327 pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
329 &self.updated_at
330 }
331 pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
334 self.created_by = ::std::option::Option::Some(input.into());
335 self
336 }
337 pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
339 self.created_by = input;
340 self
341 }
342 pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
344 &self.created_by
345 }
346 pub fn last_updated_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
349 self.last_updated_by = ::std::option::Option::Some(input.into());
350 self
351 }
352 pub fn set_last_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
354 self.last_updated_by = input;
355 self
356 }
357 pub fn get_last_updated_by(&self) -> &::std::option::Option<::std::string::String> {
359 &self.last_updated_by
360 }
361 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
362 self._request_id = Some(request_id.into());
363 self
364 }
365
366 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
367 self._request_id = request_id;
368 self
369 }
370 pub fn build(self) -> ::std::result::Result<crate::operation::get_rule::GetRuleOutput, ::aws_smithy_types::error::operation::BuildError> {
382 ::std::result::Result::Ok(crate::operation::get_rule::GetRuleOutput {
383 identifier: self.identifier.ok_or_else(|| {
384 ::aws_smithy_types::error::operation::BuildError::missing_field(
385 "identifier",
386 "identifier was not specified but it is required when building GetRuleOutput",
387 )
388 })?,
389 revision: self.revision.ok_or_else(|| {
390 ::aws_smithy_types::error::operation::BuildError::missing_field(
391 "revision",
392 "revision was not specified but it is required when building GetRuleOutput",
393 )
394 })?,
395 name: self.name.ok_or_else(|| {
396 ::aws_smithy_types::error::operation::BuildError::missing_field(
397 "name",
398 "name was not specified but it is required when building GetRuleOutput",
399 )
400 })?,
401 rule_type: self.rule_type.ok_or_else(|| {
402 ::aws_smithy_types::error::operation::BuildError::missing_field(
403 "rule_type",
404 "rule_type was not specified but it is required when building GetRuleOutput",
405 )
406 })?,
407 target: self.target,
408 action: self.action.ok_or_else(|| {
409 ::aws_smithy_types::error::operation::BuildError::missing_field(
410 "action",
411 "action was not specified but it is required when building GetRuleOutput",
412 )
413 })?,
414 scope: self.scope,
415 detail: self.detail,
416 target_type: self.target_type,
417 description: self.description,
418 created_at: self.created_at.ok_or_else(|| {
419 ::aws_smithy_types::error::operation::BuildError::missing_field(
420 "created_at",
421 "created_at was not specified but it is required when building GetRuleOutput",
422 )
423 })?,
424 updated_at: self.updated_at.ok_or_else(|| {
425 ::aws_smithy_types::error::operation::BuildError::missing_field(
426 "updated_at",
427 "updated_at was not specified but it is required when building GetRuleOutput",
428 )
429 })?,
430 created_by: self.created_by.ok_or_else(|| {
431 ::aws_smithy_types::error::operation::BuildError::missing_field(
432 "created_by",
433 "created_by was not specified but it is required when building GetRuleOutput",
434 )
435 })?,
436 last_updated_by: self.last_updated_by.ok_or_else(|| {
437 ::aws_smithy_types::error::operation::BuildError::missing_field(
438 "last_updated_by",
439 "last_updated_by was not specified but it is required when building GetRuleOutput",
440 )
441 })?,
442 _request_id: self._request_id,
443 })
444 }
445}
446impl ::std::fmt::Debug for GetRuleOutputBuilder {
447 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
448 let mut formatter = f.debug_struct("GetRuleOutputBuilder");
449 formatter.field("identifier", &self.identifier);
450 formatter.field("revision", &self.revision);
451 formatter.field("name", &"*** Sensitive Data Redacted ***");
452 formatter.field("rule_type", &self.rule_type);
453 formatter.field("target", &self.target);
454 formatter.field("action", &self.action);
455 formatter.field("scope", &self.scope);
456 formatter.field("detail", &self.detail);
457 formatter.field("target_type", &self.target_type);
458 formatter.field("description", &"*** Sensitive Data Redacted ***");
459 formatter.field("created_at", &self.created_at);
460 formatter.field("updated_at", &self.updated_at);
461 formatter.field("created_by", &self.created_by);
462 formatter.field("last_updated_by", &self.last_updated_by);
463 formatter.field("_request_id", &self._request_id);
464 formatter.finish()
465 }
466}