aws_sdk_ec2/operation/delete_volume/_delete_volume_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 DeleteVolumeInput {
6 /// <p>The ID of the volume.</p>
7 pub volume_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 DeleteVolumeInput {
12 /// <p>The ID of the volume.</p>
13 pub fn volume_id(&self) -> ::std::option::Option<&str> {
14 self.volume_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 DeleteVolumeInput {
22 /// Creates a new builder-style object to manufacture [`DeleteVolumeInput`](crate::operation::delete_volume::DeleteVolumeInput).
23 pub fn builder() -> crate::operation::delete_volume::builders::DeleteVolumeInputBuilder {
24 crate::operation::delete_volume::builders::DeleteVolumeInputBuilder::default()
25 }
26}
27
28/// A builder for [`DeleteVolumeInput`](crate::operation::delete_volume::DeleteVolumeInput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct DeleteVolumeInputBuilder {
32 pub(crate) volume_id: ::std::option::Option<::std::string::String>,
33 pub(crate) dry_run: ::std::option::Option<bool>,
34}
35impl DeleteVolumeInputBuilder {
36 /// <p>The ID of the volume.</p>
37 /// This field is required.
38 pub fn volume_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39 self.volume_id = ::std::option::Option::Some(input.into());
40 self
41 }
42 /// <p>The ID of the volume.</p>
43 pub fn set_volume_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44 self.volume_id = input;
45 self
46 }
47 /// <p>The ID of the volume.</p>
48 pub fn get_volume_id(&self) -> &::std::option::Option<::std::string::String> {
49 &self.volume_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 [`DeleteVolumeInput`](crate::operation::delete_volume::DeleteVolumeInput).
66 pub fn build(
67 self,
68 ) -> ::std::result::Result<crate::operation::delete_volume::DeleteVolumeInput, ::aws_smithy_types::error::operation::BuildError> {
69 ::std::result::Result::Ok(crate::operation::delete_volume::DeleteVolumeInput {
70 volume_id: self.volume_id,
71 dry_run: self.dry_run,
72 })
73 }
74}