aws_sdk_ec2/operation/attach_volume/
_attach_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 AttachVolumeInput {
6    /// <p>The device name (for example, <code>/dev/sdh</code> or <code>xvdh</code>).</p>
7    pub device: ::std::option::Option<::std::string::String>,
8    /// <p>The ID of the instance.</p>
9    pub instance_id: ::std::option::Option<::std::string::String>,
10    /// <p>The ID of the EBS volume. The volume and instance must be within the same Availability Zone.</p>
11    pub volume_id: ::std::option::Option<::std::string::String>,
12    /// <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>
13    pub dry_run: ::std::option::Option<bool>,
14}
15impl AttachVolumeInput {
16    /// <p>The device name (for example, <code>/dev/sdh</code> or <code>xvdh</code>).</p>
17    pub fn device(&self) -> ::std::option::Option<&str> {
18        self.device.as_deref()
19    }
20    /// <p>The ID of the instance.</p>
21    pub fn instance_id(&self) -> ::std::option::Option<&str> {
22        self.instance_id.as_deref()
23    }
24    /// <p>The ID of the EBS volume. The volume and instance must be within the same Availability Zone.</p>
25    pub fn volume_id(&self) -> ::std::option::Option<&str> {
26        self.volume_id.as_deref()
27    }
28    /// <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>
29    pub fn dry_run(&self) -> ::std::option::Option<bool> {
30        self.dry_run
31    }
32}
33impl AttachVolumeInput {
34    /// Creates a new builder-style object to manufacture [`AttachVolumeInput`](crate::operation::attach_volume::AttachVolumeInput).
35    pub fn builder() -> crate::operation::attach_volume::builders::AttachVolumeInputBuilder {
36        crate::operation::attach_volume::builders::AttachVolumeInputBuilder::default()
37    }
38}
39
40/// A builder for [`AttachVolumeInput`](crate::operation::attach_volume::AttachVolumeInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct AttachVolumeInputBuilder {
44    pub(crate) device: ::std::option::Option<::std::string::String>,
45    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
46    pub(crate) volume_id: ::std::option::Option<::std::string::String>,
47    pub(crate) dry_run: ::std::option::Option<bool>,
48}
49impl AttachVolumeInputBuilder {
50    /// <p>The device name (for example, <code>/dev/sdh</code> or <code>xvdh</code>).</p>
51    /// This field is required.
52    pub fn device(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.device = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The device name (for example, <code>/dev/sdh</code> or <code>xvdh</code>).</p>
57    pub fn set_device(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.device = input;
59        self
60    }
61    /// <p>The device name (for example, <code>/dev/sdh</code> or <code>xvdh</code>).</p>
62    pub fn get_device(&self) -> &::std::option::Option<::std::string::String> {
63        &self.device
64    }
65    /// <p>The ID of the instance.</p>
66    /// This field is required.
67    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.instance_id = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>The ID of the instance.</p>
72    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.instance_id = input;
74        self
75    }
76    /// <p>The ID of the instance.</p>
77    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
78        &self.instance_id
79    }
80    /// <p>The ID of the EBS volume. The volume and instance must be within the same Availability Zone.</p>
81    /// This field is required.
82    pub fn volume_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.volume_id = ::std::option::Option::Some(input.into());
84        self
85    }
86    /// <p>The ID of the EBS volume. The volume and instance must be within the same Availability Zone.</p>
87    pub fn set_volume_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.volume_id = input;
89        self
90    }
91    /// <p>The ID of the EBS volume. The volume and instance must be within the same Availability Zone.</p>
92    pub fn get_volume_id(&self) -> &::std::option::Option<::std::string::String> {
93        &self.volume_id
94    }
95    /// <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>
96    pub fn dry_run(mut self, input: bool) -> Self {
97        self.dry_run = ::std::option::Option::Some(input);
98        self
99    }
100    /// <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>
101    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
102        self.dry_run = input;
103        self
104    }
105    /// <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>
106    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
107        &self.dry_run
108    }
109    /// Consumes the builder and constructs a [`AttachVolumeInput`](crate::operation::attach_volume::AttachVolumeInput).
110    pub fn build(
111        self,
112    ) -> ::std::result::Result<crate::operation::attach_volume::AttachVolumeInput, ::aws_smithy_types::error::operation::BuildError> {
113        ::std::result::Result::Ok(crate::operation::attach_volume::AttachVolumeInput {
114            device: self.device,
115            instance_id: self.instance_id,
116            volume_id: self.volume_id,
117            dry_run: self.dry_run,
118        })
119    }
120}