#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateSnapshotInput {
pub replication_group_id: ::std::option::Option<::std::string::String>,
pub cache_cluster_id: ::std::option::Option<::std::string::String>,
pub snapshot_name: ::std::option::Option<::std::string::String>,
pub kms_key_id: ::std::option::Option<::std::string::String>,
pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateSnapshotInput {
pub fn replication_group_id(&self) -> ::std::option::Option<&str> {
self.replication_group_id.as_deref()
}
pub fn cache_cluster_id(&self) -> ::std::option::Option<&str> {
self.cache_cluster_id.as_deref()
}
pub fn snapshot_name(&self) -> ::std::option::Option<&str> {
self.snapshot_name.as_deref()
}
pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
self.kms_key_id.as_deref()
}
pub fn tags(&self) -> ::std::option::Option<&[crate::types::Tag]> {
self.tags.as_deref()
}
}
impl CreateSnapshotInput {
pub fn builder() -> crate::operation::create_snapshot::builders::CreateSnapshotInputBuilder {
crate::operation::create_snapshot::builders::CreateSnapshotInputBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CreateSnapshotInputBuilder {
pub(crate) replication_group_id: ::std::option::Option<::std::string::String>,
pub(crate) cache_cluster_id: ::std::option::Option<::std::string::String>,
pub(crate) snapshot_name: ::std::option::Option<::std::string::String>,
pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateSnapshotInputBuilder {
pub fn replication_group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.replication_group_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_replication_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.replication_group_id = input;
self
}
pub fn get_replication_group_id(&self) -> &::std::option::Option<::std::string::String> {
&self.replication_group_id
}
pub fn cache_cluster_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.cache_cluster_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_cache_cluster_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.cache_cluster_id = input;
self
}
pub fn get_cache_cluster_id(&self) -> &::std::option::Option<::std::string::String> {
&self.cache_cluster_id
}
pub fn snapshot_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.snapshot_name = ::std::option::Option::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 get_snapshot_name(&self) -> &::std::option::Option<::std::string::String> {
&self.snapshot_name
}
pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.kms_key_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.kms_key_id = input;
self
}
pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
&self.kms_key_id
}
pub fn tags(mut self, input: crate::types::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = ::std::option::Option::Some(v);
self
}
pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.tags = input;
self
}
pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
&self.tags
}
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_snapshot::CreateSnapshotInput, ::aws_smithy_http::operation::error::BuildError> {
::std::result::Result::Ok(crate::operation::create_snapshot::CreateSnapshotInput {
replication_group_id: self.replication_group_id,
cache_cluster_id: self.cache_cluster_id,
snapshot_name: self.snapshot_name,
kms_key_id: self.kms_key_id,
tags: self.tags,
})
}
}