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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
// 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>
    pub attach_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The device name.</p>
    /// <p>If the volume is attached to a Fargate task, this parameter returns <code>null</code>.</p>
    pub device: ::std::option::Option<::std::string::String>,
    /// <p>The ID of the instance.</p>
    /// <p>If the volume is attached to a Fargate task, this parameter returns <code>null</code>.</p>
    pub instance_id: ::std::option::Option<::std::string::String>,
    /// <p>The attachment state of the volume.</p>
    pub state: ::std::option::Option<crate::types::VolumeAttachmentState>,
    /// <p>The ID of the volume.</p>
    pub volume_id: ::std::option::Option<::std::string::String>,
    /// <p>Indicates whether the EBS volume is deleted on instance termination.</p>
    pub delete_on_termination: ::std::option::Option<bool>,
    /// <p>The ARN of the Amazon ECS or Fargate task to which the volume is attached.</p>
    pub associated_resource: ::std::option::Option<::std::string::String>,
    /// <p>The service principal of Amazon Web Services service that owns the underlying instance to which the volume is attached.</p>
    /// <p>This parameter is returned only for volumes that are attached to Fargate tasks.</p>
    pub instance_owning_service: ::std::option::Option<::std::string::String>,
    _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>
    /// <p>If the volume is attached to a Fargate task, this parameter returns <code>null</code>.</p>
    pub fn device(&self) -> ::std::option::Option<&str> {
        self.device.as_deref()
    }
    /// <p>The ID of the instance.</p>
    /// <p>If the volume is attached to a Fargate task, this parameter returns <code>null</code>.</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
    }
    /// <p>The ARN of the Amazon ECS or Fargate task to which the volume is attached.</p>
    pub fn associated_resource(&self) -> ::std::option::Option<&str> {
        self.associated_resource.as_deref()
    }
    /// <p>The service principal of Amazon Web Services service that owns the underlying instance to which the volume is attached.</p>
    /// <p>This parameter is returned only for volumes that are attached to Fargate tasks.</p>
    pub fn instance_owning_service(&self) -> ::std::option::Option<&str> {
        self.instance_owning_service.as_deref()
    }
}
impl ::aws_types::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).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
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>,
    pub(crate) associated_resource: ::std::option::Option<::std::string::String>,
    pub(crate) instance_owning_service: ::std::option::Option<::std::string::String>,
    _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 = ::std::option::Option::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 time stamp when the attachment initiated.</p>
    pub fn get_attach_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.attach_time
    }
    /// <p>The device name.</p>
    /// <p>If the volume is attached to a Fargate task, this parameter returns <code>null</code>.</p>
    pub fn device(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.device = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The device name.</p>
    /// <p>If the volume is attached to a Fargate task, this parameter returns <code>null</code>.</p>
    pub fn set_device(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.device = input;
        self
    }
    /// <p>The device name.</p>
    /// <p>If the volume is attached to a Fargate task, this parameter returns <code>null</code>.</p>
    pub fn get_device(&self) -> &::std::option::Option<::std::string::String> {
        &self.device
    }
    /// <p>The ID of the instance.</p>
    /// <p>If the volume is attached to a Fargate task, this parameter returns <code>null</code>.</p>
    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the instance.</p>
    /// <p>If the volume is attached to a Fargate task, this parameter returns <code>null</code>.</p>
    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_id = input;
        self
    }
    /// <p>The ID of the instance.</p>
    /// <p>If the volume is attached to a Fargate task, this parameter returns <code>null</code>.</p>
    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_id
    }
    /// <p>The attachment state of the volume.</p>
    pub fn state(mut self, input: crate::types::VolumeAttachmentState) -> Self {
        self.state = ::std::option::Option::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 attachment state of the volume.</p>
    pub fn get_state(&self) -> &::std::option::Option<crate::types::VolumeAttachmentState> {
        &self.state
    }
    /// <p>The ID of the volume.</p>
    pub fn volume_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.volume_id = ::std::option::Option::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>The ID of the volume.</p>
    pub fn get_volume_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.volume_id
    }
    /// <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 = ::std::option::Option::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
    }
    /// <p>Indicates whether the EBS volume is deleted on instance termination.</p>
    pub fn get_delete_on_termination(&self) -> &::std::option::Option<bool> {
        &self.delete_on_termination
    }
    /// <p>The ARN of the Amazon ECS or Fargate task to which the volume is attached.</p>
    pub fn associated_resource(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.associated_resource = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the Amazon ECS or Fargate task to which the volume is attached.</p>
    pub fn set_associated_resource(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.associated_resource = input;
        self
    }
    /// <p>The ARN of the Amazon ECS or Fargate task to which the volume is attached.</p>
    pub fn get_associated_resource(&self) -> &::std::option::Option<::std::string::String> {
        &self.associated_resource
    }
    /// <p>The service principal of Amazon Web Services service that owns the underlying instance to which the volume is attached.</p>
    /// <p>This parameter is returned only for volumes that are attached to Fargate tasks.</p>
    pub fn instance_owning_service(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_owning_service = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The service principal of Amazon Web Services service that owns the underlying instance to which the volume is attached.</p>
    /// <p>This parameter is returned only for volumes that are attached to Fargate tasks.</p>
    pub fn set_instance_owning_service(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_owning_service = input;
        self
    }
    /// <p>The service principal of Amazon Web Services service that owns the underlying instance to which the volume is attached.</p>
    /// <p>This parameter is returned only for volumes that are attached to Fargate tasks.</p>
    pub fn get_instance_owning_service(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_owning_service
    }
    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,
            associated_resource: self.associated_resource,
            instance_owning_service: self.instance_owning_service,
            _request_id: self._request_id,
        }
    }
}