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
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Specifies the configuration of a lifecycle policy.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PolicyDetails {
    /// <p>The valid target resource types and actions a policy can manage. Specify <code>EBS_SNAPSHOT_MANAGEMENT</code> to create a lifecycle policy that manages the lifecycle of Amazon EBS snapshots. Specify <code>IMAGE_MANAGEMENT</code> to create a lifecycle policy that manages the lifecycle of EBS-backed AMIs. Specify <code>EVENT_BASED_POLICY </code> to create an event-based policy that performs specific actions when a defined event occurs in your Amazon Web Services account.</p>
    /// <p>The default is <code>EBS_SNAPSHOT_MANAGEMENT</code>.</p>
    pub policy_type: std::option::Option<crate::model::PolicyTypeValues>,
    /// <p>The target resource type for snapshot and AMI lifecycle policies. Use <code>VOLUME </code>to create snapshots of individual volumes or use <code>INSTANCE</code> to create multi-volume snapshots from the volumes for an instance.</p>
    /// <p>This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter.</p>
    pub resource_types: std::option::Option<std::vec::Vec<crate::model::ResourceTypeValues>>,
    /// <p>The location of the resources to backup. If the source resources are located in an Amazon Web Services Region, specify <code>CLOUD</code>. If the source resources are located on an Outpost in your account, specify <code>OUTPOST</code>. </p>
    /// <p>If you specify <code>OUTPOST</code>, Amazon Data Lifecycle Manager backs up all resources of the specified type with matching target tags across all of the Outposts in your account.</p>
    pub resource_locations:
        std::option::Option<std::vec::Vec<crate::model::ResourceLocationValues>>,
    /// <p>The single tag that identifies targeted resources for this policy.</p>
    /// <p>This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter.</p>
    pub target_tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
    /// <p>The schedules of policy-defined actions for snapshot and AMI lifecycle policies. A policy can have up to four schedules—one mandatory schedule and up to three optional schedules.</p>
    /// <p>This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter.</p>
    pub schedules: std::option::Option<std::vec::Vec<crate::model::Schedule>>,
    /// <p>A set of optional parameters for snapshot and AMI lifecycle policies. </p>
    /// <p>This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter.</p>
    pub parameters: std::option::Option<crate::model::Parameters>,
    /// <p>The event that triggers the event-based policy. </p>
    /// <p>This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter.</p>
    pub event_source: std::option::Option<crate::model::EventSource>,
    /// <p>The actions to be performed when the event-based policy is triggered. You can specify only one action per policy.</p>
    /// <p>This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter.</p>
    pub actions: std::option::Option<std::vec::Vec<crate::model::Action>>,
}
impl PolicyDetails {
    /// <p>The valid target resource types and actions a policy can manage. Specify <code>EBS_SNAPSHOT_MANAGEMENT</code> to create a lifecycle policy that manages the lifecycle of Amazon EBS snapshots. Specify <code>IMAGE_MANAGEMENT</code> to create a lifecycle policy that manages the lifecycle of EBS-backed AMIs. Specify <code>EVENT_BASED_POLICY </code> to create an event-based policy that performs specific actions when a defined event occurs in your Amazon Web Services account.</p>
    /// <p>The default is <code>EBS_SNAPSHOT_MANAGEMENT</code>.</p>
    pub fn policy_type(&self) -> std::option::Option<&crate::model::PolicyTypeValues> {
        self.policy_type.as_ref()
    }
    /// <p>The target resource type for snapshot and AMI lifecycle policies. Use <code>VOLUME </code>to create snapshots of individual volumes or use <code>INSTANCE</code> to create multi-volume snapshots from the volumes for an instance.</p>
    /// <p>This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter.</p>
    pub fn resource_types(&self) -> std::option::Option<&[crate::model::ResourceTypeValues]> {
        self.resource_types.as_deref()
    }
    /// <p>The location of the resources to backup. If the source resources are located in an Amazon Web Services Region, specify <code>CLOUD</code>. If the source resources are located on an Outpost in your account, specify <code>OUTPOST</code>. </p>
    /// <p>If you specify <code>OUTPOST</code>, Amazon Data Lifecycle Manager backs up all resources of the specified type with matching target tags across all of the Outposts in your account.</p>
    pub fn resource_locations(
        &self,
    ) -> std::option::Option<&[crate::model::ResourceLocationValues]> {
        self.resource_locations.as_deref()
    }
    /// <p>The single tag that identifies targeted resources for this policy.</p>
    /// <p>This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter.</p>
    pub fn target_tags(&self) -> std::option::Option<&[crate::model::Tag]> {
        self.target_tags.as_deref()
    }
    /// <p>The schedules of policy-defined actions for snapshot and AMI lifecycle policies. A policy can have up to four schedules—one mandatory schedule and up to three optional schedules.</p>
    /// <p>This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter.</p>
    pub fn schedules(&self) -> std::option::Option<&[crate::model::Schedule]> {
        self.schedules.as_deref()
    }
    /// <p>A set of optional parameters for snapshot and AMI lifecycle policies. </p>
    /// <p>This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter.</p>
    pub fn parameters(&self) -> std::option::Option<&crate::model::Parameters> {
        self.parameters.as_ref()
    }
    /// <p>The event that triggers the event-based policy. </p>
    /// <p>This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter.</p>
    pub fn event_source(&self) -> std::option::Option<&crate::model::EventSource> {
        self.event_source.as_ref()
    }
    /// <p>The actions to be performed when the event-based policy is triggered. You can specify only one action per policy.</p>
    /// <p>This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter.</p>
    pub fn actions(&self) -> std::option::Option<&[crate::model::Action]> {
        self.actions.as_deref()
    }
}
impl std::fmt::Debug for PolicyDetails {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("PolicyDetails");
        formatter.field("policy_type", &self.policy_type);
        formatter.field("resource_types", &self.resource_types);
        formatter.field("resource_locations", &self.resource_locations);
        formatter.field("target_tags", &self.target_tags);
        formatter.field("schedules", &self.schedules);
        formatter.field("parameters", &self.parameters);
        formatter.field("event_source", &self.event_source);
        formatter.field("actions", &self.actions);
        formatter.finish()
    }
}
/// See [`PolicyDetails`](crate::model::PolicyDetails)
pub mod policy_details {
    /// A builder for [`PolicyDetails`](crate::model::PolicyDetails)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) policy_type: std::option::Option<crate::model::PolicyTypeValues>,
        pub(crate) resource_types:
            std::option::Option<std::vec::Vec<crate::model::ResourceTypeValues>>,
        pub(crate) resource_locations:
            std::option::Option<std::vec::Vec<crate::model::ResourceLocationValues>>,
        pub(crate) target_tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
        pub(crate) schedules: std::option::Option<std::vec::Vec<crate::model::Schedule>>,
        pub(crate) parameters: std::option::Option<crate::model::Parameters>,
        pub(crate) event_source: std::option::Option<crate::model::EventSource>,
        pub(crate) actions: std::option::Option<std::vec::Vec<crate::model::Action>>,
    }
    impl Builder {
        /// <p>The valid target resource types and actions a policy can manage. Specify <code>EBS_SNAPSHOT_MANAGEMENT</code> to create a lifecycle policy that manages the lifecycle of Amazon EBS snapshots. Specify <code>IMAGE_MANAGEMENT</code> to create a lifecycle policy that manages the lifecycle of EBS-backed AMIs. Specify <code>EVENT_BASED_POLICY </code> to create an event-based policy that performs specific actions when a defined event occurs in your Amazon Web Services account.</p>
        /// <p>The default is <code>EBS_SNAPSHOT_MANAGEMENT</code>.</p>
        pub fn policy_type(mut self, input: crate::model::PolicyTypeValues) -> Self {
            self.policy_type = Some(input);
            self
        }
        /// <p>The valid target resource types and actions a policy can manage. Specify <code>EBS_SNAPSHOT_MANAGEMENT</code> to create a lifecycle policy that manages the lifecycle of Amazon EBS snapshots. Specify <code>IMAGE_MANAGEMENT</code> to create a lifecycle policy that manages the lifecycle of EBS-backed AMIs. Specify <code>EVENT_BASED_POLICY </code> to create an event-based policy that performs specific actions when a defined event occurs in your Amazon Web Services account.</p>
        /// <p>The default is <code>EBS_SNAPSHOT_MANAGEMENT</code>.</p>
        pub fn set_policy_type(
            mut self,
            input: std::option::Option<crate::model::PolicyTypeValues>,
        ) -> Self {
            self.policy_type = input;
            self
        }
        /// Appends an item to `resource_types`.
        ///
        /// To override the contents of this collection use [`set_resource_types`](Self::set_resource_types).
        ///
        /// <p>The target resource type for snapshot and AMI lifecycle policies. Use <code>VOLUME </code>to create snapshots of individual volumes or use <code>INSTANCE</code> to create multi-volume snapshots from the volumes for an instance.</p>
        /// <p>This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter.</p>
        pub fn resource_types(mut self, input: crate::model::ResourceTypeValues) -> Self {
            let mut v = self.resource_types.unwrap_or_default();
            v.push(input);
            self.resource_types = Some(v);
            self
        }
        /// <p>The target resource type for snapshot and AMI lifecycle policies. Use <code>VOLUME </code>to create snapshots of individual volumes or use <code>INSTANCE</code> to create multi-volume snapshots from the volumes for an instance.</p>
        /// <p>This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter.</p>
        pub fn set_resource_types(
            mut self,
            input: std::option::Option<std::vec::Vec<crate::model::ResourceTypeValues>>,
        ) -> Self {
            self.resource_types = input;
            self
        }
        /// Appends an item to `resource_locations`.
        ///
        /// To override the contents of this collection use [`set_resource_locations`](Self::set_resource_locations).
        ///
        /// <p>The location of the resources to backup. If the source resources are located in an Amazon Web Services Region, specify <code>CLOUD</code>. If the source resources are located on an Outpost in your account, specify <code>OUTPOST</code>. </p>
        /// <p>If you specify <code>OUTPOST</code>, Amazon Data Lifecycle Manager backs up all resources of the specified type with matching target tags across all of the Outposts in your account.</p>
        pub fn resource_locations(mut self, input: crate::model::ResourceLocationValues) -> Self {
            let mut v = self.resource_locations.unwrap_or_default();
            v.push(input);
            self.resource_locations = Some(v);
            self
        }
        /// <p>The location of the resources to backup. If the source resources are located in an Amazon Web Services Region, specify <code>CLOUD</code>. If the source resources are located on an Outpost in your account, specify <code>OUTPOST</code>. </p>
        /// <p>If you specify <code>OUTPOST</code>, Amazon Data Lifecycle Manager backs up all resources of the specified type with matching target tags across all of the Outposts in your account.</p>
        pub fn set_resource_locations(
            mut self,
            input: std::option::Option<std::vec::Vec<crate::model::ResourceLocationValues>>,
        ) -> Self {
            self.resource_locations = input;
            self
        }
        /// Appends an item to `target_tags`.
        ///
        /// To override the contents of this collection use [`set_target_tags`](Self::set_target_tags).
        ///
        /// <p>The single tag that identifies targeted resources for this policy.</p>
        /// <p>This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter.</p>
        pub fn target_tags(mut self, input: crate::model::Tag) -> Self {
            let mut v = self.target_tags.unwrap_or_default();
            v.push(input);
            self.target_tags = Some(v);
            self
        }
        /// <p>The single tag that identifies targeted resources for this policy.</p>
        /// <p>This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter.</p>
        pub fn set_target_tags(
            mut self,
            input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
        ) -> Self {
            self.target_tags = input;
            self
        }
        /// Appends an item to `schedules`.
        ///
        /// To override the contents of this collection use [`set_schedules`](Self::set_schedules).
        ///
        /// <p>The schedules of policy-defined actions for snapshot and AMI lifecycle policies. A policy can have up to four schedules—one mandatory schedule and up to three optional schedules.</p>
        /// <p>This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter.</p>
        pub fn schedules(mut self, input: crate::model::Schedule) -> Self {
            let mut v = self.schedules.unwrap_or_default();
            v.push(input);
            self.schedules = Some(v);
            self
        }
        /// <p>The schedules of policy-defined actions for snapshot and AMI lifecycle policies. A policy can have up to four schedules—one mandatory schedule and up to three optional schedules.</p>
        /// <p>This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter.</p>
        pub fn set_schedules(
            mut self,
            input: std::option::Option<std::vec::Vec<crate::model::Schedule>>,
        ) -> Self {
            self.schedules = input;
            self
        }
        /// <p>A set of optional parameters for snapshot and AMI lifecycle policies. </p>
        /// <p>This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter.</p>
        pub fn parameters(mut self, input: crate::model::Parameters) -> Self {
            self.parameters = Some(input);
            self
        }
        /// <p>A set of optional parameters for snapshot and AMI lifecycle policies. </p>
        /// <p>This parameter is required for snapshot and AMI policies only. If you are creating an event-based policy, omit this parameter.</p>
        pub fn set_parameters(
            mut self,
            input: std::option::Option<crate::model::Parameters>,
        ) -> Self {
            self.parameters = input;
            self
        }
        /// <p>The event that triggers the event-based policy. </p>
        /// <p>This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter.</p>
        pub fn event_source(mut self, input: crate::model::EventSource) -> Self {
            self.event_source = Some(input);
            self
        }
        /// <p>The event that triggers the event-based policy. </p>
        /// <p>This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter.</p>
        pub fn set_event_source(
            mut self,
            input: std::option::Option<crate::model::EventSource>,
        ) -> Self {
            self.event_source = input;
            self
        }
        /// Appends an item to `actions`.
        ///
        /// To override the contents of this collection use [`set_actions`](Self::set_actions).
        ///
        /// <p>The actions to be performed when the event-based policy is triggered. You can specify only one action per policy.</p>
        /// <p>This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter.</p>
        pub fn actions(mut self, input: crate::model::Action) -> Self {
            let mut v = self.actions.unwrap_or_default();
            v.push(input);
            self.actions = Some(v);
            self
        }
        /// <p>The actions to be performed when the event-based policy is triggered. You can specify only one action per policy.</p>
        /// <p>This parameter is required for event-based policies only. If you are creating a snapshot or AMI policy, omit this parameter.</p>
        pub fn set_actions(
            mut self,
            input: std::option::Option<std::vec::Vec<crate::model::Action>>,
        ) -> Self {
            self.actions = input;
            self
        }
        /// Consumes the builder and constructs a [`PolicyDetails`](crate::model::PolicyDetails)
        pub fn build(self) -> crate::model::PolicyDetails {
            crate::model::PolicyDetails {
                policy_type: self.policy_type,
                resource_types: self.resource_types,
                resource_locations: self.resource_locations,
                target_tags: self.target_tags,
                schedules: self.schedules,
                parameters: self.parameters,
                event_source: self.event_source,
                actions: self.actions,
            }
        }
    }
}
impl PolicyDetails {
    /// Creates a new builder-style object to manufacture [`PolicyDetails`](crate::model::PolicyDetails)
    pub fn builder() -> crate::model::policy_details::Builder {
        crate::model::policy_details::Builder::default()
    }
}

