aws_sdk_datazone/operation/update_rule/
_update_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 UpdateRuleOutput {
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 description of the rule.</p>
23    pub description: ::std::option::Option<::std::string::String>,
24    /// <p>The timestamp at which the rule was created.</p>
25    pub created_at: ::aws_smithy_types::DateTime,
26    /// <p>The timestamp at which the rule was last updated.</p>
27    pub updated_at: ::aws_smithy_types::DateTime,
28    /// <p>The user who created the rule.</p>
29    pub created_by: ::std::string::String,
30    /// <p>The timestamp at which the rule was last updated.</p>
31    pub last_updated_by: ::std::string::String,
32    _request_id: Option<String>,
33}
34impl UpdateRuleOutput {
35    /// <p>The ID of the rule.</p>
36    pub fn identifier(&self) -> &str {
37        use std::ops::Deref;
38        self.identifier.deref()
39    }
40    /// <p>The revision of the rule.</p>
41    pub fn revision(&self) -> &str {
42        use std::ops::Deref;
43        self.revision.deref()
44    }
45    /// <p>The name of the rule.</p>
46    pub fn name(&self) -> &str {
47        use std::ops::Deref;
48        self.name.deref()
49    }
50    /// <p>The type of the rule.</p>
51    pub fn rule_type(&self) -> &crate::types::RuleType {
52        &self.rule_type
53    }
54    /// <p>The target of the rule.</p>
55    pub fn target(&self) -> ::std::option::Option<&crate::types::RuleTarget> {
56        self.target.as_ref()
57    }
58    /// <p>The action of the rule.</p>
59    pub fn action(&self) -> &crate::types::RuleAction {
60        &self.action
61    }
62    /// <p>The scope of the rule.</p>
63    pub fn scope(&self) -> ::std::option::Option<&crate::types::RuleScope> {
64        self.scope.as_ref()
65    }
66    /// <p>The detail of the rule.</p>
67    pub fn detail(&self) -> ::std::option::Option<&crate::types::RuleDetail> {
68        self.detail.as_ref()
69    }
70    /// <p>The description of the rule.</p>
71    pub fn description(&self) -> ::std::option::Option<&str> {
72        self.description.as_deref()
73    }
74    /// <p>The timestamp at which the rule was created.</p>
75    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
76        &self.created_at
77    }
78    /// <p>The timestamp at which the rule was last updated.</p>
79    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
80        &self.updated_at
81    }
82    /// <p>The user who created the rule.</p>
83    pub fn created_by(&self) -> &str {
84        use std::ops::Deref;
85        self.created_by.deref()
86    }
87    /// <p>The timestamp at which the rule was last updated.</p>
88    pub fn last_updated_by(&self) -> &str {
89        use std::ops::Deref;
90        self.last_updated_by.deref()
91    }
92}
93impl ::std::fmt::Debug for UpdateRuleOutput {
94    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
95        let mut formatter = f.debug_struct("UpdateRuleOutput");
96        formatter.field("identifier", &self.identifier);
97        formatter.field("revision", &self.revision);
98        formatter.field("name", &"*** Sensitive Data Redacted ***");
99        formatter.field("rule_type", &self.rule_type);
100        formatter.field("target", &self.target);
101        formatter.field("action", &self.action);
102        formatter.field("scope", &self.scope);
103        formatter.field("detail", &self.detail);
104        formatter.field("description", &"*** Sensitive Data Redacted ***");
105        formatter.field("created_at", &self.created_at);
106        formatter.field("updated_at", &self.updated_at);
107        formatter.field("created_by", &self.created_by);
108        formatter.field("last_updated_by", &self.last_updated_by);
109        formatter.field("_request_id", &self._request_id);
110        formatter.finish()
111    }
112}
113impl ::aws_types::request_id::RequestId for UpdateRuleOutput {
114    fn request_id(&self) -> Option<&str> {
115        self._request_id.as_deref()
116    }
117}
118impl UpdateRuleOutput {
119    /// Creates a new builder-style object to manufacture [`UpdateRuleOutput`](crate::operation::update_rule::UpdateRuleOutput).
120    pub fn builder() -> crate::operation::update_rule::builders::UpdateRuleOutputBuilder {
121        crate::operation::update_rule::builders::UpdateRuleOutputBuilder::default()
122    }
123}
124
125/// A builder for [`UpdateRuleOutput`](crate::operation::update_rule::UpdateRuleOutput).
126#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
127#[non_exhaustive]
128pub struct UpdateRuleOutputBuilder {
129    pub(crate) identifier: ::std::option::Option<::std::string::String>,
130    pub(crate) revision: ::std::option::Option<::std::string::String>,
131    pub(crate) name: ::std::option::Option<::std::string::String>,
132    pub(crate) rule_type: ::std::option::Option<crate::types::RuleType>,
133    pub(crate) target: ::std::option::Option<crate::types::RuleTarget>,
134    pub(crate) action: ::std::option::Option<crate::types::RuleAction>,
135    pub(crate) scope: ::std::option::Option<crate::types::RuleScope>,
136    pub(crate) detail: ::std::option::Option<crate::types::RuleDetail>,
137    pub(crate) description: ::std::option::Option<::std::string::String>,
138    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
139    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
140    pub(crate) created_by: ::std::option::Option<::std::string::String>,
141    pub(crate) last_updated_by: ::std::option::Option<::std::string::String>,
142    _request_id: Option<String>,
143}
144impl UpdateRuleOutputBuilder {
145    /// <p>The ID of the rule.</p>
146    /// This field is required.
147    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.identifier = ::std::option::Option::Some(input.into());
149        self
150    }
151    /// <p>The ID of the rule.</p>
152    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.identifier = input;
154        self
155    }
156    /// <p>The ID of the rule.</p>
157    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
158        &self.identifier
159    }
160    /// <p>The revision of the rule.</p>
161    /// This field is required.
162    pub fn revision(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.revision = ::std::option::Option::Some(input.into());
164        self
165    }
166    /// <p>The revision of the rule.</p>
167    pub fn set_revision(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.revision = input;
169        self
170    }
171    /// <p>The revision of the rule.</p>
172    pub fn get_revision(&self) -> &::std::option::Option<::std::string::String> {
173        &self.revision
174    }
175    /// <p>The name of the rule.</p>
176    /// This field is required.
177    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178        self.name = ::std::option::Option::Some(input.into());
179        self
180    }
181    /// <p>The name of the rule.</p>
182    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183        self.name = input;
184        self
185    }
186    /// <p>The name of the rule.</p>
187    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
188        &self.name
189    }
190    /// <p>The type of the rule.</p>
191    /// This field is required.
192    pub fn rule_type(mut self, input: crate::types::RuleType) -> Self {
193        self.rule_type = ::std::option::Option::Some(input);
194        self
195    }
196    /// <p>The type of the rule.</p>
197    pub fn set_rule_type(mut self, input: ::std::option::Option<crate::types::RuleType>) -> Self {
198        self.rule_type = input;
199        self
200    }
201    /// <p>The type of the rule.</p>
202    pub fn get_rule_type(&self) -> &::std::option::Option<crate::types::RuleType> {
203        &self.rule_type
204    }
205    /// <p>The target of the rule.</p>
206    /// This field is required.
207    pub fn target(mut self, input: crate::types::RuleTarget) -> Self {
208        self.target = ::std::option::Option::Some(input);
209        self
210    }
211    /// <p>The target of the rule.</p>
212    pub fn set_target(mut self, input: ::std::option::Option<crate::types::RuleTarget>) -> Self {
213        self.target = input;
214        self
215    }
216    /// <p>The target of the rule.</p>
217    pub fn get_target(&self) -> &::std::option::Option<crate::types::RuleTarget> {
218        &self.target
219    }
220    /// <p>The action of the rule.</p>
221    /// This field is required.
222    pub fn action(mut self, input: crate::types::RuleAction) -> Self {
223        self.action = ::std::option::Option::Some(input);
224        self
225    }
226    /// <p>The action of the rule.</p>
227    pub fn set_action(mut self, input: ::std::option::Option<crate::types::RuleAction>) -> Self {
228        self.action = input;
229        self
230    }
231    /// <p>The action of the rule.</p>
232    pub fn get_action(&self) -> &::std::option::Option<crate::types::RuleAction> {
233        &self.action
234    }
235    /// <p>The scope of the rule.</p>
236    /// This field is required.
237    pub fn scope(mut self, input: crate::types::RuleScope) -> Self {
238        self.scope = ::std::option::Option::Some(input);
239        self
240    }
241    /// <p>The scope of the rule.</p>
242    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::RuleScope>) -> Self {
243        self.scope = input;
244        self
245    }
246    /// <p>The scope of the rule.</p>
247    pub fn get_scope(&self) -> &::std::option::Option<crate::types::RuleScope> {
248        &self.scope
249    }
250    /// <p>The detail of the rule.</p>
251    /// This field is required.
252    pub fn detail(mut self, input: crate::types::RuleDetail) -> Self {
253        self.detail = ::std::option::Option::Some(input);
254        self
255    }
256    /// <p>The detail of the rule.</p>
257    pub fn set_detail(mut self, input: ::std::option::Option<crate::types::RuleDetail>) -> Self {
258        self.detail = input;
259        self
260    }
261    /// <p>The detail of the rule.</p>
262    pub fn get_detail(&self) -> &::std::option::Option<crate::types::RuleDetail> {
263        &self.detail
264    }
265    /// <p>The description of the rule.</p>
266    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
267        self.description = ::std::option::Option::Some(input.into());
268        self
269    }
270    /// <p>The description of the rule.</p>
271    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
272        self.description = input;
273        self
274    }
275    /// <p>The description of the rule.</p>
276    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
277        &self.description
278    }
279    /// <p>The timestamp at which the rule was created.</p>
280    /// This field is required.
281    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
282        self.created_at = ::std::option::Option::Some(input);
283        self
284    }
285    /// <p>The timestamp at which the rule was created.</p>
286    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
287        self.created_at = input;
288        self
289    }
290    /// <p>The timestamp at which the rule was created.</p>
291    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
292        &self.created_at
293    }
294    /// <p>The timestamp at which the rule was last updated.</p>
295    /// This field is required.
296    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
297        self.updated_at = ::std::option::Option::Some(input);
298        self
299    }
300    /// <p>The timestamp at which the rule was last updated.</p>
301    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
302        self.updated_at = input;
303        self
304    }
305    /// <p>The timestamp at which the rule was last updated.</p>
306    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
307        &self.updated_at
308    }
309    /// <p>The user who created the rule.</p>
310    /// This field is required.
311    pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
312        self.created_by = ::std::option::Option::Some(input.into());
313        self
314    }
315    /// <p>The user who created the rule.</p>
316    pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
317        self.created_by = input;
318        self
319    }
320    /// <p>The user who created the rule.</p>
321    pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
322        &self.created_by
323    }
324    /// <p>The timestamp at which the rule was last updated.</p>
325    /// This field is required.
326    pub fn last_updated_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
327        self.last_updated_by = ::std::option::Option::Some(input.into());
328        self
329    }
330    /// <p>The timestamp at which the rule was last updated.</p>
331    pub fn set_last_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
332        self.last_updated_by = input;
333        self
334    }
335    /// <p>The timestamp at which the rule was last updated.</p>
336    pub fn get_last_updated_by(&self) -> &::std::option::Option<::std::string::String> {
337        &self.last_updated_by
338    }
339    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
340        self._request_id = Some(request_id.into());
341        self
342    }
343
344    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
345        self._request_id = request_id;
346        self
347    }
348    /// Consumes the builder and constructs a [`UpdateRuleOutput`](crate::operation::update_rule::UpdateRuleOutput).
349    /// This method will fail if any of the following fields are not set:
350    /// - [`identifier`](crate::operation::update_rule::builders::UpdateRuleOutputBuilder::identifier)
351    /// - [`revision`](crate::operation::update_rule::builders::UpdateRuleOutputBuilder::revision)
352    /// - [`name`](crate::operation::update_rule::builders::UpdateRuleOutputBuilder::name)
353    /// - [`rule_type`](crate::operation::update_rule::builders::UpdateRuleOutputBuilder::rule_type)
354    /// - [`action`](crate::operation::update_rule::builders::UpdateRuleOutputBuilder::action)
355    /// - [`created_at`](crate::operation::update_rule::builders::UpdateRuleOutputBuilder::created_at)
356    /// - [`updated_at`](crate::operation::update_rule::builders::UpdateRuleOutputBuilder::updated_at)
357    /// - [`created_by`](crate::operation::update_rule::builders::UpdateRuleOutputBuilder::created_by)
358    /// - [`last_updated_by`](crate::operation::update_rule::builders::UpdateRuleOutputBuilder::last_updated_by)
359    pub fn build(self) -> ::std::result::Result<crate::operation::update_rule::UpdateRuleOutput, ::aws_smithy_types::error::operation::BuildError> {
360        ::std::result::Result::Ok(crate::operation::update_rule::UpdateRuleOutput {
361            identifier: self.identifier.ok_or_else(|| {
362                ::aws_smithy_types::error::operation::BuildError::missing_field(
363                    "identifier",
364                    "identifier was not specified but it is required when building UpdateRuleOutput",
365                )
366            })?,
367            revision: self.revision.ok_or_else(|| {
368                ::aws_smithy_types::error::operation::BuildError::missing_field(
369                    "revision",
370                    "revision was not specified but it is required when building UpdateRuleOutput",
371                )
372            })?,
373            name: self.name.ok_or_else(|| {
374                ::aws_smithy_types::error::operation::BuildError::missing_field(
375                    "name",
376                    "name was not specified but it is required when building UpdateRuleOutput",
377                )
378            })?,
379            rule_type: self.rule_type.ok_or_else(|| {
380                ::aws_smithy_types::error::operation::BuildError::missing_field(
381                    "rule_type",
382                    "rule_type was not specified but it is required when building UpdateRuleOutput",
383                )
384            })?,
385            target: self.target,
386            action: self.action.ok_or_else(|| {
387                ::aws_smithy_types::error::operation::BuildError::missing_field(
388                    "action",
389                    "action was not specified but it is required when building UpdateRuleOutput",
390                )
391            })?,
392            scope: self.scope,
393            detail: self.detail,
394            description: self.description,
395            created_at: self.created_at.ok_or_else(|| {
396                ::aws_smithy_types::error::operation::BuildError::missing_field(
397                    "created_at",
398                    "created_at was not specified but it is required when building UpdateRuleOutput",
399                )
400            })?,
401            updated_at: self.updated_at.ok_or_else(|| {
402                ::aws_smithy_types::error::operation::BuildError::missing_field(
403                    "updated_at",
404                    "updated_at was not specified but it is required when building UpdateRuleOutput",
405                )
406            })?,
407            created_by: self.created_by.ok_or_else(|| {
408                ::aws_smithy_types::error::operation::BuildError::missing_field(
409                    "created_by",
410                    "created_by was not specified but it is required when building UpdateRuleOutput",
411                )
412            })?,
413            last_updated_by: self.last_updated_by.ok_or_else(|| {
414                ::aws_smithy_types::error::operation::BuildError::missing_field(
415                    "last_updated_by",
416                    "last_updated_by was not specified but it is required when building UpdateRuleOutput",
417                )
418            })?,
419            _request_id: self._request_id,
420        })
421    }
422}
423impl ::std::fmt::Debug for UpdateRuleOutputBuilder {
424    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
425        let mut formatter = f.debug_struct("UpdateRuleOutputBuilder");
426        formatter.field("identifier", &self.identifier);
427        formatter.field("revision", &self.revision);
428        formatter.field("name", &"*** Sensitive Data Redacted ***");
429        formatter.field("rule_type", &self.rule_type);
430        formatter.field("target", &self.target);
431        formatter.field("action", &self.action);
432        formatter.field("scope", &self.scope);
433        formatter.field("detail", &self.detail);
434        formatter.field("description", &"*** Sensitive Data Redacted ***");
435        formatter.field("created_at", &self.created_at);
436        formatter.field("updated_at", &self.updated_at);
437        formatter.field("created_by", &self.created_by);
438        formatter.field("last_updated_by", &self.last_updated_by);
439        formatter.field("_request_id", &self._request_id);
440        formatter.finish()
441    }
442}