aws-sdk-ec2 1.224.0

AWS SDK for Amazon Elastic Compute Cloud
Documentation
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
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Describes an image.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Image {
    /// <p>The platform details associated with the billing code of the AMI. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-billing-info.html">Understand AMI billing information</a> in the <i>Amazon EC2 User Guide</i>.</p>
    pub platform_details: ::std::option::Option<::std::string::String>,
    /// <p>The operation of the Amazon EC2 instance and the billing code that is associated with the AMI. <code>usageOperation</code> corresponds to the <a href="https://docs.aws.amazon.com/cur/latest/userguide/Lineitem-columns.html#Lineitem-details-O-Operation">lineitem/Operation</a> column on your Amazon Web Services Cost and Usage Report and in the <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html">Amazon Web Services Price List API</a>. You can view these fields on the <b>Instances</b> or <b>AMIs</b> pages in the Amazon EC2 console, or in the responses that are returned by the <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImages.html">DescribeImages</a> command in the Amazon EC2 API, or the <a href="https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html">describe-images</a> command in the CLI.</p>
    pub usage_operation: ::std::option::Option<::std::string::String>,
    /// <p>Any block device mapping entries.</p>
    pub block_device_mappings: ::std::option::Option<::std::vec::Vec<crate::types::BlockDeviceMapping>>,
    /// <p>The description of the AMI that was provided during image creation.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>Specifies whether enhanced networking with ENA is enabled.</p>
    pub ena_support: ::std::option::Option<bool>,
    /// <p>The hypervisor type of the image. Only <code>xen</code> is supported. <code>ovm</code> is not supported.</p>
    pub hypervisor: ::std::option::Option<crate::types::HypervisorType>,
    /// <p>The owner alias (<code>amazon</code> | <code>aws-backup-vault</code> | <code>aws-marketplace</code>).</p>
    pub image_owner_alias: ::std::option::Option<::std::string::String>,
    /// <p>The name of the AMI that was provided during image creation.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The device name of the root device volume (for example, <code>/dev/sda1</code>).</p>
    pub root_device_name: ::std::option::Option<::std::string::String>,
    /// <p>The type of root device used by the AMI. The AMI can use an Amazon EBS volume or an instance store volume.</p>
    pub root_device_type: ::std::option::Option<crate::types::DeviceType>,
    /// <p>Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.</p>
    pub sriov_net_support: ::std::option::Option<::std::string::String>,
    /// <p>The reason for the state change.</p>
    pub state_reason: ::std::option::Option<crate::types::StateReason>,
    /// <p>Any tags assigned to the image.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    /// <p>The type of virtualization of the AMI.</p>
    pub virtualization_type: ::std::option::Option<crate::types::VirtualizationType>,
    /// <p>The boot mode of the image. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html">Instance launch behavior with Amazon EC2 boot modes</a> in the <i>Amazon EC2 User Guide</i>.</p>
    pub boot_mode: ::std::option::Option<crate::types::BootModeValues>,
    /// <p>If the image is configured for NitroTPM support, the value is <code>v2.0</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitrotpm.html">NitroTPM</a> in the <i>Amazon EC2 User Guide</i>.</p>
    pub tpm_support: ::std::option::Option<crate::types::TpmSupportValues>,
    /// <p>The date and time to deprecate the AMI, in UTC, in the following format: <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z. If you specified a value for seconds, Amazon EC2 rounds the seconds to the nearest minute.</p>
    pub deprecation_time: ::std::option::Option<::std::string::String>,
    /// <p>If <code>v2.0</code>, it indicates that IMDSv2 is specified in the AMI. Instances launched from this AMI will have <code>HttpTokens</code> automatically set to <code>required</code> so that, by default, the instance requires that IMDSv2 is used when requesting instance metadata. In addition, <code>HttpPutResponseHopLimit</code> is set to <code>2</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration">Configure the AMI</a> in the <i>Amazon EC2 User Guide</i>.</p>
    pub imds_support: ::std::option::Option<crate::types::ImdsSupportValues>,
    /// <p>The ID of the instance that the AMI was created from if the AMI was created using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage.html">CreateImage</a>. This field only appears if the AMI was created using CreateImage.</p>
    pub source_instance_id: ::std::option::Option<::std::string::String>,
    /// <p>Indicates whether deregistration protection is enabled for the AMI.</p>
    pub deregistration_protection: ::std::option::Option<::std::string::String>,
    /// <p>The date and time, in <a href="http://www.iso.org/iso/iso8601">ISO 8601 date-time format</a>, when the AMI was last used to launch an EC2 instance. When the AMI is used to launch an instance, there is a 24-hour delay before that usage is reported.</p><note>
    /// <p><code>lastLaunchedTime</code> data is available starting April 2017.</p>
    /// </note>
    pub last_launched_time: ::std::option::Option<::std::string::String>,
    /// <p>If <code>true</code>, the AMI satisfies the criteria for Allowed AMIs and can be discovered and used in the account. If <code>false</code> and Allowed AMIs is set to <code>enabled</code>, the AMI can't be discovered or used in the account. If <code>false</code> and Allowed AMIs is set to <code>audit-mode</code>, the AMI can be discovered and used in the account.</p>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-allowed-amis.html">Control the discovery and use of AMIs in Amazon EC2 with Allowed AMIs</a> in <i>Amazon EC2 User Guide</i>.</p>
    pub image_allowed: ::std::option::Option<bool>,
    /// <p>The ID of the source AMI from which the AMI was created.</p>
    pub source_image_id: ::std::option::Option<::std::string::String>,
    /// <p>The Region of the source AMI.</p>
    pub source_image_region: ::std::option::Option<::std::string::String>,
    /// <p>Indicates whether the image is eligible for Amazon Web Services Free Tier.</p>
    /// <ul>
    /// <li>
    /// <p>If <code>true</code>, the AMI is eligible for Free Tier and can be used to launch instances under the Free Tier limits.</p></li>
    /// <li>
    /// <p>If <code>false</code>, the AMI is not eligible for Free Tier.</p></li>
    /// </ul>
    pub free_tier_eligible: ::std::option::Option<bool>,
    /// <p>The ID of the AMI.</p>
    pub image_id: ::std::option::Option<::std::string::String>,
    /// <p>The location of the AMI.</p>
    pub image_location: ::std::option::Option<::std::string::String>,
    /// <p>The current state of the AMI. If the state is <code>available</code>, the image is successfully registered and can be used to launch an instance.</p>
    pub state: ::std::option::Option<crate::types::ImageState>,
    /// <p>The ID of the Amazon Web Services account that owns the image.</p>
    pub owner_id: ::std::option::Option<::std::string::String>,
    /// <p>The date and time the image was created.</p>
    pub creation_date: ::std::option::Option<::std::string::String>,
    /// <p>Indicates whether the image has public launch permissions. The value is <code>true</code> if this image has public launch permissions or <code>false</code> if it has only implicit and explicit launch permissions.</p>
    pub public: ::std::option::Option<bool>,
    /// <p>Any product codes associated with the AMI.</p>
    pub product_codes: ::std::option::Option<::std::vec::Vec<crate::types::ProductCode>>,
    /// <p>The architecture of the image.</p>
    pub architecture: ::std::option::Option<crate::types::ArchitectureValues>,
    /// <p>The type of image.</p>
    pub image_type: ::std::option::Option<crate::types::ImageTypeValues>,
    /// <p>The kernel associated with the image, if any. Only applicable for machine images.</p>
    pub kernel_id: ::std::option::Option<::std::string::String>,
    /// <p>The RAM disk associated with the image, if any. Only applicable for machine images.</p>
    pub ramdisk_id: ::std::option::Option<::std::string::String>,
    /// <p>This value is set to <code>windows</code> for Windows AMIs; otherwise, it is blank.</p>
    pub platform: ::std::option::Option<crate::types::PlatformValues>,
}
impl Image {
    /// <p>The platform details associated with the billing code of the AMI. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-billing-info.html">Understand AMI billing information</a> in the <i>Amazon EC2 User Guide</i>.</p>
    pub fn platform_details(&self) -> ::std::option::Option<&str> {
        self.platform_details.as_deref()
    }
    /// <p>The operation of the Amazon EC2 instance and the billing code that is associated with the AMI. <code>usageOperation</code> corresponds to the <a href="https://docs.aws.amazon.com/cur/latest/userguide/Lineitem-columns.html#Lineitem-details-O-Operation">lineitem/Operation</a> column on your Amazon Web Services Cost and Usage Report and in the <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html">Amazon Web Services Price List API</a>. You can view these fields on the <b>Instances</b> or <b>AMIs</b> pages in the Amazon EC2 console, or in the responses that are returned by the <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImages.html">DescribeImages</a> command in the Amazon EC2 API, or the <a href="https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html">describe-images</a> command in the CLI.</p>
    pub fn usage_operation(&self) -> ::std::option::Option<&str> {
        self.usage_operation.as_deref()
    }
    /// <p>Any block device mapping entries.</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 `.block_device_mappings.is_none()`.
    pub fn block_device_mappings(&self) -> &[crate::types::BlockDeviceMapping] {
        self.block_device_mappings.as_deref().unwrap_or_default()
    }
    /// <p>The description of the AMI that was provided during image creation.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>Specifies whether enhanced networking with ENA is enabled.</p>
    pub fn ena_support(&self) -> ::std::option::Option<bool> {
        self.ena_support
    }
    /// <p>The hypervisor type of the image. Only <code>xen</code> is supported. <code>ovm</code> is not supported.</p>
    pub fn hypervisor(&self) -> ::std::option::Option<&crate::types::HypervisorType> {
        self.hypervisor.as_ref()
    }
    /// <p>The owner alias (<code>amazon</code> | <code>aws-backup-vault</code> | <code>aws-marketplace</code>).</p>
    pub fn image_owner_alias(&self) -> ::std::option::Option<&str> {
        self.image_owner_alias.as_deref()
    }
    /// <p>The name of the AMI that was provided during image creation.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The device name of the root device volume (for example, <code>/dev/sda1</code>).</p>
    pub fn root_device_name(&self) -> ::std::option::Option<&str> {
        self.root_device_name.as_deref()
    }
    /// <p>The type of root device used by the AMI. The AMI can use an Amazon EBS volume or an instance store volume.</p>
    pub fn root_device_type(&self) -> ::std::option::Option<&crate::types::DeviceType> {
        self.root_device_type.as_ref()
    }
    /// <p>Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.</p>
    pub fn sriov_net_support(&self) -> ::std::option::Option<&str> {
        self.sriov_net_support.as_deref()
    }
    /// <p>The reason for the state change.</p>
    pub fn state_reason(&self) -> ::std::option::Option<&crate::types::StateReason> {
        self.state_reason.as_ref()
    }
    /// <p>Any tags assigned to the image.</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()
    }
    /// <p>The type of virtualization of the AMI.</p>
    pub fn virtualization_type(&self) -> ::std::option::Option<&crate::types::VirtualizationType> {
        self.virtualization_type.as_ref()
    }
    /// <p>The boot mode of the image. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html">Instance launch behavior with Amazon EC2 boot modes</a> in the <i>Amazon EC2 User Guide</i>.</p>
    pub fn boot_mode(&self) -> ::std::option::Option<&crate::types::BootModeValues> {
        self.boot_mode.as_ref()
    }
    /// <p>If the image is configured for NitroTPM support, the value is <code>v2.0</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitrotpm.html">NitroTPM</a> in the <i>Amazon EC2 User Guide</i>.</p>
    pub fn tpm_support(&self) -> ::std::option::Option<&crate::types::TpmSupportValues> {
        self.tpm_support.as_ref()
    }
    /// <p>The date and time to deprecate the AMI, in UTC, in the following format: <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z. If you specified a value for seconds, Amazon EC2 rounds the seconds to the nearest minute.</p>
    pub fn deprecation_time(&self) -> ::std::option::Option<&str> {
        self.deprecation_time.as_deref()
    }
    /// <p>If <code>v2.0</code>, it indicates that IMDSv2 is specified in the AMI. Instances launched from this AMI will have <code>HttpTokens</code> automatically set to <code>required</code> so that, by default, the instance requires that IMDSv2 is used when requesting instance metadata. In addition, <code>HttpPutResponseHopLimit</code> is set to <code>2</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration">Configure the AMI</a> in the <i>Amazon EC2 User Guide</i>.</p>
    pub fn imds_support(&self) -> ::std::option::Option<&crate::types::ImdsSupportValues> {
        self.imds_support.as_ref()
    }
    /// <p>The ID of the instance that the AMI was created from if the AMI was created using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage.html">CreateImage</a>. This field only appears if the AMI was created using CreateImage.</p>
    pub fn source_instance_id(&self) -> ::std::option::Option<&str> {
        self.source_instance_id.as_deref()
    }
    /// <p>Indicates whether deregistration protection is enabled for the AMI.</p>
    pub fn deregistration_protection(&self) -> ::std::option::Option<&str> {
        self.deregistration_protection.as_deref()
    }
    /// <p>The date and time, in <a href="http://www.iso.org/iso/iso8601">ISO 8601 date-time format</a>, when the AMI was last used to launch an EC2 instance. When the AMI is used to launch an instance, there is a 24-hour delay before that usage is reported.</p><note>
    /// <p><code>lastLaunchedTime</code> data is available starting April 2017.</p>
    /// </note>
    pub fn last_launched_time(&self) -> ::std::option::Option<&str> {
        self.last_launched_time.as_deref()
    }
    /// <p>If <code>true</code>, the AMI satisfies the criteria for Allowed AMIs and can be discovered and used in the account. If <code>false</code> and Allowed AMIs is set to <code>enabled</code>, the AMI can't be discovered or used in the account. If <code>false</code> and Allowed AMIs is set to <code>audit-mode</code>, the AMI can be discovered and used in the account.</p>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-allowed-amis.html">Control the discovery and use of AMIs in Amazon EC2 with Allowed AMIs</a> in <i>Amazon EC2 User Guide</i>.</p>
    pub fn image_allowed(&self) -> ::std::option::Option<bool> {
        self.image_allowed
    }
    /// <p>The ID of the source AMI from which the AMI was created.</p>
    pub fn source_image_id(&self) -> ::std::option::Option<&str> {
        self.source_image_id.as_deref()
    }
    /// <p>The Region of the source AMI.</p>
    pub fn source_image_region(&self) -> ::std::option::Option<&str> {
        self.source_image_region.as_deref()
    }
    /// <p>Indicates whether the image is eligible for Amazon Web Services Free Tier.</p>
    /// <ul>
    /// <li>
    /// <p>If <code>true</code>, the AMI is eligible for Free Tier and can be used to launch instances under the Free Tier limits.</p></li>
    /// <li>
    /// <p>If <code>false</code>, the AMI is not eligible for Free Tier.</p></li>
    /// </ul>
    pub fn free_tier_eligible(&self) -> ::std::option::Option<bool> {
        self.free_tier_eligible
    }
    /// <p>The ID of the AMI.</p>
    pub fn image_id(&self) -> ::std::option::Option<&str> {
        self.image_id.as_deref()
    }
    /// <p>The location of the AMI.</p>
    pub fn image_location(&self) -> ::std::option::Option<&str> {
        self.image_location.as_deref()
    }
    /// <p>The current state of the AMI. If the state is <code>available</code>, the image is successfully registered and can be used to launch an instance.</p>
    pub fn state(&self) -> ::std::option::Option<&crate::types::ImageState> {
        self.state.as_ref()
    }
    /// <p>The ID of the Amazon Web Services account that owns the image.</p>
    pub fn owner_id(&self) -> ::std::option::Option<&str> {
        self.owner_id.as_deref()
    }
    /// <p>The date and time the image was created.</p>
    pub fn creation_date(&self) -> ::std::option::Option<&str> {
        self.creation_date.as_deref()
    }
    /// <p>Indicates whether the image has public launch permissions. The value is <code>true</code> if this image has public launch permissions or <code>false</code> if it has only implicit and explicit launch permissions.</p>
    pub fn public(&self) -> ::std::option::Option<bool> {
        self.public
    }
    /// <p>Any product codes associated with the AMI.</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 architecture of the image.</p>
    pub fn architecture(&self) -> ::std::option::Option<&crate::types::ArchitectureValues> {
        self.architecture.as_ref()
    }
    /// <p>The type of image.</p>
    pub fn image_type(&self) -> ::std::option::Option<&crate::types::ImageTypeValues> {
        self.image_type.as_ref()
    }
    /// <p>The kernel associated with the image, if any. Only applicable for machine images.</p>
    pub fn kernel_id(&self) -> ::std::option::Option<&str> {
        self.kernel_id.as_deref()
    }
    /// <p>The RAM disk associated with the image, if any. Only applicable for machine images.</p>
    pub fn ramdisk_id(&self) -> ::std::option::Option<&str> {
        self.ramdisk_id.as_deref()
    }
    /// <p>This value is set to <code>windows</code> for Windows AMIs; otherwise, it is blank.</p>
    pub fn platform(&self) -> ::std::option::Option<&crate::types::PlatformValues> {
        self.platform.as_ref()
    }
}
impl Image {
    /// Creates a new builder-style object to manufacture [`Image`](crate::types::Image).
    pub fn builder() -> crate::types::builders::ImageBuilder {
        crate::types::builders::ImageBuilder::default()
    }
}