/// <p>Specifies an action for an event-based policy.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Action {
    /// <p>A descriptive name for the action.</p>
    pub name: std::option::Option<std::string::String>,
    /// <p>The rule for copying shared snapshots across Regions.</p>
    pub cross_region_copy: std::option::Option<std::vec::Vec<crate::model::CrossRegionCopyAction>>,
}
impl Action {
    /// <p>A descriptive name for the action.</p>
    pub fn name(&self) -> std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The rule for copying shared snapshots across Regions.</p>
    pub fn cross_region_copy(&self) -> std::option::Option<&[crate::model::CrossRegionCopyAction]> {
        self.cross_region_copy.as_deref()
    }
}
impl std::fmt::Debug for Action {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("Action");
        formatter.field("name", &self.name);
        formatter.field("cross_region_copy", &self.cross_region_copy);
        formatter.finish()
    }
}
/// See [`Action`](crate::model::Action)
pub mod action {
    /// A builder for [`Action`](crate::model::Action)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) name: std::option::Option<std::string::String>,
        pub(crate) cross_region_copy:
            std::option::Option<std::vec::Vec<crate::model::CrossRegionCopyAction>>,
    }
    impl Builder {
        /// <p>A descriptive name for the action.</p>
        pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
            self.name = Some(input.into());
            self
        }
        /// <p>A descriptive name for the action.</p>
        pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.name = input;
            self
        }
        /// Appends an item to `cross_region_copy`.
        ///
        /// To override the contents of this collection use [`set_cross_region_copy`](Self::set_cross_region_copy).
        ///
        /// <p>The rule for copying shared snapshots across Regions.</p>
        pub fn cross_region_copy(mut self, input: crate::model::CrossRegionCopyAction) -> Self {
            let mut v = self.cross_region_copy.unwrap_or_default();
            v.push(input);
            self.cross_region_copy = Some(v);
            self
        }
        /// <p>The rule for copying shared snapshots across Regions.</p>
        pub fn set_cross_region_copy(
            mut self,
            input: std::option::Option<std::vec::Vec<crate::model::CrossRegionCopyAction>>,
        ) -> Self {
            self.cross_region_copy = input;
            self
        }
        /// Consumes the builder and constructs a [`Action`](crate::model::Action)
        pub fn build(self) -> crate::model::Action {
            crate::model::Action {
                name: self.name,
                cross_region_copy: self.cross_region_copy,
            }
        }
    }
}
impl Action {
    /// Creates a new builder-style object to manufacture [`Action`](crate::model::Action)
    pub fn builder() -> crate::model::action::Builder {
        crate::model::action::Builder::default()
    }
}

/// <p>Specifies a rule for copying shared snapshots across Regions.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CrossRegionCopyAction {
    /// <p>The target Region.</p>
    pub target: std::option::Option<std::string::String>,
    /// <p>The encryption settings for the copied snapshot.</p>
    pub encryption_configuration: std::option::Option<crate::model::EncryptionConfiguration>,
    /// <p>Specifies the retention rule for cross-Region snapshot copies.</p>
    pub retain_rule: std::option::Option<crate::model::CrossRegionCopyRetainRule>,
}
impl CrossRegionCopyAction {
    /// <p>The target Region.</p>
    pub fn target(&self) -> std::option::Option<&str> {
        self.target.as_deref()
    }
    /// <p>The encryption settings for the copied snapshot.</p>
    pub fn encryption_configuration(
        &self,
    ) -> std::option::Option<&crate::model::EncryptionConfiguration> {
        self.encryption_configuration.as_ref()
    }
    /// <p>Specifies the retention rule for cross-Region snapshot copies.</p>
    pub fn retain_rule(&self) -> std::option::Option<&crate::model::CrossRegionCopyRetainRule> {
        self.retain_rule.as_ref()
    }
}
impl std::fmt::Debug for CrossRegionCopyAction {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("CrossRegionCopyAction");
        formatter.field("target", &self.target);
        formatter.field("encryption_configuration", &self.encryption_configuration);
        formatter.field("retain_rule", &self.retain_rule);
        formatter.finish()
    }
}
/// See [`CrossRegionCopyAction`](crate::model::CrossRegionCopyAction)
pub mod cross_region_copy_action {
    /// A builder for [`CrossRegionCopyAction`](crate::model::CrossRegionCopyAction)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) target: std::option::Option<std::string::String>,
        pub(crate) encryption_configuration:
            std::option::Option<crate::model::EncryptionConfiguration>,
        pub(crate) retain_rule: std::option::Option<crate::model::CrossRegionCopyRetainRule>,
    }
    impl Builder {
        /// <p>The target Region.</p>
        pub fn target(mut self, input: impl Into<std::string::String>) -> Self {
            self.target = Some(input.into());
            self
        }
        /// <p>The target Region.</p>
        pub fn set_target(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.target = input;
            self
        }
        /// <p>The encryption settings for the copied snapshot.</p>
        pub fn encryption_configuration(
            mut self,
            input: crate::model::EncryptionConfiguration,
        ) -> Self {
            self.encryption_configuration = Some(input);
            self
        }
        /// <p>The encryption settings for the copied snapshot.</p>
        pub fn set_encryption_configuration(
            mut self,
            input: std::option::Option<crate::model::EncryptionConfiguration>,
        ) -> Self {
            self.encryption_configuration = input;
            self
        }
        /// <p>Specifies the retention rule for cross-Region snapshot copies.</p>
        pub fn retain_rule(mut self, input: crate::model::CrossRegionCopyRetainRule) -> Self {
            self.retain_rule = Some(input);
            self
        }
        /// <p>Specifies the retention rule for cross-Region snapshot copies.</p>
        pub fn set_retain_rule(
            mut self,
            input: std::option::Option<crate::model::CrossRegionCopyRetainRule>,
        ) -> Self {
            self.retain_rule = input;
            self
        }
        /// Consumes the builder and constructs a [`CrossRegionCopyAction`](crate::model::CrossRegionCopyAction)
        pub fn build(self) -> crate::model::CrossRegionCopyAction {
            crate::model::CrossRegionCopyAction {
                target: self.target,
                encryption_configuration: self.encryption_configuration,
                retain_rule: self.retain_rule,
            }
        }
    }
}
impl CrossRegionCopyAction {
    /// Creates a new builder-style object to manufacture [`CrossRegionCopyAction`](crate::model::CrossRegionCopyAction)
    pub fn builder() -> crate::model::cross_region_copy_action::Builder {
        crate::model::cross_region_copy_action::Builder::default()
    }
}

/// <p>Specifies the retention rule for cross-Region snapshot copies.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CrossRegionCopyRetainRule {
    /// <p>The amount of time to retain each snapshot. The maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.</p>
    pub interval: i32,
    /// <p>The unit of time for time-based retention.</p>
    pub interval_unit: std::option::Option<crate::model::RetentionIntervalUnitValues>,
}
impl CrossRegionCopyRetainRule {
    /// <p>The amount of time to retain each snapshot. The maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.</p>
    pub fn interval(&self) -> i32 {
        self.interval
    }
    /// <p>The unit of time for time-based retention.</p>
    pub fn interval_unit(&self) -> std::option::Option<&crate::model::RetentionIntervalUnitValues> {
        self.interval_unit.as_ref()
    }
}
impl std::fmt::Debug for CrossRegionCopyRetainRule {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("CrossRegionCopyRetainRule");
        formatter.field("interval", &self.interval);
        formatter.field("interval_unit", &self.interval_unit);
        formatter.finish()
    }
}
/// See [`CrossRegionCopyRetainRule`](crate::model::CrossRegionCopyRetainRule)
pub mod cross_region_copy_retain_rule {
    /// A builder for [`CrossRegionCopyRetainRule`](crate::model::CrossRegionCopyRetainRule)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) interval: std::option::Option<i32>,
        pub(crate) interval_unit: std::option::Option<crate::model::RetentionIntervalUnitValues>,
    }
    impl Builder {
        /// <p>The amount of time to retain each snapshot. The maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.</p>
        pub fn interval(mut self, input: i32) -> Self {
            self.interval = Some(input);
            self
        }
        /// <p>The amount of time to retain each snapshot. The maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.</p>
        pub fn set_interval(mut self, input: std::option::Option<i32>) -> Self {
            self.interval = input;
            self
        }
        /// <p>The unit of time for time-based retention.</p>
        pub fn interval_unit(mut self, input: crate::model::RetentionIntervalUnitValues) -> Self {
            self.interval_unit = Some(input);
            self
        }
        /// <p>The unit of time for time-based retention.</p>
        pub fn set_interval_unit(
            mut self,
            input: std::option::Option<crate::model::RetentionIntervalUnitValues>,
        ) -> Self {
            self.interval_unit = input;
            self
        }
        /// Consumes the builder and constructs a [`CrossRegionCopyRetainRule`](crate::model::CrossRegionCopyRetainRule)
        pub fn build(self) -> crate::model::CrossRegionCopyRetainRule {
            crate::model::CrossRegionCopyRetainRule {
                interval: self.interval.unwrap_or_default(),
                interval_unit: self.interval_unit,
            }
        }
    }
}
impl CrossRegionCopyRetainRule {
    /// Creates a new builder-style object to manufacture [`CrossRegionCopyRetainRule`](crate::model::CrossRegionCopyRetainRule)
    pub fn builder() -> crate::model::cross_region_copy_retain_rule::Builder {
        crate::model::cross_region_copy_retain_rule::Builder::default()
    }
}

#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
    std::clone::Clone,
    std::cmp::Eq,
    std::cmp::Ord,
    std::cmp::PartialEq,
    std::cmp::PartialOrd,
    std::fmt::Debug,
    std::hash::Hash,
)]
pub enum RetentionIntervalUnitValues {
    #[allow(missing_docs)] // documentation missing in model
    Days,
    #[allow(missing_docs)] // documentation missing in model
    Months,
    #[allow(missing_docs)] // documentation missing in model
    Weeks,
    #[allow(missing_docs)] // documentation missing in model
    Years,
    /// Unknown contains new variants that have been added since this code was generated.
    Unknown(String),
}
impl std::convert::From<&str> for RetentionIntervalUnitValues {
    fn from(s: &str) -> Self {
        match s {
            "DAYS" => RetentionIntervalUnitValues::Days,
            "MONTHS" => RetentionIntervalUnitValues::Months,
            "WEEKS" => RetentionIntervalUnitValues::Weeks,
            "YEARS" => RetentionIntervalUnitValues::Years,
            other => RetentionIntervalUnitValues::Unknown(other.to_owned()),
        }
    }
}
impl std::str::FromStr for RetentionIntervalUnitValues {
    type Err = std::convert::Infallible;

    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
        Ok(RetentionIntervalUnitValues::from(s))
    }
}
impl RetentionIntervalUnitValues {
    /// Returns the `&str` value of the enum member.
    pub fn as_str(&self) -> &str {
        match self {
            RetentionIntervalUnitValues::Days => "DAYS",
            RetentionIntervalUnitValues::Months => "MONTHS",
            RetentionIntervalUnitValues::Weeks => "WEEKS",
            RetentionIntervalUnitValues::Years => "YEARS",
            RetentionIntervalUnitValues::Unknown(s) => s.as_ref(),
        }
    }
    /// Returns all the `&str` values of the enum members.
    pub fn values() -> &'static [&'static str] {
        &["DAYS", "MONTHS", "WEEKS", "YEARS"]
    }
}
impl AsRef<str> for RetentionIntervalUnitValues {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

/// <p>Specifies the encryption settings for shared snapshots that are copied across Regions.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct EncryptionConfiguration {
    /// <p>To encrypt a copy of an unencrypted snapshot when encryption by default is not enabled, enable encryption using this parameter. Copies of encrypted snapshots are encrypted, even if this parameter is false or when encryption by default is not enabled.</p>
    pub encrypted: std::option::Option<bool>,
    /// <p>The Amazon Resource Name (ARN) of the KMS key to use for EBS encryption. If this parameter is not specified, the default KMS key for the account is used.</p>
    pub cmk_arn: std::option::Option<std::string::String>,
}
impl EncryptionConfiguration {
    /// <p>To encrypt a copy of an unencrypted snapshot when encryption by default is not enabled, enable encryption using this parameter. Copies of encrypted snapshots are encrypted, even if this parameter is false or when encryption by default is not enabled.</p>
    pub fn encrypted(&self) -> std::option::Option<bool> {
        self.encrypted
    }
    /// <p>The Amazon Resource Name (ARN) of the KMS key to use for EBS encryption. If this parameter is not specified, the default KMS key for the account is used.</p>
    pub fn cmk_arn(&self) -> std::option::Option<&str> {
        self.cmk_arn.as_deref()
    }
}
impl std::fmt::Debug for EncryptionConfiguration {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("EncryptionConfiguration");
        formatter.field("encrypted", &self.encrypted);
        formatter.field("cmk_arn", &self.cmk_arn);
        formatter.finish()
    }
}
/// See [`EncryptionConfiguration`](crate::model::EncryptionConfiguration)
pub mod encryption_configuration {
    /// A builder for [`EncryptionConfiguration`](crate::model::EncryptionConfiguration)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) encrypted: std::option::Option<bool>,
        pub(crate) cmk_arn: std::option::Option<std::string::String>,
    }
    impl Builder {
        /// <p>To encrypt a copy of an unencrypted snapshot when encryption by default is not enabled, enable encryption using this parameter. Copies of encrypted snapshots are encrypted, even if this parameter is false or when encryption by default is not enabled.</p>
        pub fn encrypted(mut self, input: bool) -> Self {
            self.encrypted = Some(input);
            self
        }
        /// <p>To encrypt a copy of an unencrypted snapshot when encryption by default is not enabled, enable encryption using this parameter. Copies of encrypted snapshots are encrypted, even if this parameter is false or when encryption by default is not enabled.</p>
        pub fn set_encrypted(mut self, input: std::option::Option<bool>) -> Self {
            self.encrypted = input;
            self
        }
        /// <p>The Amazon Resource Name (ARN) of the KMS key to use for EBS encryption. If this parameter is not specified, the default KMS key for the account is used.</p>
        pub fn cmk_arn(mut self, input: impl Into<std::string::String>) -> Self {
            self.cmk_arn = Some(input.into());
            self
        }
        /// <p>The Amazon Resource Name (ARN) of the KMS key to use for EBS encryption. If this parameter is not specified, the default KMS key for the account is used.</p>
        pub fn set_cmk_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.cmk_arn = input;
            self
        }
        /// Consumes the builder and constructs a [`EncryptionConfiguration`](crate::model::EncryptionConfiguration)
        pub fn build(self) -> crate::model::EncryptionConfiguration {
            crate::model::EncryptionConfiguration {
                encrypted: self.encrypted,
                cmk_arn: self.cmk_arn,
            }
        }
    }
}
impl EncryptionConfiguration {
    /// Creates a new builder-style object to manufacture [`EncryptionConfiguration`](crate::model::EncryptionConfiguration)
    pub fn builder() -> crate::model::encryption_configuration::Builder {
        crate::model::encryption_configuration::Builder::default()
    }
}

