aws_sdk_datazone/operation/get_rule/
_get_rule_output.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 GetRuleOutput {
6    /// <p>The ID of the rule.</p>
7    pub identifier: ::std::string::String,
8    /// <p>The revision of the rule.</p>
9    pub revision: ::std::string::String,
10    /// <p>The name of the rule.</p>
11    pub name: ::std::string::String,
12    /// <p>The type of the rule.</p>
13    pub rule_type: crate::types::RuleType,
14    /// <p>The target of the rule.</p>
15    pub target: ::std::option::Option<crate::types::RuleTarget>,
16    /// <p>The action of the rule.</p>
17    pub action: crate::types::RuleAction,
18    /// <p>The scope of the rule.</p>
19    pub scope: ::std::option::Option<crate::types::RuleScope>,
20    /// <p>The detail of the rule.</p>
21    pub detail: ::std::option::Option<crate::types::RuleDetail>,
22    /// <p>The target type of the rule.</p>
23    pub target_type: ::std::option::Option<crate::types::RuleTargetType>,
24    /// <p>The description of the rule.</p>
25    pub description: ::std::option::Option<::std::string::String>,
26    /// <p>The timestamp at which the rule was created.</p>
27    pub created_at: ::aws_smithy_types::DateTime,
28    /// <p>The timestamp at which the rule was last updated.</p>
29    pub updated_at: ::aws_smithy_types::DateTime,
30    /// <p>The user who created the rule.</p>
31    pub created_by: ::std::string::String,
32    /// <p>The timestamp at which the rule was last updated.</p>
33    pub last_updated_by: ::std::string::String,
34    _request_id: Option<String>,
35}
36impl GetRuleOutput {
37    /// <p>The ID of the rule.</p>
38    pub fn identifier(&self) -> &str {
39        use std::ops::Deref;
40        self.identifier.deref()
41    }
42    /// <p>The revision of the rule.</p>
43    pub fn revision(&self) -> &str {
44        use std::ops::Deref;
45        self.revision.deref()
46    }
47    /// <p>The name of the rule.</p>
48    pub fn name(&self) -> &str {
49        use std::ops::Deref;
50        self.name.deref()
51    }
52    /// <p>The type of the rule.</p>
53    pub fn rule_type(&self) -> &crate::types::RuleType {
54        &self.rule_type
55    }
56    /// <p>The target of the rule.</p>
57    pub fn target(&self) -> ::std::option::Option<&crate::types::RuleTarget> {
58        self.target.as_ref()
59    }
60    /// <p>The action of the rule.</p>
61    pub fn action(&self) -> &crate::types::RuleAction {
62        &self.action
63    }
64    /// <p>The scope of the rule.</p>
65    pub fn scope(&self) -> ::std::option::Option<&crate::types::RuleScope> {
66        self.scope.as_ref()
67    }
68    /// <p>The detail of the rule.</p>
69    pub fn detail(&self) -> ::std::option::Option<&crate::types::RuleDetail> {
70        self.detail.as_ref()
71    }
72    /// <p>The target type of the rule.</p>
73    pub fn target_type(&self) -> ::std::option::Option<&crate::types::RuleTargetType> {
74        self.target_type.as_ref()
75    }
76    /// <p>The description of the rule.</p>
77    pub fn description(&self) -> ::std::option::Option<&str> {
78        self.description.as_deref()
79    }
80    /// <p>The timestamp at which the rule was created.</p>
81    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
82        &self.created_at
83    }
84    /// <p>The timestamp at which the rule was last updated.</p>
85    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
86        &self.updated_at
87    }
88    /// <p>The user who created the rule.</p>
89    pub fn created_by(&self) -> &str {
90        use std::ops::Deref;
91        self.created_by.deref()
92    }
93    /// <p>The timestamp at which the rule was last updated.</p>
94    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    /// Creates a new builder-style object to manufacture [`GetRuleOutput`](crate::operation::get_rule::GetRuleOutput).
127    pub fn builder() -> crate::operation::get_rule::builders::GetRuleOutputBuilder {
128        crate::operation::get_rule::builders::GetRuleOutputBuilder::default()
129    }
130}
131
132/// A builder for [`GetRuleOutput`](crate::operation::get_rule::GetRuleOutput).
133#[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    /// <p>The ID of the rule.</p>
154    /// This field is required.
155    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    /// <p>The ID of the rule.</p>
160    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
161        self.identifier = input;
162        self
163    }
164    /// <p>The ID of the rule.</p>
165    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
166        &self.identifier
167    }
168    /// <p>The revision of the rule.</p>
169    /// This field is required.
170    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    /// <p>The revision of the rule.</p>
175    pub fn set_revision(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176        self.revision = input;
177        self
178    }
179    /// <p>The revision of the rule.</p>
180    pub fn get_revision(&self) -> &::std::option::Option<::std::string::String> {
181        &self.revision
182    }
183    /// <p>The name of the rule.</p>
184    /// This field is required.
185    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    /// <p>The name of the rule.</p>
190    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191        self.name = input;
192        self
193    }
194    /// <p>The name of the rule.</p>
195    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
196        &self.name
197    }
198    /// <p>The type of the rule.</p>
199    /// This field is required.
200    pub fn rule_type(mut self, input: crate::types::RuleType) -> Self {
201        self.rule_type = ::std::option::Option::Some(input);
202        self
203    }
204    /// <p>The type of the rule.</p>
205    pub fn set_rule_type(mut self, input: ::std::option::Option<crate::types::RuleType>) -> Self {
206        self.rule_type = input;
207        self
208    }
209    /// <p>The type of the rule.</p>
210    pub fn get_rule_type(&self) -> &::std::option::Option<crate::types::RuleType> {
211        &self.rule_type
212    }
213    /// <p>The target of the rule.</p>
214    /// This field is required.
215    pub fn target(mut self, input: crate::types::RuleTarget) -> Self {
216        self.target = ::std::option::Option::Some(input);
217        self
218    }
219    /// <p>The target of the rule.</p>
220    pub fn set_target(mut self, input: ::std::option::Option<crate::types::RuleTarget>) -> Self {
221        self.target = input;
222        self
223    }
224    /// <p>The target of the rule.</p>
225    pub fn get_target(&self) -> &::std::option::Option<crate::types::RuleTarget> {
226        &self.target
227    }
228    /// <p>The action of the rule.</p>
229    /// This field is required.
230    pub fn action(mut self, input: crate::types::RuleAction) -> Self {
231        self.action = ::std::option::Option::Some(input);
232        self
233    }
234    /// <p>The action of the rule.</p>
235    pub fn set_action(mut self, input: ::std::option::Option<crate::types::RuleAction>) -> Self {
236        self.action = input;
237        self
238    }
239    /// <p>The action of the rule.</p>
240    pub fn get_action(&self) -> &::std::option::Option<crate::types::RuleAction> {
241        &self.action
242    }
243    /// <p>The scope of the rule.</p>
244    /// This field is required.
245    pub fn scope(mut self, input: crate::types::RuleScope) -> Self {
246        self.scope = ::std::option::Option::Some(input);
247        self
248    }
249    /// <p>The scope of the rule.</p>
250    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::RuleScope>) -> Self {
251        self.scope = input;
252        self
253    }
254    /// <p>The scope of the rule.</p>
255    pub fn get_scope(&self) -> &::std::option::Option<crate::types::RuleScope> {
256        &self.scope
257    }
258    /// <p>The detail of the rule.</p>
259    /// This field is required.
260    pub fn detail(mut self, input: crate::types::RuleDetail) -> Self {
261        self.detail = ::std::option::Option::Some(input);
262        self
263    }
264    /// <p>The detail of the rule.</p>
265    pub fn set_detail(mut self, input: ::std::option::Option<crate::types::RuleDetail>) -> Self {
266        self.detail = input;
267        self
268    }
269    /// <p>The detail of the rule.</p>
270    pub fn get_detail(&self) -> &::std::option::Option<crate::types::RuleDetail> {
271        &self.detail
272    }
273    /// <p>The target type of the rule.</p>
274    pub fn target_type(mut self, input: crate::types::RuleTargetType) -> Self {
275        self.target_type = ::std::option::Option::Some(input);
276        self
277    }
278    /// <p>The target type of the rule.</p>
279    pub fn set_target_type(mut self, input: ::std::option::Option<crate::types::RuleTargetType>) -> Self {
280        self.target_type = input;
281        self
282    }
283    /// <p>The target type of the rule.</p>
284    pub fn get_target_type(&self) -> &::std::option::Option<crate::types::RuleTargetType> {
285        &self.target_type
286    }
287    /// <p>The description of the rule.</p>
288    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    /// <p>The description of the rule.</p>
293    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
294        self.description = input;
295        self
296    }
297    /// <p>The description of the rule.</p>
298    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
299        &self.description
300    }
301    /// <p>The timestamp at which the rule was created.</p>
302    /// This field is required.
303    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    /// <p>The timestamp at which the rule was created.</p>
308    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    /// <p>The timestamp at which the rule was created.</p>
313    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
314        &self.created_at
315    }
316    /// <p>The timestamp at which the rule was last updated.</p>
317    /// This field is required.
318    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    /// <p>The timestamp at which the rule was last updated.</p>
323    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    /// <p>The timestamp at which the rule was last updated.</p>
328    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
329        &self.updated_at
330    }
331    /// <p>The user who created the rule.</p>
332    /// This field is required.
333    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    /// <p>The user who created the rule.</p>
338    pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
339        self.created_by = input;
340        self
341    }
342    /// <p>The user who created the rule.</p>
343    pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
344        &self.created_by
345    }
346    /// <p>The timestamp at which the rule was last updated.</p>
347    /// This field is required.
348    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    /// <p>The timestamp at which the rule was last updated.</p>
353    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    /// <p>The timestamp at which the rule was last updated.</p>
358    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    /// Consumes the builder and constructs a [`GetRuleOutput`](crate::operation::get_rule::GetRuleOutput).
371    /// This method will fail if any of the following fields are not set:
372    /// - [`identifier`](crate::operation::get_rule::builders::GetRuleOutputBuilder::identifier)
373    /// - [`revision`](crate::operation::get_rule::builders::GetRuleOutputBuilder::revision)
374    /// - [`name`](crate::operation::get_rule::builders::GetRuleOutputBuilder::name)
375    /// - [`rule_type`](crate::operation::get_rule::builders::GetRuleOutputBuilder::rule_type)
376    /// - [`action`](crate::operation::get_rule::builders::GetRuleOutputBuilder::action)
377    /// - [`created_at`](crate::operation::get_rule::builders::GetRuleOutputBuilder::created_at)
378    /// - [`updated_at`](crate::operation::get_rule::builders::GetRuleOutputBuilder::updated_at)
379    /// - [`created_by`](crate::operation::get_rule::builders::GetRuleOutputBuilder::created_by)
380    /// - [`last_updated_by`](crate::operation::get_rule::builders::GetRuleOutputBuilder::last_updated_by)
381    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}