aws_sdk_fsx/operation/describe_snapshots/_describe_snapshots_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DescribeSnapshotsInput {
6 /// <p>The IDs of the snapshots that you want to retrieve. This parameter value overrides any filters. If any IDs aren't found, a <code>SnapshotNotFound</code> error occurs.</p>
7 pub snapshot_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8 /// <p>The filters structure. The supported names are <code>file-system-id</code> or <code>volume-id</code>.</p>
9 pub filters: ::std::option::Option<::std::vec::Vec<crate::types::SnapshotFilter>>,
10 /// <p>The maximum number of resources to return in the response. This value must be an integer greater than zero.</p>
11 pub max_results: ::std::option::Option<i32>,
12 /// <p>(Optional) Opaque pagination token returned from a previous operation (String). If present, this token indicates from what point you can continue processing the request, where the previous <code>NextToken</code> value left off.</p>
13 pub next_token: ::std::option::Option<::std::string::String>,
14 /// <p>Set to <code>false</code> (default) if you want to only see the snapshots owned by your Amazon Web Services account. Set to <code>true</code> if you want to see the snapshots in your account and the ones shared with you from another account.</p>
15 pub include_shared: ::std::option::Option<bool>,
16}
17impl DescribeSnapshotsInput {
18 /// <p>The IDs of the snapshots that you want to retrieve. This parameter value overrides any filters. If any IDs aren't found, a <code>SnapshotNotFound</code> error occurs.</p>
19 ///
20 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.snapshot_ids.is_none()`.
21 pub fn snapshot_ids(&self) -> &[::std::string::String] {
22 self.snapshot_ids.as_deref().unwrap_or_default()
23 }
24 /// <p>The filters structure. The supported names are <code>file-system-id</code> or <code>volume-id</code>.</p>
25 ///
26 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.filters.is_none()`.
27 pub fn filters(&self) -> &[crate::types::SnapshotFilter] {
28 self.filters.as_deref().unwrap_or_default()
29 }
30 /// <p>The maximum number of resources to return in the response. This value must be an integer greater than zero.</p>
31 pub fn max_results(&self) -> ::std::option::Option<i32> {
32 self.max_results
33 }
34 /// <p>(Optional) Opaque pagination token returned from a previous operation (String). If present, this token indicates from what point you can continue processing the request, where the previous <code>NextToken</code> value left off.</p>
35 pub fn next_token(&self) -> ::std::option::Option<&str> {
36 self.next_token.as_deref()
37 }
38 /// <p>Set to <code>false</code> (default) if you want to only see the snapshots owned by your Amazon Web Services account. Set to <code>true</code> if you want to see the snapshots in your account and the ones shared with you from another account.</p>
39 pub fn include_shared(&self) -> ::std::option::Option<bool> {
40 self.include_shared
41 }
42}
43impl DescribeSnapshotsInput {
44 /// Creates a new builder-style object to manufacture [`DescribeSnapshotsInput`](crate::operation::describe_snapshots::DescribeSnapshotsInput).
45 pub fn builder() -> crate::operation::describe_snapshots::builders::DescribeSnapshotsInputBuilder {
46 crate::operation::describe_snapshots::builders::DescribeSnapshotsInputBuilder::default()
47 }
48}
49
50/// A builder for [`DescribeSnapshotsInput`](crate::operation::describe_snapshots::DescribeSnapshotsInput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct DescribeSnapshotsInputBuilder {
54 pub(crate) snapshot_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
55 pub(crate) filters: ::std::option::Option<::std::vec::Vec<crate::types::SnapshotFilter>>,
56 pub(crate) max_results: ::std::option::Option<i32>,
57 pub(crate) next_token: ::std::option::Option<::std::string::String>,
58 pub(crate) include_shared: ::std::option::Option<bool>,
59}
60impl DescribeSnapshotsInputBuilder {
61 /// Appends an item to `snapshot_ids`.
62 ///
63 /// To override the contents of this collection use [`set_snapshot_ids`](Self::set_snapshot_ids).
64 ///
65 /// <p>The IDs of the snapshots that you want to retrieve. This parameter value overrides any filters. If any IDs aren't found, a <code>SnapshotNotFound</code> error occurs.</p>
66 pub fn snapshot_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67 let mut v = self.snapshot_ids.unwrap_or_default();
68 v.push(input.into());
69 self.snapshot_ids = ::std::option::Option::Some(v);
70 self
71 }
72 /// <p>The IDs of the snapshots that you want to retrieve. This parameter value overrides any filters. If any IDs aren't found, a <code>SnapshotNotFound</code> error occurs.</p>
73 pub fn set_snapshot_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
74 self.snapshot_ids = input;
75 self
76 }
77 /// <p>The IDs of the snapshots that you want to retrieve. This parameter value overrides any filters. If any IDs aren't found, a <code>SnapshotNotFound</code> error occurs.</p>
78 pub fn get_snapshot_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
79 &self.snapshot_ids
80 }
81 /// Appends an item to `filters`.
82 ///
83 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
84 ///
85 /// <p>The filters structure. The supported names are <code>file-system-id</code> or <code>volume-id</code>.</p>
86 pub fn filters(mut self, input: crate::types::SnapshotFilter) -> Self {
87 let mut v = self.filters.unwrap_or_default();
88 v.push(input);
89 self.filters = ::std::option::Option::Some(v);
90 self
91 }
92 /// <p>The filters structure. The supported names are <code>file-system-id</code> or <code>volume-id</code>.</p>
93 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SnapshotFilter>>) -> Self {
94 self.filters = input;
95 self
96 }
97 /// <p>The filters structure. The supported names are <code>file-system-id</code> or <code>volume-id</code>.</p>
98 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SnapshotFilter>> {
99 &self.filters
100 }
101 /// <p>The maximum number of resources to return in the response. This value must be an integer greater than zero.</p>
102 pub fn max_results(mut self, input: i32) -> Self {
103 self.max_results = ::std::option::Option::Some(input);
104 self
105 }
106 /// <p>The maximum number of resources to return in the response. This value must be an integer greater than zero.</p>
107 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
108 self.max_results = input;
109 self
110 }
111 /// <p>The maximum number of resources to return in the response. This value must be an integer greater than zero.</p>
112 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
113 &self.max_results
114 }
115 /// <p>(Optional) Opaque pagination token returned from a previous operation (String). If present, this token indicates from what point you can continue processing the request, where the previous <code>NextToken</code> value left off.</p>
116 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117 self.next_token = ::std::option::Option::Some(input.into());
118 self
119 }
120 /// <p>(Optional) Opaque pagination token returned from a previous operation (String). If present, this token indicates from what point you can continue processing the request, where the previous <code>NextToken</code> value left off.</p>
121 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122 self.next_token = input;
123 self
124 }
125 /// <p>(Optional) Opaque pagination token returned from a previous operation (String). If present, this token indicates from what point you can continue processing the request, where the previous <code>NextToken</code> value left off.</p>
126 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
127 &self.next_token
128 }
129 /// <p>Set to <code>false</code> (default) if you want to only see the snapshots owned by your Amazon Web Services account. Set to <code>true</code> if you want to see the snapshots in your account and the ones shared with you from another account.</p>
130 pub fn include_shared(mut self, input: bool) -> Self {
131 self.include_shared = ::std::option::Option::Some(input);
132 self
133 }
134 /// <p>Set to <code>false</code> (default) if you want to only see the snapshots owned by your Amazon Web Services account. Set to <code>true</code> if you want to see the snapshots in your account and the ones shared with you from another account.</p>
135 pub fn set_include_shared(mut self, input: ::std::option::Option<bool>) -> Self {
136 self.include_shared = input;
137 self
138 }
139 /// <p>Set to <code>false</code> (default) if you want to only see the snapshots owned by your Amazon Web Services account. Set to <code>true</code> if you want to see the snapshots in your account and the ones shared with you from another account.</p>
140 pub fn get_include_shared(&self) -> &::std::option::Option<bool> {
141 &self.include_shared
142 }
143 /// Consumes the builder and constructs a [`DescribeSnapshotsInput`](crate::operation::describe_snapshots::DescribeSnapshotsInput).
144 pub fn build(
145 self,
146 ) -> ::std::result::Result<crate::operation::describe_snapshots::DescribeSnapshotsInput, ::aws_smithy_types::error::operation::BuildError> {
147 ::std::result::Result::Ok(crate::operation::describe_snapshots::DescribeSnapshotsInput {
148 snapshot_ids: self.snapshot_ids,
149 filters: self.filters,
150 max_results: self.max_results,
151 next_token: self.next_token,
152 include_shared: self.include_shared,
153 })
154 }
155}