/// <p>Specifies an event that triggers an event-based policy.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct EventSource {
    /// <p>The source of the event. Currently only managed CloudWatch Events rules are supported.</p>
    pub r#type: std::option::Option<crate::model::EventSourceValues>,
    /// <p>Information about the event.</p>
    pub parameters: std::option::Option<crate::model::EventParameters>,
}
impl EventSource {
    /// <p>The source of the event. Currently only managed CloudWatch Events rules are supported.</p>
    pub fn r#type(&self) -> std::option::Option<&crate::model::EventSourceValues> {
        self.r#type.as_ref()
    }
    /// <p>Information about the event.</p>
    pub fn parameters(&self) -> std::option::Option<&crate::model::EventParameters> {
        self.parameters.as_ref()
    }
}
impl std::fmt::Debug for EventSource {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("EventSource");
        formatter.field("r#type", &self.r#type);
        formatter.field("parameters", &self.parameters);
        formatter.finish()
    }
}
/// See [`EventSource`](crate::model::EventSource)
pub mod event_source {
    /// A builder for [`EventSource`](crate::model::EventSource)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) r#type: std::option::Option<crate::model::EventSourceValues>,
        pub(crate) parameters: std::option::Option<crate::model::EventParameters>,
    }
    impl Builder {
        /// <p>The source of the event. Currently only managed CloudWatch Events rules are supported.</p>
        pub fn r#type(mut self, input: crate::model::EventSourceValues) -> Self {
            self.r#type = Some(input);
            self
        }
        /// <p>The source of the event. Currently only managed CloudWatch Events rules are supported.</p>
        pub fn set_type(
            mut self,
            input: std::option::Option<crate::model::EventSourceValues>,
        ) -> Self {
            self.r#type = input;
            self
        }
        /// <p>Information about the event.</p>
        pub fn parameters(mut self, input: crate::model::EventParameters) -> Self {
            self.parameters = Some(input);
            self
        }
        /// <p>Information about the event.</p>
        pub fn set_parameters(
            mut self,
            input: std::option::Option<crate::model::EventParameters>,
        ) -> Self {
            self.parameters = input;
            self
        }
        /// Consumes the builder and constructs a [`EventSource`](crate::model::EventSource)
        pub fn build(self) -> crate::model::EventSource {
            crate::model::EventSource {
                r#type: self.r#type,
                parameters: self.parameters,
            }
        }
    }
}
impl EventSource {
    /// Creates a new builder-style object to manufacture [`EventSource`](crate::model::EventSource)
    pub fn builder() -> crate::model::event_source::Builder {
        crate::model::event_source::Builder::default()
    }
}

/// <p>Specifies an event that triggers an event-based policy.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct EventParameters {
    /// <p>The type of event. Currently, only snapshot sharing events are supported.</p>
    pub event_type: std::option::Option<crate::model::EventTypeValues>,
    /// <p>The IDs of the Amazon Web Services accounts that can trigger policy by sharing snapshots with your account. The policy only runs if one of the specified Amazon Web Services accounts shares a snapshot with your account.</p>
    pub snapshot_owner: std::option::Option<std::vec::Vec<std::string::String>>,
    /// <p>The snapshot description that can trigger the policy. The description pattern is specified using a regular expression. The policy runs only if a snapshot with a description that matches the specified pattern is shared with your account.</p>
    /// <p>For example, specifying <code>^.*Created for policy: policy-1234567890abcdef0.*$</code> configures the policy to run only if snapshots created by policy <code>policy-1234567890abcdef0</code> are shared with your account.</p>
    pub description_regex: std::option::Option<std::string::String>,
}
impl EventParameters {
    /// <p>The type of event. Currently, only snapshot sharing events are supported.</p>
    pub fn event_type(&self) -> std::option::Option<&crate::model::EventTypeValues> {
        self.event_type.as_ref()
    }
    /// <p>The IDs of the Amazon Web Services accounts that can trigger policy by sharing snapshots with your account. The policy only runs if one of the specified Amazon Web Services accounts shares a snapshot with your account.</p>
    pub fn snapshot_owner(&self) -> std::option::Option<&[std::string::String]> {
        self.snapshot_owner.as_deref()
    }
    /// <p>The snapshot description that can trigger the policy. The description pattern is specified using a regular expression. The policy runs only if a snapshot with a description that matches the specified pattern is shared with your account.</p>
    /// <p>For example, specifying <code>^.*Created for policy: policy-1234567890abcdef0.*$</code> configures the policy to run only if snapshots created by policy <code>policy-1234567890abcdef0</code> are shared with your account.</p>
    pub fn description_regex(&self) -> std::option::Option<&str> {
        self.description_regex.as_deref()
    }
}
impl std::fmt::Debug for EventParameters {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("EventParameters");
        formatter.field("event_type", &self.event_type);
        formatter.field("snapshot_owner", &self.snapshot_owner);
        formatter.field("description_regex", &self.description_regex);
        formatter.finish()
    }
}
/// See [`EventParameters`](crate::model::EventParameters)
pub mod event_parameters {
    /// A builder for [`EventParameters`](crate::model::EventParameters)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) event_type: std::option::Option<crate::model::EventTypeValues>,
        pub(crate) snapshot_owner: std::option::Option<std::vec::Vec<std::string::String>>,
        pub(crate) description_regex: std::option::Option<std::string::String>,
    }
    impl Builder {
        /// <p>The type of event. Currently, only snapshot sharing events are supported.</p>
        pub fn event_type(mut self, input: crate::model::EventTypeValues) -> Self {
            self.event_type = Some(input);
            self
        }
        /// <p>The type of event. Currently, only snapshot sharing events are supported.</p>
        pub fn set_event_type(
            mut self,
            input: std::option::Option<crate::model::EventTypeValues>,
        ) -> Self {
            self.event_type = input;
            self
        }
        /// Appends an item to `snapshot_owner`.
        ///
        /// To override the contents of this collection use [`set_snapshot_owner`](Self::set_snapshot_owner).
        ///
        /// <p>The IDs of the Amazon Web Services accounts that can trigger policy by sharing snapshots with your account. The policy only runs if one of the specified Amazon Web Services accounts shares a snapshot with your account.</p>
        pub fn snapshot_owner(mut self, input: impl Into<std::string::String>) -> Self {
            let mut v = self.snapshot_owner.unwrap_or_default();
            v.push(input.into());
            self.snapshot_owner = Some(v);
            self
        }
        /// <p>The IDs of the Amazon Web Services accounts that can trigger policy by sharing snapshots with your account. The policy only runs if one of the specified Amazon Web Services accounts shares a snapshot with your account.</p>
        pub fn set_snapshot_owner(
            mut self,
            input: std::option::Option<std::vec::Vec<std::string::String>>,
        ) -> Self {
            self.snapshot_owner = input;
            self
        }
        /// <p>The snapshot description that can trigger the policy. The description pattern is specified using a regular expression. The policy runs only if a snapshot with a description that matches the specified pattern is shared with your account.</p>
        /// <p>For example, specifying <code>^.*Created for policy: policy-1234567890abcdef0.*$</code> configures the policy to run only if snapshots created by policy <code>policy-1234567890abcdef0</code> are shared with your account.</p>
        pub fn description_regex(mut self, input: impl Into<std::string::String>) -> Self {
            self.description_regex = Some(input.into());
            self
        }
        /// <p>The snapshot description that can trigger the policy. The description pattern is specified using a regular expression. The policy runs only if a snapshot with a description that matches the specified pattern is shared with your account.</p>
        /// <p>For example, specifying <code>^.*Created for policy: policy-1234567890abcdef0.*$</code> configures the policy to run only if snapshots created by policy <code>policy-1234567890abcdef0</code> are shared with your account.</p>
        pub fn set_description_regex(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.description_regex = input;
            self
        }
        /// Consumes the builder and constructs a [`EventParameters`](crate::model::EventParameters)
        pub fn build(self) -> crate::model::EventParameters {
            crate::model::EventParameters {
                event_type: self.event_type,
                snapshot_owner: self.snapshot_owner,
                description_regex: self.description_regex,
            }
        }
    }
}
impl EventParameters {
    /// Creates a new builder-style object to manufacture [`EventParameters`](crate::model::EventParameters)
    pub fn builder() -> crate::model::event_parameters::Builder {
        crate::model::event_parameters::Builder::default()
    }
}

#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
    std::clone::Clone,
    std::cmp::Eq,
    std::cmp::Ord,
    std::cmp::PartialEq,
    std::cmp::PartialOrd,
    std::fmt::Debug,
    std::hash::Hash,
)]
pub enum EventTypeValues {
    #[allow(missing_docs)] // documentation missing in model
    ShareSnapshot,
    /// Unknown contains new variants that have been added since this code was generated.
    Unknown(String),
}
impl std::convert::From<&str> for EventTypeValues {
    fn from(s: &str) -> Self {
        match s {
            "shareSnapshot" => EventTypeValues::ShareSnapshot,
            other => EventTypeValues::Unknown(other.to_owned()),
        }
    }
}
impl std::str::FromStr for EventTypeValues {
    type Err = std::convert::Infallible;

    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
        Ok(EventTypeValues::from(s))
    }
}
impl EventTypeValues {
    /// Returns the `&str` value of the enum member.
    pub fn as_str(&self) -> &str {
        match self {
            EventTypeValues::ShareSnapshot => "shareSnapshot",
            EventTypeValues::Unknown(s) => s.as_ref(),
        }
    }
    /// Returns all the `&str` values of the enum members.
    pub fn values() -> &'static [&'static str] {
        &["shareSnapshot"]
    }
}
impl AsRef<str> for EventTypeValues {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
    std::clone::Clone,
    std::cmp::Eq,
    std::cmp::Ord,
    std::cmp::PartialEq,
    std::cmp::PartialOrd,
    std::fmt::Debug,
    std::hash::Hash,
)]
pub enum EventSourceValues {
    #[allow(missing_docs)] // documentation missing in model
    ManagedCwe,
    /// Unknown contains new variants that have been added since this code was generated.
    Unknown(String),
}
impl std::convert::From<&str> for EventSourceValues {
    fn from(s: &str) -> Self {
        match s {
            "MANAGED_CWE" => EventSourceValues::ManagedCwe,
            other => EventSourceValues::Unknown(other.to_owned()),
        }
    }
}
impl std::str::FromStr for EventSourceValues {
    type Err = std::convert::Infallible;

    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
        Ok(EventSourceValues::from(s))
    }
}
impl EventSourceValues {
    /// Returns the `&str` value of the enum member.
    pub fn as_str(&self) -> &str {
        match self {
            EventSourceValues::ManagedCwe => "MANAGED_CWE",
            EventSourceValues::Unknown(s) => s.as_ref(),
        }
    }
    /// Returns all the `&str` values of the enum members.
    pub fn values() -> &'static [&'static str] {
        &["MANAGED_CWE"]
    }
}
impl AsRef<str> for EventSourceValues {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

/// <p>Specifies optional parameters to add to a policy. The set of valid parameters depends on the combination of policy type and resource type.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Parameters {
    /// <p>[EBS Snapshot Management – Instance policies only] Indicates whether to exclude the root volume from snapshots created using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSnapshots.html">CreateSnapshots</a>. The default is false.</p>
    pub exclude_boot_volume: std::option::Option<bool>,
    /// <p>Applies to AMI lifecycle policies only. Indicates whether targeted instances are rebooted when the lifecycle policy runs. <code>true</code> indicates that targeted instances are not rebooted when the policy runs. <code>false</code> indicates that target instances are rebooted when the policy runs. The default is <code>true</code> (instances are not rebooted).</p>
    pub no_reboot: std::option::Option<bool>,
}
impl Parameters {
    /// <p>[EBS Snapshot Management – Instance policies only] Indicates whether to exclude the root volume from snapshots created using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSnapshots.html">CreateSnapshots</a>. The default is false.</p>
    pub fn exclude_boot_volume(&self) -> std::option::Option<bool> {
        self.exclude_boot_volume
    }
    /// <p>Applies to AMI lifecycle policies only. Indicates whether targeted instances are rebooted when the lifecycle policy runs. <code>true</code> indicates that targeted instances are not rebooted when the policy runs. <code>false</code> indicates that target instances are rebooted when the policy runs. The default is <code>true</code> (instances are not rebooted).</p>
    pub fn no_reboot(&self) -> std::option::Option<bool> {
        self.no_reboot
    }
}
impl std::fmt::Debug for Parameters {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("Parameters");
        formatter.field("exclude_boot_volume", &self.exclude_boot_volume);
        formatter.field("no_reboot", &self.no_reboot);
        formatter.finish()
    }
}
/// See [`Parameters`](crate::model::Parameters)
pub mod parameters {
    /// A builder for [`Parameters`](crate::model::Parameters)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) exclude_boot_volume: std::option::Option<bool>,
        pub(crate) no_reboot: std::option::Option<bool>,
    }
    impl Builder {
        /// <p>[EBS Snapshot Management – Instance policies only] Indicates whether to exclude the root volume from snapshots created using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSnapshots.html">CreateSnapshots</a>. The default is false.</p>
        pub fn exclude_boot_volume(mut self, input: bool) -> Self {
            self.exclude_boot_volume = Some(input);
            self
        }
        /// <p>[EBS Snapshot Management – Instance policies only] Indicates whether to exclude the root volume from snapshots created using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSnapshots.html">CreateSnapshots</a>. The default is false.</p>
        pub fn set_exclude_boot_volume(mut self, input: std::option::Option<bool>) -> Self {
            self.exclude_boot_volume = input;
            self
        }
        /// <p>Applies to AMI lifecycle policies only. Indicates whether targeted instances are rebooted when the lifecycle policy runs. <code>true</code> indicates that targeted instances are not rebooted when the policy runs. <code>false</code> indicates that target instances are rebooted when the policy runs. The default is <code>true</code> (instances are not rebooted).</p>
        pub fn no_reboot(mut self, input: bool) -> Self {
            self.no_reboot = Some(input);
            self
        }
        /// <p>Applies to AMI lifecycle policies only. Indicates whether targeted instances are rebooted when the lifecycle policy runs. <code>true</code> indicates that targeted instances are not rebooted when the policy runs. <code>false</code> indicates that target instances are rebooted when the policy runs. The default is <code>true</code> (instances are not rebooted).</p>
        pub fn set_no_reboot(mut self, input: std::option::Option<bool>) -> Self {
            self.no_reboot = input;
            self
        }
        /// Consumes the builder and constructs a [`Parameters`](crate::model::Parameters)
        pub fn build(self) -> crate::model::Parameters {
            crate::model::Parameters {
                exclude_boot_volume: self.exclude_boot_volume,
                no_reboot: self.no_reboot,
            }
        }
    }
}
impl Parameters {
    /// Creates a new builder-style object to manufacture [`Parameters`](crate::model::Parameters)
    pub fn builder() -> crate::model::parameters::Builder {
        crate::model::parameters::Builder::default()
    }
}

