aws_sdk_elasticache/operation/create_snapshot/
_create_snapshot_input.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateSnapshotInput {
7 pub replication_group_id: ::std::option::Option<::std::string::String>,
9 pub cache_cluster_id: ::std::option::Option<::std::string::String>,
11 pub snapshot_name: ::std::option::Option<::std::string::String>,
13 pub kms_key_id: ::std::option::Option<::std::string::String>,
15 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
17}
18impl CreateSnapshotInput {
19 pub fn replication_group_id(&self) -> ::std::option::Option<&str> {
21 self.replication_group_id.as_deref()
22 }
23 pub fn cache_cluster_id(&self) -> ::std::option::Option<&str> {
25 self.cache_cluster_id.as_deref()
26 }
27 pub fn snapshot_name(&self) -> ::std::option::Option<&str> {
29 self.snapshot_name.as_deref()
30 }
31 pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
33 self.kms_key_id.as_deref()
34 }
35 pub fn tags(&self) -> &[crate::types::Tag] {
39 self.tags.as_deref().unwrap_or_default()
40 }
41}
42impl CreateSnapshotInput {
43 pub fn builder() -> crate::operation::create_snapshot::builders::CreateSnapshotInputBuilder {
45 crate::operation::create_snapshot::builders::CreateSnapshotInputBuilder::default()
46 }
47}
48
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
51#[non_exhaustive]
52pub struct CreateSnapshotInputBuilder {
53 pub(crate) replication_group_id: ::std::option::Option<::std::string::String>,
54 pub(crate) cache_cluster_id: ::std::option::Option<::std::string::String>,
55 pub(crate) snapshot_name: ::std::option::Option<::std::string::String>,
56 pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
57 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
58}
59impl CreateSnapshotInputBuilder {
60 pub fn replication_group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62 self.replication_group_id = ::std::option::Option::Some(input.into());
63 self
64 }
65 pub fn set_replication_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67 self.replication_group_id = input;
68 self
69 }
70 pub fn get_replication_group_id(&self) -> &::std::option::Option<::std::string::String> {
72 &self.replication_group_id
73 }
74 pub fn cache_cluster_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76 self.cache_cluster_id = ::std::option::Option::Some(input.into());
77 self
78 }
79 pub fn set_cache_cluster_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81 self.cache_cluster_id = input;
82 self
83 }
84 pub fn get_cache_cluster_id(&self) -> &::std::option::Option<::std::string::String> {
86 &self.cache_cluster_id
87 }
88 pub fn snapshot_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91 self.snapshot_name = ::std::option::Option::Some(input.into());
92 self
93 }
94 pub fn set_snapshot_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96 self.snapshot_name = input;
97 self
98 }
99 pub fn get_snapshot_name(&self) -> &::std::option::Option<::std::string::String> {
101 &self.snapshot_name
102 }
103 pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105 self.kms_key_id = ::std::option::Option::Some(input.into());
106 self
107 }
108 pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110 self.kms_key_id = input;
111 self
112 }
113 pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
115 &self.kms_key_id
116 }
117 pub fn tags(mut self, input: crate::types::Tag) -> Self {
123 let mut v = self.tags.unwrap_or_default();
124 v.push(input);
125 self.tags = ::std::option::Option::Some(v);
126 self
127 }
128 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
130 self.tags = input;
131 self
132 }
133 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
135 &self.tags
136 }
137 pub fn build(
139 self,
140 ) -> ::std::result::Result<crate::operation::create_snapshot::CreateSnapshotInput, ::aws_smithy_types::error::operation::BuildError> {
141 ::std::result::Result::Ok(crate::operation::create_snapshot::CreateSnapshotInput {
142 replication_group_id: self.replication_group_id,
143 cache_cluster_id: self.cache_cluster_id,
144 snapshot_name: self.snapshot_name,
145 kms_key_id: self.kms_key_id,
146 tags: self.tags,
147 })
148 }
149}