aws_sdk_ec2/operation/create_snapshots/_create_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 CreateSnapshotsInput {
6 /// <p>A description propagated to every snapshot specified by the instance.</p>
7 pub description: ::std::option::Option<::std::string::String>,
8 /// <p>The instance to specify which volumes should be included in the snapshots.</p>
9 pub instance_specification: ::std::option::Option<crate::types::InstanceSpecification>,
10 /// <note>
11 /// <p>Only supported for instances on Outposts. If the source instance is not on an Outpost, omit this parameter.</p>
12 /// </note>
13 /// <ul>
14 /// <li>
15 /// <p>To create the snapshots on the same Outpost as the source instance, specify the ARN of that Outpost. The snapshots must be created on the same Outpost as the instance.</p></li>
16 /// <li>
17 /// <p>To create the snapshots in the parent Region of the Outpost, omit this parameter.</p></li>
18 /// </ul>
19 /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#create-snapshot"> Create local snapshots from volumes on an Outpost</a> in the <i>Amazon EBS User Guide</i>.</p>
20 pub outpost_arn: ::std::option::Option<::std::string::String>,
21 /// <p>Tags to apply to every snapshot specified by the instance.</p>
22 pub tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
23 /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
24 pub dry_run: ::std::option::Option<bool>,
25 /// <p>Copies the tags from the specified volume to corresponding snapshot.</p>
26 pub copy_tags_from_source: ::std::option::Option<crate::types::CopyTagsFromSource>,
27 /// <note>
28 /// <p>Only supported for instances in Local Zones. If the source instance is not in a Local Zone, omit this parameter.</p>
29 /// </note>
30 /// <ul>
31 /// <li>
32 /// <p>To create local snapshots in the same Local Zone as the source instance, specify <code>local</code>.</p></li>
33 /// <li>
34 /// <p>To create a regional snapshots in the parent Region of the Local Zone, specify <code>regional</code> or omit this parameter.</p></li>
35 /// </ul>
36 /// <p>Default value: <code>regional</code></p>
37 pub location: ::std::option::Option<crate::types::SnapshotLocationEnum>,
38}
39impl CreateSnapshotsInput {
40 /// <p>A description propagated to every snapshot specified by the instance.</p>
41 pub fn description(&self) -> ::std::option::Option<&str> {
42 self.description.as_deref()
43 }
44 /// <p>The instance to specify which volumes should be included in the snapshots.</p>
45 pub fn instance_specification(&self) -> ::std::option::Option<&crate::types::InstanceSpecification> {
46 self.instance_specification.as_ref()
47 }
48 /// <note>
49 /// <p>Only supported for instances on Outposts. If the source instance is not on an Outpost, omit this parameter.</p>
50 /// </note>
51 /// <ul>
52 /// <li>
53 /// <p>To create the snapshots on the same Outpost as the source instance, specify the ARN of that Outpost. The snapshots must be created on the same Outpost as the instance.</p></li>
54 /// <li>
55 /// <p>To create the snapshots in the parent Region of the Outpost, omit this parameter.</p></li>
56 /// </ul>
57 /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#create-snapshot"> Create local snapshots from volumes on an Outpost</a> in the <i>Amazon EBS User Guide</i>.</p>
58 pub fn outpost_arn(&self) -> ::std::option::Option<&str> {
59 self.outpost_arn.as_deref()
60 }
61 /// <p>Tags to apply to every snapshot specified by the instance.</p>
62 ///
63 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tag_specifications.is_none()`.
64 pub fn tag_specifications(&self) -> &[crate::types::TagSpecification] {
65 self.tag_specifications.as_deref().unwrap_or_default()
66 }
67 /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
68 pub fn dry_run(&self) -> ::std::option::Option<bool> {
69 self.dry_run
70 }
71 /// <p>Copies the tags from the specified volume to corresponding snapshot.</p>
72 pub fn copy_tags_from_source(&self) -> ::std::option::Option<&crate::types::CopyTagsFromSource> {
73 self.copy_tags_from_source.as_ref()
74 }
75 /// <note>
76 /// <p>Only supported for instances in Local Zones. If the source instance is not in a Local Zone, omit this parameter.</p>
77 /// </note>
78 /// <ul>
79 /// <li>
80 /// <p>To create local snapshots in the same Local Zone as the source instance, specify <code>local</code>.</p></li>
81 /// <li>
82 /// <p>To create a regional snapshots in the parent Region of the Local Zone, specify <code>regional</code> or omit this parameter.</p></li>
83 /// </ul>
84 /// <p>Default value: <code>regional</code></p>
85 pub fn location(&self) -> ::std::option::Option<&crate::types::SnapshotLocationEnum> {
86 self.location.as_ref()
87 }
88}
89impl CreateSnapshotsInput {
90 /// Creates a new builder-style object to manufacture [`CreateSnapshotsInput`](crate::operation::create_snapshots::CreateSnapshotsInput).
91 pub fn builder() -> crate::operation::create_snapshots::builders::CreateSnapshotsInputBuilder {
92 crate::operation::create_snapshots::builders::CreateSnapshotsInputBuilder::default()
93 }
94}
95
96/// A builder for [`CreateSnapshotsInput`](crate::operation::create_snapshots::CreateSnapshotsInput).
97#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
98#[non_exhaustive]
99pub struct CreateSnapshotsInputBuilder {
100 pub(crate) description: ::std::option::Option<::std::string::String>,
101 pub(crate) instance_specification: ::std::option::Option<crate::types::InstanceSpecification>,
102 pub(crate) outpost_arn: ::std::option::Option<::std::string::String>,
103 pub(crate) tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
104 pub(crate) dry_run: ::std::option::Option<bool>,
105 pub(crate) copy_tags_from_source: ::std::option::Option<crate::types::CopyTagsFromSource>,
106 pub(crate) location: ::std::option::Option<crate::types::SnapshotLocationEnum>,
107}
108impl CreateSnapshotsInputBuilder {
109 /// <p>A description propagated to every snapshot specified by the instance.</p>
110 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111 self.description = ::std::option::Option::Some(input.into());
112 self
113 }
114 /// <p>A description propagated to every snapshot specified by the instance.</p>
115 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116 self.description = input;
117 self
118 }
119 /// <p>A description propagated to every snapshot specified by the instance.</p>
120 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
121 &self.description
122 }
123 /// <p>The instance to specify which volumes should be included in the snapshots.</p>
124 /// This field is required.
125 pub fn instance_specification(mut self, input: crate::types::InstanceSpecification) -> Self {
126 self.instance_specification = ::std::option::Option::Some(input);
127 self
128 }
129 /// <p>The instance to specify which volumes should be included in the snapshots.</p>
130 pub fn set_instance_specification(mut self, input: ::std::option::Option<crate::types::InstanceSpecification>) -> Self {
131 self.instance_specification = input;
132 self
133 }
134 /// <p>The instance to specify which volumes should be included in the snapshots.</p>
135 pub fn get_instance_specification(&self) -> &::std::option::Option<crate::types::InstanceSpecification> {
136 &self.instance_specification
137 }
138 /// <note>
139 /// <p>Only supported for instances on Outposts. If the source instance is not on an Outpost, omit this parameter.</p>
140 /// </note>
141 /// <ul>
142 /// <li>
143 /// <p>To create the snapshots on the same Outpost as the source instance, specify the ARN of that Outpost. The snapshots must be created on the same Outpost as the instance.</p></li>
144 /// <li>
145 /// <p>To create the snapshots in the parent Region of the Outpost, omit this parameter.</p></li>
146 /// </ul>
147 /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#create-snapshot"> Create local snapshots from volumes on an Outpost</a> in the <i>Amazon EBS User Guide</i>.</p>
148 pub fn outpost_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149 self.outpost_arn = ::std::option::Option::Some(input.into());
150 self
151 }
152 /// <note>
153 /// <p>Only supported for instances on Outposts. If the source instance is not on an Outpost, omit this parameter.</p>
154 /// </note>
155 /// <ul>
156 /// <li>
157 /// <p>To create the snapshots on the same Outpost as the source instance, specify the ARN of that Outpost. The snapshots must be created on the same Outpost as the instance.</p></li>
158 /// <li>
159 /// <p>To create the snapshots in the parent Region of the Outpost, omit this parameter.</p></li>
160 /// </ul>
161 /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#create-snapshot"> Create local snapshots from volumes on an Outpost</a> in the <i>Amazon EBS User Guide</i>.</p>
162 pub fn set_outpost_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163 self.outpost_arn = input;
164 self
165 }
166 /// <note>
167 /// <p>Only supported for instances on Outposts. If the source instance is not on an Outpost, omit this parameter.</p>
168 /// </note>
169 /// <ul>
170 /// <li>
171 /// <p>To create the snapshots on the same Outpost as the source instance, specify the ARN of that Outpost. The snapshots must be created on the same Outpost as the instance.</p></li>
172 /// <li>
173 /// <p>To create the snapshots in the parent Region of the Outpost, omit this parameter.</p></li>
174 /// </ul>
175 /// <p>For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#create-snapshot"> Create local snapshots from volumes on an Outpost</a> in the <i>Amazon EBS User Guide</i>.</p>
176 pub fn get_outpost_arn(&self) -> &::std::option::Option<::std::string::String> {
177 &self.outpost_arn
178 }
179 /// Appends an item to `tag_specifications`.
180 ///
181 /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
182 ///
183 /// <p>Tags to apply to every snapshot specified by the instance.</p>
184 pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
185 let mut v = self.tag_specifications.unwrap_or_default();
186 v.push(input);
187 self.tag_specifications = ::std::option::Option::Some(v);
188 self
189 }
190 /// <p>Tags to apply to every snapshot specified by the instance.</p>
191 pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
192 self.tag_specifications = input;
193 self
194 }
195 /// <p>Tags to apply to every snapshot specified by the instance.</p>
196 pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
197 &self.tag_specifications
198 }
199 /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
200 pub fn dry_run(mut self, input: bool) -> Self {
201 self.dry_run = ::std::option::Option::Some(input);
202 self
203 }
204 /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
205 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
206 self.dry_run = input;
207 self
208 }
209 /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
210 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
211 &self.dry_run
212 }
213 /// <p>Copies the tags from the specified volume to corresponding snapshot.</p>
214 pub fn copy_tags_from_source(mut self, input: crate::types::CopyTagsFromSource) -> Self {
215 self.copy_tags_from_source = ::std::option::Option::Some(input);
216 self
217 }
218 /// <p>Copies the tags from the specified volume to corresponding snapshot.</p>
219 pub fn set_copy_tags_from_source(mut self, input: ::std::option::Option<crate::types::CopyTagsFromSource>) -> Self {
220 self.copy_tags_from_source = input;
221 self
222 }
223 /// <p>Copies the tags from the specified volume to corresponding snapshot.</p>
224 pub fn get_copy_tags_from_source(&self) -> &::std::option::Option<crate::types::CopyTagsFromSource> {
225 &self.copy_tags_from_source
226 }
227 /// <note>
228 /// <p>Only supported for instances in Local Zones. If the source instance is not in a Local Zone, omit this parameter.</p>
229 /// </note>
230 /// <ul>
231 /// <li>
232 /// <p>To create local snapshots in the same Local Zone as the source instance, specify <code>local</code>.</p></li>
233 /// <li>
234 /// <p>To create a regional snapshots in the parent Region of the Local Zone, specify <code>regional</code> or omit this parameter.</p></li>
235 /// </ul>
236 /// <p>Default value: <code>regional</code></p>
237 pub fn location(mut self, input: crate::types::SnapshotLocationEnum) -> Self {
238 self.location = ::std::option::Option::Some(input);
239 self
240 }
241 /// <note>
242 /// <p>Only supported for instances in Local Zones. If the source instance is not in a Local Zone, omit this parameter.</p>
243 /// </note>
244 /// <ul>
245 /// <li>
246 /// <p>To create local snapshots in the same Local Zone as the source instance, specify <code>local</code>.</p></li>
247 /// <li>
248 /// <p>To create a regional snapshots in the parent Region of the Local Zone, specify <code>regional</code> or omit this parameter.</p></li>
249 /// </ul>
250 /// <p>Default value: <code>regional</code></p>
251 pub fn set_location(mut self, input: ::std::option::Option<crate::types::SnapshotLocationEnum>) -> Self {
252 self.location = input;
253 self
254 }
255 /// <note>
256 /// <p>Only supported for instances in Local Zones. If the source instance is not in a Local Zone, omit this parameter.</p>
257 /// </note>
258 /// <ul>
259 /// <li>
260 /// <p>To create local snapshots in the same Local Zone as the source instance, specify <code>local</code>.</p></li>
261 /// <li>
262 /// <p>To create a regional snapshots in the parent Region of the Local Zone, specify <code>regional</code> or omit this parameter.</p></li>
263 /// </ul>
264 /// <p>Default value: <code>regional</code></p>
265 pub fn get_location(&self) -> &::std::option::Option<crate::types::SnapshotLocationEnum> {
266 &self.location
267 }
268 /// Consumes the builder and constructs a [`CreateSnapshotsInput`](crate::operation::create_snapshots::CreateSnapshotsInput).
269 pub fn build(
270 self,
271 ) -> ::std::result::Result<crate::operation::create_snapshots::CreateSnapshotsInput, ::aws_smithy_types::error::operation::BuildError> {
272 ::std::result::Result::Ok(crate::operation::create_snapshots::CreateSnapshotsInput {
273 description: self.description,
274 instance_specification: self.instance_specification,
275 outpost_arn: self.outpost_arn,
276 tag_specifications: self.tag_specifications,
277 dry_run: self.dry_run,
278 copy_tags_from_source: self.copy_tags_from_source,
279 location: self.location,
280 })
281 }
282}