/// <p>Specifies a backup schedule for a snapshot or AMI lifecycle policy.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Schedule {
    /// <p>The name of the schedule.</p>
    pub name: std::option::Option<std::string::String>,
    /// <p>Copy all user-defined tags on a source volume to snapshots of the volume created by this policy.</p>
    pub copy_tags: bool,
    /// <p>The tags to apply to policy-created resources. These user-defined tags are in addition to the Amazon Web Services-added lifecycle tags.</p>
    pub tags_to_add: std::option::Option<std::vec::Vec<crate::model::Tag>>,
    /// <p>A collection of key/value pairs with values determined dynamically when the policy is executed. Keys may be any valid Amazon EC2 tag key. Values must be in one of the two following formats: <code>$(instance-id)</code> or <code>$(timestamp)</code>. Variable tags are only valid for EBS Snapshot Management – Instance policies.</p>
    pub variable_tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
    /// <p>The creation rule.</p>
    pub create_rule: std::option::Option<crate::model::CreateRule>,
    /// <p>The retention rule.</p>
    pub retain_rule: std::option::Option<crate::model::RetainRule>,
    /// <p>The rule for enabling fast snapshot restore.</p>
    pub fast_restore_rule: std::option::Option<crate::model::FastRestoreRule>,
    /// <p>The rule for cross-Region snapshot copies.</p>
    /// <p>You can only specify cross-Region copy rules for policies that create snapshots in a Region. If the policy creates snapshots on an Outpost, then you cannot copy the snapshots to a Region or to an Outpost. If the policy creates snapshots in a Region, then snapshots can be copied to up to three Regions or Outposts.</p>
    pub cross_region_copy_rules:
        std::option::Option<std::vec::Vec<crate::model::CrossRegionCopyRule>>,
    /// <p>The rule for sharing snapshots with other Amazon Web Services accounts.</p>
    pub share_rules: std::option::Option<std::vec::Vec<crate::model::ShareRule>>,
    /// <p>The AMI deprecation rule for the schedule.</p>
    pub deprecate_rule: std::option::Option<crate::model::DeprecateRule>,
}
impl Schedule {
    /// <p>The name of the schedule.</p>
    pub fn name(&self) -> std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>Copy all user-defined tags on a source volume to snapshots of the volume created by this policy.</p>
    pub fn copy_tags(&self) -> bool {
        self.copy_tags
    }
    /// <p>The tags to apply to policy-created resources. These user-defined tags are in addition to the Amazon Web Services-added lifecycle tags.</p>
    pub fn tags_to_add(&self) -> std::option::Option<&[crate::model::Tag]> {
        self.tags_to_add.as_deref()
    }
    /// <p>A collection of key/value pairs with values determined dynamically when the policy is executed. Keys may be any valid Amazon EC2 tag key. Values must be in one of the two following formats: <code>$(instance-id)</code> or <code>$(timestamp)</code>. Variable tags are only valid for EBS Snapshot Management – Instance policies.</p>
    pub fn variable_tags(&self) -> std::option::Option<&[crate::model::Tag]> {
        self.variable_tags.as_deref()
    }
    /// <p>The creation rule.</p>
    pub fn create_rule(&self) -> std::option::Option<&crate::model::CreateRule> {
        self.create_rule.as_ref()
    }
    /// <p>The retention rule.</p>
    pub fn retain_rule(&self) -> std::option::Option<&crate::model::RetainRule> {
        self.retain_rule.as_ref()
    }
    /// <p>The rule for enabling fast snapshot restore.</p>
    pub fn fast_restore_rule(&self) -> std::option::Option<&crate::model::FastRestoreRule> {
        self.fast_restore_rule.as_ref()
    }
    /// <p>The rule for cross-Region snapshot copies.</p>
    /// <p>You can only specify cross-Region copy rules for policies that create snapshots in a Region. If the policy creates snapshots on an Outpost, then you cannot copy the snapshots to a Region or to an Outpost. If the policy creates snapshots in a Region, then snapshots can be copied to up to three Regions or Outposts.</p>
    pub fn cross_region_copy_rules(
        &self,
    ) -> std::option::Option<&[crate::model::CrossRegionCopyRule]> {
        self.cross_region_copy_rules.as_deref()
    }
    /// <p>The rule for sharing snapshots with other Amazon Web Services accounts.</p>
    pub fn share_rules(&self) -> std::option::Option<&[crate::model::ShareRule]> {
        self.share_rules.as_deref()
    }
    /// <p>The AMI deprecation rule for the schedule.</p>
    pub fn deprecate_rule(&self) -> std::option::Option<&crate::model::DeprecateRule> {
        self.deprecate_rule.as_ref()
    }
}
impl std::fmt::Debug for Schedule {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("Schedule");
        formatter.field("name", &self.name);
        formatter.field("copy_tags", &self.copy_tags);
        formatter.field("tags_to_add", &self.tags_to_add);
        formatter.field("variable_tags", &self.variable_tags);
        formatter.field("create_rule", &self.create_rule);
        formatter.field("retain_rule", &self.retain_rule);
        formatter.field("fast_restore_rule", &self.fast_restore_rule);
        formatter.field("cross_region_copy_rules", &self.cross_region_copy_rules);
        formatter.field("share_rules", &self.share_rules);
        formatter.field("deprecate_rule", &self.deprecate_rule);
        formatter.finish()
    }
}
/// See [`Schedule`](crate::model::Schedule)
pub mod schedule {
    /// A builder for [`Schedule`](crate::model::Schedule)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) name: std::option::Option<std::string::String>,
        pub(crate) copy_tags: std::option::Option<bool>,
        pub(crate) tags_to_add: std::option::Option<std::vec::Vec<crate::model::Tag>>,
        pub(crate) variable_tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
        pub(crate) create_rule: std::option::Option<crate::model::CreateRule>,
        pub(crate) retain_rule: std::option::Option<crate::model::RetainRule>,
        pub(crate) fast_restore_rule: std::option::Option<crate::model::FastRestoreRule>,
        pub(crate) cross_region_copy_rules:
            std::option::Option<std::vec::Vec<crate::model::CrossRegionCopyRule>>,
        pub(crate) share_rules: std::option::Option<std::vec::Vec<crate::model::ShareRule>>,
        pub(crate) deprecate_rule: std::option::Option<crate::model::DeprecateRule>,
    }
    impl Builder {
        /// <p>The name of the schedule.</p>
        pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
            self.name = Some(input.into());
            self
        }
        /// <p>The name of the schedule.</p>
        pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.name = input;
            self
        }
        /// <p>Copy all user-defined tags on a source volume to snapshots of the volume created by this policy.</p>
        pub fn copy_tags(mut self, input: bool) -> Self {
            self.copy_tags = Some(input);
            self
        }
        /// <p>Copy all user-defined tags on a source volume to snapshots of the volume created by this policy.</p>
        pub fn set_copy_tags(mut self, input: std::option::Option<bool>) -> Self {
            self.copy_tags = input;
            self
        }
        /// Appends an item to `tags_to_add`.
        ///
        /// To override the contents of this collection use [`set_tags_to_add`](Self::set_tags_to_add).
        ///
        /// <p>The tags to apply to policy-created resources. These user-defined tags are in addition to the Amazon Web Services-added lifecycle tags.</p>
        pub fn tags_to_add(mut self, input: crate::model::Tag) -> Self {
            let mut v = self.tags_to_add.unwrap_or_default();
            v.push(input);
            self.tags_to_add = Some(v);
            self
        }
        /// <p>The tags to apply to policy-created resources. These user-defined tags are in addition to the Amazon Web Services-added lifecycle tags.</p>
        pub fn set_tags_to_add(
            mut self,
            input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
        ) -> Self {
            self.tags_to_add = input;
            self
        }
        /// Appends an item to `variable_tags`.
        ///
        /// To override the contents of this collection use [`set_variable_tags`](Self::set_variable_tags).
        ///
        /// <p>A collection of key/value pairs with values determined dynamically when the policy is executed. Keys may be any valid Amazon EC2 tag key. Values must be in one of the two following formats: <code>$(instance-id)</code> or <code>$(timestamp)</code>. Variable tags are only valid for EBS Snapshot Management – Instance policies.</p>
        pub fn variable_tags(mut self, input: crate::model::Tag) -> Self {
            let mut v = self.variable_tags.unwrap_or_default();
            v.push(input);
            self.variable_tags = Some(v);
            self
        }
        /// <p>A collection of key/value pairs with values determined dynamically when the policy is executed. Keys may be any valid Amazon EC2 tag key. Values must be in one of the two following formats: <code>$(instance-id)</code> or <code>$(timestamp)</code>. Variable tags are only valid for EBS Snapshot Management – Instance policies.</p>
        pub fn set_variable_tags(
            mut self,
            input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
        ) -> Self {
            self.variable_tags = input;
            self
        }
        /// <p>The creation rule.</p>
        pub fn create_rule(mut self, input: crate::model::CreateRule) -> Self {
            self.create_rule = Some(input);
            self
        }
        /// <p>The creation rule.</p>
        pub fn set_create_rule(
            mut self,
            input: std::option::Option<crate::model::CreateRule>,
        ) -> Self {
            self.create_rule = input;
            self
        }
        /// <p>The retention rule.</p>
        pub fn retain_rule(mut self, input: crate::model::RetainRule) -> Self {
            self.retain_rule = Some(input);
            self
        }
        /// <p>The retention rule.</p>
        pub fn set_retain_rule(
            mut self,
            input: std::option::Option<crate::model::RetainRule>,
        ) -> Self {
            self.retain_rule = input;
            self
        }
        /// <p>The rule for enabling fast snapshot restore.</p>
        pub fn fast_restore_rule(mut self, input: crate::model::FastRestoreRule) -> Self {
            self.fast_restore_rule = Some(input);
            self
        }
        /// <p>The rule for enabling fast snapshot restore.</p>
        pub fn set_fast_restore_rule(
            mut self,
            input: std::option::Option<crate::model::FastRestoreRule>,
        ) -> Self {
            self.fast_restore_rule = input;
            self
        }
        /// Appends an item to `cross_region_copy_rules`.
        ///
        /// To override the contents of this collection use [`set_cross_region_copy_rules`](Self::set_cross_region_copy_rules).
        ///
        /// <p>The rule for cross-Region snapshot copies.</p>
        /// <p>You can only specify cross-Region copy rules for policies that create snapshots in a Region. If the policy creates snapshots on an Outpost, then you cannot copy the snapshots to a Region or to an Outpost. If the policy creates snapshots in a Region, then snapshots can be copied to up to three Regions or Outposts.</p>
        pub fn cross_region_copy_rules(mut self, input: crate::model::CrossRegionCopyRule) -> Self {
            let mut v = self.cross_region_copy_rules.unwrap_or_default();
            v.push(input);
            self.cross_region_copy_rules = Some(v);
            self
        }
        /// <p>The rule for cross-Region snapshot copies.</p>
        /// <p>You can only specify cross-Region copy rules for policies that create snapshots in a Region. If the policy creates snapshots on an Outpost, then you cannot copy the snapshots to a Region or to an Outpost. If the policy creates snapshots in a Region, then snapshots can be copied to up to three Regions or Outposts.</p>
        pub fn set_cross_region_copy_rules(
            mut self,
            input: std::option::Option<std::vec::Vec<crate::model::CrossRegionCopyRule>>,
        ) -> Self {
            self.cross_region_copy_rules = input;
            self
        }
        /// Appends an item to `share_rules`.
        ///
        /// To override the contents of this collection use [`set_share_rules`](Self::set_share_rules).
        ///
        /// <p>The rule for sharing snapshots with other Amazon Web Services accounts.</p>
        pub fn share_rules(mut self, input: crate::model::ShareRule) -> Self {
            let mut v = self.share_rules.unwrap_or_default();
            v.push(input);
            self.share_rules = Some(v);
            self
        }
        /// <p>The rule for sharing snapshots with other Amazon Web Services accounts.</p>
        pub fn set_share_rules(
            mut self,
            input: std::option::Option<std::vec::Vec<crate::model::ShareRule>>,
        ) -> Self {
            self.share_rules = input;
            self
        }
        /// <p>The AMI deprecation rule for the schedule.</p>
        pub fn deprecate_rule(mut self, input: crate::model::DeprecateRule) -> Self {
            self.deprecate_rule = Some(input);
            self
        }
        /// <p>The AMI deprecation rule for the schedule.</p>
        pub fn set_deprecate_rule(
            mut self,
            input: std::option::Option<crate::model::DeprecateRule>,
        ) -> Self {
            self.deprecate_rule = input;
            self
        }
        /// Consumes the builder and constructs a [`Schedule`](crate::model::Schedule)
        pub fn build(self) -> crate::model::Schedule {
            crate::model::Schedule {
                name: self.name,
                copy_tags: self.copy_tags.unwrap_or_default(),
                tags_to_add: self.tags_to_add,
                variable_tags: self.variable_tags,
                create_rule: self.create_rule,
                retain_rule: self.retain_rule,
                fast_restore_rule: self.fast_restore_rule,
                cross_region_copy_rules: self.cross_region_copy_rules,
                share_rules: self.share_rules,
                deprecate_rule: self.deprecate_rule,
            }
        }
    }
}
impl Schedule {
    /// Creates a new builder-style object to manufacture [`Schedule`](crate::model::Schedule)
    pub fn builder() -> crate::model::schedule::Builder {
        crate::model::schedule::Builder::default()
    }
}

/// <p>Specifies an AMI deprecation rule for a schedule.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DeprecateRule {
    /// <p>If the schedule has a count-based retention rule, this parameter specifies the number of oldest AMIs to deprecate. The count must be less than or equal to the schedule's retention count, and it can't be greater than 1000.</p>
    pub count: i32,
    /// <p>If the schedule has an age-based retention rule, this parameter specifies the period after which to deprecate AMIs created by the schedule. The period must be less than or equal to the schedule's retention period, and it can't be greater than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.</p>
    pub interval: i32,
    /// <p>The unit of time in which to measure the <b>Interval</b>.</p>
    pub interval_unit: std::option::Option<crate::model::RetentionIntervalUnitValues>,
}
impl DeprecateRule {
    /// <p>If the schedule has a count-based retention rule, this parameter specifies the number of oldest AMIs to deprecate. The count must be less than or equal to the schedule's retention count, and it can't be greater than 1000.</p>
    pub fn count(&self) -> i32 {
        self.count
    }
    /// <p>If the schedule has an age-based retention rule, this parameter specifies the period after which to deprecate AMIs created by the schedule. The period must be less than or equal to the schedule's retention period, and it can't be greater than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.</p>
    pub fn interval(&self) -> i32 {
        self.interval
    }
    /// <p>The unit of time in which to measure the <b>Interval</b>.</p>
    pub fn interval_unit(&self) -> std::option::Option<&crate::model::RetentionIntervalUnitValues> {
        self.interval_unit.as_ref()
    }
}
impl std::fmt::Debug for DeprecateRule {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("DeprecateRule");
        formatter.field("count", &self.count);
        formatter.field("interval", &self.interval);
        formatter.field("interval_unit", &self.interval_unit);
        formatter.finish()
    }
}
/// See [`DeprecateRule`](crate::model::DeprecateRule)
pub mod deprecate_rule {
    /// A builder for [`DeprecateRule`](crate::model::DeprecateRule)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) count: std::option::Option<i32>,
        pub(crate) interval: std::option::Option<i32>,
        pub(crate) interval_unit: std::option::Option<crate::model::RetentionIntervalUnitValues>,
    }
    impl Builder {
        /// <p>If the schedule has a count-based retention rule, this parameter specifies the number of oldest AMIs to deprecate. The count must be less than or equal to the schedule's retention count, and it can't be greater than 1000.</p>
        pub fn count(mut self, input: i32) -> Self {
            self.count = Some(input);
            self
        }
        /// <p>If the schedule has a count-based retention rule, this parameter specifies the number of oldest AMIs to deprecate. The count must be less than or equal to the schedule's retention count, and it can't be greater than 1000.</p>
        pub fn set_count(mut self, input: std::option::Option<i32>) -> Self {
            self.count = input;
            self
        }
        /// <p>If the schedule has an age-based retention rule, this parameter specifies the period after which to deprecate AMIs created by the schedule. The period must be less than or equal to the schedule's retention period, and it can't be greater than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.</p>
        pub fn interval(mut self, input: i32) -> Self {
            self.interval = Some(input);
            self
        }
        /// <p>If the schedule has an age-based retention rule, this parameter specifies the period after which to deprecate AMIs created by the schedule. The period must be less than or equal to the schedule's retention period, and it can't be greater than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.</p>
        pub fn set_interval(mut self, input: std::option::Option<i32>) -> Self {
            self.interval = input;
            self
        }
        /// <p>The unit of time in which to measure the <b>Interval</b>.</p>
        pub fn interval_unit(mut self, input: crate::model::RetentionIntervalUnitValues) -> Self {
            self.interval_unit = Some(input);
            self
        }
        /// <p>The unit of time in which to measure the <b>Interval</b>.</p>
        pub fn set_interval_unit(
            mut self,
            input: std::option::Option<crate::model::RetentionIntervalUnitValues>,
        ) -> Self {
            self.interval_unit = input;
            self
        }
        /// Consumes the builder and constructs a [`DeprecateRule`](crate::model::DeprecateRule)
        pub fn build(self) -> crate::model::DeprecateRule {
            crate::model::DeprecateRule {
                count: self.count.unwrap_or_default(),
                interval: self.interval.unwrap_or_default(),
                interval_unit: self.interval_unit,
            }
        }
    }
}
impl DeprecateRule {
    /// Creates a new builder-style object to manufacture [`DeprecateRule`](crate::model::DeprecateRule)
    pub fn builder() -> crate::model::deprecate_rule::Builder {
        crate::model::deprecate_rule::Builder::default()
    }
}

