aws_sdk_controltower/operation/enable_baseline/
_enable_baseline_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 EnableBaselineInput {
6    /// <p>The specific version to be enabled of the specified baseline.</p>
7    pub baseline_version: ::std::option::Option<::std::string::String>,
8    /// <p>A list of <code>key-value</code> objects that specify enablement parameters, where <code>key</code> is a string and <code>value</code> is a document of any type.</p>
9    pub parameters: ::std::option::Option<::std::vec::Vec<crate::types::EnabledBaselineParameter>>,
10    /// <p>The ARN of the baseline to be enabled.</p>
11    pub baseline_identifier: ::std::option::Option<::std::string::String>,
12    /// <p>The ARN of the target on which the baseline will be enabled. Only OUs are supported as targets.</p>
13    pub target_identifier: ::std::option::Option<::std::string::String>,
14    /// <p>Tags associated with input to <code>EnableBaseline</code>.</p>
15    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
16}
17impl EnableBaselineInput {
18    /// <p>The specific version to be enabled of the specified baseline.</p>
19    pub fn baseline_version(&self) -> ::std::option::Option<&str> {
20        self.baseline_version.as_deref()
21    }
22    /// <p>A list of <code>key-value</code> objects that specify enablement parameters, where <code>key</code> is a string and <code>value</code> is a document of any type.</p>
23    ///
24    /// 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()`.
25    pub fn parameters(&self) -> &[crate::types::EnabledBaselineParameter] {
26        self.parameters.as_deref().unwrap_or_default()
27    }
28    /// <p>The ARN of the baseline to be enabled.</p>
29    pub fn baseline_identifier(&self) -> ::std::option::Option<&str> {
30        self.baseline_identifier.as_deref()
31    }
32    /// <p>The ARN of the target on which the baseline will be enabled. Only OUs are supported as targets.</p>
33    pub fn target_identifier(&self) -> ::std::option::Option<&str> {
34        self.target_identifier.as_deref()
35    }
36    /// <p>Tags associated with input to <code>EnableBaseline</code>.</p>
37    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
38        self.tags.as_ref()
39    }
40}
41impl EnableBaselineInput {
42    /// Creates a new builder-style object to manufacture [`EnableBaselineInput`](crate::operation::enable_baseline::EnableBaselineInput).
43    pub fn builder() -> crate::operation::enable_baseline::builders::EnableBaselineInputBuilder {
44        crate::operation::enable_baseline::builders::EnableBaselineInputBuilder::default()
45    }
46}
47
48/// A builder for [`EnableBaselineInput`](crate::operation::enable_baseline::EnableBaselineInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct EnableBaselineInputBuilder {
52    pub(crate) baseline_version: ::std::option::Option<::std::string::String>,
53    pub(crate) parameters: ::std::option::Option<::std::vec::Vec<crate::types::EnabledBaselineParameter>>,
54    pub(crate) baseline_identifier: ::std::option::Option<::std::string::String>,
55    pub(crate) target_identifier: ::std::option::Option<::std::string::String>,
56    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
57}
58impl EnableBaselineInputBuilder {
59    /// <p>The specific version to be enabled of the specified baseline.</p>
60    /// This field is required.
61    pub fn baseline_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.baseline_version = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The specific version to be enabled of the specified baseline.</p>
66    pub fn set_baseline_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.baseline_version = input;
68        self
69    }
70    /// <p>The specific version to be enabled of the specified baseline.</p>
71    pub fn get_baseline_version(&self) -> &::std::option::Option<::std::string::String> {
72        &self.baseline_version
73    }
74    /// Appends an item to `parameters`.
75    ///
76    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
77    ///
78    /// <p>A list of <code>key-value</code> objects that specify enablement parameters, where <code>key</code> is a string and <code>value</code> is a document of any type.</p>
79    pub fn parameters(mut self, input: crate::types::EnabledBaselineParameter) -> Self {
80        let mut v = self.parameters.unwrap_or_default();
81        v.push(input);
82        self.parameters = ::std::option::Option::Some(v);
83        self
84    }
85    /// <p>A list of <code>key-value</code> objects that specify enablement parameters, where <code>key</code> is a string and <code>value</code> is a document of any type.</p>
86    pub fn set_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EnabledBaselineParameter>>) -> Self {
87        self.parameters = input;
88        self
89    }
90    /// <p>A list of <code>key-value</code> objects that specify enablement parameters, where <code>key</code> is a string and <code>value</code> is a document of any type.</p>
91    pub fn get_parameters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EnabledBaselineParameter>> {
92        &self.parameters
93    }
94    /// <p>The ARN of the baseline to be enabled.</p>
95    /// This field is required.
96    pub fn baseline_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.baseline_identifier = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// <p>The ARN of the baseline to be enabled.</p>
101    pub fn set_baseline_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.baseline_identifier = input;
103        self
104    }
105    /// <p>The ARN of the baseline to be enabled.</p>
106    pub fn get_baseline_identifier(&self) -> &::std::option::Option<::std::string::String> {
107        &self.baseline_identifier
108    }
109    /// <p>The ARN of the target on which the baseline will be enabled. Only OUs are supported as targets.</p>
110    /// This field is required.
111    pub fn target_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
112        self.target_identifier = ::std::option::Option::Some(input.into());
113        self
114    }
115    /// <p>The ARN of the target on which the baseline will be enabled. Only OUs are supported as targets.</p>
116    pub fn set_target_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
117        self.target_identifier = input;
118        self
119    }
120    /// <p>The ARN of the target on which the baseline will be enabled. Only OUs are supported as targets.</p>
121    pub fn get_target_identifier(&self) -> &::std::option::Option<::std::string::String> {
122        &self.target_identifier
123    }
124    /// Adds a key-value pair to `tags`.
125    ///
126    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
127    ///
128    /// <p>Tags associated with input to <code>EnableBaseline</code>.</p>
129    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
130        let mut hash_map = self.tags.unwrap_or_default();
131        hash_map.insert(k.into(), v.into());
132        self.tags = ::std::option::Option::Some(hash_map);
133        self
134    }
135    /// <p>Tags associated with input to <code>EnableBaseline</code>.</p>
136    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
137        self.tags = input;
138        self
139    }
140    /// <p>Tags associated with input to <code>EnableBaseline</code>.</p>
141    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
142        &self.tags
143    }
144    /// Consumes the builder and constructs a [`EnableBaselineInput`](crate::operation::enable_baseline::EnableBaselineInput).
145    pub fn build(
146        self,
147    ) -> ::std::result::Result<crate::operation::enable_baseline::EnableBaselineInput, ::aws_smithy_types::error::operation::BuildError> {
148        ::std::result::Result::Ok(crate::operation::enable_baseline::EnableBaselineInput {
149            baseline_version: self.baseline_version,
150            parameters: self.parameters,
151            baseline_identifier: self.baseline_identifier,
152            target_identifier: self.target_identifier,
153            tags: self.tags,
154        })
155    }
156}