#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreatePackageInput {
#[doc(hidden)]
pub package_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl CreatePackageInput {
pub fn package_name(&self) -> std::option::Option<&str> {
self.package_name.as_deref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
}
impl CreatePackageInput {
pub fn builder() -> crate::operation::create_package::builders::CreatePackageInputBuilder {
crate::operation::create_package::builders::CreatePackageInputBuilder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct CreatePackageInputBuilder {
pub(crate) package_name: std::option::Option<std::string::String>,
pub(crate) tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl CreatePackageInputBuilder {
pub fn package_name(mut self, input: impl Into<std::string::String>) -> Self {
self.package_name = Some(input.into());
self
}
pub fn set_package_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.package_name = input;
self
}
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = 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 build(
self,
) -> Result<
crate::operation::create_package::CreatePackageInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::operation::create_package::CreatePackageInput {
package_name: self.package_name,
tags: self.tags,
})
}
}