#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdatePlacementInput {
#[doc(hidden)]
pub placement_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub project_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub attributes:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl UpdatePlacementInput {
pub fn placement_name(&self) -> std::option::Option<&str> {
self.placement_name.as_deref()
}
pub fn project_name(&self) -> std::option::Option<&str> {
self.project_name.as_deref()
}
pub fn attributes(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.attributes.as_ref()
}
}
impl UpdatePlacementInput {
pub fn builder() -> crate::operation::update_placement::builders::UpdatePlacementInputBuilder {
crate::operation::update_placement::builders::UpdatePlacementInputBuilder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct UpdatePlacementInputBuilder {
pub(crate) placement_name: std::option::Option<std::string::String>,
pub(crate) project_name: std::option::Option<std::string::String>,
pub(crate) attributes:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl UpdatePlacementInputBuilder {
pub fn placement_name(mut self, input: impl Into<std::string::String>) -> Self {
self.placement_name = Some(input.into());
self
}
pub fn set_placement_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.placement_name = input;
self
}
pub fn project_name(mut self, input: impl Into<std::string::String>) -> Self {
self.project_name = Some(input.into());
self
}
pub fn set_project_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.project_name = input;
self
}
pub fn attributes(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.attributes.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.attributes = Some(hash_map);
self
}
pub fn set_attributes(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.attributes = input;
self
}
pub fn build(
self,
) -> Result<
crate::operation::update_placement::UpdatePlacementInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::operation::update_placement::UpdatePlacementInput {
placement_name: self.placement_name,
project_name: self.project_name,
attributes: self.attributes,
})
}
}