aws_sdk_ec2/operation/delete_snapshot/_delete_snapshot_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 DeleteSnapshotInput {
6 /// <p>The ID of the EBS snapshot.</p>
7 pub snapshot_id: ::std::option::Option<::std::string::String>,
8 /// <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>
9 pub dry_run: ::std::option::Option<bool>,
10}
11impl DeleteSnapshotInput {
12 /// <p>The ID of the EBS snapshot.</p>
13 pub fn snapshot_id(&self) -> ::std::option::Option<&str> {
14 self.snapshot_id.as_deref()
15 }
16 /// <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>
17 pub fn dry_run(&self) -> ::std::option::Option<bool> {
18 self.dry_run
19 }
20}
21impl DeleteSnapshotInput {
22 /// Creates a new builder-style object to manufacture [`DeleteSnapshotInput`](crate::operation::delete_snapshot::DeleteSnapshotInput).
23 pub fn builder() -> crate::operation::delete_snapshot::builders::DeleteSnapshotInputBuilder {
24 crate::operation::delete_snapshot::builders::DeleteSnapshotInputBuilder::default()
25 }
26}
27
28/// A builder for [`DeleteSnapshotInput`](crate::operation::delete_snapshot::DeleteSnapshotInput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct DeleteSnapshotInputBuilder {
32 pub(crate) snapshot_id: ::std::option::Option<::std::string::String>,
33 pub(crate) dry_run: ::std::option::Option<bool>,
34}
35impl DeleteSnapshotInputBuilder {
36 /// <p>The ID of the EBS snapshot.</p>
37 /// This field is required.
38 pub fn snapshot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39 self.snapshot_id = ::std::option::Option::Some(input.into());
40 self
41 }
42 /// <p>The ID of the EBS snapshot.</p>
43 pub fn set_snapshot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44 self.snapshot_id = input;
45 self
46 }
47 /// <p>The ID of the EBS snapshot.</p>
48 pub fn get_snapshot_id(&self) -> &::std::option::Option<::std::string::String> {
49 &self.snapshot_id
50 }
51 /// <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>
52 pub fn dry_run(mut self, input: bool) -> Self {
53 self.dry_run = ::std::option::Option::Some(input);
54 self
55 }
56 /// <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>
57 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
58 self.dry_run = input;
59 self
60 }
61 /// <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>
62 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
63 &self.dry_run
64 }
65 /// Consumes the builder and constructs a [`DeleteSnapshotInput`](crate::operation::delete_snapshot::DeleteSnapshotInput).
66 pub fn build(
67 self,
68 ) -> ::std::result::Result<crate::operation::delete_snapshot::DeleteSnapshotInput, ::aws_smithy_types::error::operation::BuildError> {
69 ::std::result::Result::Ok(crate::operation::delete_snapshot::DeleteSnapshotInput {
70 snapshot_id: self.snapshot_id,
71 dry_run: self.dry_run,
72 })
73 }
74}