/// <p>Specifies a rule for sharing snapshots across Amazon Web Services accounts.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ShareRule {
    /// <p>The IDs of the Amazon Web Services accounts with which to share the snapshots.</p>
    pub target_accounts: std::option::Option<std::vec::Vec<std::string::String>>,
    /// <p>The period after which snapshots that are shared with other Amazon Web Services accounts are automatically unshared.</p>
    pub unshare_interval: i32,
    /// <p>The unit of time for the automatic unsharing interval.</p>
    pub unshare_interval_unit: std::option::Option<crate::model::RetentionIntervalUnitValues>,
}
impl ShareRule {
    /// <p>The IDs of the Amazon Web Services accounts with which to share the snapshots.</p>
    pub fn target_accounts(&self) -> std::option::Option<&[std::string::String]> {
        self.target_accounts.as_deref()
    }
    /// <p>The period after which snapshots that are shared with other Amazon Web Services accounts are automatically unshared.</p>
    pub fn unshare_interval(&self) -> i32 {
        self.unshare_interval
    }
    /// <p>The unit of time for the automatic unsharing interval.</p>
    pub fn unshare_interval_unit(
        &self,
    ) -> std::option::Option<&crate::model::RetentionIntervalUnitValues> {
        self.unshare_interval_unit.as_ref()
    }
}
impl std::fmt::Debug for ShareRule {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("ShareRule");
        formatter.field("target_accounts", &self.target_accounts);
        formatter.field("unshare_interval", &self.unshare_interval);
        formatter.field("unshare_interval_unit", &self.unshare_interval_unit);
        formatter.finish()
    }
}
/// See [`ShareRule`](crate::model::ShareRule)
pub mod share_rule {
    /// A builder for [`ShareRule`](crate::model::ShareRule)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) target_accounts: std::option::Option<std::vec::Vec<std::string::String>>,
        pub(crate) unshare_interval: std::option::Option<i32>,
        pub(crate) unshare_interval_unit:
            std::option::Option<crate::model::RetentionIntervalUnitValues>,
    }
    impl Builder {
        /// Appends an item to `target_accounts`.
        ///
        /// To override the contents of this collection use [`set_target_accounts`](Self::set_target_accounts).
        ///
        /// <p>The IDs of the Amazon Web Services accounts with which to share the snapshots.</p>
        pub fn target_accounts(mut self, input: impl Into<std::string::String>) -> Self {
            let mut v = self.target_accounts.unwrap_or_default();
            v.push(input.into());
            self.target_accounts = Some(v);
            self
        }
        /// <p>The IDs of the Amazon Web Services accounts with which to share the snapshots.</p>
        pub fn set_target_accounts(
            mut self,
            input: std::option::Option<std::vec::Vec<std::string::String>>,
        ) -> Self {
            self.target_accounts = input;
            self
        }
        /// <p>The period after which snapshots that are shared with other Amazon Web Services accounts are automatically unshared.</p>
        pub fn unshare_interval(mut self, input: i32) -> Self {
            self.unshare_interval = Some(input);
            self
        }
        /// <p>The period after which snapshots that are shared with other Amazon Web Services accounts are automatically unshared.</p>
        pub fn set_unshare_interval(mut self, input: std::option::Option<i32>) -> Self {
            self.unshare_interval = input;
            self
        }
        /// <p>The unit of time for the automatic unsharing interval.</p>
        pub fn unshare_interval_unit(
            mut self,
            input: crate::model::RetentionIntervalUnitValues,
        ) -> Self {
            self.unshare_interval_unit = Some(input);
            self
        }
        /// <p>The unit of time for the automatic unsharing interval.</p>
        pub fn set_unshare_interval_unit(
            mut self,
            input: std::option::Option<crate::model::RetentionIntervalUnitValues>,
        ) -> Self {
            self.unshare_interval_unit = input;
            self
        }
        /// Consumes the builder and constructs a [`ShareRule`](crate::model::ShareRule)
        pub fn build(self) -> crate::model::ShareRule {
            crate::model::ShareRule {
                target_accounts: self.target_accounts,
                unshare_interval: self.unshare_interval.unwrap_or_default(),
                unshare_interval_unit: self.unshare_interval_unit,
            }
        }
    }
}
impl ShareRule {
    /// Creates a new builder-style object to manufacture [`ShareRule`](crate::model::ShareRule)
    pub fn builder() -> crate::model::share_rule::Builder {
        crate::model::share_rule::Builder::default()
    }
}

/// <p>Specifies a rule for cross-Region snapshot copies.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CrossRegionCopyRule {
    /// <p>Avoid using this parameter when creating new policies. Instead, use <b>Target</b> to specify a target Region or a target Outpost for snapshot copies.</p>
    /// <p>For policies created before the <b>Target</b> parameter was introduced, this parameter indicates the target Region for snapshot copies.</p>
    pub target_region: std::option::Option<std::string::String>,
    /// <p>The target Region or the Amazon Resource Name (ARN) of the target Outpost for the snapshot copies.</p>
    /// <p>Use this parameter instead of <b>TargetRegion</b>. Do not specify both.</p>
    pub target: std::option::Option<std::string::String>,
    /// <p>To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption using this parameter. Copies of encrypted snapshots are encrypted, even if this parameter is false or if encryption by default is not enabled.</p>
    pub encrypted: std::option::Option<bool>,
    /// <p>The Amazon Resource Name (ARN) of the KMS key to use for EBS encryption. If this parameter is not specified, the default KMS key for the account is used.</p>
    pub cmk_arn: std::option::Option<std::string::String>,
    /// <p>Indicates whether to copy all user-defined tags from the source snapshot to the cross-Region snapshot copy.</p>
    pub copy_tags: std::option::Option<bool>,
    /// <p>The retention rule that indicates how long snapshot copies are to be retained in the destination Region.</p>
    pub retain_rule: std::option::Option<crate::model::CrossRegionCopyRetainRule>,
    /// <p>The AMI deprecation rule for cross-Region AMI copies created by the rule.</p>
    pub deprecate_rule: std::option::Option<crate::model::CrossRegionCopyDeprecateRule>,
}
impl CrossRegionCopyRule {
    /// <p>Avoid using this parameter when creating new policies. Instead, use <b>Target</b> to specify a target Region or a target Outpost for snapshot copies.</p>
    /// <p>For policies created before the <b>Target</b> parameter was introduced, this parameter indicates the target Region for snapshot copies.</p>
    pub fn target_region(&self) -> std::option::Option<&str> {
        self.target_region.as_deref()
    }
    /// <p>The target Region or the Amazon Resource Name (ARN) of the target Outpost for the snapshot copies.</p>
    /// <p>Use this parameter instead of <b>TargetRegion</b>. Do not specify both.</p>
    pub fn target(&self) -> std::option::Option<&str> {
        self.target.as_deref()
    }
    /// <p>To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption using this parameter. Copies of encrypted snapshots are encrypted, even if this parameter is false or if encryption by default is not enabled.</p>
    pub fn encrypted(&self) -> std::option::Option<bool> {
        self.encrypted
    }
    /// <p>The Amazon Resource Name (ARN) of the KMS key to use for EBS encryption. If this parameter is not specified, the default KMS key for the account is used.</p>
    pub fn cmk_arn(&self) -> std::option::Option<&str> {
        self.cmk_arn.as_deref()
    }
    /// <p>Indicates whether to copy all user-defined tags from the source snapshot to the cross-Region snapshot copy.</p>
    pub fn copy_tags(&self) -> std::option::Option<bool> {
        self.copy_tags
    }
    /// <p>The retention rule that indicates how long snapshot copies are to be retained in the destination Region.</p>
    pub fn retain_rule(&self) -> std::option::Option<&crate::model::CrossRegionCopyRetainRule> {
        self.retain_rule.as_ref()
    }
    /// <p>The AMI deprecation rule for cross-Region AMI copies created by the rule.</p>
    pub fn deprecate_rule(
        &self,
    ) -> std::option::Option<&crate::model::CrossRegionCopyDeprecateRule> {
        self.deprecate_rule.as_ref()
    }
}
impl std::fmt::Debug for CrossRegionCopyRule {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("CrossRegionCopyRule");
        formatter.field("target_region", &self.target_region);
        formatter.field("target", &self.target);
        formatter.field("encrypted", &self.encrypted);
        formatter.field("cmk_arn", &self.cmk_arn);
        formatter.field("copy_tags", &self.copy_tags);
        formatter.field("retain_rule", &self.retain_rule);
        formatter.field("deprecate_rule", &self.deprecate_rule);
        formatter.finish()
    }
}
/// See [`CrossRegionCopyRule`](crate::model::CrossRegionCopyRule)
pub mod cross_region_copy_rule {
    /// A builder for [`CrossRegionCopyRule`](crate::model::CrossRegionCopyRule)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) target_region: std::option::Option<std::string::String>,
        pub(crate) target: std::option::Option<std::string::String>,
        pub(crate) encrypted: std::option::Option<bool>,
        pub(crate) cmk_arn: std::option::Option<std::string::String>,
        pub(crate) copy_tags: std::option::Option<bool>,
        pub(crate) retain_rule: std::option::Option<crate::model::CrossRegionCopyRetainRule>,
        pub(crate) deprecate_rule: std::option::Option<crate::model::CrossRegionCopyDeprecateRule>,
    }
    impl Builder {
        /// <p>Avoid using this parameter when creating new policies. Instead, use <b>Target</b> to specify a target Region or a target Outpost for snapshot copies.</p>
        /// <p>For policies created before the <b>Target</b> parameter was introduced, this parameter indicates the target Region for snapshot copies.</p>
        pub fn target_region(mut self, input: impl Into<std::string::String>) -> Self {
            self.target_region = Some(input.into());
            self
        }
        /// <p>Avoid using this parameter when creating new policies. Instead, use <b>Target</b> to specify a target Region or a target Outpost for snapshot copies.</p>
        /// <p>For policies created before the <b>Target</b> parameter was introduced, this parameter indicates the target Region for snapshot copies.</p>
        pub fn set_target_region(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.target_region = input;
            self
        }
        /// <p>The target Region or the Amazon Resource Name (ARN) of the target Outpost for the snapshot copies.</p>
        /// <p>Use this parameter instead of <b>TargetRegion</b>. Do not specify both.</p>
        pub fn target(mut self, input: impl Into<std::string::String>) -> Self {
            self.target = Some(input.into());
            self
        }
        /// <p>The target Region or the Amazon Resource Name (ARN) of the target Outpost for the snapshot copies.</p>
        /// <p>Use this parameter instead of <b>TargetRegion</b>. Do not specify both.</p>
        pub fn set_target(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.target = input;
            self
        }
        /// <p>To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption using this parameter. Copies of encrypted snapshots are encrypted, even if this parameter is false or if encryption by default is not enabled.</p>
        pub fn encrypted(mut self, input: bool) -> Self {
            self.encrypted = Some(input);
            self
        }
        /// <p>To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption using this parameter. Copies of encrypted snapshots are encrypted, even if this parameter is false or if encryption by default is not enabled.</p>
        pub fn set_encrypted(mut self, input: std::option::Option<bool>) -> Self {
            self.encrypted = input;
            self
        }
        /// <p>The Amazon Resource Name (ARN) of the KMS key to use for EBS encryption. If this parameter is not specified, the default KMS key for the account is used.</p>
        pub fn cmk_arn(mut self, input: impl Into<std::string::String>) -> Self {
            self.cmk_arn = Some(input.into());
            self
        }
        /// <p>The Amazon Resource Name (ARN) of the KMS key to use for EBS encryption. If this parameter is not specified, the default KMS key for the account is used.</p>
        pub fn set_cmk_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.cmk_arn = input;
            self
        }
        /// <p>Indicates whether to copy all user-defined tags from the source snapshot to the cross-Region snapshot copy.</p>
        pub fn copy_tags(mut self, input: bool) -> Self {
            self.copy_tags = Some(input);
            self
        }
        /// <p>Indicates whether to copy all user-defined tags from the source snapshot to the cross-Region snapshot copy.</p>
        pub fn set_copy_tags(mut self, input: std::option::Option<bool>) -> Self {
            self.copy_tags = input;
            self
        }
        /// <p>The retention rule that indicates how long snapshot copies are to be retained in the destination Region.</p>
        pub fn retain_rule(mut self, input: crate::model::CrossRegionCopyRetainRule) -> Self {
            self.retain_rule = Some(input);
            self
        }
        /// <p>The retention rule that indicates how long snapshot copies are to be retained in the destination Region.</p>
        pub fn set_retain_rule(
            mut self,
            input: std::option::Option<crate::model::CrossRegionCopyRetainRule>,
        ) -> Self {
            self.retain_rule = input;
            self
        }
        /// <p>The AMI deprecation rule for cross-Region AMI copies created by the rule.</p>
        pub fn deprecate_rule(mut self, input: crate::model::CrossRegionCopyDeprecateRule) -> Self {
            self.deprecate_rule = Some(input);
            self
        }
        /// <p>The AMI deprecation rule for cross-Region AMI copies created by the rule.</p>
        pub fn set_deprecate_rule(
            mut self,
            input: std::option::Option<crate::model::CrossRegionCopyDeprecateRule>,
        ) -> Self {
            self.deprecate_rule = input;
            self
        }
        /// Consumes the builder and constructs a [`CrossRegionCopyRule`](crate::model::CrossRegionCopyRule)
        pub fn build(self) -> crate::model::CrossRegionCopyRule {
            crate::model::CrossRegionCopyRule {
                target_region: self.target_region,
                target: self.target,
                encrypted: self.encrypted,
                cmk_arn: self.cmk_arn,
                copy_tags: self.copy_tags,
                retain_rule: self.retain_rule,
                deprecate_rule: self.deprecate_rule,
            }
        }
    }
}
impl CrossRegionCopyRule {
    /// Creates a new builder-style object to manufacture [`CrossRegionCopyRule`](crate::model::CrossRegionCopyRule)
    pub fn builder() -> crate::model::cross_region_copy_rule::Builder {
        crate::model::cross_region_copy_rule::Builder::default()
    }
}

