aws_sdk_controltower/operation/enable_control/
_enable_control_input.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, ::std::fmt::Debug)]
5pub struct EnableControlInput {
6    /// <p>The ARN of the control. Only <b>Strongly recommended</b> and <b>Elective</b> controls are permitted, with the exception of the <b>Region deny</b> 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>
7    pub control_identifier: ::std::option::Option<::std::string::String>,
8    /// <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>
9    pub target_identifier: ::std::option::Option<::std::string::String>,
10    /// <p>Tags to be applied to the <code>EnabledControl</code> resource.</p>
11    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
12    /// <p>A list of input parameter values, which are specified to configure the control when you enable it.</p>
13    pub parameters: ::std::option::Option<::std::vec::Vec<crate::types::EnabledControlParameter>>,
14}
15impl EnableControlInput {
16    /// <p>The ARN of the control. Only <b>Strongly recommended</b> and <b>Elective</b> controls are permitted, with the exception of the <b>Region deny</b> 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>
17    pub fn control_identifier(&self) -> ::std::option::Option<&str> {
18        self.control_identifier.as_deref()
19    }
20    /// <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>
21    pub fn target_identifier(&self) -> ::std::option::Option<&str> {
22        self.target_identifier.as_deref()
23    }
24    /// <p>Tags to be applied to the <code>EnabledControl</code> resource.</p>
25    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
26        self.tags.as_ref()
27    }
28    /// <p>A list of input parameter values, which are specified to configure the control when you enable it.</p>
29    ///
30    /// 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()`.
31    pub fn parameters(&self) -> &[crate::types::EnabledControlParameter] {
32        self.parameters.as_deref().unwrap_or_default()
33    }
34}
35impl EnableControlInput {
36    /// Creates a new builder-style object to manufacture [`EnableControlInput`](crate::operation::enable_control::EnableControlInput).
37    pub fn builder() -> crate::operation::enable_control::builders::EnableControlInputBuilder {
38        crate::operation::enable_control::builders::EnableControlInputBuilder::default()
39    }
40}
41
42/// A builder for [`EnableControlInput`](crate::operation::enable_control::EnableControlInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct EnableControlInputBuilder {
46    pub(crate) control_identifier: ::std::option::Option<::std::string::String>,
47    pub(crate) target_identifier: ::std::option::Option<::std::string::String>,
48    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
49    pub(crate) parameters: ::std::option::Option<::std::vec::Vec<crate::types::EnabledControlParameter>>,
50}
51impl EnableControlInputBuilder {
52    /// <p>The ARN of the control. Only <b>Strongly recommended</b> and <b>Elective</b> controls are permitted, with the exception of the <b>Region deny</b> 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>
53    /// This field is required.
54    pub fn control_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.control_identifier = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The ARN of the control. Only <b>Strongly recommended</b> and <b>Elective</b> controls are permitted, with the exception of the <b>Region deny</b> 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>
59    pub fn set_control_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.control_identifier = input;
61        self
62    }
63    /// <p>The ARN of the control. Only <b>Strongly recommended</b> and <b>Elective</b> controls are permitted, with the exception of the <b>Region deny</b> 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>
64    pub fn get_control_identifier(&self) -> &::std::option::Option<::std::string::String> {
65        &self.control_identifier
66    }
67    /// <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>
68    /// This field is required.
69    pub fn target_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70        self.target_identifier = ::std::option::Option::Some(input.into());
71        self
72    }
73    /// <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>
74    pub fn set_target_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75        self.target_identifier = input;
76        self
77    }
78    /// <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>
79    pub fn get_target_identifier(&self) -> &::std::option::Option<::std::string::String> {
80        &self.target_identifier
81    }
82    /// Adds a key-value pair to `tags`.
83    ///
84    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
85    ///
86    /// <p>Tags to be applied to the <code>EnabledControl</code> resource.</p>
87    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
88        let mut hash_map = self.tags.unwrap_or_default();
89        hash_map.insert(k.into(), v.into());
90        self.tags = ::std::option::Option::Some(hash_map);
91        self
92    }
93    /// <p>Tags to be applied to the <code>EnabledControl</code> resource.</p>
94    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
95        self.tags = input;
96        self
97    }
98    /// <p>Tags to be applied to the <code>EnabledControl</code> resource.</p>
99    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
100        &self.tags
101    }
102    /// Appends an item to `parameters`.
103    ///
104    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
105    ///
106    /// <p>A list of input parameter values, which are specified to configure the control when you enable it.</p>
107    pub fn parameters(mut self, input: crate::types::EnabledControlParameter) -> Self {
108        let mut v = self.parameters.unwrap_or_default();
109        v.push(input);
110        self.parameters = ::std::option::Option::Some(v);
111        self
112    }
113    /// <p>A list of input parameter values, which are specified to configure the control when you enable it.</p>
114    pub fn set_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EnabledControlParameter>>) -> Self {
115        self.parameters = input;
116        self
117    }
118    /// <p>A list of input parameter values, which are specified to configure the control when you enable it.</p>
119    pub fn get_parameters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EnabledControlParameter>> {
120        &self.parameters
121    }
122    /// Consumes the builder and constructs a [`EnableControlInput`](crate::operation::enable_control::EnableControlInput).
123    pub fn build(
124        self,
125    ) -> ::std::result::Result<crate::operation::enable_control::EnableControlInput, ::aws_smithy_types::error::operation::BuildError> {
126        ::std::result::Result::Ok(crate::operation::enable_control::EnableControlInput {
127            control_identifier: self.control_identifier,
128            target_identifier: self.target_identifier,
129            tags: self.tags,
130            parameters: self.parameters,
131        })
132    }
133}