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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Contains information about the details of an instance.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct InstanceDetails {
    /// <p>The Availability Zone of the EC2 instance.</p>
    pub availability_zone: ::std::option::Option<::std::string::String>,
    /// <p>The profile information of the EC2 instance.</p>
    pub iam_instance_profile: ::std::option::Option<crate::types::IamInstanceProfile>,
    /// <p>The image description of the EC2 instance.</p>
    pub image_description: ::std::option::Option<::std::string::String>,
    /// <p>The image ID of the EC2 instance.</p>
    pub image_id: ::std::option::Option<::std::string::String>,
    /// <p>The ID of the EC2 instance.</p>
    pub instance_id: ::std::option::Option<::std::string::String>,
    /// <p>The state of the EC2 instance.</p>
    pub instance_state: ::std::option::Option<::std::string::String>,
    /// <p>The type of the EC2 instance.</p>
    pub instance_type: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of the Amazon Web Services Outpost. Only applicable to Amazon Web Services Outposts instances.</p>
    pub outpost_arn: ::std::option::Option<::std::string::String>,
    /// <p>The launch time of the EC2 instance.</p>
    pub launch_time: ::std::option::Option<::std::string::String>,
    /// <p>The elastic network interface information of the EC2 instance.</p>
    pub network_interfaces: ::std::option::Option<::std::vec::Vec<crate::types::NetworkInterface>>,
    /// <p>The platform of the EC2 instance.</p>
    pub platform: ::std::option::Option<::std::string::String>,
    /// <p>The product code of the EC2 instance.</p>
    pub product_codes: ::std::option::Option<::std::vec::Vec<crate::types::ProductCode>>,
    /// <p>The tags of the EC2 instance.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl InstanceDetails {
    /// <p>The Availability Zone of the EC2 instance.</p>
    pub fn availability_zone(&self) -> ::std::option::Option<&str> {
        self.availability_zone.as_deref()
    }
    /// <p>The profile information of the EC2 instance.</p>
    pub fn iam_instance_profile(&self) -> ::std::option::Option<&crate::types::IamInstanceProfile> {
        self.iam_instance_profile.as_ref()
    }
    /// <p>The image description of the EC2 instance.</p>
    pub fn image_description(&self) -> ::std::option::Option<&str> {
        self.image_description.as_deref()
    }
    /// <p>The image ID of the EC2 instance.</p>
    pub fn image_id(&self) -> ::std::option::Option<&str> {
        self.image_id.as_deref()
    }
    /// <p>The ID of the EC2 instance.</p>
    pub fn instance_id(&self) -> ::std::option::Option<&str> {
        self.instance_id.as_deref()
    }
    /// <p>The state of the EC2 instance.</p>
    pub fn instance_state(&self) -> ::std::option::Option<&str> {
        self.instance_state.as_deref()
    }
    /// <p>The type of the EC2 instance.</p>
    pub fn instance_type(&self) -> ::std::option::Option<&str> {
        self.instance_type.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the Amazon Web Services Outpost. Only applicable to Amazon Web Services Outposts instances.</p>
    pub fn outpost_arn(&self) -> ::std::option::Option<&str> {
        self.outpost_arn.as_deref()
    }
    /// <p>The launch time of the EC2 instance.</p>
    pub fn launch_time(&self) -> ::std::option::Option<&str> {
        self.launch_time.as_deref()
    }
    /// <p>The elastic network interface information of the EC2 instance.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.network_interfaces.is_none()`.
    pub fn network_interfaces(&self) -> &[crate::types::NetworkInterface] {
        self.network_interfaces.as_deref().unwrap_or_default()
    }
    /// <p>The platform of the EC2 instance.</p>
    pub fn platform(&self) -> ::std::option::Option<&str> {
        self.platform.as_deref()
    }
    /// <p>The product code of the EC2 instance.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.product_codes.is_none()`.
    pub fn product_codes(&self) -> &[crate::types::ProductCode] {
        self.product_codes.as_deref().unwrap_or_default()
    }
    /// <p>The tags of the EC2 instance.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
    pub fn tags(&self) -> &[crate::types::Tag] {
        self.tags.as_deref().unwrap_or_default()
    }
}
impl InstanceDetails {
    /// Creates a new builder-style object to manufacture [`InstanceDetails`](crate::types::InstanceDetails).
    pub fn builder() -> crate::types::builders::InstanceDetailsBuilder {
        crate::types::builders::InstanceDetailsBuilder::default()
    }
}

/// A builder for [`InstanceDetails`](crate::types::InstanceDetails).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct InstanceDetailsBuilder {
    pub(crate) availability_zone: ::std::option::Option<::std::string::String>,
    pub(crate) iam_instance_profile: ::std::option::Option<crate::types::IamInstanceProfile>,
    pub(crate) image_description: ::std::option::Option<::std::string::String>,
    pub(crate) image_id: ::std::option::Option<::std::string::String>,
    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
    pub(crate) instance_state: ::std::option::Option<::std::string::String>,
    pub(crate) instance_type: ::std::option::Option<::std::string::String>,
    pub(crate) outpost_arn: ::std::option::Option<::std::string::String>,
    pub(crate) launch_time: ::std::option::Option<::std::string::String>,
    pub(crate) network_interfaces: ::std::option::Option<::std::vec::Vec<crate::types::NetworkInterface>>,
    pub(crate) platform: ::std::option::Option<::std::string::String>,
    pub(crate) product_codes: ::std::option::Option<::std::vec::Vec<crate::types::ProductCode>>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl InstanceDetailsBuilder {
    /// <p>The Availability Zone of the EC2 instance.</p>
    pub fn availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.availability_zone = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Availability Zone of the EC2 instance.</p>
    pub fn set_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.availability_zone = input;
        self
    }
    /// <p>The Availability Zone of the EC2 instance.</p>
    pub fn get_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
        &self.availability_zone
    }
    /// <p>The profile information of the EC2 instance.</p>
    pub fn iam_instance_profile(mut self, input: crate::types::IamInstanceProfile) -> Self {
        self.iam_instance_profile = ::std::option::Option::Some(input);
        self
    }
    /// <p>The profile information of the EC2 instance.</p>
    pub fn set_iam_instance_profile(mut self, input: ::std::option::Option<crate::types::IamInstanceProfile>) -> Self {
        self.iam_instance_profile = input;
        self
    }
    /// <p>The profile information of the EC2 instance.</p>
    pub fn get_iam_instance_profile(&self) -> &::std::option::Option<crate::types::IamInstanceProfile> {
        &self.iam_instance_profile
    }
    /// <p>The image description of the EC2 instance.</p>
    pub fn image_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.image_description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The image description of the EC2 instance.</p>
    pub fn set_image_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.image_description = input;
        self
    }
    /// <p>The image description of the EC2 instance.</p>
    pub fn get_image_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.image_description
    }
    /// <p>The image ID of the EC2 instance.</p>
    pub fn image_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.image_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The image ID of the EC2 instance.</p>
    pub fn set_image_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.image_id = input;
        self
    }
    /// <p>The image ID of the EC2 instance.</p>
    pub fn get_image_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.image_id
    }
    /// <p>The ID of the EC2 instance.</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 EC2 instance.</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 EC2 instance.</p>
    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_id
    }
    /// <p>The state of the EC2 instance.</p>
    pub fn instance_state(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_state = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The state of the EC2 instance.</p>
    pub fn set_instance_state(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_state = input;
        self
    }
    /// <p>The state of the EC2 instance.</p>
    pub fn get_instance_state(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_state
    }
    /// <p>The type of the EC2 instance.</p>
    pub fn instance_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The type of the EC2 instance.</p>
    pub fn set_instance_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_type = input;
        self
    }
    /// <p>The type of the EC2 instance.</p>
    pub fn get_instance_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_type
    }
    /// <p>The Amazon Resource Name (ARN) of the Amazon Web Services Outpost. Only applicable to Amazon Web Services Outposts instances.</p>
    pub fn outpost_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.outpost_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the Amazon Web Services Outpost. Only applicable to Amazon Web Services Outposts instances.</p>
    pub fn set_outpost_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.outpost_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the Amazon Web Services Outpost. Only applicable to Amazon Web Services Outposts instances.</p>
    pub fn get_outpost_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.outpost_arn
    }
    /// <p>The launch time of the EC2 instance.</p>
    pub fn launch_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.launch_time = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The launch time of the EC2 instance.</p>
    pub fn set_launch_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.launch_time = input;
        self
    }
    /// <p>The launch time of the EC2 instance.</p>
    pub fn get_launch_time(&self) -> &::std::option::Option<::std::string::String> {
        &self.launch_time
    }
    /// Appends an item to `network_interfaces`.
    ///
    /// To override the contents of this collection use [`set_network_interfaces`](Self::set_network_interfaces).
    ///
    /// <p>The elastic network interface information of the EC2 instance.</p>
    pub fn network_interfaces(mut self, input: crate::types::NetworkInterface) -> Self {
        let mut v = self.network_interfaces.unwrap_or_default();
        v.push(input);
        self.network_interfaces = ::std::option::Option::Some(v);
        self
    }
    /// <p>The elastic network interface information of the EC2 instance.</p>
    pub fn set_network_interfaces(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::NetworkInterface>>) -> Self {
        self.network_interfaces = input;
        self
    }
    /// <p>The elastic network interface information of the EC2 instance.</p>
    pub fn get_network_interfaces(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::NetworkInterface>> {
        &self.network_interfaces
    }
    /// <p>The platform of the EC2 instance.</p>
    pub fn platform(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.platform = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The platform of the EC2 instance.</p>
    pub fn set_platform(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.platform = input;
        self
    }
    /// <p>The platform of the EC2 instance.</p>
    pub fn get_platform(&self) -> &::std::option::Option<::std::string::String> {
        &self.platform
    }
    /// Appends an item to `product_codes`.
    ///
    /// To override the contents of this collection use [`set_product_codes`](Self::set_product_codes).
    ///
    /// <p>The product code of the EC2 instance.</p>
    pub fn product_codes(mut self, input: crate::types::ProductCode) -> Self {
        let mut v = self.product_codes.unwrap_or_default();
        v.push(input);
        self.product_codes = ::std::option::Option::Some(v);
        self
    }
    /// <p>The product code of the EC2 instance.</p>
    pub fn set_product_codes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ProductCode>>) -> Self {
        self.product_codes = input;
        self
    }
    /// <p>The product code of the EC2 instance.</p>
    pub fn get_product_codes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ProductCode>> {
        &self.product_codes
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags of the EC2 instance.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>The tags of the EC2 instance.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The tags of the EC2 instance.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`InstanceDetails`](crate::types::InstanceDetails).
    pub fn build(self) -> crate::types::InstanceDetails {
        crate::types::InstanceDetails {
            availability_zone: self.availability_zone,
            iam_instance_profile: self.iam_instance_profile,
            image_description: self.image_description,
            image_id: self.image_id,
            instance_id: self.instance_id,
            instance_state: self.instance_state,
            instance_type: self.instance_type,
            outpost_arn: self.outpost_arn,
            launch_time: self.launch_time,
            network_interfaces: self.network_interfaces,
            platform: self.platform,
            product_codes: self.product_codes,
            tags: self.tags,
        }
    }
}