aws_sdk_datazone/operation/create_rule/
_create_rule_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CreateRuleOutput {
6    pub identifier: ::std::string::String,
8    pub name: ::std::string::String,
10    pub rule_type: crate::types::RuleType,
12    pub target: ::std::option::Option<crate::types::RuleTarget>,
14    pub action: crate::types::RuleAction,
16    pub scope: ::std::option::Option<crate::types::RuleScope>,
18    pub detail: ::std::option::Option<crate::types::RuleDetail>,
20    pub target_type: ::std::option::Option<crate::types::RuleTargetType>,
22    pub description: ::std::option::Option<::std::string::String>,
24    pub created_at: ::aws_smithy_types::DateTime,
26    pub created_by: ::std::string::String,
28    _request_id: Option<String>,
29}
30impl CreateRuleOutput {
31    pub fn identifier(&self) -> &str {
33        use std::ops::Deref;
34        self.identifier.deref()
35    }
36    pub fn name(&self) -> &str {
38        use std::ops::Deref;
39        self.name.deref()
40    }
41    pub fn rule_type(&self) -> &crate::types::RuleType {
43        &self.rule_type
44    }
45    pub fn target(&self) -> ::std::option::Option<&crate::types::RuleTarget> {
47        self.target.as_ref()
48    }
49    pub fn action(&self) -> &crate::types::RuleAction {
51        &self.action
52    }
53    pub fn scope(&self) -> ::std::option::Option<&crate::types::RuleScope> {
55        self.scope.as_ref()
56    }
57    pub fn detail(&self) -> ::std::option::Option<&crate::types::RuleDetail> {
59        self.detail.as_ref()
60    }
61    pub fn target_type(&self) -> ::std::option::Option<&crate::types::RuleTargetType> {
63        self.target_type.as_ref()
64    }
65    pub fn description(&self) -> ::std::option::Option<&str> {
67        self.description.as_deref()
68    }
69    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
71        &self.created_at
72    }
73    pub fn created_by(&self) -> &str {
75        use std::ops::Deref;
76        self.created_by.deref()
77    }
78}
79impl ::std::fmt::Debug for CreateRuleOutput {
80    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
81        let mut formatter = f.debug_struct("CreateRuleOutput");
82        formatter.field("identifier", &self.identifier);
83        formatter.field("name", &"*** Sensitive Data Redacted ***");
84        formatter.field("rule_type", &self.rule_type);
85        formatter.field("target", &self.target);
86        formatter.field("action", &self.action);
87        formatter.field("scope", &self.scope);
88        formatter.field("detail", &self.detail);
89        formatter.field("target_type", &self.target_type);
90        formatter.field("description", &"*** Sensitive Data Redacted ***");
91        formatter.field("created_at", &self.created_at);
92        formatter.field("created_by", &self.created_by);
93        formatter.field("_request_id", &self._request_id);
94        formatter.finish()
95    }
96}
97impl ::aws_types::request_id::RequestId for CreateRuleOutput {
98    fn request_id(&self) -> Option<&str> {
99        self._request_id.as_deref()
100    }
101}
102impl CreateRuleOutput {
103    pub fn builder() -> crate::operation::create_rule::builders::CreateRuleOutputBuilder {
105        crate::operation::create_rule::builders::CreateRuleOutputBuilder::default()
106    }
107}
108
109#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
111#[non_exhaustive]
112pub struct CreateRuleOutputBuilder {
113    pub(crate) identifier: ::std::option::Option<::std::string::String>,
114    pub(crate) name: ::std::option::Option<::std::string::String>,
115    pub(crate) rule_type: ::std::option::Option<crate::types::RuleType>,
116    pub(crate) target: ::std::option::Option<crate::types::RuleTarget>,
117    pub(crate) action: ::std::option::Option<crate::types::RuleAction>,
118    pub(crate) scope: ::std::option::Option<crate::types::RuleScope>,
119    pub(crate) detail: ::std::option::Option<crate::types::RuleDetail>,
120    pub(crate) target_type: ::std::option::Option<crate::types::RuleTargetType>,
121    pub(crate) description: ::std::option::Option<::std::string::String>,
122    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
123    pub(crate) created_by: ::std::option::Option<::std::string::String>,
124    _request_id: Option<String>,
125}
126impl CreateRuleOutputBuilder {
127    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.identifier = ::std::option::Option::Some(input.into());
131        self
132    }
133    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.identifier = input;
136        self
137    }
138    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
140        &self.identifier
141    }
142    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.name = ::std::option::Option::Some(input.into());
146        self
147    }
148    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.name = input;
151        self
152    }
153    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
155        &self.name
156    }
157    pub fn rule_type(mut self, input: crate::types::RuleType) -> Self {
160        self.rule_type = ::std::option::Option::Some(input);
161        self
162    }
163    pub fn set_rule_type(mut self, input: ::std::option::Option<crate::types::RuleType>) -> Self {
165        self.rule_type = input;
166        self
167    }
168    pub fn get_rule_type(&self) -> &::std::option::Option<crate::types::RuleType> {
170        &self.rule_type
171    }
172    pub fn target(mut self, input: crate::types::RuleTarget) -> Self {
175        self.target = ::std::option::Option::Some(input);
176        self
177    }
178    pub fn set_target(mut self, input: ::std::option::Option<crate::types::RuleTarget>) -> Self {
180        self.target = input;
181        self
182    }
183    pub fn get_target(&self) -> &::std::option::Option<crate::types::RuleTarget> {
185        &self.target
186    }
187    pub fn action(mut self, input: crate::types::RuleAction) -> Self {
190        self.action = ::std::option::Option::Some(input);
191        self
192    }
193    pub fn set_action(mut self, input: ::std::option::Option<crate::types::RuleAction>) -> Self {
195        self.action = input;
196        self
197    }
198    pub fn get_action(&self) -> &::std::option::Option<crate::types::RuleAction> {
200        &self.action
201    }
202    pub fn scope(mut self, input: crate::types::RuleScope) -> Self {
205        self.scope = ::std::option::Option::Some(input);
206        self
207    }
208    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::RuleScope>) -> Self {
210        self.scope = input;
211        self
212    }
213    pub fn get_scope(&self) -> &::std::option::Option<crate::types::RuleScope> {
215        &self.scope
216    }
217    pub fn detail(mut self, input: crate::types::RuleDetail) -> Self {
220        self.detail = ::std::option::Option::Some(input);
221        self
222    }
223    pub fn set_detail(mut self, input: ::std::option::Option<crate::types::RuleDetail>) -> Self {
225        self.detail = input;
226        self
227    }
228    pub fn get_detail(&self) -> &::std::option::Option<crate::types::RuleDetail> {
230        &self.detail
231    }
232    pub fn target_type(mut self, input: crate::types::RuleTargetType) -> Self {
234        self.target_type = ::std::option::Option::Some(input);
235        self
236    }
237    pub fn set_target_type(mut self, input: ::std::option::Option<crate::types::RuleTargetType>) -> Self {
239        self.target_type = input;
240        self
241    }
242    pub fn get_target_type(&self) -> &::std::option::Option<crate::types::RuleTargetType> {
244        &self.target_type
245    }
246    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
248        self.description = ::std::option::Option::Some(input.into());
249        self
250    }
251    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
253        self.description = input;
254        self
255    }
256    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
258        &self.description
259    }
260    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
263        self.created_at = ::std::option::Option::Some(input);
264        self
265    }
266    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
268        self.created_at = input;
269        self
270    }
271    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
273        &self.created_at
274    }
275    pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
278        self.created_by = ::std::option::Option::Some(input.into());
279        self
280    }
281    pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
283        self.created_by = input;
284        self
285    }
286    pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
288        &self.created_by
289    }
290    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
291        self._request_id = Some(request_id.into());
292        self
293    }
294
295    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
296        self._request_id = request_id;
297        self
298    }
299    pub fn build(self) -> ::std::result::Result<crate::operation::create_rule::CreateRuleOutput, ::aws_smithy_types::error::operation::BuildError> {
308        ::std::result::Result::Ok(crate::operation::create_rule::CreateRuleOutput {
309            identifier: self.identifier.ok_or_else(|| {
310                ::aws_smithy_types::error::operation::BuildError::missing_field(
311                    "identifier",
312                    "identifier was not specified but it is required when building CreateRuleOutput",
313                )
314            })?,
315            name: self.name.ok_or_else(|| {
316                ::aws_smithy_types::error::operation::BuildError::missing_field(
317                    "name",
318                    "name was not specified but it is required when building CreateRuleOutput",
319                )
320            })?,
321            rule_type: self.rule_type.ok_or_else(|| {
322                ::aws_smithy_types::error::operation::BuildError::missing_field(
323                    "rule_type",
324                    "rule_type was not specified but it is required when building CreateRuleOutput",
325                )
326            })?,
327            target: self.target,
328            action: self.action.ok_or_else(|| {
329                ::aws_smithy_types::error::operation::BuildError::missing_field(
330                    "action",
331                    "action was not specified but it is required when building CreateRuleOutput",
332                )
333            })?,
334            scope: self.scope,
335            detail: self.detail,
336            target_type: self.target_type,
337            description: self.description,
338            created_at: self.created_at.ok_or_else(|| {
339                ::aws_smithy_types::error::operation::BuildError::missing_field(
340                    "created_at",
341                    "created_at was not specified but it is required when building CreateRuleOutput",
342                )
343            })?,
344            created_by: self.created_by.ok_or_else(|| {
345                ::aws_smithy_types::error::operation::BuildError::missing_field(
346                    "created_by",
347                    "created_by was not specified but it is required when building CreateRuleOutput",
348                )
349            })?,
350            _request_id: self._request_id,
351        })
352    }
353}
354impl ::std::fmt::Debug for CreateRuleOutputBuilder {
355    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
356        let mut formatter = f.debug_struct("CreateRuleOutputBuilder");
357        formatter.field("identifier", &self.identifier);
358        formatter.field("name", &"*** Sensitive Data Redacted ***");
359        formatter.field("rule_type", &self.rule_type);
360        formatter.field("target", &self.target);
361        formatter.field("action", &self.action);
362        formatter.field("scope", &self.scope);
363        formatter.field("detail", &self.detail);
364        formatter.field("target_type", &self.target_type);
365        formatter.field("description", &"*** Sensitive Data Redacted ***");
366        formatter.field("created_at", &self.created_at);
367        formatter.field("created_by", &self.created_by);
368        formatter.field("_request_id", &self._request_id);
369        formatter.finish()
370    }
371}