aws_sdk_datazone/operation/update_rule/
_update_rule_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct UpdateRuleOutput {
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 description: ::std::option::Option<::std::string::String>,
24 pub created_at: ::aws_smithy_types::DateTime,
26 pub updated_at: ::aws_smithy_types::DateTime,
28 pub created_by: ::std::string::String,
30 pub last_updated_by: ::std::string::String,
32 _request_id: Option<String>,
33}
34impl UpdateRuleOutput {
35 pub fn identifier(&self) -> &str {
37 use std::ops::Deref;
38 self.identifier.deref()
39 }
40 pub fn revision(&self) -> &str {
42 use std::ops::Deref;
43 self.revision.deref()
44 }
45 pub fn name(&self) -> &str {
47 use std::ops::Deref;
48 self.name.deref()
49 }
50 pub fn rule_type(&self) -> &crate::types::RuleType {
52 &self.rule_type
53 }
54 pub fn target(&self) -> ::std::option::Option<&crate::types::RuleTarget> {
56 self.target.as_ref()
57 }
58 pub fn action(&self) -> &crate::types::RuleAction {
60 &self.action
61 }
62 pub fn scope(&self) -> ::std::option::Option<&crate::types::RuleScope> {
64 self.scope.as_ref()
65 }
66 pub fn detail(&self) -> ::std::option::Option<&crate::types::RuleDetail> {
68 self.detail.as_ref()
69 }
70 pub fn description(&self) -> ::std::option::Option<&str> {
72 self.description.as_deref()
73 }
74 pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
76 &self.created_at
77 }
78 pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
80 &self.updated_at
81 }
82 pub fn created_by(&self) -> &str {
84 use std::ops::Deref;
85 self.created_by.deref()
86 }
87 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 pub fn builder() -> crate::operation::update_rule::builders::UpdateRuleOutputBuilder {
121 crate::operation::update_rule::builders::UpdateRuleOutputBuilder::default()
122 }
123}
124
125#[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 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 pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153 self.identifier = input;
154 self
155 }
156 pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
158 &self.identifier
159 }
160 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 pub fn set_revision(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168 self.revision = input;
169 self
170 }
171 pub fn get_revision(&self) -> &::std::option::Option<::std::string::String> {
173 &self.revision
174 }
175 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 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183 self.name = input;
184 self
185 }
186 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
188 &self.name
189 }
190 pub fn rule_type(mut self, input: crate::types::RuleType) -> Self {
193 self.rule_type = ::std::option::Option::Some(input);
194 self
195 }
196 pub fn set_rule_type(mut self, input: ::std::option::Option<crate::types::RuleType>) -> Self {
198 self.rule_type = input;
199 self
200 }
201 pub fn get_rule_type(&self) -> &::std::option::Option<crate::types::RuleType> {
203 &self.rule_type
204 }
205 pub fn target(mut self, input: crate::types::RuleTarget) -> Self {
208 self.target = ::std::option::Option::Some(input);
209 self
210 }
211 pub fn set_target(mut self, input: ::std::option::Option<crate::types::RuleTarget>) -> Self {
213 self.target = input;
214 self
215 }
216 pub fn get_target(&self) -> &::std::option::Option<crate::types::RuleTarget> {
218 &self.target
219 }
220 pub fn action(mut self, input: crate::types::RuleAction) -> Self {
223 self.action = ::std::option::Option::Some(input);
224 self
225 }
226 pub fn set_action(mut self, input: ::std::option::Option<crate::types::RuleAction>) -> Self {
228 self.action = input;
229 self
230 }
231 pub fn get_action(&self) -> &::std::option::Option<crate::types::RuleAction> {
233 &self.action
234 }
235 pub fn scope(mut self, input: crate::types::RuleScope) -> Self {
238 self.scope = ::std::option::Option::Some(input);
239 self
240 }
241 pub fn set_scope(mut self, input: ::std::option::Option<crate::types::RuleScope>) -> Self {
243 self.scope = input;
244 self
245 }
246 pub fn get_scope(&self) -> &::std::option::Option<crate::types::RuleScope> {
248 &self.scope
249 }
250 pub fn detail(mut self, input: crate::types::RuleDetail) -> Self {
253 self.detail = ::std::option::Option::Some(input);
254 self
255 }
256 pub fn set_detail(mut self, input: ::std::option::Option<crate::types::RuleDetail>) -> Self {
258 self.detail = input;
259 self
260 }
261 pub fn get_detail(&self) -> &::std::option::Option<crate::types::RuleDetail> {
263 &self.detail
264 }
265 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 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
272 self.description = input;
273 self
274 }
275 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
277 &self.description
278 }
279 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 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 pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
292 &self.created_at
293 }
294 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 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 pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
307 &self.updated_at
308 }
309 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 pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
317 self.created_by = input;
318 self
319 }
320 pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
322 &self.created_by
323 }
324 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 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 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 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}