/// <p>Specifies an AMI deprecation rule for cross-Region AMI copies created by a cross-Region copy rule.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CrossRegionCopyDeprecateRule {
    /// <p>The period after which to deprecate the cross-Region AMI copies. The period must be less than or equal to the cross-Region AMI copy retention period, and it can't be greater than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.</p>
    pub interval: i32,
    /// <p>The unit of time in which to measure the <b>Interval</b>.</p>
    pub interval_unit: std::option::Option<crate::model::RetentionIntervalUnitValues>,
}
impl CrossRegionCopyDeprecateRule {
    /// <p>The period after which to deprecate the cross-Region AMI copies. The period must be less than or equal to the cross-Region AMI copy retention period, and it can't be greater than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.</p>
    pub fn interval(&self) -> i32 {
        self.interval
    }
    /// <p>The unit of time in which to measure the <b>Interval</b>.</p>
    pub fn interval_unit(&self) -> std::option::Option<&crate::model::RetentionIntervalUnitValues> {
        self.interval_unit.as_ref()
    }
}
impl std::fmt::Debug for CrossRegionCopyDeprecateRule {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("CrossRegionCopyDeprecateRule");
        formatter.field("interval", &self.interval);
        formatter.field("interval_unit", &self.interval_unit);
        formatter.finish()
    }
}
/// See [`CrossRegionCopyDeprecateRule`](crate::model::CrossRegionCopyDeprecateRule)
pub mod cross_region_copy_deprecate_rule {
    /// A builder for [`CrossRegionCopyDeprecateRule`](crate::model::CrossRegionCopyDeprecateRule)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) interval: std::option::Option<i32>,
        pub(crate) interval_unit: std::option::Option<crate::model::RetentionIntervalUnitValues>,
    }
    impl Builder {
        /// <p>The period after which to deprecate the cross-Region AMI copies. The period must be less than or equal to the cross-Region AMI copy retention period, and it can't be greater than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.</p>
        pub fn interval(mut self, input: i32) -> Self {
            self.interval = Some(input);
            self
        }
        /// <p>The period after which to deprecate the cross-Region AMI copies. The period must be less than or equal to the cross-Region AMI copy retention period, and it can't be greater than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.</p>
        pub fn set_interval(mut self, input: std::option::Option<i32>) -> Self {
            self.interval = input;
            self
        }
        /// <p>The unit of time in which to measure the <b>Interval</b>.</p>
        pub fn interval_unit(mut self, input: crate::model::RetentionIntervalUnitValues) -> Self {
            self.interval_unit = Some(input);
            self
        }
        /// <p>The unit of time in which to measure the <b>Interval</b>.</p>
        pub fn set_interval_unit(
            mut self,
            input: std::option::Option<crate::model::RetentionIntervalUnitValues>,
        ) -> Self {
            self.interval_unit = input;
            self
        }
        /// Consumes the builder and constructs a [`CrossRegionCopyDeprecateRule`](crate::model::CrossRegionCopyDeprecateRule)
        pub fn build(self) -> crate::model::CrossRegionCopyDeprecateRule {
            crate::model::CrossRegionCopyDeprecateRule {
                interval: self.interval.unwrap_or_default(),
                interval_unit: self.interval_unit,
            }
        }
    }
}
impl CrossRegionCopyDeprecateRule {
    /// Creates a new builder-style object to manufacture [`CrossRegionCopyDeprecateRule`](crate::model::CrossRegionCopyDeprecateRule)
    pub fn builder() -> crate::model::cross_region_copy_deprecate_rule::Builder {
        crate::model::cross_region_copy_deprecate_rule::Builder::default()
    }
}

/// <p>Specifies a rule for enabling fast snapshot restore. You can enable fast snapshot restore based on either a count or a time interval.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct FastRestoreRule {
    /// <p>The number of snapshots to be enabled with fast snapshot restore.</p>
    pub count: i32,
    /// <p>The amount of time to enable fast snapshot restore. The maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.</p>
    pub interval: i32,
    /// <p>The unit of time for enabling fast snapshot restore.</p>
    pub interval_unit: std::option::Option<crate::model::RetentionIntervalUnitValues>,
    /// <p>The Availability Zones in which to enable fast snapshot restore.</p>
    pub availability_zones: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl FastRestoreRule {
    /// <p>The number of snapshots to be enabled with fast snapshot restore.</p>
    pub fn count(&self) -> i32 {
        self.count
    }
    /// <p>The amount of time to enable fast snapshot restore. The maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.</p>
    pub fn interval(&self) -> i32 {
        self.interval
    }
    /// <p>The unit of time for enabling fast snapshot restore.</p>
    pub fn interval_unit(&self) -> std::option::Option<&crate::model::RetentionIntervalUnitValues> {
        self.interval_unit.as_ref()
    }
    /// <p>The Availability Zones in which to enable fast snapshot restore.</p>
    pub fn availability_zones(&self) -> std::option::Option<&[std::string::String]> {
        self.availability_zones.as_deref()
    }
}
impl std::fmt::Debug for FastRestoreRule {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("FastRestoreRule");
        formatter.field("count", &self.count);
        formatter.field("interval", &self.interval);
        formatter.field("interval_unit", &self.interval_unit);
        formatter.field("availability_zones", &self.availability_zones);
        formatter.finish()
    }
}
/// See [`FastRestoreRule`](crate::model::FastRestoreRule)
pub mod fast_restore_rule {
    /// A builder for [`FastRestoreRule`](crate::model::FastRestoreRule)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) count: std::option::Option<i32>,
        pub(crate) interval: std::option::Option<i32>,
        pub(crate) interval_unit: std::option::Option<crate::model::RetentionIntervalUnitValues>,
        pub(crate) availability_zones: std::option::Option<std::vec::Vec<std::string::String>>,
    }
    impl Builder {
        /// <p>The number of snapshots to be enabled with fast snapshot restore.</p>
        pub fn count(mut self, input: i32) -> Self {
            self.count = Some(input);
            self
        }
        /// <p>The number of snapshots to be enabled with fast snapshot restore.</p>
        pub fn set_count(mut self, input: std::option::Option<i32>) -> Self {
            self.count = input;
            self
        }
        /// <p>The amount of time to enable fast snapshot restore. The maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.</p>
        pub fn interval(mut self, input: i32) -> Self {
            self.interval = Some(input);
            self
        }
        /// <p>The amount of time to enable fast snapshot restore. The maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.</p>
        pub fn set_interval(mut self, input: std::option::Option<i32>) -> Self {
            self.interval = input;
            self
        }
        /// <p>The unit of time for enabling fast snapshot restore.</p>
        pub fn interval_unit(mut self, input: crate::model::RetentionIntervalUnitValues) -> Self {
            self.interval_unit = Some(input);
            self
        }
        /// <p>The unit of time for enabling fast snapshot restore.</p>
        pub fn set_interval_unit(
            mut self,
            input: std::option::Option<crate::model::RetentionIntervalUnitValues>,
        ) -> Self {
            self.interval_unit = input;
            self
        }
        /// Appends an item to `availability_zones`.
        ///
        /// To override the contents of this collection use [`set_availability_zones`](Self::set_availability_zones).
        ///
        /// <p>The Availability Zones in which to enable fast snapshot restore.</p>
        pub fn availability_zones(mut self, input: impl Into<std::string::String>) -> Self {
            let mut v = self.availability_zones.unwrap_or_default();
            v.push(input.into());
            self.availability_zones = Some(v);
            self
        }
        /// <p>The Availability Zones in which to enable fast snapshot restore.</p>
        pub fn set_availability_zones(
            mut self,
            input: std::option::Option<std::vec::Vec<std::string::String>>,
        ) -> Self {
            self.availability_zones = input;
            self
        }
        /// Consumes the builder and constructs a [`FastRestoreRule`](crate::model::FastRestoreRule)
        pub fn build(self) -> crate::model::FastRestoreRule {
            crate::model::FastRestoreRule {
                count: self.count.unwrap_or_default(),
                interval: self.interval.unwrap_or_default(),
                interval_unit: self.interval_unit,
                availability_zones: self.availability_zones,
            }
        }
    }
}
impl FastRestoreRule {
    /// Creates a new builder-style object to manufacture [`FastRestoreRule`](crate::model::FastRestoreRule)
    pub fn builder() -> crate::model::fast_restore_rule::Builder {
        crate::model::fast_restore_rule::Builder::default()
    }
}

/// <p>Specifies the retention rule for a lifecycle policy. You can retain snapshots based on either a count or a time interval.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct RetainRule {
    /// <p>The number of snapshots to retain for each volume, up to a maximum of 1000.</p>
    pub count: i32,
    /// <p>The amount of time to retain each snapshot. The maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.</p>
    pub interval: i32,
    /// <p>The unit of time for time-based retention.</p>
    pub interval_unit: std::option::Option<crate::model::RetentionIntervalUnitValues>,
}
impl RetainRule {
    /// <p>The number of snapshots to retain for each volume, up to a maximum of 1000.</p>
    pub fn count(&self) -> i32 {
        self.count
    }
    /// <p>The amount of time to retain each snapshot. The maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.</p>
    pub fn interval(&self) -> i32 {
        self.interval
    }
    /// <p>The unit of time for time-based retention.</p>
    pub fn interval_unit(&self) -> std::option::Option<&crate::model::RetentionIntervalUnitValues> {
        self.interval_unit.as_ref()
    }
}
impl std::fmt::Debug for RetainRule {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("RetainRule");
        formatter.field("count", &self.count);
        formatter.field("interval", &self.interval);
        formatter.field("interval_unit", &self.interval_unit);
        formatter.finish()
    }
}
/// See [`RetainRule`](crate::model::RetainRule)
pub mod retain_rule {
    /// A builder for [`RetainRule`](crate::model::RetainRule)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) count: std::option::Option<i32>,
        pub(crate) interval: std::option::Option<i32>,
        pub(crate) interval_unit: std::option::Option<crate::model::RetentionIntervalUnitValues>,
    }
    impl Builder {
        /// <p>The number of snapshots to retain for each volume, up to a maximum of 1000.</p>
        pub fn count(mut self, input: i32) -> Self {
            self.count = Some(input);
            self
        }
        /// <p>The number of snapshots to retain for each volume, up to a maximum of 1000.</p>
        pub fn set_count(mut self, input: std::option::Option<i32>) -> Self {
            self.count = input;
            self
        }
        /// <p>The amount of time to retain each snapshot. The maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.</p>
        pub fn interval(mut self, input: i32) -> Self {
            self.interval = Some(input);
            self
        }
        /// <p>The amount of time to retain each snapshot. The maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.</p>
        pub fn set_interval(mut self, input: std::option::Option<i32>) -> Self {
            self.interval = input;
            self
        }
        /// <p>The unit of time for time-based retention.</p>
        pub fn interval_unit(mut self, input: crate::model::RetentionIntervalUnitValues) -> Self {
            self.interval_unit = Some(input);
            self
        }
        /// <p>The unit of time for time-based retention.</p>
        pub fn set_interval_unit(
            mut self,
            input: std::option::Option<crate::model::RetentionIntervalUnitValues>,
        ) -> Self {
            self.interval_unit = input;
            self
        }
        /// Consumes the builder and constructs a [`RetainRule`](crate::model::RetainRule)
        pub fn build(self) -> crate::model::RetainRule {
            crate::model::RetainRule {
                count: self.count.unwrap_or_default(),
                interval: self.interval.unwrap_or_default(),
                interval_unit: self.interval_unit,
            }
        }
    }
}
impl RetainRule {
    /// Creates a new builder-style object to manufacture [`RetainRule`](crate::model::RetainRule)
    pub fn builder() -> crate::model::retain_rule::Builder {
        crate::model::retain_rule::Builder::default()
    }
}

/// <p>Specifies when to create snapshots of EBS volumes.</p>
/// <p>You must specify either a Cron expression or an interval, interval unit, and start time. You cannot specify both.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CreateRule {
    /// <p>Specifies the destination for snapshots created by the policy. To create snapshots in the same Region as the source resource, specify <code>CLOUD</code>. To create snapshots on the same Outpost as the source resource, specify <code>OUTPOST_LOCAL</code>. If you omit this parameter, <code>CLOUD</code> is used by default.</p>
    /// <p>If the policy targets resources in an Amazon Web Services Region, then you must create snapshots in the same Region as the source resource.</p>
    /// <p>If the policy targets resources on an Outpost, then you can create snapshots on the same Outpost as the source resource, or in the Region of that Outpost.</p>
    pub location: std::option::Option<crate::model::LocationValues>,
    /// <p>The interval between snapshots. The supported values are 1, 2, 3, 4, 6, 8, 12, and 24.</p>
    pub interval: i32,
    /// <p>The interval unit.</p>
    pub interval_unit: std::option::Option<crate::model::IntervalUnitValues>,
    /// <p>The time, in UTC, to start the operation. The supported format is hh:mm.</p>
    /// <p>The operation occurs within a one-hour window following the specified time. If you do not specify a time, Amazon DLM selects a time within the next 24 hours.</p>
    pub times: std::option::Option<std::vec::Vec<std::string::String>>,
    /// <p>The schedule, as a Cron expression. The schedule interval must be between 1 hour and 1 year. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions">Cron expressions</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
    pub cron_expression: std::option::Option<std::string::String>,
}
impl CreateRule {
    /// <p>Specifies the destination for snapshots created by the policy. To create snapshots in the same Region as the source resource, specify <code>CLOUD</code>. To create snapshots on the same Outpost as the source resource, specify <code>OUTPOST_LOCAL</code>. If you omit this parameter, <code>CLOUD</code> is used by default.</p>
    /// <p>If the policy targets resources in an Amazon Web Services Region, then you must create snapshots in the same Region as the source resource.</p>
    /// <p>If the policy targets resources on an Outpost, then you can create snapshots on the same Outpost as the source resource, or in the Region of that Outpost.</p>
    pub fn location(&self) -> std::option::Option<&crate::model::LocationValues> {
        self.location.as_ref()
    }
    /// <p>The interval between snapshots. The supported values are 1, 2, 3, 4, 6, 8, 12, and 24.</p>
    pub fn interval(&self) -> i32 {
        self.interval
    }
    /// <p>The interval unit.</p>
    pub fn interval_unit(&self) -> std::option::Option<&crate::model::IntervalUnitValues> {
        self.interval_unit.as_ref()
    }
    /// <p>The time, in UTC, to start the operation. The supported format is hh:mm.</p>
    /// <p>The operation occurs within a one-hour window following the specified time. If you do not specify a time, Amazon DLM selects a time within the next 24 hours.</p>
    pub fn times(&self) -> std::option::Option<&[std::string::String]> {
        self.times.as_deref()
    }
    /// <p>The schedule, as a Cron expression. The schedule interval must be between 1 hour and 1 year. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions">Cron expressions</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
    pub fn cron_expression(&self) -> std::option::Option<&str> {
        self.cron_expression.as_deref()
    }
}
impl std::fmt::Debug for CreateRule {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("CreateRule");
        formatter.field("location", &self.location);
        formatter.field("interval", &self.interval);
        formatter.field("interval_unit", &self.interval_unit);
        formatter.field("times", &self.times);
        formatter.field("cron_expression", &self.cron_expression);
        formatter.finish()
    }
}
/// See [`CreateRule`](crate::model::CreateRule)
pub mod create_rule {
    /// A builder for [`CreateRule`](crate::model::CreateRule)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) location: std::option::Option<crate::model::LocationValues>,
        pub(crate) interval: std::option::Option<i32>,
        pub(crate) interval_unit: std::option::Option<crate::model::IntervalUnitValues>,
        pub(crate) times: std::option::Option<std::vec::Vec<std::string::String>>,
        pub(crate) cron_expression: std::option::Option<std::string::String>,
    }
    impl Builder {
        /// <p>Specifies the destination for snapshots created by the policy. To create snapshots in the same Region as the source resource, specify <code>CLOUD</code>. To create snapshots on the same Outpost as the source resource, specify <code>OUTPOST_LOCAL</code>. If you omit this parameter, <code>CLOUD</code> is used by default.</p>
        /// <p>If the policy targets resources in an Amazon Web Services Region, then you must create snapshots in the same Region as the source resource.</p>
        /// <p>If the policy targets resources on an Outpost, then you can create snapshots on the same Outpost as the source resource, or in the Region of that Outpost.</p>
        pub fn location(mut self, input: crate::model::LocationValues) -> Self {
            self.location = Some(input);
            self
        }
        /// <p>Specifies the destination for snapshots created by the policy. To create snapshots in the same Region as the source resource, specify <code>CLOUD</code>. To create snapshots on the same Outpost as the source resource, specify <code>OUTPOST_LOCAL</code>. If you omit this parameter, <code>CLOUD</code> is used by default.</p>
        /// <p>If the policy targets resources in an Amazon Web Services Region, then you must create snapshots in the same Region as the source resource.</p>
        /// <p>If the policy targets resources on an Outpost, then you can create snapshots on the same Outpost as the source resource, or in the Region of that Outpost.</p>
        pub fn set_location(
            mut self,
            input: std::option::Option<crate::model::LocationValues>,
        ) -> Self {
            self.location = input;
            self
        }
        /// <p>The interval between snapshots. The supported values are 1, 2, 3, 4, 6, 8, 12, and 24.</p>
        pub fn interval(mut self, input: i32) -> Self {
            self.interval = Some(input);
            self
        }
        /// <p>The interval between snapshots. The supported values are 1, 2, 3, 4, 6, 8, 12, and 24.</p>
        pub fn set_interval(mut self, input: std::option::Option<i32>) -> Self {
            self.interval = input;
            self
        }
        /// <p>The interval unit.</p>
        pub fn interval_unit(mut self, input: crate::model::IntervalUnitValues) -> Self {
            self.interval_unit = Some(input);
            self
        }
        /// <p>The interval unit.</p>
        pub fn set_interval_unit(
            mut self,
            input: std::option::Option<crate::model::IntervalUnitValues>,
        ) -> Self {
            self.interval_unit = input;
            self
        }
        /// Appends an item to `times`.
        ///
        /// To override the contents of this collection use [`set_times`](Self::set_times).
        ///
        /// <p>The time, in UTC, to start the operation. The supported format is hh:mm.</p>
        /// <p>The operation occurs within a one-hour window following the specified time. If you do not specify a time, Amazon DLM selects a time within the next 24 hours.</p>
        pub fn times(mut self, input: impl Into<std::string::String>) -> Self {
            let mut v = self.times.unwrap_or_default();
            v.push(input.into());
            self.times = Some(v);
            self
        }
        /// <p>The time, in UTC, to start the operation. The supported format is hh:mm.</p>
        /// <p>The operation occurs within a one-hour window following the specified time. If you do not specify a time, Amazon DLM selects a time within the next 24 hours.</p>
        pub fn set_times(
            mut self,
            input: std::option::Option<std::vec::Vec<std::string::String>>,
        ) -> Self {
            self.times = input;
            self
        }
        /// <p>The schedule, as a Cron expression. The schedule interval must be between 1 hour and 1 year. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions">Cron expressions</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
        pub fn cron_expression(mut self, input: impl Into<std::string::String>) -> Self {
            self.cron_expression = Some(input.into());
            self
        }
        /// <p>The schedule, as a Cron expression. The schedule interval must be between 1 hour and 1 year. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions">Cron expressions</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
        pub fn set_cron_expression(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.cron_expression = input;
            self
        }
        /// Consumes the builder and constructs a [`CreateRule`](crate::model::CreateRule)
        pub fn build(self) -> crate::model::CreateRule {
            crate::model::CreateRule {
                location: self.location,
                interval: self.interval.unwrap_or_default(),
                interval_unit: self.interval_unit,
                times: self.times,
                cron_expression: self.cron_expression,
            }
        }
    }
}
impl CreateRule {
    /// Creates a new builder-style object to manufacture [`CreateRule`](crate::model::CreateRule)
    pub fn builder() -> crate::model::create_rule::Builder {
        crate::model::create_rule::Builder::default()
    }
}

