#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateClusterSnapshotInput {
#[doc(hidden)]
pub cluster_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub snapshot_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl CreateClusterSnapshotInput {
pub fn cluster_arn(&self) -> std::option::Option<&str> {
self.cluster_arn.as_deref()
}
pub fn snapshot_name(&self) -> std::option::Option<&str> {
self.snapshot_name.as_deref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
}
impl CreateClusterSnapshotInput {
pub fn builder(
) -> crate::operation::create_cluster_snapshot::builders::CreateClusterSnapshotInputBuilder
{
crate::operation::create_cluster_snapshot::builders::CreateClusterSnapshotInputBuilder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct CreateClusterSnapshotInputBuilder {
pub(crate) cluster_arn: std::option::Option<std::string::String>,
pub(crate) snapshot_name: std::option::Option<std::string::String>,
pub(crate) tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl CreateClusterSnapshotInputBuilder {
pub fn cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_arn = Some(input.into());
self
}
pub fn set_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_arn = input;
self
}
pub fn snapshot_name(mut self, input: impl Into<std::string::String>) -> Self {
self.snapshot_name = Some(input.into());
self
}
pub fn set_snapshot_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.snapshot_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_cluster_snapshot::CreateClusterSnapshotInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(
crate::operation::create_cluster_snapshot::CreateClusterSnapshotInput {
cluster_arn: self.cluster_arn,
snapshot_name: self.snapshot_name,
tags: self.tags,
},
)
}
}