Skip to main content

aws_sdk_controltower/types/
_enabled_control_details.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Information about the enabled control.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct EnabledControlDetails {
7    /// <p>The ARN of the enabled control.</p>
8    pub arn: ::std::option::Option<::std::string::String>,
9    /// <p>The control identifier of the enabled control. For information on how to find the <code>controlIdentifier</code>, see <a href="https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html">the overview page</a>.</p>
10    pub control_identifier: ::std::option::Option<::std::string::String>,
11    /// <p>The ARN of the organizational unit. For information on how to find the <code>targetIdentifier</code>, see <a href="https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html">the overview page</a>.</p>
12    pub target_identifier: ::std::option::Option<::std::string::String>,
13    /// <p>The deployment summary of the enabled control.</p>
14    pub status_summary: ::std::option::Option<crate::types::EnablementStatusSummary>,
15    /// <p>The drift status of the enabled control.</p>
16    pub drift_status_summary: ::std::option::Option<crate::types::DriftStatusSummary>,
17    /// <p>The ARN of the parent enabled control from which this control inherits its configuration, if applicable.</p>
18    pub parent_identifier: ::std::option::Option<::std::string::String>,
19    /// <p>Target Amazon Web Services Regions for the enabled control.</p>
20    pub target_regions: ::std::option::Option<::std::vec::Vec<crate::types::Region>>,
21    /// <p>Array of <code>EnabledControlParameter</code> objects.</p>
22    pub parameters: ::std::option::Option<::std::vec::Vec<crate::types::EnabledControlParameterSummary>>,
23}
24impl EnabledControlDetails {
25    /// <p>The ARN of the enabled control.</p>
26    pub fn arn(&self) -> ::std::option::Option<&str> {
27        self.arn.as_deref()
28    }
29    /// <p>The control identifier of the enabled control. For information on how to find the <code>controlIdentifier</code>, see <a href="https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html">the overview page</a>.</p>
30    pub fn control_identifier(&self) -> ::std::option::Option<&str> {
31        self.control_identifier.as_deref()
32    }
33    /// <p>The ARN of the organizational unit. For information on how to find the <code>targetIdentifier</code>, see <a href="https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html">the overview page</a>.</p>
34    pub fn target_identifier(&self) -> ::std::option::Option<&str> {
35        self.target_identifier.as_deref()
36    }
37    /// <p>The deployment summary of the enabled control.</p>
38    pub fn status_summary(&self) -> ::std::option::Option<&crate::types::EnablementStatusSummary> {
39        self.status_summary.as_ref()
40    }
41    /// <p>The drift status of the enabled control.</p>
42    pub fn drift_status_summary(&self) -> ::std::option::Option<&crate::types::DriftStatusSummary> {
43        self.drift_status_summary.as_ref()
44    }
45    /// <p>The ARN of the parent enabled control from which this control inherits its configuration, if applicable.</p>
46    pub fn parent_identifier(&self) -> ::std::option::Option<&str> {
47        self.parent_identifier.as_deref()
48    }
49    /// <p>Target Amazon Web Services Regions for the enabled control.</p>
50    ///
51    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.target_regions.is_none()`.
52    pub fn target_regions(&self) -> &[crate::types::Region] {
53        self.target_regions.as_deref().unwrap_or_default()
54    }
55    /// <p>Array of <code>EnabledControlParameter</code> objects.</p>
56    ///
57    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.parameters.is_none()`.
58    pub fn parameters(&self) -> &[crate::types::EnabledControlParameterSummary] {
59        self.parameters.as_deref().unwrap_or_default()
60    }
61}
62impl EnabledControlDetails {
63    /// Creates a new builder-style object to manufacture [`EnabledControlDetails`](crate::types::EnabledControlDetails).
64    pub fn builder() -> crate::types::builders::EnabledControlDetailsBuilder {
65        crate::types::builders::EnabledControlDetailsBuilder::default()
66    }
67}
68
69/// A builder for [`EnabledControlDetails`](crate::types::EnabledControlDetails).
70#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
71#[non_exhaustive]
72pub struct EnabledControlDetailsBuilder {
73    pub(crate) arn: ::std::option::Option<::std::string::String>,
74    pub(crate) control_identifier: ::std::option::Option<::std::string::String>,
75    pub(crate) target_identifier: ::std::option::Option<::std::string::String>,
76    pub(crate) status_summary: ::std::option::Option<crate::types::EnablementStatusSummary>,
77    pub(crate) drift_status_summary: ::std::option::Option<crate::types::DriftStatusSummary>,
78    pub(crate) parent_identifier: ::std::option::Option<::std::string::String>,
79    pub(crate) target_regions: ::std::option::Option<::std::vec::Vec<crate::types::Region>>,
80    pub(crate) parameters: ::std::option::Option<::std::vec::Vec<crate::types::EnabledControlParameterSummary>>,
81}
82impl EnabledControlDetailsBuilder {
83    /// <p>The ARN of the enabled control.</p>
84    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
85        self.arn = ::std::option::Option::Some(input.into());
86        self
87    }
88    /// <p>The ARN of the enabled control.</p>
89    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90        self.arn = input;
91        self
92    }
93    /// <p>The ARN of the enabled control.</p>
94    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
95        &self.arn
96    }
97    /// <p>The control identifier of the enabled control. For information on how to find the <code>controlIdentifier</code>, see <a href="https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html">the overview page</a>.</p>
98    pub fn control_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
99        self.control_identifier = ::std::option::Option::Some(input.into());
100        self
101    }
102    /// <p>The control identifier of the enabled control. For information on how to find the <code>controlIdentifier</code>, see <a href="https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html">the overview page</a>.</p>
103    pub fn set_control_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
104        self.control_identifier = input;
105        self
106    }
107    /// <p>The control identifier of the enabled control. For information on how to find the <code>controlIdentifier</code>, see <a href="https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html">the overview page</a>.</p>
108    pub fn get_control_identifier(&self) -> &::std::option::Option<::std::string::String> {
109        &self.control_identifier
110    }
111    /// <p>The ARN of the organizational unit. For information on how to find the <code>targetIdentifier</code>, see <a href="https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html">the overview page</a>.</p>
112    pub fn target_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.target_identifier = ::std::option::Option::Some(input.into());
114        self
115    }
116    /// <p>The ARN of the organizational unit. For information on how to find the <code>targetIdentifier</code>, see <a href="https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html">the overview page</a>.</p>
117    pub fn set_target_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.target_identifier = input;
119        self
120    }
121    /// <p>The ARN of the organizational unit. For information on how to find the <code>targetIdentifier</code>, see <a href="https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html">the overview page</a>.</p>
122    pub fn get_target_identifier(&self) -> &::std::option::Option<::std::string::String> {
123        &self.target_identifier
124    }
125    /// <p>The deployment summary of the enabled control.</p>
126    pub fn status_summary(mut self, input: crate::types::EnablementStatusSummary) -> Self {
127        self.status_summary = ::std::option::Option::Some(input);
128        self
129    }
130    /// <p>The deployment summary of the enabled control.</p>
131    pub fn set_status_summary(mut self, input: ::std::option::Option<crate::types::EnablementStatusSummary>) -> Self {
132        self.status_summary = input;
133        self
134    }
135    /// <p>The deployment summary of the enabled control.</p>
136    pub fn get_status_summary(&self) -> &::std::option::Option<crate::types::EnablementStatusSummary> {
137        &self.status_summary
138    }
139    /// <p>The drift status of the enabled control.</p>
140    pub fn drift_status_summary(mut self, input: crate::types::DriftStatusSummary) -> Self {
141        self.drift_status_summary = ::std::option::Option::Some(input);
142        self
143    }
144    /// <p>The drift status of the enabled control.</p>
145    pub fn set_drift_status_summary(mut self, input: ::std::option::Option<crate::types::DriftStatusSummary>) -> Self {
146        self.drift_status_summary = input;
147        self
148    }
149    /// <p>The drift status of the enabled control.</p>
150    pub fn get_drift_status_summary(&self) -> &::std::option::Option<crate::types::DriftStatusSummary> {
151        &self.drift_status_summary
152    }
153    /// <p>The ARN of the parent enabled control from which this control inherits its configuration, if applicable.</p>
154    pub fn parent_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.parent_identifier = ::std::option::Option::Some(input.into());
156        self
157    }
158    /// <p>The ARN of the parent enabled control from which this control inherits its configuration, if applicable.</p>
159    pub fn set_parent_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.parent_identifier = input;
161        self
162    }
163    /// <p>The ARN of the parent enabled control from which this control inherits its configuration, if applicable.</p>
164    pub fn get_parent_identifier(&self) -> &::std::option::Option<::std::string::String> {
165        &self.parent_identifier
166    }
167    /// Appends an item to `target_regions`.
168    ///
169    /// To override the contents of this collection use [`set_target_regions`](Self::set_target_regions).
170    ///
171    /// <p>Target Amazon Web Services Regions for the enabled control.</p>
172    pub fn target_regions(mut self, input: crate::types::Region) -> Self {
173        let mut v = self.target_regions.unwrap_or_default();
174        v.push(input);
175        self.target_regions = ::std::option::Option::Some(v);
176        self
177    }
178    /// <p>Target Amazon Web Services Regions for the enabled control.</p>
179    pub fn set_target_regions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Region>>) -> Self {
180        self.target_regions = input;
181        self
182    }
183    /// <p>Target Amazon Web Services Regions for the enabled control.</p>
184    pub fn get_target_regions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Region>> {
185        &self.target_regions
186    }
187    /// Appends an item to `parameters`.
188    ///
189    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
190    ///
191    /// <p>Array of <code>EnabledControlParameter</code> objects.</p>
192    pub fn parameters(mut self, input: crate::types::EnabledControlParameterSummary) -> Self {
193        let mut v = self.parameters.unwrap_or_default();
194        v.push(input);
195        self.parameters = ::std::option::Option::Some(v);
196        self
197    }
198    /// <p>Array of <code>EnabledControlParameter</code> objects.</p>
199    pub fn set_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EnabledControlParameterSummary>>) -> Self {
200        self.parameters = input;
201        self
202    }
203    /// <p>Array of <code>EnabledControlParameter</code> objects.</p>
204    pub fn get_parameters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EnabledControlParameterSummary>> {
205        &self.parameters
206    }
207    /// Consumes the builder and constructs a [`EnabledControlDetails`](crate::types::EnabledControlDetails).
208    pub fn build(self) -> crate::types::EnabledControlDetails {
209        crate::types::EnabledControlDetails {
210            arn: self.arn,
211            control_identifier: self.control_identifier,
212            target_identifier: self.target_identifier,
213            status_summary: self.status_summary,
214            drift_status_summary: self.drift_status_summary,
215            parent_identifier: self.parent_identifier,
216            target_regions: self.target_regions,
217            parameters: self.parameters,
218        }
219    }
220}