1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Describes volume attachment details.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AttachVolumeOutput {
    /// <p>The time stamp when the attachment initiated.</p>
    #[doc(hidden)]
    pub attach_time: std::option::Option<aws_smithy_types::DateTime>,
    /// <p>The device name.</p>
    #[doc(hidden)]
    pub device: std::option::Option<std::string::String>,
    /// <p>The ID of the instance.</p>
    #[doc(hidden)]
    pub instance_id: std::option::Option<std::string::String>,
    /// <p>The attachment state of the volume.</p>
    #[doc(hidden)]
    pub state: std::option::Option<crate::types::VolumeAttachmentState>,
    /// <p>The ID of the volume.</p>
    #[doc(hidden)]
    pub volume_id: std::option::Option<std::string::String>,
    /// <p>Indicates whether the EBS volume is deleted on instance termination.</p>
    #[doc(hidden)]
    pub delete_on_termination: std::option::Option<bool>,
    _request_id: Option<String>,
}
impl AttachVolumeOutput {
    /// <p>The time stamp when the attachment initiated.</p>
    pub fn attach_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
        self.attach_time.as_ref()
    }
    /// <p>The device name.</p>
    pub fn device(&self) -> std::option::Option<&str> {
        self.device.as_deref()
    }
    /// <p>The ID of the instance.</p>
    pub fn instance_id(&self) -> std::option::Option<&str> {
        self.instance_id.as_deref()
    }
    /// <p>The attachment state of the volume.</p>
    pub fn state(&self) -> std::option::Option<&crate::types::VolumeAttachmentState> {
        self.state.as_ref()
    }
    /// <p>The ID of the volume.</p>
    pub fn volume_id(&self) -> std::option::Option<&str> {
        self.volume_id.as_deref()
    }
    /// <p>Indicates whether the EBS volume is deleted on instance termination.</p>
    pub fn delete_on_termination(&self) -> std::option::Option<bool> {
        self.delete_on_termination
    }
}
impl aws_http::request_id::RequestId for AttachVolumeOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl AttachVolumeOutput {
    /// Creates a new builder-style object to manufacture [`AttachVolumeOutput`](crate::operation::attach_volume::AttachVolumeOutput).
    pub fn builder() -> crate::operation::attach_volume::builders::AttachVolumeOutputBuilder {
        crate::operation::attach_volume::builders::AttachVolumeOutputBuilder::default()
    }
}

/// A builder for [`AttachVolumeOutput`](crate::operation::attach_volume::AttachVolumeOutput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct AttachVolumeOutputBuilder {
    pub(crate) attach_time: std::option::Option<aws_smithy_types::DateTime>,
    pub(crate) device: std::option::Option<std::string::String>,
    pub(crate) instance_id: std::option::Option<std::string::String>,
    pub(crate) state: std::option::Option<crate::types::VolumeAttachmentState>,
    pub(crate) volume_id: std::option::Option<std::string::String>,
    pub(crate) delete_on_termination: std::option::Option<bool>,
    _request_id: Option<String>,
}
impl AttachVolumeOutputBuilder {
    /// <p>The time stamp when the attachment initiated.</p>
    pub fn attach_time(mut self, input: aws_smithy_types::DateTime) -> Self {
        self.attach_time = Some(input);
        self
    }
    /// <p>The time stamp when the attachment initiated.</p>
    pub fn set_attach_time(
        mut self,
        input: std::option::Option<aws_smithy_types::DateTime>,
    ) -> Self {
        self.attach_time = input;
        self
    }
    /// <p>The device name.</p>
    pub fn device(mut self, input: impl Into<std::string::String>) -> Self {
        self.device = Some(input.into());
        self
    }
    /// <p>The device name.</p>
    pub fn set_device(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.device = input;
        self
    }
    /// <p>The ID of the instance.</p>
    pub fn instance_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.instance_id = Some(input.into());
        self
    }
    /// <p>The ID of the instance.</p>
    pub fn set_instance_id(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.instance_id = input;
        self
    }
    /// <p>The attachment state of the volume.</p>
    pub fn state(mut self, input: crate::types::VolumeAttachmentState) -> Self {
        self.state = Some(input);
        self
    }
    /// <p>The attachment state of the volume.</p>
    pub fn set_state(
        mut self,
        input: std::option::Option<crate::types::VolumeAttachmentState>,
    ) -> Self {
        self.state = input;
        self
    }
    /// <p>The ID of the volume.</p>
    pub fn volume_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.volume_id = Some(input.into());
        self
    }
    /// <p>The ID of the volume.</p>
    pub fn set_volume_id(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.volume_id = input;
        self
    }
    /// <p>Indicates whether the EBS volume is deleted on instance termination.</p>
    pub fn delete_on_termination(mut self, input: bool) -> Self {
        self.delete_on_termination = Some(input);
        self
    }
    /// <p>Indicates whether the EBS volume is deleted on instance termination.</p>
    pub fn set_delete_on_termination(mut self, input: std::option::Option<bool>) -> Self {
        self.delete_on_termination = input;
        self
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`AttachVolumeOutput`](crate::operation::attach_volume::AttachVolumeOutput).
    pub fn build(self) -> crate::operation::attach_volume::AttachVolumeOutput {
        crate::operation::attach_volume::AttachVolumeOutput {
            attach_time: self.attach_time,
            device: self.device,
            instance_id: self.instance_id,
            state: self.state,
            volume_id: self.volume_id,
            delete_on_termination: self.delete_on_termination,
            _request_id: self._request_id,
        }
    }
}