#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
    std::clone::Clone,
    std::cmp::Eq,
    std::cmp::Ord,
    std::cmp::PartialEq,
    std::cmp::PartialOrd,
    std::fmt::Debug,
    std::hash::Hash,
)]
pub enum IntervalUnitValues {
    #[allow(missing_docs)] // documentation missing in model
    Hours,
    /// Unknown contains new variants that have been added since this code was generated.
    Unknown(String),
}
impl std::convert::From<&str> for IntervalUnitValues {
    fn from(s: &str) -> Self {
        match s {
            "HOURS" => IntervalUnitValues::Hours,
            other => IntervalUnitValues::Unknown(other.to_owned()),
        }
    }
}
impl std::str::FromStr for IntervalUnitValues {
    type Err = std::convert::Infallible;

    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
        Ok(IntervalUnitValues::from(s))
    }
}
impl IntervalUnitValues {
    /// Returns the `&str` value of the enum member.
    pub fn as_str(&self) -> &str {
        match self {
            IntervalUnitValues::Hours => "HOURS",
            IntervalUnitValues::Unknown(s) => s.as_ref(),
        }
    }
    /// Returns all the `&str` values of the enum members.
    pub fn values() -> &'static [&'static str] {
        &["HOURS"]
    }
}
impl AsRef<str> for IntervalUnitValues {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
    std::clone::Clone,
    std::cmp::Eq,
    std::cmp::Ord,
    std::cmp::PartialEq,
    std::cmp::PartialOrd,
    std::fmt::Debug,
    std::hash::Hash,
)]
pub enum LocationValues {
    #[allow(missing_docs)] // documentation missing in model
    Cloud,
    #[allow(missing_docs)] // documentation missing in model
    OutpostLocal,
    /// Unknown contains new variants that have been added since this code was generated.
    Unknown(String),
}
impl std::convert::From<&str> for LocationValues {
    fn from(s: &str) -> Self {
        match s {
            "CLOUD" => LocationValues::Cloud,
            "OUTPOST_LOCAL" => LocationValues::OutpostLocal,
            other => LocationValues::Unknown(other.to_owned()),
        }
    }
}
impl std::str::FromStr for LocationValues {
    type Err = std::convert::Infallible;

    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
        Ok(LocationValues::from(s))
    }
}
impl LocationValues {
    /// Returns the `&str` value of the enum member.
    pub fn as_str(&self) -> &str {
        match self {
            LocationValues::Cloud => "CLOUD",
            LocationValues::OutpostLocal => "OUTPOST_LOCAL",
            LocationValues::Unknown(s) => s.as_ref(),
        }
    }
    /// Returns all the `&str` values of the enum members.
    pub fn values() -> &'static [&'static str] {
        &["CLOUD", "OUTPOST_LOCAL"]
    }
}
impl AsRef<str> for LocationValues {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

/// <p>Specifies a tag for a resource.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Tag {
    /// <p>The tag key.</p>
    pub key: std::option::Option<std::string::String>,
    /// <p>The tag value.</p>
    pub value: std::option::Option<std::string::String>,
}
impl Tag {
    /// <p>The tag key.</p>
    pub fn key(&self) -> std::option::Option<&str> {
        self.key.as_deref()
    }
    /// <p>The tag value.</p>
    pub fn value(&self) -> std::option::Option<&str> {
        self.value.as_deref()
    }
}
impl std::fmt::Debug for Tag {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("Tag");
        formatter.field("key", &self.key);
        formatter.field("value", &self.value);
        formatter.finish()
    }
}
/// See [`Tag`](crate::model::Tag)
pub mod tag {
    /// A builder for [`Tag`](crate::model::Tag)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) key: std::option::Option<std::string::String>,
        pub(crate) value: std::option::Option<std::string::String>,
    }
    impl Builder {
        /// <p>The tag key.</p>
        pub fn key(mut self, input: impl Into<std::string::String>) -> Self {
            self.key = Some(input.into());
            self
        }
        /// <p>The tag key.</p>
        pub fn set_key(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.key = input;
            self
        }
        /// <p>The tag value.</p>
        pub fn value(mut self, input: impl Into<std::string::String>) -> Self {
            self.value = Some(input.into());
            self
        }
        /// <p>The tag value.</p>
        pub fn set_value(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.value = input;
            self
        }
        /// Consumes the builder and constructs a [`Tag`](crate::model::Tag)
        pub fn build(self) -> crate::model::Tag {
            crate::model::Tag {
                key: self.key,
                value: self.value,
            }
        }
    }
}
impl Tag {
    /// Creates a new builder-style object to manufacture [`Tag`](crate::model::Tag)
    pub fn builder() -> crate::model::tag::Builder {
        crate::model::tag::Builder::default()
    }
}

#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
    std::clone::Clone,
    std::cmp::Eq,
    std::cmp::Ord,
    std::cmp::PartialEq,
    std::cmp::PartialOrd,
    std::fmt::Debug,
    std::hash::Hash,
)]
pub enum ResourceLocationValues {
    #[allow(missing_docs)] // documentation missing in model
    Cloud,
    #[allow(missing_docs)] // documentation missing in model
    Outpost,
    /// Unknown contains new variants that have been added since this code was generated.
    Unknown(String),
}
impl std::convert::From<&str> for ResourceLocationValues {
    fn from(s: &str) -> Self {
        match s {
            "CLOUD" => ResourceLocationValues::Cloud,
            "OUTPOST" => ResourceLocationValues::Outpost,
            other => ResourceLocationValues::Unknown(other.to_owned()),
        }
    }
}
impl std::str::FromStr for ResourceLocationValues {
    type Err = std::convert::Infallible;

    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
        Ok(ResourceLocationValues::from(s))
    }
}
impl ResourceLocationValues {
    /// Returns the `&str` value of the enum member.
    pub fn as_str(&self) -> &str {
        match self {
            ResourceLocationValues::Cloud => "CLOUD",
            ResourceLocationValues::Outpost => "OUTPOST",
            ResourceLocationValues::Unknown(s) => s.as_ref(),
        }
    }
    /// Returns all the `&str` values of the enum members.
    pub fn values() -> &'static [&'static str] {
        &["CLOUD", "OUTPOST"]
    }
}
impl AsRef<str> for ResourceLocationValues {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
    std::clone::Clone,
    std::cmp::Eq,
    std::cmp::Ord,
    std::cmp::PartialEq,
    std::cmp::PartialOrd,
    std::fmt::Debug,
    std::hash::Hash,
)]
pub enum ResourceTypeValues {
    #[allow(missing_docs)] // documentation missing in model
    Instance,
    #[allow(missing_docs)] // documentation missing in model
    Volume,
    /// Unknown contains new variants that have been added since this code was generated.
    Unknown(String),
}
impl std::convert::From<&str> for ResourceTypeValues {
    fn from(s: &str) -> Self {
        match s {
            "INSTANCE" => ResourceTypeValues::Instance,
            "VOLUME" => ResourceTypeValues::Volume,
            other => ResourceTypeValues::Unknown(other.to_owned()),
        }
    }
}
impl std::str::FromStr for ResourceTypeValues {
    type Err = std::convert::Infallible;

    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
        Ok(ResourceTypeValues::from(s))
    }
}
impl ResourceTypeValues {
    /// Returns the `&str` value of the enum member.
    pub fn as_str(&self) -> &str {
        match self {
            ResourceTypeValues::Instance => "INSTANCE",
            ResourceTypeValues::Volume => "VOLUME",
            ResourceTypeValues::Unknown(s) => s.as_ref(),
        }
    }
    /// Returns all the `&str` values of the enum members.
    pub fn values() -> &'static [&'static str] {
        &["INSTANCE", "VOLUME"]
    }
}
impl AsRef<str> for ResourceTypeValues {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
    std::clone::Clone,
    std::cmp::Eq,
    std::cmp::Ord,
    std::cmp::PartialEq,
    std::cmp::PartialOrd,
    std::fmt::Debug,
    std::hash::Hash,
)]
pub enum PolicyTypeValues {
    #[allow(missing_docs)] // documentation missing in model
    EbsSnapshotManagement,
    #[allow(missing_docs)] // documentation missing in model
    EventBasedPolicy,
    #[allow(missing_docs)] // documentation missing in model
    ImageManagement,
    /// Unknown contains new variants that have been added since this code was generated.
    Unknown(String),
}
impl std::convert::From<&str> for PolicyTypeValues {
    fn from(s: &str) -> Self {
        match s {
            "EBS_SNAPSHOT_MANAGEMENT" => PolicyTypeValues::EbsSnapshotManagement,
            "EVENT_BASED_POLICY" => PolicyTypeValues::EventBasedPolicy,
            "IMAGE_MANAGEMENT" => PolicyTypeValues::ImageManagement,
            other => PolicyTypeValues::Unknown(other.to_owned()),
        }
    }
}
impl std::str::FromStr for PolicyTypeValues {
    type Err = std::convert::Infallible;

    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
        Ok(PolicyTypeValues::from(s))
    }
}
impl PolicyTypeValues {
    /// Returns the `&str` value of the enum member.
    pub fn as_str(&self) -> &str {
        match self {
            PolicyTypeValues::EbsSnapshotManagement => "EBS_SNAPSHOT_MANAGEMENT",
            PolicyTypeValues::EventBasedPolicy => "EVENT_BASED_POLICY",
            PolicyTypeValues::ImageManagement => "IMAGE_MANAGEMENT",
            PolicyTypeValues::Unknown(s) => s.as_ref(),
        }
    }
    /// Returns all the `&str` values of the enum members.
    pub fn values() -> &'static [&'static str] {
        &[
            "EBS_SNAPSHOT_MANAGEMENT",
            "EVENT_BASED_POLICY",
            "IMAGE_MANAGEMENT",
        ]
    }
}
impl AsRef<str> for PolicyTypeValues {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
    std::clone::Clone,
    std::cmp::Eq,
    std::cmp::Ord,
    std::cmp::PartialEq,
    std::cmp::PartialOrd,
    std::fmt::Debug,
    std::hash::Hash,
)]
pub enum SettablePolicyStateValues {
    #[allow(missing_docs)] // documentation missing in model
    Disabled,
    #[allow(missing_docs)] // documentation missing in model
    Enabled,
    /// Unknown contains new variants that have been added since this code was generated.
    Unknown(String),
}
impl std::convert::From<&str> for SettablePolicyStateValues {
    fn from(s: &str) -> Self {
        match s {
            "DISABLED" => SettablePolicyStateValues::Disabled,
            "ENABLED" => SettablePolicyStateValues::Enabled,
            other => SettablePolicyStateValues::Unknown(other.to_owned()),
        }
    }
}
impl std::str::FromStr for SettablePolicyStateValues {
    type Err = std::convert::Infallible;

    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
        Ok(SettablePolicyStateValues::from(s))
    }
}
impl SettablePolicyStateValues {
    /// Returns the `&str` value of the enum member.
    pub fn as_str(&self) -> &str {
        match self {
            SettablePolicyStateValues::Disabled => "DISABLED",
            SettablePolicyStateValues::Enabled => "ENABLED",
            SettablePolicyStateValues::Unknown(s) => s.as_ref(),
        }
    }
    /// Returns all the `&str` values of the enum members.
    pub fn values() -> &'static [&'static str] {
        &["DISABLED", "ENABLED"]
    }
}
impl AsRef<str> for SettablePolicyStateValues {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

/// <p>Detailed information about a lifecycle policy.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct LifecyclePolicy {
    /// <p>The identifier of the lifecycle policy.</p>
    pub policy_id: std::option::Option<std::string::String>,
    /// <p>The description of the lifecycle policy.</p>
    pub description: std::option::Option<std::string::String>,
    /// <p>The activation state of the lifecycle policy.</p>
    pub state: std::option::Option<crate::model::GettablePolicyStateValues>,
    /// <p>The description of the status.</p>
    pub status_message: std::option::Option<std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of the IAM role used to run the operations specified by the lifecycle policy.</p>
    pub execution_role_arn: std::option::Option<std::string::String>,
    /// <p>The local date and time when the lifecycle policy was created.</p>
    pub date_created: std::option::Option<aws_smithy_types::DateTime>,
    /// <p>The local date and time when the lifecycle policy was last modified.</p>
    pub date_modified: std::option::Option<aws_smithy_types::DateTime>,
    /// <p>The configuration of the lifecycle policy</p>
    pub policy_details: std::option::Option<crate::model::PolicyDetails>,
    /// <p>The tags.</p>
    pub tags:
        std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
    /// <p>The Amazon Resource Name (ARN) of the policy.</p>
    pub policy_arn: std::option::Option<std::string::String>,
}
impl LifecyclePolicy {
    /// <p>The identifier of the lifecycle policy.</p>
    pub fn policy_id(&self) -> std::option::Option<&str> {
        self.policy_id.as_deref()
    }
    /// <p>The description of the lifecycle policy.</p>
    pub fn description(&self) -> std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The activation state of the lifecycle policy.</p>
    pub fn state(&self) -> std::option::Option<&crate::model::GettablePolicyStateValues> {
        self.state.as_ref()
    }
    /// <p>The description of the status.</p>
    pub fn status_message(&self) -> std::option::Option<&str> {
        self.status_message.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role used to run the operations specified by the lifecycle policy.</p>
    pub fn execution_role_arn(&self) -> std::option::Option<&str> {
        self.execution_role_arn.as_deref()
    }
    /// <p>The local date and time when the lifecycle policy was created.</p>
    pub fn date_created(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
        self.date_created.as_ref()
    }
    /// <p>The local date and time when the lifecycle policy was last modified.</p>
    pub fn date_modified(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
        self.date_modified.as_ref()
    }
    /// <p>The configuration of the lifecycle policy</p>
    pub fn policy_details(&self) -> std::option::Option<&crate::model::PolicyDetails> {
        self.policy_details.as_ref()
    }
    /// <p>The tags.</p>
    pub fn tags(
        &self,
    ) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
    {
        self.tags.as_ref()
    }
    /// <p>The Amazon Resource Name (ARN) of the policy.</p>
    pub fn policy_arn(&self) -> std::option::Option<&str> {
        self.policy_arn.as_deref()
    }
}
impl std::fmt::Debug for LifecyclePolicy {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("LifecyclePolicy");
        formatter.field("policy_id", &self.policy_id);
        formatter.field("description", &self.description);
        formatter.field("state", &self.state);
        formatter.field("status_message", &self.status_message);
        formatter.field("execution_role_arn", &self.execution_role_arn);
        formatter.field("date_created", &self.date_created);
        formatter.field("date_modified", &self.date_modified);
        formatter.field("policy_details", &self.policy_details);
        formatter.field("tags", &self.tags);
        formatter.field("policy_arn", &self.policy_arn);
        formatter.finish()
    }
}
/// See [`LifecyclePolicy`](crate::model::LifecyclePolicy)
pub mod lifecycle_policy {
    /// A builder for [`LifecyclePolicy`](crate::model::LifecyclePolicy)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) policy_id: std::option::Option<std::string::String>,
        pub(crate) description: std::option::Option<std::string::String>,
        pub(crate) state: std::option::Option<crate::model::GettablePolicyStateValues>,
        pub(crate) status_message: std::option::Option<std::string::String>,
        pub(crate) execution_role_arn: std::option::Option<std::string::String>,
        pub(crate) date_created: std::option::Option<aws_smithy_types::DateTime>,
        pub(crate) date_modified: std::option::Option<aws_smithy_types::DateTime>,
        pub(crate) policy_details: std::option::Option<crate::model::PolicyDetails>,
        pub(crate) tags: std::option::Option<
            std::collections::HashMap<std::string::String, std::string::String>,
        >,
        pub(crate) policy_arn: std::option::Option<std::string::String>,
    }
    impl Builder {
        /// <p>The identifier of the lifecycle policy.</p>
        pub fn policy_id(mut self, input: impl Into<std::string::String>) -> Self {
            self.policy_id = Some(input.into());
            self
        }
        /// <p>The identifier of the lifecycle policy.</p>
        pub fn set_policy_id(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.policy_id = input;
            self
        }
        /// <p>The description of the lifecycle policy.</p>
        pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
            self.description = Some(input.into());
            self
        }
        /// <p>The description of the lifecycle policy.</p>
        pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.description = input;
            self
        }
        /// <p>The activation state of the lifecycle policy.</p>
        pub fn state(mut self, input: crate::model::GettablePolicyStateValues) -> Self {
            self.state = Some(input);
            self
        }
        /// <p>The activation state of the lifecycle policy.</p>
        pub fn set_state(
            mut self,
            input: std::option::Option<crate::model::GettablePolicyStateValues>,
        ) -> Self {
            self.state = input;
            self
        }
        /// <p>The description of the status.</p>
        pub fn status_message(mut self, input: impl Into<std::string::String>) -> Self {
            self.status_message = Some(input.into());
            self
        }
        /// <p>The description of the status.</p>
        pub fn set_status_message(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.status_message = input;
            self
        }
        /// <p>The Amazon Resource Name (ARN) of the IAM role used to run the operations specified by the lifecycle policy.</p>
        pub fn execution_role_arn(mut self, input: impl Into<std::string::String>) -> Self {
            self.execution_role_arn = Some(input.into());
            self
        }
        /// <p>The Amazon Resource Name (ARN) of the IAM role used to run the operations specified by the lifecycle policy.</p>
        pub fn set_execution_role_arn(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.execution_role_arn = input;
            self
        }
        /// <p>The local date and time when the lifecycle policy was created.</p>
        pub fn date_created(mut self, input: aws_smithy_types::DateTime) -> Self {
            self.date_created = Some(input);
            self
        }
        /// <p>The local date and time when the lifecycle policy was created.</p>
        pub fn set_date_created(
            mut self,
            input: std::option::Option<aws_smithy_types::DateTime>,
        ) -> Self {
            self.date_created = input;
            self
        }
        /// <p>The local date and time when the lifecycle policy was last modified.</p>
        pub fn date_modified(mut self, input: aws_smithy_types::DateTime) -> Self {
            self.date_modified = Some(input);
            self
        }
        /// <p>The local date and time when the lifecycle policy was last modified.</p>
        pub fn set_date_modified(
            mut self,
            input: std::option::Option<aws_smithy_types::DateTime>,
        ) -> Self {
            self.date_modified = input;
            self
        }
        /// <p>The configuration of the lifecycle policy</p>
        pub fn policy_details(mut self, input: crate::model::PolicyDetails) -> Self {
            self.policy_details = Some(input);
            self
        }
        /// <p>The configuration of the lifecycle policy</p>
        pub fn set_policy_details(
            mut self,
            input: std::option::Option<crate::model::PolicyDetails>,
        ) -> Self {
            self.policy_details = input;
            self
        }
        /// Adds a key-value pair to `tags`.
        ///
        /// To override the contents of this collection use [`set_tags`](Self::set_tags).
        ///
        /// <p>The tags.</p>
        pub fn tags(
            mut self,
            k: impl Into<std::string::String>,
            v: impl Into<std::string::String>,
        ) -> Self {
            let mut hash_map = self.tags.unwrap_or_default();
            hash_map.insert(k.into(), v.into());
            self.tags = Some(hash_map);
            self
        }
        /// <p>The tags.</p>
        pub fn set_tags(
            mut self,
            input: std::option::Option<
                std::collections::HashMap<std::string::String, std::string::String>,
            >,
        ) -> Self {
            self.tags = input;
            self
        }
        /// <p>The Amazon Resource Name (ARN) of the policy.</p>
        pub fn policy_arn(mut self, input: impl Into<std::string::String>) -> Self {
            self.policy_arn = Some(input.into());
            self
        }
        /// <p>The Amazon Resource Name (ARN) of the policy.</p>
        pub fn set_policy_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.policy_arn = input;
            self
        }
        /// Consumes the builder and constructs a [`LifecyclePolicy`](crate::model::LifecyclePolicy)
        pub fn build(self) -> crate::model::LifecyclePolicy {
            crate::model::LifecyclePolicy {
                policy_id: self.policy_id,
                description: self.description,
                state: self.state,
                status_message: self.status_message,
                execution_role_arn: self.execution_role_arn,
                date_created: self.date_created,
                date_modified: self.date_modified,
                policy_details: self.policy_details,
                tags: self.tags,
                policy_arn: self.policy_arn,
            }
        }
    }
}
impl LifecyclePolicy {
    /// Creates a new builder-style object to manufacture [`LifecyclePolicy`](crate::model::LifecyclePolicy)
    pub fn builder() -> crate::model::lifecycle_policy::Builder {
        crate::model::lifecycle_policy::Builder::default()
    }
}

