aws_sdk_controltower/operation/enable_baseline/
_enable_baseline_input.rs#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct EnableBaselineInput {
pub baseline_version: ::std::option::Option<::std::string::String>,
pub parameters: ::std::option::Option<::std::vec::Vec<crate::types::EnabledBaselineParameter>>,
pub baseline_identifier: ::std::option::Option<::std::string::String>,
pub target_identifier: ::std::option::Option<::std::string::String>,
pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl EnableBaselineInput {
pub fn baseline_version(&self) -> ::std::option::Option<&str> {
self.baseline_version.as_deref()
}
pub fn parameters(&self) -> &[crate::types::EnabledBaselineParameter] {
self.parameters.as_deref().unwrap_or_default()
}
pub fn baseline_identifier(&self) -> ::std::option::Option<&str> {
self.baseline_identifier.as_deref()
}
pub fn target_identifier(&self) -> ::std::option::Option<&str> {
self.target_identifier.as_deref()
}
pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.tags.as_ref()
}
}
impl EnableBaselineInput {
pub fn builder() -> crate::operation::enable_baseline::builders::EnableBaselineInputBuilder {
crate::operation::enable_baseline::builders::EnableBaselineInputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct EnableBaselineInputBuilder {
pub(crate) baseline_version: ::std::option::Option<::std::string::String>,
pub(crate) parameters: ::std::option::Option<::std::vec::Vec<crate::types::EnabledBaselineParameter>>,
pub(crate) baseline_identifier: ::std::option::Option<::std::string::String>,
pub(crate) target_identifier: ::std::option::Option<::std::string::String>,
pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl EnableBaselineInputBuilder {
pub fn baseline_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.baseline_version = ::std::option::Option::Some(input.into());
self
}
pub fn set_baseline_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.baseline_version = input;
self
}
pub fn get_baseline_version(&self) -> &::std::option::Option<::std::string::String> {
&self.baseline_version
}
pub fn parameters(mut self, input: crate::types::EnabledBaselineParameter) -> Self {
let mut v = self.parameters.unwrap_or_default();
v.push(input);
self.parameters = ::std::option::Option::Some(v);
self
}
pub fn set_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EnabledBaselineParameter>>) -> Self {
self.parameters = input;
self
}
pub fn get_parameters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EnabledBaselineParameter>> {
&self.parameters
}
pub fn baseline_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.baseline_identifier = ::std::option::Option::Some(input.into());
self
}
pub fn set_baseline_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.baseline_identifier = input;
self
}
pub fn get_baseline_identifier(&self) -> &::std::option::Option<::std::string::String> {
&self.baseline_identifier
}
pub fn target_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.target_identifier = ::std::option::Option::Some(input.into());
self
}
pub fn set_target_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.target_identifier = input;
self
}
pub fn get_target_identifier(&self) -> &::std::option::Option<::std::string::String> {
&self.target_identifier
}
pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = ::std::option::Option::Some(hash_map);
self
}
pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.tags = input;
self
}
pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.tags
}
pub fn build(
self,
) -> ::std::result::Result<crate::operation::enable_baseline::EnableBaselineInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::enable_baseline::EnableBaselineInput {
baseline_version: self.baseline_version,
parameters: self.parameters,
baseline_identifier: self.baseline_identifier,
target_identifier: self.target_identifier,
tags: self.tags,
})
}
}