aws_sdk_elasticache/operation/describe_snapshots/
_describe_snapshots_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the input of a <code>DescribeSnapshotsMessage</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DescribeSnapshotsInput {
7    /// <p>A user-supplied replication group identifier. If this parameter is specified, only snapshots associated with that specific replication group are described.</p>
8    pub replication_group_id: ::std::option::Option<::std::string::String>,
9    /// <p>A user-supplied cluster identifier. If this parameter is specified, only snapshots associated with that specific cluster are described.</p>
10    pub cache_cluster_id: ::std::option::Option<::std::string::String>,
11    /// <p>A user-supplied name of the snapshot. If this parameter is specified, only this snapshot are described.</p>
12    pub snapshot_name: ::std::option::Option<::std::string::String>,
13    /// <p>If set to <code>system</code>, the output shows snapshots that were automatically created by ElastiCache. If set to <code>user</code> the output shows snapshots that were manually created. If omitted, the output shows both automatically and manually created snapshots.</p>
14    pub snapshot_source: ::std::option::Option<::std::string::String>,
15    /// <p>An optional marker returned from a prior request. Use this marker for pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
16    pub marker: ::std::option::Option<::std::string::String>,
17    /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a marker is included in the response so that the remaining results can be retrieved.</p>
18    /// <p>Default: 50</p>
19    /// <p>Constraints: minimum 20; maximum 50.</p>
20    pub max_records: ::std::option::Option<i32>,
21    /// <p>A Boolean value which if true, the node group (shard) configuration is included in the snapshot description.</p>
22    pub show_node_group_config: ::std::option::Option<bool>,
23}
24impl DescribeSnapshotsInput {
25    /// <p>A user-supplied replication group identifier. If this parameter is specified, only snapshots associated with that specific replication group are described.</p>
26    pub fn replication_group_id(&self) -> ::std::option::Option<&str> {
27        self.replication_group_id.as_deref()
28    }
29    /// <p>A user-supplied cluster identifier. If this parameter is specified, only snapshots associated with that specific cluster are described.</p>
30    pub fn cache_cluster_id(&self) -> ::std::option::Option<&str> {
31        self.cache_cluster_id.as_deref()
32    }
33    /// <p>A user-supplied name of the snapshot. If this parameter is specified, only this snapshot are described.</p>
34    pub fn snapshot_name(&self) -> ::std::option::Option<&str> {
35        self.snapshot_name.as_deref()
36    }
37    /// <p>If set to <code>system</code>, the output shows snapshots that were automatically created by ElastiCache. If set to <code>user</code> the output shows snapshots that were manually created. If omitted, the output shows both automatically and manually created snapshots.</p>
38    pub fn snapshot_source(&self) -> ::std::option::Option<&str> {
39        self.snapshot_source.as_deref()
40    }
41    /// <p>An optional marker returned from a prior request. Use this marker for pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
42    pub fn marker(&self) -> ::std::option::Option<&str> {
43        self.marker.as_deref()
44    }
45    /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a marker is included in the response so that the remaining results can be retrieved.</p>
46    /// <p>Default: 50</p>
47    /// <p>Constraints: minimum 20; maximum 50.</p>
48    pub fn max_records(&self) -> ::std::option::Option<i32> {
49        self.max_records
50    }
51    /// <p>A Boolean value which if true, the node group (shard) configuration is included in the snapshot description.</p>
52    pub fn show_node_group_config(&self) -> ::std::option::Option<bool> {
53        self.show_node_group_config
54    }
55}
56impl DescribeSnapshotsInput {
57    /// Creates a new builder-style object to manufacture [`DescribeSnapshotsInput`](crate::operation::describe_snapshots::DescribeSnapshotsInput).
58    pub fn builder() -> crate::operation::describe_snapshots::builders::DescribeSnapshotsInputBuilder {
59        crate::operation::describe_snapshots::builders::DescribeSnapshotsInputBuilder::default()
60    }
61}
62
63/// A builder for [`DescribeSnapshotsInput`](crate::operation::describe_snapshots::DescribeSnapshotsInput).
64#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
65#[non_exhaustive]
66pub struct DescribeSnapshotsInputBuilder {
67    pub(crate) replication_group_id: ::std::option::Option<::std::string::String>,
68    pub(crate) cache_cluster_id: ::std::option::Option<::std::string::String>,
69    pub(crate) snapshot_name: ::std::option::Option<::std::string::String>,
70    pub(crate) snapshot_source: ::std::option::Option<::std::string::String>,
71    pub(crate) marker: ::std::option::Option<::std::string::String>,
72    pub(crate) max_records: ::std::option::Option<i32>,
73    pub(crate) show_node_group_config: ::std::option::Option<bool>,
74}
75impl DescribeSnapshotsInputBuilder {
76    /// <p>A user-supplied replication group identifier. If this parameter is specified, only snapshots associated with that specific replication group are described.</p>
77    pub fn replication_group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.replication_group_id = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// <p>A user-supplied replication group identifier. If this parameter is specified, only snapshots associated with that specific replication group are described.</p>
82    pub fn set_replication_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.replication_group_id = input;
84        self
85    }
86    /// <p>A user-supplied replication group identifier. If this parameter is specified, only snapshots associated with that specific replication group are described.</p>
87    pub fn get_replication_group_id(&self) -> &::std::option::Option<::std::string::String> {
88        &self.replication_group_id
89    }
90    /// <p>A user-supplied cluster identifier. If this parameter is specified, only snapshots associated with that specific cluster are described.</p>
91    pub fn cache_cluster_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92        self.cache_cluster_id = ::std::option::Option::Some(input.into());
93        self
94    }
95    /// <p>A user-supplied cluster identifier. If this parameter is specified, only snapshots associated with that specific cluster are described.</p>
96    pub fn set_cache_cluster_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97        self.cache_cluster_id = input;
98        self
99    }
100    /// <p>A user-supplied cluster identifier. If this parameter is specified, only snapshots associated with that specific cluster are described.</p>
101    pub fn get_cache_cluster_id(&self) -> &::std::option::Option<::std::string::String> {
102        &self.cache_cluster_id
103    }
104    /// <p>A user-supplied name of the snapshot. If this parameter is specified, only this snapshot are described.</p>
105    pub fn snapshot_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106        self.snapshot_name = ::std::option::Option::Some(input.into());
107        self
108    }
109    /// <p>A user-supplied name of the snapshot. If this parameter is specified, only this snapshot are described.</p>
110    pub fn set_snapshot_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111        self.snapshot_name = input;
112        self
113    }
114    /// <p>A user-supplied name of the snapshot. If this parameter is specified, only this snapshot are described.</p>
115    pub fn get_snapshot_name(&self) -> &::std::option::Option<::std::string::String> {
116        &self.snapshot_name
117    }
118    /// <p>If set to <code>system</code>, the output shows snapshots that were automatically created by ElastiCache. If set to <code>user</code> the output shows snapshots that were manually created. If omitted, the output shows both automatically and manually created snapshots.</p>
119    pub fn snapshot_source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.snapshot_source = ::std::option::Option::Some(input.into());
121        self
122    }
123    /// <p>If set to <code>system</code>, the output shows snapshots that were automatically created by ElastiCache. If set to <code>user</code> the output shows snapshots that were manually created. If omitted, the output shows both automatically and manually created snapshots.</p>
124    pub fn set_snapshot_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.snapshot_source = input;
126        self
127    }
128    /// <p>If set to <code>system</code>, the output shows snapshots that were automatically created by ElastiCache. If set to <code>user</code> the output shows snapshots that were manually created. If omitted, the output shows both automatically and manually created snapshots.</p>
129    pub fn get_snapshot_source(&self) -> &::std::option::Option<::std::string::String> {
130        &self.snapshot_source
131    }
132    /// <p>An optional marker returned from a prior request. Use this marker for pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
133    pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.marker = ::std::option::Option::Some(input.into());
135        self
136    }
137    /// <p>An optional marker returned from a prior request. Use this marker for pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
138    pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.marker = input;
140        self
141    }
142    /// <p>An optional marker returned from a prior request. Use this marker for pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
143    pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
144        &self.marker
145    }
146    /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a marker is included in the response so that the remaining results can be retrieved.</p>
147    /// <p>Default: 50</p>
148    /// <p>Constraints: minimum 20; maximum 50.</p>
149    pub fn max_records(mut self, input: i32) -> Self {
150        self.max_records = ::std::option::Option::Some(input);
151        self
152    }
153    /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a marker is included in the response so that the remaining results can be retrieved.</p>
154    /// <p>Default: 50</p>
155    /// <p>Constraints: minimum 20; maximum 50.</p>
156    pub fn set_max_records(mut self, input: ::std::option::Option<i32>) -> Self {
157        self.max_records = input;
158        self
159    }
160    /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a marker is included in the response so that the remaining results can be retrieved.</p>
161    /// <p>Default: 50</p>
162    /// <p>Constraints: minimum 20; maximum 50.</p>
163    pub fn get_max_records(&self) -> &::std::option::Option<i32> {
164        &self.max_records
165    }
166    /// <p>A Boolean value which if true, the node group (shard) configuration is included in the snapshot description.</p>
167    pub fn show_node_group_config(mut self, input: bool) -> Self {
168        self.show_node_group_config = ::std::option::Option::Some(input);
169        self
170    }
171    /// <p>A Boolean value which if true, the node group (shard) configuration is included in the snapshot description.</p>
172    pub fn set_show_node_group_config(mut self, input: ::std::option::Option<bool>) -> Self {
173        self.show_node_group_config = input;
174        self
175    }
176    /// <p>A Boolean value which if true, the node group (shard) configuration is included in the snapshot description.</p>
177    pub fn get_show_node_group_config(&self) -> &::std::option::Option<bool> {
178        &self.show_node_group_config
179    }
180    /// Consumes the builder and constructs a [`DescribeSnapshotsInput`](crate::operation::describe_snapshots::DescribeSnapshotsInput).
181    pub fn build(
182        self,
183    ) -> ::std::result::Result<crate::operation::describe_snapshots::DescribeSnapshotsInput, ::aws_smithy_types::error::operation::BuildError> {
184        ::std::result::Result::Ok(crate::operation::describe_snapshots::DescribeSnapshotsInput {
185            replication_group_id: self.replication_group_id,
186            cache_cluster_id: self.cache_cluster_id,
187            snapshot_name: self.snapshot_name,
188            snapshot_source: self.snapshot_source,
189            marker: self.marker,
190            max_records: self.max_records,
191            show_node_group_config: self.show_node_group_config,
192        })
193    }
194}