aws_sdk_ec2/operation/attach_volume/
_attach_volume_output.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AttachVolumeOutput {
7    pub delete_on_termination: ::std::option::Option<bool>,
9    pub associated_resource: ::std::option::Option<::std::string::String>,
11    pub instance_owning_service: ::std::option::Option<::std::string::String>,
14    pub volume_id: ::std::option::Option<::std::string::String>,
16    pub instance_id: ::std::option::Option<::std::string::String>,
19    pub device: ::std::option::Option<::std::string::String>,
22    pub state: ::std::option::Option<crate::types::VolumeAttachmentState>,
24    pub attach_time: ::std::option::Option<::aws_smithy_types::DateTime>,
26    _request_id: Option<String>,
27}
28impl AttachVolumeOutput {
29    pub fn delete_on_termination(&self) -> ::std::option::Option<bool> {
31        self.delete_on_termination
32    }
33    pub fn associated_resource(&self) -> ::std::option::Option<&str> {
35        self.associated_resource.as_deref()
36    }
37    pub fn instance_owning_service(&self) -> ::std::option::Option<&str> {
40        self.instance_owning_service.as_deref()
41    }
42    pub fn volume_id(&self) -> ::std::option::Option<&str> {
44        self.volume_id.as_deref()
45    }
46    pub fn instance_id(&self) -> ::std::option::Option<&str> {
49        self.instance_id.as_deref()
50    }
51    pub fn device(&self) -> ::std::option::Option<&str> {
54        self.device.as_deref()
55    }
56    pub fn state(&self) -> ::std::option::Option<&crate::types::VolumeAttachmentState> {
58        self.state.as_ref()
59    }
60    pub fn attach_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
62        self.attach_time.as_ref()
63    }
64}
65impl ::aws_types::request_id::RequestId for AttachVolumeOutput {
66    fn request_id(&self) -> Option<&str> {
67        self._request_id.as_deref()
68    }
69}
70impl AttachVolumeOutput {
71    pub fn builder() -> crate::operation::attach_volume::builders::AttachVolumeOutputBuilder {
73        crate::operation::attach_volume::builders::AttachVolumeOutputBuilder::default()
74    }
75}
76
77#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
79#[non_exhaustive]
80pub struct AttachVolumeOutputBuilder {
81    pub(crate) delete_on_termination: ::std::option::Option<bool>,
82    pub(crate) associated_resource: ::std::option::Option<::std::string::String>,
83    pub(crate) instance_owning_service: ::std::option::Option<::std::string::String>,
84    pub(crate) volume_id: ::std::option::Option<::std::string::String>,
85    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
86    pub(crate) device: ::std::option::Option<::std::string::String>,
87    pub(crate) state: ::std::option::Option<crate::types::VolumeAttachmentState>,
88    pub(crate) attach_time: ::std::option::Option<::aws_smithy_types::DateTime>,
89    _request_id: Option<String>,
90}
91impl AttachVolumeOutputBuilder {
92    pub fn delete_on_termination(mut self, input: bool) -> Self {
94        self.delete_on_termination = ::std::option::Option::Some(input);
95        self
96    }
97    pub fn set_delete_on_termination(mut self, input: ::std::option::Option<bool>) -> Self {
99        self.delete_on_termination = input;
100        self
101    }
102    pub fn get_delete_on_termination(&self) -> &::std::option::Option<bool> {
104        &self.delete_on_termination
105    }
106    pub fn associated_resource(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
108        self.associated_resource = ::std::option::Option::Some(input.into());
109        self
110    }
111    pub fn set_associated_resource(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113        self.associated_resource = input;
114        self
115    }
116    pub fn get_associated_resource(&self) -> &::std::option::Option<::std::string::String> {
118        &self.associated_resource
119    }
120    pub fn instance_owning_service(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.instance_owning_service = ::std::option::Option::Some(input.into());
124        self
125    }
126    pub fn set_instance_owning_service(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.instance_owning_service = input;
130        self
131    }
132    pub fn get_instance_owning_service(&self) -> &::std::option::Option<::std::string::String> {
135        &self.instance_owning_service
136    }
137    pub fn volume_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.volume_id = ::std::option::Option::Some(input.into());
140        self
141    }
142    pub fn set_volume_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144        self.volume_id = input;
145        self
146    }
147    pub fn get_volume_id(&self) -> &::std::option::Option<::std::string::String> {
149        &self.volume_id
150    }
151    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154        self.instance_id = ::std::option::Option::Some(input.into());
155        self
156    }
157    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.instance_id = input;
161        self
162    }
163    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
166        &self.instance_id
167    }
168    pub fn device(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171        self.device = ::std::option::Option::Some(input.into());
172        self
173    }
174    pub fn set_device(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177        self.device = input;
178        self
179    }
180    pub fn get_device(&self) -> &::std::option::Option<::std::string::String> {
183        &self.device
184    }
185    pub fn state(mut self, input: crate::types::VolumeAttachmentState) -> Self {
187        self.state = ::std::option::Option::Some(input);
188        self
189    }
190    pub fn set_state(mut self, input: ::std::option::Option<crate::types::VolumeAttachmentState>) -> Self {
192        self.state = input;
193        self
194    }
195    pub fn get_state(&self) -> &::std::option::Option<crate::types::VolumeAttachmentState> {
197        &self.state
198    }
199    pub fn attach_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
201        self.attach_time = ::std::option::Option::Some(input);
202        self
203    }
204    pub fn set_attach_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
206        self.attach_time = input;
207        self
208    }
209    pub fn get_attach_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
211        &self.attach_time
212    }
213    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
214        self._request_id = Some(request_id.into());
215        self
216    }
217
218    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
219        self._request_id = request_id;
220        self
221    }
222    pub fn build(self) -> crate::operation::attach_volume::AttachVolumeOutput {
224        crate::operation::attach_volume::AttachVolumeOutput {
225            delete_on_termination: self.delete_on_termination,
226            associated_resource: self.associated_resource,
227            instance_owning_service: self.instance_owning_service,
228            volume_id: self.volume_id,
229            instance_id: self.instance_id,
230            device: self.device,
231            state: self.state,
232            attach_time: self.attach_time,
233            _request_id: self._request_id,
234        }
235    }
236}