/// A builder for [`Image`](crate::types::Image).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ImageBuilder {
    pub(crate) platform_details: ::std::option::Option<::std::string::String>,
    pub(crate) usage_operation: ::std::option::Option<::std::string::String>,
    pub(crate) block_device_mappings: ::std::option::Option<::std::vec::Vec<crate::types::BlockDeviceMapping>>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) ena_support: ::std::option::Option<bool>,
    pub(crate) hypervisor: ::std::option::Option<crate::types::HypervisorType>,
    pub(crate) image_owner_alias: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) root_device_name: ::std::option::Option<::std::string::String>,
    pub(crate) root_device_type: ::std::option::Option<crate::types::DeviceType>,
    pub(crate) sriov_net_support: ::std::option::Option<::std::string::String>,
    pub(crate) state_reason: ::std::option::Option<crate::types::StateReason>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    pub(crate) virtualization_type: ::std::option::Option<crate::types::VirtualizationType>,
    pub(crate) boot_mode: ::std::option::Option<crate::types::BootModeValues>,
    pub(crate) tpm_support: ::std::option::Option<crate::types::TpmSupportValues>,
    pub(crate) deprecation_time: ::std::option::Option<::std::string::String>,
    pub(crate) imds_support: ::std::option::Option<crate::types::ImdsSupportValues>,
    pub(crate) source_instance_id: ::std::option::Option<::std::string::String>,
    pub(crate) deregistration_protection: ::std::option::Option<::std::string::String>,
    pub(crate) last_launched_time: ::std::option::Option<::std::string::String>,
    pub(crate) image_allowed: ::std::option::Option<bool>,
    pub(crate) source_image_id: ::std::option::Option<::std::string::String>,
    pub(crate) source_image_region: ::std::option::Option<::std::string::String>,
    pub(crate) free_tier_eligible: ::std::option::Option<bool>,
    pub(crate) image_id: ::std::option::Option<::std::string::String>,
    pub(crate) image_location: ::std::option::Option<::std::string::String>,
    pub(crate) state: ::std::option::Option<crate::types::ImageState>,
    pub(crate) owner_id: ::std::option::Option<::std::string::String>,
    pub(crate) creation_date: ::std::option::Option<::std::string::String>,
    pub(crate) public: ::std::option::Option<bool>,
    pub(crate) product_codes: ::std::option::Option<::std::vec::Vec<crate::types::ProductCode>>,
    pub(crate) architecture: ::std::option::Option<crate::types::ArchitectureValues>,
    pub(crate) image_type: ::std::option::Option<crate::types::ImageTypeValues>,
    pub(crate) kernel_id: ::std::option::Option<::std::string::String>,
    pub(crate) ramdisk_id: ::std::option::Option<::std::string::String>,
    pub(crate) platform: ::std::option::Option<crate::types::PlatformValues>,
}
impl ImageBuilder {
    /// <p>The platform details associated with the billing code of the AMI. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-billing-info.html">Understand AMI billing information</a> in the <i>Amazon EC2 User Guide</i>.</p>
    pub fn platform_details(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.platform_details = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The platform details associated with the billing code of the AMI. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-billing-info.html">Understand AMI billing information</a> in the <i>Amazon EC2 User Guide</i>.</p>
    pub fn set_platform_details(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.platform_details = input;
        self
    }
    /// <p>The platform details associated with the billing code of the AMI. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-billing-info.html">Understand AMI billing information</a> in the <i>Amazon EC2 User Guide</i>.</p>
    pub fn get_platform_details(&self) -> &::std::option::Option<::std::string::String> {
        &self.platform_details
    }
    /// <p>The operation of the Amazon EC2 instance and the billing code that is associated with the AMI. <code>usageOperation</code> corresponds to the <a href="https://docs.aws.amazon.com/cur/latest/userguide/Lineitem-columns.html#Lineitem-details-O-Operation">lineitem/Operation</a> column on your Amazon Web Services Cost and Usage Report and in the <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html">Amazon Web Services Price List API</a>. You can view these fields on the <b>Instances</b> or <b>AMIs</b> pages in the Amazon EC2 console, or in the responses that are returned by the <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImages.html">DescribeImages</a> command in the Amazon EC2 API, or the <a href="https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html">describe-images</a> command in the CLI.</p>
    pub fn usage_operation(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.usage_operation = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The operation of the Amazon EC2 instance and the billing code that is associated with the AMI. <code>usageOperation</code> corresponds to the <a href="https://docs.aws.amazon.com/cur/latest/userguide/Lineitem-columns.html#Lineitem-details-O-Operation">lineitem/Operation</a> column on your Amazon Web Services Cost and Usage Report and in the <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html">Amazon Web Services Price List API</a>. You can view these fields on the <b>Instances</b> or <b>AMIs</b> pages in the Amazon EC2 console, or in the responses that are returned by the <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImages.html">DescribeImages</a> command in the Amazon EC2 API, or the <a href="https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html">describe-images</a> command in the CLI.</p>
    pub fn set_usage_operation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.usage_operation = input;
        self
    }
    /// <p>The operation of the Amazon EC2 instance and the billing code that is associated with the AMI. <code>usageOperation</code> corresponds to the <a href="https://docs.aws.amazon.com/cur/latest/userguide/Lineitem-columns.html#Lineitem-details-O-Operation">lineitem/Operation</a> column on your Amazon Web Services Cost and Usage Report and in the <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html">Amazon Web Services Price List API</a>. You can view these fields on the <b>Instances</b> or <b>AMIs</b> pages in the Amazon EC2 console, or in the responses that are returned by the <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImages.html">DescribeImages</a> command in the Amazon EC2 API, or the <a href="https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html">describe-images</a> command in the CLI.</p>
    pub fn get_usage_operation(&self) -> &::std::option::Option<::std::string::String> {
        &self.usage_operation
    }
    /// Appends an item to `block_device_mappings`.
    ///
    /// To override the contents of this collection use [`set_block_device_mappings`](Self::set_block_device_mappings).
    ///
    /// <p>Any block device mapping entries.</p>
    pub fn block_device_mappings(mut self, input: crate::types::BlockDeviceMapping) -> Self {
        let mut v = self.block_device_mappings.unwrap_or_default();
        v.push(input);
        self.block_device_mappings = ::std::option::Option::Some(v);
        self
    }
    /// <p>Any block device mapping entries.</p>
    pub fn set_block_device_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BlockDeviceMapping>>) -> Self {
        self.block_device_mappings = input;
        self
    }
    /// <p>Any block device mapping entries.</p>
    pub fn get_block_device_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BlockDeviceMapping>> {
        &self.block_device_mappings
    }
    /// <p>The description of the AMI that was provided during image creation.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The description of the AMI that was provided during image creation.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The description of the AMI that was provided during image creation.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>Specifies whether enhanced networking with ENA is enabled.</p>
    pub fn ena_support(mut self, input: bool) -> Self {
        self.ena_support = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies whether enhanced networking with ENA is enabled.</p>
    pub fn set_ena_support(mut self, input: ::std::option::Option<bool>) -> Self {
        self.ena_support = input;
        self
    }
    /// <p>Specifies whether enhanced networking with ENA is enabled.</p>
    pub fn get_ena_support(&self) -> &::std::option::Option<bool> {
        &self.ena_support
    }
    /// <p>The hypervisor type of the image. Only <code>xen</code> is supported. <code>ovm</code> is not supported.</p>
    pub fn hypervisor(mut self, input: crate::types::HypervisorType) -> Self {
        self.hypervisor = ::std::option::Option::Some(input);
        self
    }
    /// <p>The hypervisor type of the image. Only <code>xen</code> is supported. <code>ovm</code> is not supported.</p>
    pub fn set_hypervisor(mut self, input: ::std::option::Option<crate::types::HypervisorType>) -> Self {
        self.hypervisor = input;
        self
    }
    /// <p>The hypervisor type of the image. Only <code>xen</code> is supported. <code>ovm</code> is not supported.</p>
    pub fn get_hypervisor(&self) -> &::std::option::Option<crate::types::HypervisorType> {
        &self.hypervisor
    }
    /// <p>The owner alias (<code>amazon</code> | <code>aws-backup-vault</code> | <code>aws-marketplace</code>).</p>
    pub fn image_owner_alias(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.image_owner_alias = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The owner alias (<code>amazon</code> | <code>aws-backup-vault</code> | <code>aws-marketplace</code>).</p>
    pub fn set_image_owner_alias(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.image_owner_alias = input;
        self
    }
    /// <p>The owner alias (<code>amazon</code> | <code>aws-backup-vault</code> | <code>aws-marketplace</code>).</p>
    pub fn get_image_owner_alias(&self) -> &::std::option::Option<::std::string::String> {
        &self.image_owner_alias
    }
    /// <p>The name of the AMI that was provided during image creation.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the AMI that was provided during image creation.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the AMI that was provided during image creation.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The device name of the root device volume (for example, <code>/dev/sda1</code>).</p>
    pub fn root_device_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.root_device_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The device name of the root device volume (for example, <code>/dev/sda1</code>).</p>
    pub fn set_root_device_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.root_device_name = input;
        self
    }
    /// <p>The device name of the root device volume (for example, <code>/dev/sda1</code>).</p>
    pub fn get_root_device_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.root_device_name
    }
    /// <p>The type of root device used by the AMI. The AMI can use an Amazon EBS volume or an instance store volume.</p>
    pub fn root_device_type(mut self, input: crate::types::DeviceType) -> Self {
        self.root_device_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of root device used by the AMI. The AMI can use an Amazon EBS volume or an instance store volume.</p>
    pub fn set_root_device_type(mut self, input: ::std::option::Option<crate::types::DeviceType>) -> Self {
        self.root_device_type = input;
        self
    }
    /// <p>The type of root device used by the AMI. The AMI can use an Amazon EBS volume or an instance store volume.</p>
    pub fn get_root_device_type(&self) -> &::std::option::Option<crate::types::DeviceType> {
        &self.root_device_type
    }
    /// <p>Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.</p>
    pub fn sriov_net_support(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.sriov_net_support = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.</p>
    pub fn set_sriov_net_support(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.sriov_net_support = input;
        self
    }
    /// <p>Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.</p>
    pub fn get_sriov_net_support(&self) -> &::std::option::Option<::std::string::String> {
        &self.sriov_net_support
    }
    /// <p>The reason for the state change.</p>
    pub fn state_reason(mut self, input: crate::types::StateReason) -> Self {
        self.state_reason = ::std::option::Option::Some(input);
        self
    }
    /// <p>The reason for the state change.</p>
    pub fn set_state_reason(mut self, input: ::std::option::Option<crate::types::StateReason>) -> Self {
        self.state_reason = input;
        self
    }
    /// <p>The reason for the state change.</p>
    pub fn get_state_reason(&self) -> &::std::option::Option<crate::types::StateReason> {
        &self.state_reason
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Any tags assigned to the image.</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>Any tags assigned to the image.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>Any tags assigned to the image.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// <p>The type of virtualization of the AMI.</p>
    pub fn virtualization_type(mut self, input: crate::types::VirtualizationType) -> Self {
        self.virtualization_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of virtualization of the AMI.</p>
    pub fn set_virtualization_type(mut self, input: ::std::option::Option<crate::types::VirtualizationType>) -> Self {
        self.virtualization_type = input;
        self
    }
    /// <p>The type of virtualization of the AMI.</p>
    pub fn get_virtualization_type(&self) -> &::std::option::Option<crate::types::VirtualizationType> {
        &self.virtualization_type
    }
    /// <p>The boot mode of the image. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html">Instance launch behavior with Amazon EC2 boot modes</a> in the <i>Amazon EC2 User Guide</i>.</p>
    pub fn boot_mode(mut self, input: crate::types::BootModeValues) -> Self {
        self.boot_mode = ::std::option::Option::Some(input);
        self
    }
    /// <p>The boot mode of the image. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html">Instance launch behavior with Amazon EC2 boot modes</a> in the <i>Amazon EC2 User Guide</i>.</p>
    pub fn set_boot_mode(mut self, input: ::std::option::Option<crate::types::BootModeValues>) -> Self {
        self.boot_mode = input;
        self
    }
    /// <p>The boot mode of the image. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html">Instance launch behavior with Amazon EC2 boot modes</a> in the <i>Amazon EC2 User Guide</i>.</p>
    pub fn get_boot_mode(&self) -> &::std::option::Option<crate::types::BootModeValues> {
        &self.boot_mode
    }
    /// <p>If the image is configured for NitroTPM support, the value is <code>v2.0</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitrotpm.html">NitroTPM</a> in the <i>Amazon EC2 User Guide</i>.</p>
    pub fn tpm_support(mut self, input: crate::types::TpmSupportValues) -> Self {
        self.tpm_support = ::std::option::Option::Some(input);
        self
    }
    /// <p>If the image is configured for NitroTPM support, the value is <code>v2.0</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitrotpm.html">NitroTPM</a> in the <i>Amazon EC2 User Guide</i>.</p>
    pub fn set_tpm_support(mut self, input: ::std::option::Option<crate::types::TpmSupportValues>) -> Self {
        self.tpm_support = input;
        self
    }
    /// <p>If the image is configured for NitroTPM support, the value is <code>v2.0</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitrotpm.html">NitroTPM</a> in the <i>Amazon EC2 User Guide</i>.</p>
    pub fn get_tpm_support(&self) -> &::std::option::Option<crate::types::TpmSupportValues> {
        &self.tpm_support
    }
    /// <p>The date and time to deprecate the AMI, in UTC, in the following format: <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z. If you specified a value for seconds, Amazon EC2 rounds the seconds to the nearest minute.</p>
    pub fn deprecation_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.deprecation_time = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The date and time to deprecate the AMI, in UTC, in the following format: <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z. If you specified a value for seconds, Amazon EC2 rounds the seconds to the nearest minute.</p>
    pub fn set_deprecation_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.deprecation_time = input;
        self
    }
    /// <p>The date and time to deprecate the AMI, in UTC, in the following format: <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z. If you specified a value for seconds, Amazon EC2 rounds the seconds to the nearest minute.</p>
    pub fn get_deprecation_time(&self) -> &::std::option::Option<::std::string::String> {
        &self.deprecation_time
    }
    /// <p>If <code>v2.0</code>, it indicates that IMDSv2 is specified in the AMI. Instances launched from this AMI will have <code>HttpTokens</code> automatically set to <code>required</code> so that, by default, the instance requires that IMDSv2 is used when requesting instance metadata. In addition, <code>HttpPutResponseHopLimit</code> is set to <code>2</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration">Configure the AMI</a> in the <i>Amazon EC2 User Guide</i>.</p>
    pub fn imds_support(mut self, input: crate::types::ImdsSupportValues) -> Self {
        self.imds_support = ::std::option::Option::Some(input);
        self
    }
    /// <p>If <code>v2.0</code>, it indicates that IMDSv2 is specified in the AMI. Instances launched from this AMI will have <code>HttpTokens</code> automatically set to <code>required</code> so that, by default, the instance requires that IMDSv2 is used when requesting instance metadata. In addition, <code>HttpPutResponseHopLimit</code> is set to <code>2</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration">Configure the AMI</a> in the <i>Amazon EC2 User Guide</i>.</p>
    pub fn set_imds_support(mut self, input: ::std::option::Option<crate::types::ImdsSupportValues>) -> Self {
        self.imds_support = input;
        self
    }
    /// <p>If <code>v2.0</code>, it indicates that IMDSv2 is specified in the AMI. Instances launched from this AMI will have <code>HttpTokens</code> automatically set to <code>required</code> so that, by default, the instance requires that IMDSv2 is used when requesting instance metadata. In addition, <code>HttpPutResponseHopLimit</code> is set to <code>2</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration">Configure the AMI</a> in the <i>Amazon EC2 User Guide</i>.</p>
    pub fn get_imds_support(&self) -> &::std::option::Option<crate::types::ImdsSupportValues> {
        &self.imds_support
    }
    /// <p>The ID of the instance that the AMI was created from if the AMI was created using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage.html">CreateImage</a>. This field only appears if the AMI was created using CreateImage.</p>
    pub fn source_instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.source_instance_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the instance that the AMI was created from if the AMI was created using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage.html">CreateImage</a>. This field only appears if the AMI was created using CreateImage.</p>
    pub fn set_source_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.source_instance_id = input;
        self
    }
    /// <p>The ID of the instance that the AMI was created from if the AMI was created using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage.html">CreateImage</a>. This field only appears if the AMI was created using CreateImage.</p>
    pub fn get_source_instance_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.source_instance_id
    }
    /// <p>Indicates whether deregistration protection is enabled for the AMI.</p>
    pub fn deregistration_protection(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.deregistration_protection = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Indicates whether deregistration protection is enabled for the AMI.</p>
    pub fn set_deregistration_protection(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.deregistration_protection = input;
        self
    }
    /// <p>Indicates whether deregistration protection is enabled for the AMI.</p>
    pub fn get_deregistration_protection(&self) -> &::std::option::Option<::std::string::String> {
        &self.deregistration_protection
    }
    /// <p>The date and time, in <a href="http://www.iso.org/iso/iso8601">ISO 8601 date-time format</a>, when the AMI was last used to launch an EC2 instance. When the AMI is used to launch an instance, there is a 24-hour delay before that usage is reported.</p><note>
    /// <p><code>lastLaunchedTime</code> data is available starting April 2017.</p>
    /// </note>
    pub fn last_launched_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.last_launched_time = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The date and time, in <a href="http://www.iso.org/iso/iso8601">ISO 8601 date-time format</a>, when the AMI was last used to launch an EC2 instance. When the AMI is used to launch an instance, there is a 24-hour delay before that usage is reported.</p><note>
    /// <p><code>lastLaunchedTime</code> data is available starting April 2017.</p>
    /// </note>
    pub fn set_last_launched_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.last_launched_time = input;
        self
    }
    /// <p>The date and time, in <a href="http://www.iso.org/iso/iso8601">ISO 8601 date-time format</a>, when the AMI was last used to launch an EC2 instance. When the AMI is used to launch an instance, there is a 24-hour delay before that usage is reported.</p><note>
    /// <p><code>lastLaunchedTime</code> data is available starting April 2017.</p>
    /// </note>
    pub fn get_last_launched_time(&self) -> &::std::option::Option<::std::string::String> {
        &self.last_launched_time
    }
    /// <p>If <code>true</code>, the AMI satisfies the criteria for Allowed AMIs and can be discovered and used in the account. If <code>false</code> and Allowed AMIs is set to <code>enabled</code>, the AMI can't be discovered or used in the account. If <code>false</code> and Allowed AMIs is set to <code>audit-mode</code>, the AMI can be discovered and used in the account.</p>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-allowed-amis.html">Control the discovery and use of AMIs in Amazon EC2 with Allowed AMIs</a> in <i>Amazon EC2 User Guide</i>.</p>
    pub fn image_allowed(mut self, input: bool) -> Self {
        self.image_allowed = ::std::option::Option::Some(input);
        self
    }
    /// <p>If <code>true</code>, the AMI satisfies the criteria for Allowed AMIs and can be discovered and used in the account. If <code>false</code> and Allowed AMIs is set to <code>enabled</code>, the AMI can't be discovered or used in the account. If <code>false</code> and Allowed AMIs is set to <code>audit-mode</code>, the AMI can be discovered and used in the account.</p>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-allowed-amis.html">Control the discovery and use of AMIs in Amazon EC2 with Allowed AMIs</a> in <i>Amazon EC2 User Guide</i>.</p>
    pub fn set_image_allowed(mut self, input: ::std::option::Option<bool>) -> Self {
        self.image_allowed = input;
        self
    }
    /// <p>If <code>true</code>, the AMI satisfies the criteria for Allowed AMIs and can be discovered and used in the account. If <code>false</code> and Allowed AMIs is set to <code>enabled</code>, the AMI can't be discovered or used in the account. If <code>false</code> and Allowed AMIs is set to <code>audit-mode</code>, the AMI can be discovered and used in the account.</p>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-allowed-amis.html">Control the discovery and use of AMIs in Amazon EC2 with Allowed AMIs</a> in <i>Amazon EC2 User Guide</i>.</p>
    pub fn get_image_allowed(&self) -> &::std::option::Option<bool> {
        &self.image_allowed
    }
    /// <p>The ID of the source AMI from which the AMI was created.</p>
    pub fn source_image_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.source_image_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the source AMI from which the AMI was created.</p>
    pub fn set_source_image_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.source_image_id = input;
        self
    }
    /// <p>The ID of the source AMI from which the AMI was created.</p>
    pub fn get_source_image_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.source_image_id
    }
    /// <p>The Region of the source AMI.</p>
    pub fn source_image_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.source_image_region = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Region of the source AMI.</p>
    pub fn set_source_image_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.source_image_region = input;
        self
    }
    /// <p>The Region of the source AMI.</p>
    pub fn get_source_image_region(&self) -> &::std::option::Option<::std::string::String> {
        &self.source_image_region
    }
    /// <p>Indicates whether the image is eligible for Amazon Web Services Free Tier.</p>
    /// <ul>
    /// <li>
    /// <p>If <code>true</code>, the AMI is eligible for Free Tier and can be used to launch instances under the Free Tier limits.</p></li>
    /// <li>
    /// <p>If <code>false</code>, the AMI is not eligible for Free Tier.</p></li>
    /// </ul>
    pub fn free_tier_eligible(mut self, input: bool) -> Self {
        self.free_tier_eligible = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates whether the image is eligible for Amazon Web Services Free Tier.</p>
    /// <ul>
    /// <li>
    /// <p>If <code>true</code>, the AMI is eligible for Free Tier and can be used to launch instances under the Free Tier limits.</p></li>
    /// <li>
    /// <p>If <code>false</code>, the AMI is not eligible for Free Tier.</p></li>
    /// </ul>
    pub fn set_free_tier_eligible(mut self, input: ::std::option::Option<bool>) -> Self {
        self.free_tier_eligible = input;
        self
    }
    /// <p>Indicates whether the image is eligible for Amazon Web Services Free Tier.</p>
    /// <ul>
    /// <li>
    /// <p>If <code>true</code>, the AMI is eligible for Free Tier and can be used to launch instances under the Free Tier limits.</p></li>
    /// <li>
    /// <p>If <code>false</code>, the AMI is not eligible for Free Tier.</p></li>
    /// </ul>
    pub fn get_free_tier_eligible(&self) -> &::std::option::Option<bool> {
        &self.free_tier_eligible
    }
    /// <p>The ID of the AMI.</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 ID of the AMI.</p>
    pub fn set_image_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.image_id = input;
        self
    }
    /// <p>The ID of the AMI.</p>
    pub fn get_image_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.image_id
    }
    /// <p>The location of the AMI.</p>
    pub fn image_location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.image_location = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The location of the AMI.</p>
    pub fn set_image_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.image_location = input;
        self
    }
    /// <p>The location of the AMI.</p>
    pub fn get_image_location(&self) -> &::std::option::Option<::std::string::String> {
        &self.image_location
    }
    /// <p>The current state of the AMI. If the state is <code>available</code>, the image is successfully registered and can be used to launch an instance.</p>
    pub fn state(mut self, input: crate::types::ImageState) -> Self {
        self.state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current state of the AMI. If the state is <code>available</code>, the image is successfully registered and can be used to launch an instance.</p>
    pub fn set_state(mut self, input: ::std::option::Option<crate::types::ImageState>) -> Self {
        self.state = input;
        self
    }
    /// <p>The current state of the AMI. If the state is <code>available</code>, the image is successfully registered and can be used to launch an instance.</p>
    pub fn get_state(&self) -> &::std::option::Option<crate::types::ImageState> {
        &self.state
    }
    /// <p>The ID of the Amazon Web Services account that owns the image.</p>
    pub fn owner_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.owner_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the Amazon Web Services account that owns the image.</p>
    pub fn set_owner_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.owner_id = input;
        self
    }
    /// <p>The ID of the Amazon Web Services account that owns the image.</p>
    pub fn get_owner_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.owner_id
    }
    /// <p>The date and time the image was created.</p>
    pub fn creation_date(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.creation_date = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The date and time the image was created.</p>
    pub fn set_creation_date(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.creation_date = input;
        self
    }
    /// <p>The date and time the image was created.</p>
    pub fn get_creation_date(&self) -> &::std::option::Option<::std::string::String> {
        &self.creation_date
    }
    /// <p>Indicates whether the image has public launch permissions. The value is <code>true</code> if this image has public launch permissions or <code>false</code> if it has only implicit and explicit launch permissions.</p>
    pub fn public(mut self, input: bool) -> Self {
        self.public = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates whether the image has public launch permissions. The value is <code>true</code> if this image has public launch permissions or <code>false</code> if it has only implicit and explicit launch permissions.</p>
    pub fn set_public(mut self, input: ::std::option::Option<bool>) -> Self {
        self.public = input;
        self
    }
    /// <p>Indicates whether the image has public launch permissions. The value is <code>true</code> if this image has public launch permissions or <code>false</code> if it has only implicit and explicit launch permissions.</p>
    pub fn get_public(&self) -> &::std::option::Option<bool> {
        &self.public
    }
    /// Appends an item to `product_codes`.
    ///
    /// To override the contents of this collection use [`set_product_codes`](Self::set_product_codes).
    ///
    /// <p>Any product codes associated with the AMI.</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>Any product codes associated with the AMI.</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>Any product codes associated with the AMI.</p>
    pub fn get_product_codes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ProductCode>> {
        &self.product_codes
    }
    /// <p>The architecture of the image.</p>
    pub fn architecture(mut self, input: crate::types::ArchitectureValues) -> Self {
        self.architecture = ::std::option::Option::Some(input);
        self
    }
    /// <p>The architecture of the image.</p>
    pub fn set_architecture(mut self, input: ::std::option::Option<crate::types::ArchitectureValues>) -> Self {
        self.architecture = input;
        self
    }
    /// <p>The architecture of the image.</p>
    pub fn get_architecture(&self) -> &::std::option::Option<crate::types::ArchitectureValues> {
        &self.architecture
    }
    /// <p>The type of image.</p>
    pub fn image_type(mut self, input: crate::types::ImageTypeValues) -> Self {
        self.image_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of image.</p>
    pub fn set_image_type(mut self, input: ::std::option::Option<crate::types::ImageTypeValues>) -> Self {
        self.image_type = input;
        self
    }
    /// <p>The type of image.</p>
    pub fn get_image_type(&self) -> &::std::option::Option<crate::types::ImageTypeValues> {
        &self.image_type
    }
    /// <p>The kernel associated with the image, if any. Only applicable for machine images.</p>
    pub fn kernel_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.kernel_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The kernel associated with the image, if any. Only applicable for machine images.</p>
    pub fn set_kernel_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.kernel_id = input;
        self
    }
    /// <p>The kernel associated with the image, if any. Only applicable for machine images.</p>
    pub fn get_kernel_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.kernel_id
    }
    /// <p>The RAM disk associated with the image, if any. Only applicable for machine images.</p>
    pub fn ramdisk_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.ramdisk_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The RAM disk associated with the image, if any. Only applicable for machine images.</p>
    pub fn set_ramdisk_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.ramdisk_id = input;
        self
    }
    /// <p>The RAM disk associated with the image, if any. Only applicable for machine images.</p>
    pub fn get_ramdisk_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.ramdisk_id
    }
    /// <p>This value is set to <code>windows</code> for Windows AMIs; otherwise, it is blank.</p>
    pub fn platform(mut self, input: crate::types::PlatformValues) -> Self {
        self.platform = ::std::option::Option::Some(input);
        self
    }
    /// <p>This value is set to <code>windows</code> for Windows AMIs; otherwise, it is blank.</p>
    pub fn set_platform(mut self, input: ::std::option::Option<crate::types::PlatformValues>) -> Self {
        self.platform = input;
        self
    }
    /// <p>This value is set to <code>windows</code> for Windows AMIs; otherwise, it is blank.</p>
    pub fn get_platform(&self) -> &::std::option::Option<crate::types::PlatformValues> {
        &self.platform
    }
    /// Consumes the builder and constructs a [`Image`](crate::types::Image).
    pub fn build(self) -> crate::types::Image {
        crate::types::Image {
            platform_details: self.platform_details,
            usage_operation: self.usage_operation,
            block_device_mappings: self.block_device_mappings,
            description: self.description,
            ena_support: self.ena_support,
            hypervisor: self.hypervisor,
            image_owner_alias: self.image_owner_alias,
            name: self.name,
            root_device_name: self.root_device_name,
            root_device_type: self.root_device_type,
            sriov_net_support: self.sriov_net_support,
            state_reason: self.state_reason,
            tags: self.tags,
            virtualization_type: self.virtualization_type,
            boot_mode: self.boot_mode,
            tpm_support: self.tpm_support,
            deprecation_time: self.deprecation_time,
            imds_support: self.imds_support,
            source_instance_id: self.source_instance_id,
            deregistration_protection: self.deregistration_protection,
            last_launched_time: self.last_launched_time,
            image_allowed: self.image_allowed,
            source_image_id: self.source_image_id,
            source_image_region: self.source_image_region,
            free_tier_eligible: self.free_tier_eligible,
            image_id: self.image_id,
            image_location: self.image_location,
            state: self.state,
            owner_id: self.owner_id,
            creation_date: self.creation_date,
            public: self.public,
            product_codes: self.product_codes,
            architecture: self.architecture,
            image_type: self.image_type,
            kernel_id: self.kernel_id,
            ramdisk_id: self.ramdisk_id,
            platform: self.platform,
        }
    }
}