#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
    std::clone::Clone,
    std::cmp::Eq,
    std::cmp::Ord,
    std::cmp::PartialEq,
    std::cmp::PartialOrd,
    std::fmt::Debug,
    std::hash::Hash,
)]
pub enum GettablePolicyStateValues {
    #[allow(missing_docs)] // documentation missing in model
    Disabled,
    #[allow(missing_docs)] // documentation missing in model
    Enabled,
    #[allow(missing_docs)] // documentation missing in model
    Error,
    /// Unknown contains new variants that have been added since this code was generated.
    Unknown(String),
}
impl std::convert::From<&str> for GettablePolicyStateValues {
    fn from(s: &str) -> Self {
        match s {
            "DISABLED" => GettablePolicyStateValues::Disabled,
            "ENABLED" => GettablePolicyStateValues::Enabled,
            "ERROR" => GettablePolicyStateValues::Error,
            other => GettablePolicyStateValues::Unknown(other.to_owned()),
        }
    }
}
impl std::str::FromStr for GettablePolicyStateValues {
    type Err = std::convert::Infallible;

    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
        Ok(GettablePolicyStateValues::from(s))
    }
}
impl GettablePolicyStateValues {
    /// Returns the `&str` value of the enum member.
    pub fn as_str(&self) -> &str {
        match self {
            GettablePolicyStateValues::Disabled => "DISABLED",
            GettablePolicyStateValues::Enabled => "ENABLED",
            GettablePolicyStateValues::Error => "ERROR",
            GettablePolicyStateValues::Unknown(s) => s.as_ref(),
        }
    }
    /// Returns all the `&str` values of the enum members.
    pub fn values() -> &'static [&'static str] {
        &["DISABLED", "ENABLED", "ERROR"]
    }
}
impl AsRef<str> for GettablePolicyStateValues {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

/// <p>Summary information about a lifecycle policy.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct LifecyclePolicySummary {
    /// <p>The identifier of the lifecycle policy.</p>
    pub policy_id: std::option::Option<std::string::String>,
    /// <p>The description of the lifecycle policy.</p>
    pub description: std::option::Option<std::string::String>,
    /// <p>The activation state of the lifecycle policy.</p>
    pub state: std::option::Option<crate::model::GettablePolicyStateValues>,
    /// <p>The tags.</p>
    pub tags:
        std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
    /// <p>The type of policy. <code>EBS_SNAPSHOT_MANAGEMENT</code> indicates that the policy manages the lifecycle of Amazon EBS snapshots. <code>IMAGE_MANAGEMENT</code> indicates that the policy manages the lifecycle of EBS-backed AMIs.</p>
    pub policy_type: std::option::Option<crate::model::PolicyTypeValues>,
}
impl LifecyclePolicySummary {
    /// <p>The identifier of the lifecycle policy.</p>
    pub fn policy_id(&self) -> std::option::Option<&str> {
        self.policy_id.as_deref()
    }
    /// <p>The description of the lifecycle policy.</p>
    pub fn description(&self) -> std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The activation state of the lifecycle policy.</p>
    pub fn state(&self) -> std::option::Option<&crate::model::GettablePolicyStateValues> {
        self.state.as_ref()
    }
    /// <p>The tags.</p>
    pub fn tags(
        &self,
    ) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
    {
        self.tags.as_ref()
    }
    /// <p>The type of policy. <code>EBS_SNAPSHOT_MANAGEMENT</code> indicates that the policy manages the lifecycle of Amazon EBS snapshots. <code>IMAGE_MANAGEMENT</code> indicates that the policy manages the lifecycle of EBS-backed AMIs.</p>
    pub fn policy_type(&self) -> std::option::Option<&crate::model::PolicyTypeValues> {
        self.policy_type.as_ref()
    }
}
impl std::fmt::Debug for LifecyclePolicySummary {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("LifecyclePolicySummary");
        formatter.field("policy_id", &self.policy_id);
        formatter.field("description", &self.description);
        formatter.field("state", &self.state);
        formatter.field("tags", &self.tags);
        formatter.field("policy_type", &self.policy_type);
        formatter.finish()
    }
}
/// See [`LifecyclePolicySummary`](crate::model::LifecyclePolicySummary)
pub mod lifecycle_policy_summary {
    /// A builder for [`LifecyclePolicySummary`](crate::model::LifecyclePolicySummary)
    #[non_exhaustive]
    #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) policy_id: std::option::Option<std::string::String>,
        pub(crate) description: std::option::Option<std::string::String>,
        pub(crate) state: std::option::Option<crate::model::GettablePolicyStateValues>,
        pub(crate) tags: std::option::Option<
            std::collections::HashMap<std::string::String, std::string::String>,
        >,
        pub(crate) policy_type: std::option::Option<crate::model::PolicyTypeValues>,
    }
    impl Builder {
        /// <p>The identifier of the lifecycle policy.</p>
        pub fn policy_id(mut self, input: impl Into<std::string::String>) -> Self {
            self.policy_id = Some(input.into());
            self
        }
        /// <p>The identifier of the lifecycle policy.</p>
        pub fn set_policy_id(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.policy_id = input;
            self
        }
        /// <p>The description of the lifecycle policy.</p>
        pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
            self.description = Some(input.into());
            self
        }
        /// <p>The description of the lifecycle policy.</p>
        pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.description = input;
            self
        }
        /// <p>The activation state of the lifecycle policy.</p>
        pub fn state(mut self, input: crate::model::GettablePolicyStateValues) -> Self {
            self.state = Some(input);
            self
        }
        /// <p>The activation state of the lifecycle policy.</p>
        pub fn set_state(
            mut self,
            input: std::option::Option<crate::model::GettablePolicyStateValues>,
        ) -> Self {
            self.state = input;
            self
        }
        /// Adds a key-value pair to `tags`.
        ///
        /// To override the contents of this collection use [`set_tags`](Self::set_tags).
        ///
        /// <p>The tags.</p>
        pub fn tags(
            mut self,
            k: impl Into<std::string::String>,
            v: impl Into<std::string::String>,
        ) -> Self {
            let mut hash_map = self.tags.unwrap_or_default();
            hash_map.insert(k.into(), v.into());
            self.tags = Some(hash_map);
            self
        }
        /// <p>The tags.</p>
        pub fn set_tags(
            mut self,
            input: std::option::Option<
                std::collections::HashMap<std::string::String, std::string::String>,
            >,
        ) -> Self {
            self.tags = input;
            self
        }
        /// <p>The type of policy. <code>EBS_SNAPSHOT_MANAGEMENT</code> indicates that the policy manages the lifecycle of Amazon EBS snapshots. <code>IMAGE_MANAGEMENT</code> indicates that the policy manages the lifecycle of EBS-backed AMIs.</p>
        pub fn policy_type(mut self, input: crate::model::PolicyTypeValues) -> Self {
            self.policy_type = Some(input);
            self
        }
        /// <p>The type of policy. <code>EBS_SNAPSHOT_MANAGEMENT</code> indicates that the policy manages the lifecycle of Amazon EBS snapshots. <code>IMAGE_MANAGEMENT</code> indicates that the policy manages the lifecycle of EBS-backed AMIs.</p>
        pub fn set_policy_type(
            mut self,
            input: std::option::Option<crate::model::PolicyTypeValues>,
        ) -> Self {
            self.policy_type = input;
            self
        }
        /// Consumes the builder and constructs a [`LifecyclePolicySummary`](crate::model::LifecyclePolicySummary)
        pub fn build(self) -> crate::model::LifecyclePolicySummary {
            crate::model::LifecyclePolicySummary {
                policy_id: self.policy_id,
                description: self.description,
                state: self.state,
                tags: self.tags,
                policy_type: self.policy_type,
            }
        }
    }
}
impl LifecyclePolicySummary {
    /// Creates a new builder-style object to manufacture [`LifecyclePolicySummary`](crate::model::LifecyclePolicySummary)
    pub fn builder() -> crate::model::lifecycle_policy_summary::Builder {
        crate::model::lifecycle_policy_summary::Builder::default()
    }
}