controller/cloudnativepg/
clusters.rs

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
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
// WARNING: generated by kopium - manual changes will be overwritten

// kopium command: kopium -D Default clusters.postgresql.cnpg.io -A
// kopium version: 0.16.5

use k8s_openapi::apimachinery::pkg::{api::resource::Quantity, util::intstr::IntOrString};
use kube::CustomResource;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;

/// Specification of the desired behavior of the cluster. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
#[kube(
    group = "postgresql.cnpg.io",
    version = "v1",
    kind = "Cluster",
    plural = "clusters"
)]
#[kube(namespaced)]
#[kube(status = "ClusterStatus")]
pub struct ClusterSpec {
    /// Affinity/Anti-affinity rules for Pods
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub affinity: Option<ClusterAffinity>,
    /// The configuration to be used for backups
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub backup: Option<ClusterBackup>,
    /// Instructions to bootstrap this cluster
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub bootstrap: Option<ClusterBootstrap>,
    /// The configuration for the CA and related certificates
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub certificates: Option<ClusterCertificates>,
    /// Description of this PostgreSQL cluster
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// When this option is enabled, the operator will use the `SuperuserSecret` to update the `postgres` user password (if the secret is not present, the operator will automatically create one). When this option is disabled, the operator will ignore the `SuperuserSecret` content, delete it when automatically created, and then blank the password of the `postgres` user by setting it to `NULL`. Disabled by default.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "enableSuperuserAccess"
    )]
    pub enable_superuser_access: Option<bool>,
    /// Env follows the Env format to pass environment variables to the pods created in the cluster
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub env: Option<Vec<ClusterEnv>>,
    /// EnvFrom follows the EnvFrom format to pass environment variables sources to the pods to be used by Env
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "envFrom")]
    pub env_from: Option<Vec<ClusterEnvFrom>>,
    /// EphemeralVolumeSource allows the user to configure the source of ephemeral volumes.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "ephemeralVolumeSource"
    )]
    pub ephemeral_volume_source: Option<ClusterEphemeralVolumeSource>,
    /// EphemeralVolumesSizeLimit allows the user to set the limits for the ephemeral volumes
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "ephemeralVolumesSizeLimit"
    )]
    pub ephemeral_volumes_size_limit: Option<ClusterEphemeralVolumesSizeLimit>,
    /// The list of external clusters which are used in the configuration
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "externalClusters"
    )]
    pub external_clusters: Option<Vec<ClusterExternalClusters>>,
    /// The amount of time (in seconds) to wait before triggering a failover after the primary PostgreSQL instance in the cluster was detected to be unhealthy
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "failoverDelay"
    )]
    pub failover_delay: Option<i32>,
    /// Name of the container image, supporting both tags (`<image>:<tag>`) and digests for deterministic and repeatable deployments (`<image>:<tag>@sha256:<digestValue>`)
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "imageName")]
    pub image_name: Option<String>,
    /// Image pull policy. One of `Always`, `Never` or `IfNotPresent`. If not defined, it defaults to `IfNotPresent`. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "imagePullPolicy"
    )]
    pub image_pull_policy: Option<String>,
    /// The list of pull secrets to be used to pull the images
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "imagePullSecrets"
    )]
    pub image_pull_secrets: Option<Vec<ClusterImagePullSecrets>>,
    /// Metadata that will be inherited by all objects related to the Cluster
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "inheritedMetadata"
    )]
    pub inherited_metadata: Option<ClusterInheritedMetadata>,
    /// Number of instances required in the cluster
    pub instances: i64,
    /// The instances' log level, one of the following values: error, warning, info (default), debug, trace
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "logLevel")]
    pub log_level: Option<ClusterLogLevel>,
    /// The configuration that is used by the portions of PostgreSQL that are managed by the instance manager
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub managed: Option<ClusterManaged>,
    /// The target value for the synchronous replication quorum, that can be decreased if the number of ready standbys is lower than this. Undefined or 0 disable synchronous replication.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "maxSyncReplicas"
    )]
    pub max_sync_replicas: Option<i64>,
    /// Minimum number of instances required in synchronous replication with the primary. Undefined or 0 allow writes to complete when no standby is available.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "minSyncReplicas"
    )]
    pub min_sync_replicas: Option<i64>,
    /// The configuration of the monitoring infrastructure of this cluster
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub monitoring: Option<ClusterMonitoring>,
    /// Define a maintenance window for the Kubernetes nodes
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "nodeMaintenanceWindow"
    )]
    pub node_maintenance_window: Option<ClusterNodeMaintenanceWindow>,
    /// The GID of the `postgres` user inside the image, defaults to `26`
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "postgresGID"
    )]
    pub postgres_gid: Option<i64>,
    /// The UID of the `postgres` user inside the image, defaults to `26`
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "postgresUID"
    )]
    pub postgres_uid: Option<i64>,
    /// Configuration of the PostgreSQL server
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub postgresql: Option<ClusterPostgresql>,
    /// Method to follow to upgrade the primary server during a rolling update procedure, after all replicas have been successfully updated: it can be with a switchover (`switchover`) or in-place (`restart` - default)
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "primaryUpdateMethod"
    )]
    pub primary_update_method: Option<ClusterPrimaryUpdateMethod>,
    /// Deployment strategy to follow to upgrade the primary server during a rolling update procedure, after all replicas have been successfully updated: it can be automated (`unsupervised` - default) or manual (`supervised`)
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "primaryUpdateStrategy"
    )]
    pub primary_update_strategy: Option<ClusterPrimaryUpdateStrategy>,
    /// Name of the priority class which will be used in every generated Pod, if the PriorityClass specified does not exist, the pod will not be able to schedule.  Please refer to https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#priorityclass for more information
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "priorityClassName"
    )]
    pub priority_class_name: Option<String>,
    /// Template to be used to define projected volumes, projected volumes will be mounted under `/projected` base folder
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "projectedVolumeTemplate"
    )]
    pub projected_volume_template: Option<ClusterProjectedVolumeTemplate>,
    /// Replica cluster configuration
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub replica: Option<ClusterReplica>,
    /// Replication slots management configuration
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "replicationSlots"
    )]
    pub replication_slots: Option<ClusterReplicationSlots>,
    /// Resources requirements of every generated Pod. Please refer to https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ for more information.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resources: Option<ClusterResources>,
    /// If specified, the pod will be dispatched by specified Kubernetes scheduler. If not specified, the pod will be dispatched by the default scheduler. More info: https://kubernetes.io/docs/concepts/scheduling-eviction/kube-scheduler/
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "schedulerName"
    )]
    pub scheduler_name: Option<String>,
    /// The SeccompProfile applied to every Pod and Container. Defaults to: `RuntimeDefault`
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "seccompProfile"
    )]
    pub seccomp_profile: Option<ClusterSeccompProfile>,
    /// Configure the generation of the service account
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "serviceAccountTemplate"
    )]
    pub service_account_template: Option<ClusterServiceAccountTemplate>,
    /// The time in seconds that controls the window of time reserved for the smart shutdown of Postgres to complete. Make sure you reserve enough time for the operator to request a fast shutdown of Postgres (that is: `stopDelay` - `smartShutdownTimeout`).
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "smartShutdownTimeout"
    )]
    pub smart_shutdown_timeout: Option<i32>,
    /// The time in seconds that is allowed for a PostgreSQL instance to successfully start up (default 3600). The startup probe failure threshold is derived from this value using the formula: ceiling(startDelay / 10).
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "startDelay"
    )]
    pub start_delay: Option<i32>,
    /// The time in seconds that is allowed for a PostgreSQL instance to gracefully shutdown (default 1800)
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "stopDelay")]
    pub stop_delay: Option<i32>,
    /// Configuration of the storage of the instances
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub storage: Option<ClusterStorage>,
    /// The secret containing the superuser password. If not defined a new secret will be created with a randomly generated password
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "superuserSecret"
    )]
    pub superuser_secret: Option<ClusterSuperuserSecret>,
    /// The time in seconds that is allowed for a primary PostgreSQL instance to gracefully shutdown during a switchover. Default value is 3600 seconds (1 hour).
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "switchoverDelay"
    )]
    pub switchover_delay: Option<i32>,
    /// The tablespaces configuration
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tablespaces: Option<Vec<ClusterTablespaces>>,
    /// TopologySpreadConstraints specifies how to spread matching pods among the given topology. More info: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "topologySpreadConstraints"
    )]
    pub topology_spread_constraints: Option<Vec<ClusterTopologySpreadConstraints>>,
    /// Configuration of the storage for PostgreSQL WAL (Write-Ahead Log)
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "walStorage"
    )]
    pub wal_storage: Option<ClusterWalStorage>,
}

/// Affinity/Anti-affinity rules for Pods
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinity {
    /// AdditionalPodAffinity allows to specify pod affinity terms to be passed to all the cluster's pods.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "additionalPodAffinity"
    )]
    pub additional_pod_affinity: Option<ClusterAffinityAdditionalPodAffinity>,
    /// AdditionalPodAntiAffinity allows to specify pod anti-affinity terms to be added to the ones generated by the operator if EnablePodAntiAffinity is set to true (default) or to be used exclusively if set to false.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "additionalPodAntiAffinity"
    )]
    pub additional_pod_anti_affinity: Option<ClusterAffinityAdditionalPodAntiAffinity>,
    /// Activates anti-affinity for the pods. The operator will define pods anti-affinity unless this field is explicitly set to false
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "enablePodAntiAffinity"
    )]
    pub enable_pod_anti_affinity: Option<bool>,
    /// NodeAffinity describes node affinity scheduling rules for the pod. More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "nodeAffinity"
    )]
    pub node_affinity: Option<ClusterAffinityNodeAffinity>,
    /// NodeSelector is map of key-value pairs used to define the nodes on which the pods can run. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "nodeSelector"
    )]
    pub node_selector: Option<BTreeMap<String, String>>,
    /// PodAntiAffinityType allows the user to decide whether pod anti-affinity between cluster instance has to be considered a strong requirement during scheduling or not. Allowed values are: "preferred" (default if empty) or "required". Setting it to "required", could lead to instances remaining pending until new kubernetes nodes are added if all the existing nodes don't match the required pod anti-affinity rule. More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "podAntiAffinityType"
    )]
    pub pod_anti_affinity_type: Option<String>,
    /// Tolerations is a list of Tolerations that should be set for all the pods, in order to allow them to run on tainted nodes. More info: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tolerations: Option<Vec<ClusterAffinityTolerations>>,
    /// TopologyKey to use for anti-affinity configuration. See k8s documentation for more info on that
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "topologyKey"
    )]
    pub topology_key: Option<String>,
}

/// AdditionalPodAffinity allows to specify pod affinity terms to be passed to all the cluster's pods.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAffinity {
    /// The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "preferredDuringSchedulingIgnoredDuringExecution"
    )]
    pub preferred_during_scheduling_ignored_during_execution: Option<
        Vec<ClusterAffinityAdditionalPodAffinityPreferredDuringSchedulingIgnoredDuringExecution>,
    >,
    /// If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "requiredDuringSchedulingIgnoredDuringExecution"
    )]
    pub required_during_scheduling_ignored_during_execution: Option<
        Vec<ClusterAffinityAdditionalPodAffinityRequiredDuringSchedulingIgnoredDuringExecution>,
    >,
}

/// The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAffinityPreferredDuringSchedulingIgnoredDuringExecution {
    /// Required. A pod affinity term, associated with the corresponding weight.
    #[serde(rename = "podAffinityTerm")]
    pub pod_affinity_term: ClusterAffinityAdditionalPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTerm,
    /// weight associated with matching the corresponding podAffinityTerm, in the range 1-100.
    pub weight: i32,
}

/// Required. A pod affinity term, associated with the corresponding weight.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTerm {
    /// A label query over a set of resources, in this case pods.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
    pub label_selector: Option<ClusterAffinityAdditionalPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelector>,
    /// A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "namespaceSelector")]
    pub namespace_selector: Option<ClusterAffinityAdditionalPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelector>,
    /// namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespaces: Option<Vec<String>>,
    /// This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.
    #[serde(rename = "topologyKey")]
    pub topology_key: String,
}

/// A label query over a set of resources, in this case pods.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<ClusterAffinityAdditionalPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelectorMatchExpressions
{
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<ClusterAffinityAdditionalPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelectorMatchExpressions
{
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key <topologyKey> matches that of any node on which a pod of the set of pods is running
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAffinityRequiredDuringSchedulingIgnoredDuringExecution {
    /// A label query over a set of resources, in this case pods.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
    pub label_selector: Option<ClusterAffinityAdditionalPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelector>,
    /// A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "namespaceSelector")]
    pub namespace_selector: Option<ClusterAffinityAdditionalPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelector>,
    /// namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespaces: Option<Vec<String>>,
    /// This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.
    #[serde(rename = "topologyKey")]
    pub topology_key: String,
}

/// A label query over a set of resources, in this case pods.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<ClusterAffinityAdditionalPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelectorMatchExpressions
{
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<ClusterAffinityAdditionalPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelectorMatchExpressions
{
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// AdditionalPodAntiAffinity allows to specify pod anti-affinity terms to be added to the ones generated by the operator if EnablePodAntiAffinity is set to true (default) or to be used exclusively if set to false.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAntiAffinity {
    /// The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "preferredDuringSchedulingIgnoredDuringExecution"
    )]
    pub preferred_during_scheduling_ignored_during_execution: Option<
        Vec<
            ClusterAffinityAdditionalPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecution,
        >,
    >,
    /// If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "requiredDuringSchedulingIgnoredDuringExecution"
    )]
    pub required_during_scheduling_ignored_during_execution: Option<
        Vec<ClusterAffinityAdditionalPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecution>,
    >,
}

/// The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecution {
    /// Required. A pod affinity term, associated with the corresponding weight.
    #[serde(rename = "podAffinityTerm")]
    pub pod_affinity_term: ClusterAffinityAdditionalPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTerm,
    /// weight associated with matching the corresponding podAffinityTerm, in the range 1-100.
    pub weight: i32,
}

/// Required. A pod affinity term, associated with the corresponding weight.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTerm {
    /// A label query over a set of resources, in this case pods.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
    pub label_selector: Option<ClusterAffinityAdditionalPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelector>,
    /// A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "namespaceSelector")]
    pub namespace_selector: Option<ClusterAffinityAdditionalPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelector>,
    /// namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespaces: Option<Vec<String>>,
    /// This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.
    #[serde(rename = "topologyKey")]
    pub topology_key: String,
}

/// A label query over a set of resources, in this case pods.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<ClusterAffinityAdditionalPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelectorMatchExpressions
{
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<ClusterAffinityAdditionalPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelectorMatchExpressions
{
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key <topologyKey> matches that of any node on which a pod of the set of pods is running
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecution {
    /// A label query over a set of resources, in this case pods.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
    pub label_selector: Option<ClusterAffinityAdditionalPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelector>,
    /// A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "namespaceSelector")]
    pub namespace_selector: Option<ClusterAffinityAdditionalPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelector>,
    /// namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespaces: Option<Vec<String>>,
    /// This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.
    #[serde(rename = "topologyKey")]
    pub topology_key: String,
}

/// A label query over a set of resources, in this case pods.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<ClusterAffinityAdditionalPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelectorMatchExpressions
{
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<ClusterAffinityAdditionalPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityAdditionalPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelectorMatchExpressions
{
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// NodeAffinity describes node affinity scheduling rules for the pod. More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityNodeAffinity {
    /// The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "preferredDuringSchedulingIgnoredDuringExecution"
    )]
    pub preferred_during_scheduling_ignored_during_execution:
        Option<Vec<ClusterAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution>>,
    /// If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "requiredDuringSchedulingIgnoredDuringExecution"
    )]
    pub required_during_scheduling_ignored_during_execution:
        Option<ClusterAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution>,
}

/// An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution {
    /// A node selector term, associated with the corresponding weight.
    pub preference:
        ClusterAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreference,
    /// Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.
    pub weight: i32,
}

/// A node selector term, associated with the corresponding weight.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreference {
    /// A list of node selector requirements by node's labels.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<ClusterAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreferenceMatchExpressions>>,
    /// A list of node selector requirements by node's fields.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchFields")]
    pub match_fields: Option<Vec<ClusterAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreferenceMatchFields>>,
}

/// A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreferenceMatchExpressions
{
    /// The label key that the selector applies to.
    pub key: String,
    /// Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
    pub operator: String,
    /// An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreferenceMatchFields
{
    /// The label key that the selector applies to.
    pub key: String,
    /// Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
    pub operator: String,
    /// An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution {
    /// Required. A list of node selector terms. The terms are ORed.
    #[serde(rename = "nodeSelectorTerms")]
    pub node_selector_terms: Vec<
        ClusterAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms,
    >,
}

/// A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms {
    /// A list of node selector requirements by node's labels.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
    pub match_expressions: Option<Vec<ClusterAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsMatchExpressions>>,
    /// A list of node selector requirements by node's fields.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchFields")]
    pub match_fields: Option<Vec<ClusterAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsMatchFields>>,
}

/// A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsMatchExpressions
{
    /// The label key that the selector applies to.
    pub key: String,
    /// Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
    pub operator: String,
    /// An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsMatchFields
{
    /// The label key that the selector applies to.
    pub key: String,
    /// Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
    pub operator: String,
    /// An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// The pod this Toleration is attached to tolerates any taint that matches the triple <key,value,effect> using the matching operator <operator>.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterAffinityTolerations {
    /// Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub effect: Option<String>,
    /// Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub key: Option<String>,
    /// Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub operator: Option<String>,
    /// TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "tolerationSeconds"
    )]
    pub toleration_seconds: Option<i64>,
    /// Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
}

/// The configuration to be used for backups
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBackup {
    /// The configuration for the barman-cloud tool suite
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "barmanObjectStore"
    )]
    pub barman_object_store: Option<ClusterBackupBarmanObjectStore>,
    /// RetentionPolicy is the retention policy to be used for backups and WALs (i.e. '60d'). The retention policy is expressed in the form of `XXu` where `XX` is a positive integer and `u` is in `[dwm]` - days, weeks, months. It's currently only applicable when using the BarmanObjectStore method.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "retentionPolicy"
    )]
    pub retention_policy: Option<String>,
    /// The policy to decide which instance should perform backups. Available options are empty string, which will default to `prefer-standby` policy, `primary` to have backups run always on primary instances, `prefer-standby` to have backups run preferably on the most updated standby, if available.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub target: Option<ClusterBackupTarget>,
    /// VolumeSnapshot provides the configuration for the execution of volume snapshot backups.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "volumeSnapshot"
    )]
    pub volume_snapshot: Option<ClusterBackupVolumeSnapshot>,
}

/// The configuration for the barman-cloud tool suite
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBackupBarmanObjectStore {
    /// The credentials to use to upload data to Azure Blob Storage
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "azureCredentials"
    )]
    pub azure_credentials: Option<ClusterBackupBarmanObjectStoreAzureCredentials>,
    /// The configuration to be used to backup the data files When not defined, base backups files will be stored uncompressed and may be unencrypted in the object store, according to the bucket default policy.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub data: Option<ClusterBackupBarmanObjectStoreData>,
    /// The path where to store the backup (i.e. s3://bucket/path/to/folder) this path, with different destination folders, will be used for WALs and for data
    #[serde(rename = "destinationPath")]
    pub destination_path: String,
    /// EndpointCA store the CA bundle of the barman endpoint. Useful when using self-signed certificates to avoid errors with certificate issuer and barman-cloud-wal-archive
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "endpointCA"
    )]
    pub endpoint_ca: Option<ClusterBackupBarmanObjectStoreEndpointCa>,
    /// Endpoint to be used to upload data to the cloud, overriding the automatic endpoint discovery
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "endpointURL"
    )]
    pub endpoint_url: Option<String>,
    /// The credentials to use to upload data to Google Cloud Storage
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "googleCredentials"
    )]
    pub google_credentials: Option<ClusterBackupBarmanObjectStoreGoogleCredentials>,
    /// HistoryTags is a list of key value pairs that will be passed to the Barman --history-tags option.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "historyTags"
    )]
    pub history_tags: Option<BTreeMap<String, String>>,
    /// The credentials to use to upload data to S3
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "s3Credentials"
    )]
    pub s3_credentials: Option<ClusterBackupBarmanObjectStoreS3Credentials>,
    /// The server name on S3, the cluster name is used if this parameter is omitted
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "serverName"
    )]
    pub server_name: Option<String>,
    /// Tags is a list of key value pairs that will be passed to the Barman --tags option.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tags: Option<BTreeMap<String, String>>,
    /// The configuration for the backup of the WAL stream. When not defined, WAL files will be stored uncompressed and may be unencrypted in the object store, according to the bucket default policy.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub wal: Option<ClusterBackupBarmanObjectStoreWal>,
}

/// The credentials to use to upload data to Azure Blob Storage
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBackupBarmanObjectStoreAzureCredentials {
    /// The connection string to be used
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "connectionString"
    )]
    pub connection_string: Option<ClusterBackupBarmanObjectStoreAzureCredentialsConnectionString>,
    /// Use the Azure AD based authentication without providing explicitly the keys.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "inheritFromAzureAD"
    )]
    pub inherit_from_azure_ad: Option<bool>,
    /// The storage account where to upload data
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "storageAccount"
    )]
    pub storage_account: Option<ClusterBackupBarmanObjectStoreAzureCredentialsStorageAccount>,
    /// The storage account key to be used in conjunction with the storage account name
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "storageKey"
    )]
    pub storage_key: Option<ClusterBackupBarmanObjectStoreAzureCredentialsStorageKey>,
    /// A shared-access-signature to be used in conjunction with the storage account name
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "storageSasToken"
    )]
    pub storage_sas_token: Option<ClusterBackupBarmanObjectStoreAzureCredentialsStorageSasToken>,
}

/// The connection string to be used
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBackupBarmanObjectStoreAzureCredentialsConnectionString {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// The storage account where to upload data
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBackupBarmanObjectStoreAzureCredentialsStorageAccount {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// The storage account key to be used in conjunction with the storage account name
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBackupBarmanObjectStoreAzureCredentialsStorageKey {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// A shared-access-signature to be used in conjunction with the storage account name
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBackupBarmanObjectStoreAzureCredentialsStorageSasToken {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// The configuration to be used to backup the data files When not defined, base backups files will be stored uncompressed and may be unencrypted in the object store, according to the bucket default policy.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBackupBarmanObjectStoreData {
    /// Compress a backup file (a tar file per tablespace) while streaming it to the object store. Available options are empty string (no compression, default), `gzip`, `bzip2` or `snappy`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub compression: Option<ClusterBackupBarmanObjectStoreDataCompression>,
    /// Whenever to force the encryption of files (if the bucket is not already configured for that). Allowed options are empty string (use the bucket policy, default), `AES256` and `aws:kms`
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub encryption: Option<ClusterBackupBarmanObjectStoreDataEncryption>,
    /// Control whether the I/O workload for the backup initial checkpoint will be limited, according to the `checkpoint_completion_target` setting on the PostgreSQL server. If set to true, an immediate checkpoint will be used, meaning PostgreSQL will complete the checkpoint as soon as possible. `false` by default.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "immediateCheckpoint"
    )]
    pub immediate_checkpoint: Option<bool>,
    /// The number of parallel jobs to be used to upload the backup, defaults to 2
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub jobs: Option<i32>,
}

/// The configuration to be used to backup the data files When not defined, base backups files will be stored uncompressed and may be unencrypted in the object store, according to the bucket default policy.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub enum ClusterBackupBarmanObjectStoreDataCompression {
    #[serde(rename = "gzip")]
    Gzip,
    #[serde(rename = "bzip2")]
    Bzip2,
    #[serde(rename = "snappy")]
    Snappy,
}

/// The configuration to be used to backup the data files When not defined, base backups files will be stored uncompressed and may be unencrypted in the object store, according to the bucket default policy.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub enum ClusterBackupBarmanObjectStoreDataEncryption {
    #[serde(rename = "AES256")]
    Aes256,
    #[serde(rename = "aws:kms")]
    AwsKms,
}

/// EndpointCA store the CA bundle of the barman endpoint. Useful when using self-signed certificates to avoid errors with certificate issuer and barman-cloud-wal-archive
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBackupBarmanObjectStoreEndpointCa {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// The credentials to use to upload data to Google Cloud Storage
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBackupBarmanObjectStoreGoogleCredentials {
    /// The secret containing the Google Cloud Storage JSON file with the credentials
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "applicationCredentials"
    )]
    pub application_credentials:
        Option<ClusterBackupBarmanObjectStoreGoogleCredentialsApplicationCredentials>,
    /// If set to true, will presume that it's running inside a GKE environment, default to false.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "gkeEnvironment"
    )]
    pub gke_environment: Option<bool>,
}

/// The secret containing the Google Cloud Storage JSON file with the credentials
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBackupBarmanObjectStoreGoogleCredentialsApplicationCredentials {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// The credentials to use to upload data to S3
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBackupBarmanObjectStoreS3Credentials {
    /// The reference to the access key id
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "accessKeyId"
    )]
    pub access_key_id: Option<ClusterBackupBarmanObjectStoreS3CredentialsAccessKeyId>,
    /// Use the role based authentication without providing explicitly the keys.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "inheritFromIAMRole"
    )]
    pub inherit_from_iam_role: Option<bool>,
    /// The reference to the secret containing the region name
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub region: Option<ClusterBackupBarmanObjectStoreS3CredentialsRegion>,
    /// The reference to the secret access key
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "secretAccessKey"
    )]
    pub secret_access_key: Option<ClusterBackupBarmanObjectStoreS3CredentialsSecretAccessKey>,
    /// The references to the session key
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "sessionToken"
    )]
    pub session_token: Option<ClusterBackupBarmanObjectStoreS3CredentialsSessionToken>,
}

/// The reference to the access key id
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBackupBarmanObjectStoreS3CredentialsAccessKeyId {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// The reference to the secret containing the region name
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBackupBarmanObjectStoreS3CredentialsRegion {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// The reference to the secret access key
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBackupBarmanObjectStoreS3CredentialsSecretAccessKey {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// The references to the session key
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBackupBarmanObjectStoreS3CredentialsSessionToken {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// The configuration for the backup of the WAL stream. When not defined, WAL files will be stored uncompressed and may be unencrypted in the object store, according to the bucket default policy.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBackupBarmanObjectStoreWal {
    /// Compress a WAL file before sending it to the object store. Available options are empty string (no compression, default), `gzip`, `bzip2` or `snappy`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub compression: Option<ClusterBackupBarmanObjectStoreWalCompression>,
    /// Whenever to force the encryption of files (if the bucket is not already configured for that). Allowed options are empty string (use the bucket policy, default), `AES256` and `aws:kms`
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub encryption: Option<ClusterBackupBarmanObjectStoreWalEncryption>,
    /// Number of WAL files to be either archived in parallel (when the PostgreSQL instance is archiving to a backup object store) or restored in parallel (when a PostgreSQL standby is fetching WAL files from a recovery object store). If not specified, WAL files will be processed one at a time. It accepts a positive integer as a value - with 1 being the minimum accepted value.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "maxParallel"
    )]
    pub max_parallel: Option<i64>,
}

/// The configuration for the backup of the WAL stream. When not defined, WAL files will be stored uncompressed and may be unencrypted in the object store, according to the bucket default policy.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub enum ClusterBackupBarmanObjectStoreWalCompression {
    #[serde(rename = "gzip")]
    Gzip,
    #[serde(rename = "bzip2")]
    Bzip2,
    #[serde(rename = "snappy")]
    Snappy,
}

/// The configuration for the backup of the WAL stream. When not defined, WAL files will be stored uncompressed and may be unencrypted in the object store, according to the bucket default policy.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub enum ClusterBackupBarmanObjectStoreWalEncryption {
    #[serde(rename = "AES256")]
    Aes256,
    #[serde(rename = "aws:kms")]
    AwsKms,
}

/// The configuration to be used for backups
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub enum ClusterBackupTarget {
    #[serde(rename = "primary")]
    Primary,
    #[serde(rename = "prefer-standby")]
    PreferStandby,
}

/// VolumeSnapshot provides the configuration for the execution of volume snapshot backups.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema, PartialEq)]
pub struct ClusterBackupVolumeSnapshot {
    /// Annotations key-value pairs that will be added to .metadata.annotations snapshot resources.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub annotations: Option<BTreeMap<String, String>>,
    /// ClassName specifies the Snapshot Class to be used for PG_DATA PersistentVolumeClaim. It is the default class for the other types if no specific class is present
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "className")]
    pub class_name: Option<String>,
    /// Labels are key-value pairs that will be added to .metadata.labels snapshot resources.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub labels: Option<BTreeMap<String, String>>,
    /// Whether the default type of backup with volume snapshots is online/hot (`true`, default) or offline/cold (`false`)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub online: Option<bool>,
    /// Configuration parameters to control the online/hot backup with volume snapshots
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "onlineConfiguration"
    )]
    pub online_configuration: Option<ClusterBackupVolumeSnapshotOnlineConfiguration>,
    /// SnapshotOwnerReference indicates the type of owner reference the snapshot should have
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "snapshotOwnerReference"
    )]
    pub snapshot_owner_reference: Option<ClusterBackupVolumeSnapshotSnapshotOwnerReference>,
    /// TablespaceClassName specifies the Snapshot Class to be used for the tablespaces. defaults to the PGDATA Snapshot Class, if set
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "tablespaceClassName"
    )]
    pub tablespace_class_name: Option<BTreeMap<String, String>>,
    /// WalClassName specifies the Snapshot Class to be used for the PG_WAL PersistentVolumeClaim.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "walClassName"
    )]
    pub wal_class_name: Option<String>,
}

/// Configuration parameters to control the online/hot backup with volume snapshots
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema, PartialEq)]
pub struct ClusterBackupVolumeSnapshotOnlineConfiguration {
    /// Control whether the I/O workload for the backup initial checkpoint will be limited, according to the `checkpoint_completion_target` setting on the PostgreSQL server. If set to true, an immediate checkpoint will be used, meaning PostgreSQL will complete the checkpoint as soon as possible. `false` by default.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "immediateCheckpoint"
    )]
    pub immediate_checkpoint: Option<bool>,
    /// If false, the function will return immediately after the backup is completed, without waiting for WAL to be archived. This behavior is only useful with backup software that independently monitors WAL archiving. Otherwise, WAL required to make the backup consistent might be missing and make the backup useless. By default, or when this parameter is true, pg_backup_stop will wait for WAL to be archived when archiving is enabled. On a standby, this means that it will wait only when archive_mode = always. If write activity on the primary is low, it may be useful to run pg_switch_wal on the primary in order to trigger an immediate segment switch.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "waitForArchive"
    )]
    pub wait_for_archive: Option<bool>,
}

/// VolumeSnapshot provides the configuration for the execution of volume snapshot backups.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, PartialEq)]
pub enum ClusterBackupVolumeSnapshotSnapshotOwnerReference {
    #[serde(rename = "none")]
    None,
    #[serde(rename = "cluster")]
    Cluster,
    #[serde(rename = "backup")]
    Backup,
}

/// Instructions to bootstrap this cluster
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBootstrap {
    /// Bootstrap the cluster via initdb
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub initdb: Option<ClusterBootstrapInitdb>,
    /// Bootstrap the cluster taking a physical backup of another compatible PostgreSQL instance
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub pg_basebackup: Option<ClusterBootstrapPgBasebackup>,
    /// Bootstrap the cluster from a backup
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub recovery: Option<ClusterBootstrapRecovery>,
}

/// Bootstrap the cluster via initdb
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBootstrapInitdb {
    /// Whether the `-k` option should be passed to initdb, enabling checksums on data pages (default: `false`)
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "dataChecksums"
    )]
    pub data_checksums: Option<bool>,
    /// Name of the database used by the application. Default: `app`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub database: Option<String>,
    /// The value to be passed as option `--encoding` for initdb (default:`UTF8`)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub encoding: Option<String>,
    /// Bootstraps the new cluster by importing data from an existing PostgreSQL instance using logical backup (`pg_dump` and `pg_restore`)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub import: Option<ClusterBootstrapInitdbImport>,
    /// The value to be passed as option `--lc-ctype` for initdb (default:`C`)
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "localeCType"
    )]
    pub locale_c_type: Option<String>,
    /// The value to be passed as option `--lc-collate` for initdb (default:`C`)
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "localeCollate"
    )]
    pub locale_collate: Option<String>,
    /// The list of options that must be passed to initdb when creating the cluster. Deprecated: This could lead to inconsistent configurations, please use the explicit provided parameters instead. If defined, explicit values will be ignored.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub options: Option<Vec<String>>,
    /// Name of the owner of the database in the instance to be used by applications. Defaults to the value of the `database` key.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub owner: Option<String>,
    /// List of SQL queries to be executed as a superuser in the application database right after is created - to be used with extreme care (by default empty)
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "postInitApplicationSQL"
    )]
    pub post_init_application_sql: Option<Vec<String>>,
    /// PostInitApplicationSQLRefs points references to ConfigMaps or Secrets which contain SQL files, the general implementation order to these references is from all Secrets to all ConfigMaps, and inside Secrets or ConfigMaps, the implementation order is same as the order of each array (by default empty)
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "postInitApplicationSQLRefs"
    )]
    pub post_init_application_sql_refs: Option<ClusterBootstrapInitdbPostInitApplicationSqlRefs>,
    /// List of SQL queries to be executed as a superuser immediately after the cluster has been created - to be used with extreme care (by default empty)
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "postInitSQL"
    )]
    pub post_init_sql: Option<Vec<String>>,
    /// List of SQL queries to be executed as a superuser in the `template1` after the cluster has been created - to be used with extreme care (by default empty)
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "postInitTemplateSQL"
    )]
    pub post_init_template_sql: Option<Vec<String>>,
    /// Name of the secret containing the initial credentials for the owner of the user database. If empty a new secret will be created from scratch
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub secret: Option<ClusterBootstrapInitdbSecret>,
    /// The value in megabytes (1 to 1024) to be passed to the `--wal-segsize` option for initdb (default: empty, resulting in PostgreSQL default: 16MB)
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "walSegmentSize"
    )]
    pub wal_segment_size: Option<i64>,
}

/// Bootstraps the new cluster by importing data from an existing PostgreSQL instance using logical backup (`pg_dump` and `pg_restore`)
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub struct ClusterBootstrapInitdbImport {
    /// The databases to import
    pub databases: Vec<String>,
    /// List of SQL queries to be executed as a superuser in the application database right after is imported - to be used with extreme care (by default empty). Only available in microservice type.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "postImportApplicationSQL"
    )]
    pub post_import_application_sql: Option<Vec<String>>,
    /// The roles to import
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub roles: Option<Vec<String>>,
    /// When set to true, only the `pre-data` and `post-data` sections of `pg_restore` are invoked, avoiding data import. Default: `false`.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "schemaOnly"
    )]
    pub schema_only: Option<bool>,
    /// The source of the import
    pub source: ClusterBootstrapInitdbImportSource,
    /// The import type. Can be `microservice` or `monolith`.
    #[serde(rename = "type")]
    pub r#type: ClusterBootstrapInitdbImportType,
}

/// The source of the import
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBootstrapInitdbImportSource {
    /// The name of the externalCluster used for import
    #[serde(rename = "externalCluster")]
    pub external_cluster: String,
}

/// Bootstraps the new cluster by importing data from an existing PostgreSQL instance using logical backup (`pg_dump` and `pg_restore`)
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub enum ClusterBootstrapInitdbImportType {
    #[serde(rename = "microservice")]
    Microservice,
    #[serde(rename = "monolith")]
    Monolith,
}

/// PostInitApplicationSQLRefs points references to ConfigMaps or Secrets which contain SQL files, the general implementation order to these references is from all Secrets to all ConfigMaps, and inside Secrets or ConfigMaps, the implementation order is same as the order of each array (by default empty)
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBootstrapInitdbPostInitApplicationSqlRefs {
    /// ConfigMapRefs holds a list of references to ConfigMaps
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "configMapRefs"
    )]
    pub config_map_refs: Option<Vec<ClusterBootstrapInitdbPostInitApplicationSqlRefsConfigMapRefs>>,
    /// SecretRefs holds a list of references to Secrets
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "secretRefs"
    )]
    pub secret_refs: Option<Vec<ClusterBootstrapInitdbPostInitApplicationSqlRefsSecretRefs>>,
}

/// ConfigMapKeySelector contains enough information to let you locate the key of a ConfigMap
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBootstrapInitdbPostInitApplicationSqlRefsConfigMapRefs {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// SecretKeySelector contains enough information to let you locate the key of a Secret
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBootstrapInitdbPostInitApplicationSqlRefsSecretRefs {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// Name of the secret containing the initial credentials for the owner of the user database. If empty a new secret will be created from scratch
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBootstrapInitdbSecret {
    /// Name of the referent.
    pub name: String,
}

/// Bootstrap the cluster taking a physical backup of another compatible PostgreSQL instance
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBootstrapPgBasebackup {
    /// Name of the database used by the application. Default: `app`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub database: Option<String>,
    /// Name of the owner of the database in the instance to be used by applications. Defaults to the value of the `database` key.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub owner: Option<String>,
    /// Name of the secret containing the initial credentials for the owner of the user database. If empty a new secret will be created from scratch
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub secret: Option<ClusterBootstrapPgBasebackupSecret>,
    /// The name of the server of which we need to take a physical backup
    pub source: String,
}

/// Name of the secret containing the initial credentials for the owner of the user database. If empty a new secret will be created from scratch
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBootstrapPgBasebackupSecret {
    /// Name of the referent.
    pub name: String,
}

/// Bootstrap the cluster from a backup
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBootstrapRecovery {
    /// The backup object containing the physical base backup from which to initiate the recovery procedure. Mutually exclusive with `source` and `volumeSnapshots`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub backup: Option<ClusterBootstrapRecoveryBackup>,
    /// Name of the database used by the application. Default: `app`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub database: Option<String>,
    /// Name of the owner of the database in the instance to be used by applications. Defaults to the value of the `database` key.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub owner: Option<String>,
    /// By default, the recovery process applies all the available WAL files in the archive (full recovery). However, you can also end the recovery as soon as a consistent state is reached or recover to a point-in-time (PITR) by specifying a `RecoveryTarget` object, as expected by PostgreSQL (i.e., timestamp, transaction Id, LSN, ...). More info: https://www.postgresql.org/docs/current/runtime-config-wal.html#RUNTIME-CONFIG-WAL-RECOVERY-TARGET
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "recoveryTarget"
    )]
    pub recovery_target: Option<ClusterBootstrapRecoveryRecoveryTarget>,
    /// Name of the secret containing the initial credentials for the owner of the user database. If empty a new secret will be created from scratch
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub secret: Option<ClusterBootstrapRecoverySecret>,
    /// The external cluster whose backup we will restore. This is also used as the name of the folder under which the backup is stored, so it must be set to the name of the source cluster Mutually exclusive with `backup`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub source: Option<String>,
    /// The static PVC data source(s) from which to initiate the recovery procedure. Currently supporting `VolumeSnapshot` and `PersistentVolumeClaim` resources that map an existing PVC group, compatible with CloudNativePG, and taken with a cold backup copy on a fenced Postgres instance (limitation which will be removed in the future when online backup will be implemented). Mutually exclusive with `backup`.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "volumeSnapshots"
    )]
    pub volume_snapshots: Option<ClusterBootstrapRecoveryVolumeSnapshots>,
}

/// The backup object containing the physical base backup from which to initiate the recovery procedure. Mutually exclusive with `source` and `volumeSnapshots`.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBootstrapRecoveryBackup {
    /// EndpointCA store the CA bundle of the barman endpoint. Useful when using self-signed certificates to avoid errors with certificate issuer and barman-cloud-wal-archive.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "endpointCA"
    )]
    pub endpoint_ca: Option<ClusterBootstrapRecoveryBackupEndpointCa>,
    /// Name of the referent.
    pub name: String,
}

/// EndpointCA store the CA bundle of the barman endpoint. Useful when using self-signed certificates to avoid errors with certificate issuer and barman-cloud-wal-archive.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBootstrapRecoveryBackupEndpointCa {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// By default, the recovery process applies all the available WAL files in the archive (full recovery). However, you can also end the recovery as soon as a consistent state is reached or recover to a point-in-time (PITR) by specifying a `RecoveryTarget` object, as expected by PostgreSQL (i.e., timestamp, transaction Id, LSN, ...). More info: https://www.postgresql.org/docs/current/runtime-config-wal.html#RUNTIME-CONFIG-WAL-RECOVERY-TARGET
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBootstrapRecoveryRecoveryTarget {
    /// The ID of the backup from which to start the recovery process. If empty (default) the operator will automatically detect the backup based on targetTime or targetLSN if specified. Otherwise use the latest available backup in chronological order.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "backupID")]
    pub backup_id: Option<String>,
    /// Set the target to be exclusive. If omitted, defaults to false, so that in Postgres, `recovery_target_inclusive` will be true
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub exclusive: Option<bool>,
    /// End recovery as soon as a consistent state is reached
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "targetImmediate"
    )]
    pub target_immediate: Option<bool>,
    /// The target LSN (Log Sequence Number)
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetLSN")]
    pub target_lsn: Option<String>,
    /// The target name (to be previously created with `pg_create_restore_point`)
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "targetName"
    )]
    pub target_name: Option<String>,
    /// The target timeline ("latest" or a positive integer)
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetTLI")]
    pub target_tli: Option<String>,
    /// The target time as a timestamp in the RFC3339 standard
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "targetTime"
    )]
    pub target_time: Option<String>,
    /// The target transaction ID
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetXID")]
    pub target_xid: Option<String>,
}

/// Name of the secret containing the initial credentials for the owner of the user database. If empty a new secret will be created from scratch
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBootstrapRecoverySecret {
    /// Name of the referent.
    pub name: String,
}

/// The static PVC data source(s) from which to initiate the recovery procedure. Currently supporting `VolumeSnapshot` and `PersistentVolumeClaim` resources that map an existing PVC group, compatible with CloudNativePG, and taken with a cold backup copy on a fenced Postgres instance (limitation which will be removed in the future when online backup will be implemented). Mutually exclusive with `backup`.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBootstrapRecoveryVolumeSnapshots {
    /// Configuration of the storage of the instances
    pub storage: ClusterBootstrapRecoveryVolumeSnapshotsStorage,
    /// Configuration of the storage for PostgreSQL tablespaces
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "tablespaceStorage"
    )]
    pub tablespace_storage:
        Option<BTreeMap<String, ClusterBootstrapRecoveryVolumeSnapshotsTablespaceStorage>>,
    /// Configuration of the storage for PostgreSQL WAL (Write-Ahead Log)
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "walStorage"
    )]
    pub wal_storage: Option<ClusterBootstrapRecoveryVolumeSnapshotsWalStorage>,
}

/// Configuration of the storage of the instances
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBootstrapRecoveryVolumeSnapshotsStorage {
    /// APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiGroup")]
    pub api_group: Option<String>,
    /// Kind is the type of resource being referenced
    pub kind: String,
    /// Name is the name of resource being referenced
    pub name: String,
}

/// Configuration of the storage for PostgreSQL tablespaces
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBootstrapRecoveryVolumeSnapshotsTablespaceStorage {
    /// APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiGroup")]
    pub api_group: Option<String>,
    /// Kind is the type of resource being referenced
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// Name is the name of resource being referenced
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}

/// Configuration of the storage for PostgreSQL WAL (Write-Ahead Log)
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterBootstrapRecoveryVolumeSnapshotsWalStorage {
    /// APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiGroup")]
    pub api_group: Option<String>,
    /// Kind is the type of resource being referenced
    pub kind: String,
    /// Name is the name of resource being referenced
    pub name: String,
}

/// The configuration for the CA and related certificates
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterCertificates {
    /// The secret containing the Client CA certificate. If not defined, a new secret will be created with a self-signed CA and will be used to generate all the client certificates.<br /> <br /> Contains:<br /> <br /> - `ca.crt`: CA that should be used to validate the client certificates, used as `ssl_ca_file` of all the instances.<br /> - `ca.key`: key used to generate client certificates, if ReplicationTLSSecret is provided, this can be omitted.<br />
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "clientCASecret"
    )]
    pub client_ca_secret: Option<String>,
    /// The secret of type kubernetes.io/tls containing the client certificate to authenticate as the `streaming_replica` user. If not defined, ClientCASecret must provide also `ca.key`, and a new secret will be created using the provided CA.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "replicationTLSSecret"
    )]
    pub replication_tls_secret: Option<String>,
    /// The list of the server alternative DNS names to be added to the generated server TLS certificates, when required.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "serverAltDNSNames"
    )]
    pub server_alt_dns_names: Option<Vec<String>>,
    /// The secret containing the Server CA certificate. If not defined, a new secret will be created with a self-signed CA and will be used to generate the TLS certificate ServerTLSSecret.<br /> <br /> Contains:<br /> <br /> - `ca.crt`: CA that should be used to validate the server certificate, used as `sslrootcert` in client connection strings.<br /> - `ca.key`: key used to generate Server SSL certs, if ServerTLSSecret is provided, this can be omitted.<br />
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "serverCASecret"
    )]
    pub server_ca_secret: Option<String>,
    /// The secret of type kubernetes.io/tls containing the server TLS certificate and key that will be set as `ssl_cert_file` and `ssl_key_file` so that clients can connect to postgres securely. If not defined, ServerCASecret must provide also `ca.key` and a new secret will be created using the provided CA.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "serverTLSSecret"
    )]
    pub server_tls_secret: Option<String>,
}

/// EnvVar represents an environment variable present in a Container.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterEnv {
    /// Name of the environment variable. Must be a C_IDENTIFIER.
    pub name: String,
    /// Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
    /// Source for the environment variable's value. Cannot be used if value is not empty.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
    pub value_from: Option<ClusterEnvValueFrom>,
}

/// Source for the environment variable's value. Cannot be used if value is not empty.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterEnvValueFrom {
    /// Selects a key of a ConfigMap.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "configMapKeyRef"
    )]
    pub config_map_key_ref: Option<ClusterEnvValueFromConfigMapKeyRef>,
    /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
    pub field_ref: Option<ClusterEnvValueFromFieldRef>,
    /// Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "resourceFieldRef"
    )]
    pub resource_field_ref: Option<ClusterEnvValueFromResourceFieldRef>,
    /// Selects a key of a secret in the pod's namespace
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "secretKeyRef"
    )]
    pub secret_key_ref: Option<ClusterEnvValueFromSecretKeyRef>,
}

/// Selects a key of a ConfigMap.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterEnvValueFromConfigMapKeyRef {
    /// The key to select.
    pub key: String,
    /// Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the ConfigMap or its key must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterEnvValueFromFieldRef {
    /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "apiVersion"
    )]
    pub api_version: Option<String>,
    /// Path of the field to select in the specified API version.
    #[serde(rename = "fieldPath")]
    pub field_path: String,
}

/// Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterEnvValueFromResourceFieldRef {
    /// Container name: required for volumes, optional for env vars
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "containerName"
    )]
    pub container_name: Option<String>,
    /// Specifies the output format of the exposed resources, defaults to "1"
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub divisor: Option<IntOrString>,
    /// Required: resource to select
    pub resource: String,
}

/// Selects a key of a secret in the pod's namespace
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterEnvValueFromSecretKeyRef {
    /// The key of the secret to select from.  Must be a valid secret key.
    pub key: String,
    /// Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the Secret or its key must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// EnvFromSource represents the source of a set of ConfigMaps
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterEnvFrom {
    /// The ConfigMap to select from
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "configMapRef"
    )]
    pub config_map_ref: Option<ClusterEnvFromConfigMapRef>,
    /// An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prefix: Option<String>,
    /// The Secret to select from
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretRef")]
    pub secret_ref: Option<ClusterEnvFromSecretRef>,
}

/// The ConfigMap to select from
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterEnvFromConfigMapRef {
    /// Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the ConfigMap must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// The Secret to select from
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterEnvFromSecretRef {
    /// Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the Secret must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// EphemeralVolumeSource allows the user to configure the source of ephemeral volumes.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterEphemeralVolumeSource {
    /// Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod.  The name of the PVC will be `<pod name>-<volume name>` where `<volume name>` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long).
    ///  An existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster.
    ///  This field is read-only and no changes will be made by Kubernetes to the PVC after it has been created.
    ///  Required, must not be nil.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "volumeClaimTemplate"
    )]
    pub volume_claim_template: Option<ClusterEphemeralVolumeSourceVolumeClaimTemplate>,
}

/// Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod.  The name of the PVC will be `<pod name>-<volume name>` where `<volume name>` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long).
///  An existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster.
///  This field is read-only and no changes will be made by Kubernetes to the PVC after it has been created.
///  Required, must not be nil.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterEphemeralVolumeSourceVolumeClaimTemplate {
    /// May contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub metadata: Option<ClusterEphemeralVolumeSourceVolumeClaimTemplateMetadata>,
    /// The specification for the PersistentVolumeClaim. The entire content is copied unchanged into the PVC that gets created from this template. The same fields as in a PersistentVolumeClaim are also valid here.
    pub spec: ClusterEphemeralVolumeSourceVolumeClaimTemplateSpec,
}

/// May contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterEphemeralVolumeSourceVolumeClaimTemplateMetadata {}

/// The specification for the PersistentVolumeClaim. The entire content is copied unchanged into the PVC that gets created from this template. The same fields as in a PersistentVolumeClaim are also valid here.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterEphemeralVolumeSourceVolumeClaimTemplateSpec {
    /// accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "accessModes"
    )]
    pub access_modes: Option<Vec<String>>,
    /// dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "dataSource"
    )]
    pub data_source: Option<ClusterEphemeralVolumeSourceVolumeClaimTemplateSpecDataSource>,
    /// dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn't specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn't set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While dataSource ignores disallowed values (dropping them), dataSourceRef preserves all values, and generates an error if a disallowed value is specified. * While dataSource only allows local objects, dataSourceRef allows objects in any namespaces. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "dataSourceRef"
    )]
    pub data_source_ref: Option<ClusterEphemeralVolumeSourceVolumeClaimTemplateSpecDataSourceRef>,
    /// resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resources: Option<ClusterEphemeralVolumeSourceVolumeClaimTemplateSpecResources>,
    /// selector is a label query over volumes to consider for binding.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub selector: Option<ClusterEphemeralVolumeSourceVolumeClaimTemplateSpecSelector>,
    /// storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "storageClassName"
    )]
    pub storage_class_name: Option<String>,
    /// volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "volumeMode"
    )]
    pub volume_mode: Option<String>,
    /// volumeName is the binding reference to the PersistentVolume backing this claim.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "volumeName"
    )]
    pub volume_name: Option<String>,
}

/// dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterEphemeralVolumeSourceVolumeClaimTemplateSpecDataSource {
    /// APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiGroup")]
    pub api_group: Option<String>,
    /// Kind is the type of resource being referenced
    pub kind: String,
    /// Name is the name of resource being referenced
    pub name: String,
}

/// dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn't specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn't set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While dataSource ignores disallowed values (dropping them), dataSourceRef preserves all values, and generates an error if a disallowed value is specified. * While dataSource only allows local objects, dataSourceRef allows objects in any namespaces. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterEphemeralVolumeSourceVolumeClaimTemplateSpecDataSourceRef {
    /// APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiGroup")]
    pub api_group: Option<String>,
    /// Kind is the type of resource being referenced
    pub kind: String,
    /// Name is the name of resource being referenced
    pub name: String,
    /// Namespace is the namespace of resource being referenced Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
}

/// resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterEphemeralVolumeSourceVolumeClaimTemplateSpecResources {
    /// Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container.
    ///  This is an alpha field and requires enabling the DynamicResourceAllocation feature gate.
    ///  This field is immutable. It can only be set for containers.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub claims: Option<Vec<ClusterEphemeralVolumeSourceVolumeClaimTemplateSpecResourcesClaims>>,
    /// Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub limits: Option<BTreeMap<String, IntOrString>>,
    /// Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub requests: Option<BTreeMap<String, IntOrString>>,
}

/// ResourceClaim references one entry in PodSpec.ResourceClaims.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterEphemeralVolumeSourceVolumeClaimTemplateSpecResourcesClaims {
    /// Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.
    pub name: String,
}

/// selector is a label query over volumes to consider for binding.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterEphemeralVolumeSourceVolumeClaimTemplateSpecSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "matchExpressions"
    )]
    pub match_expressions:
        Option<Vec<ClusterEphemeralVolumeSourceVolumeClaimTemplateSpecSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "matchLabels"
    )]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterEphemeralVolumeSourceVolumeClaimTemplateSpecSelectorMatchExpressions {
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// EphemeralVolumesSizeLimit allows the user to set the limits for the ephemeral volumes
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterEphemeralVolumesSizeLimit {
    /// Shm is the size limit of the shared memory volume
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub shm: Option<IntOrString>,
    /// TemporaryData is the size limit of the temporary data volume
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "temporaryData"
    )]
    pub temporary_data: Option<IntOrString>,
}

/// ExternalCluster represents the connection parameters to an external cluster which is used in the other sections of the configuration
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterExternalClusters {
    /// The configuration for the barman-cloud tool suite
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "barmanObjectStore"
    )]
    pub barman_object_store: Option<ClusterExternalClustersBarmanObjectStore>,
    /// The list of connection parameters, such as dbname, host, username, etc
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "connectionParameters"
    )]
    pub connection_parameters: Option<BTreeMap<String, String>>,
    /// The server name, required
    pub name: String,
    /// The reference to the password to be used to connect to the server. If a password is provided, CloudNativePG creates a PostgreSQL passfile at `/controller/external/NAME/pass` (where "NAME" is the cluster's name). This passfile is automatically referenced in the connection string when establishing a connection to the remote PostgreSQL server from the current PostgreSQL `Cluster`. This ensures secure and efficient password management for external clusters.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub password: Option<ClusterExternalClustersPassword>,
    /// The reference to an SSL certificate to be used to connect to this instance
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "sslCert")]
    pub ssl_cert: Option<ClusterExternalClustersSslCert>,
    /// The reference to an SSL private key to be used to connect to this instance
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "sslKey")]
    pub ssl_key: Option<ClusterExternalClustersSslKey>,
    /// The reference to an SSL CA public key to be used to connect to this instance
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "sslRootCert"
    )]
    pub ssl_root_cert: Option<ClusterExternalClustersSslRootCert>,
}

/// The configuration for the barman-cloud tool suite
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterExternalClustersBarmanObjectStore {
    /// The credentials to use to upload data to Azure Blob Storage
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "azureCredentials"
    )]
    pub azure_credentials: Option<ClusterExternalClustersBarmanObjectStoreAzureCredentials>,
    /// The configuration to be used to backup the data files When not defined, base backups files will be stored uncompressed and may be unencrypted in the object store, according to the bucket default policy.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub data: Option<ClusterExternalClustersBarmanObjectStoreData>,
    /// The path where to store the backup (i.e. s3://bucket/path/to/folder) this path, with different destination folders, will be used for WALs and for data
    #[serde(rename = "destinationPath")]
    pub destination_path: String,
    /// EndpointCA store the CA bundle of the barman endpoint. Useful when using self-signed certificates to avoid errors with certificate issuer and barman-cloud-wal-archive
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "endpointCA"
    )]
    pub endpoint_ca: Option<ClusterExternalClustersBarmanObjectStoreEndpointCa>,
    /// Endpoint to be used to upload data to the cloud, overriding the automatic endpoint discovery
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "endpointURL"
    )]
    pub endpoint_url: Option<String>,
    /// The credentials to use to upload data to Google Cloud Storage
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "googleCredentials"
    )]
    pub google_credentials: Option<ClusterExternalClustersBarmanObjectStoreGoogleCredentials>,
    /// HistoryTags is a list of key value pairs that will be passed to the Barman --history-tags option.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "historyTags"
    )]
    pub history_tags: Option<BTreeMap<String, String>>,
    /// The credentials to use to upload data to S3
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "s3Credentials"
    )]
    pub s3_credentials: Option<ClusterExternalClustersBarmanObjectStoreS3Credentials>,
    /// The server name on S3, the cluster name is used if this parameter is omitted
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "serverName"
    )]
    pub server_name: Option<String>,
    /// Tags is a list of key value pairs that will be passed to the Barman --tags option.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tags: Option<BTreeMap<String, String>>,
    /// The configuration for the backup of the WAL stream. When not defined, WAL files will be stored uncompressed and may be unencrypted in the object store, according to the bucket default policy.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub wal: Option<ClusterExternalClustersBarmanObjectStoreWal>,
}

/// The credentials to use to upload data to Azure Blob Storage
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterExternalClustersBarmanObjectStoreAzureCredentials {
    /// The connection string to be used
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "connectionString"
    )]
    pub connection_string:
        Option<ClusterExternalClustersBarmanObjectStoreAzureCredentialsConnectionString>,
    /// Use the Azure AD based authentication without providing explicitly the keys.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "inheritFromAzureAD"
    )]
    pub inherit_from_azure_ad: Option<bool>,
    /// The storage account where to upload data
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "storageAccount"
    )]
    pub storage_account:
        Option<ClusterExternalClustersBarmanObjectStoreAzureCredentialsStorageAccount>,
    /// The storage account key to be used in conjunction with the storage account name
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "storageKey"
    )]
    pub storage_key: Option<ClusterExternalClustersBarmanObjectStoreAzureCredentialsStorageKey>,
    /// A shared-access-signature to be used in conjunction with the storage account name
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "storageSasToken"
    )]
    pub storage_sas_token:
        Option<ClusterExternalClustersBarmanObjectStoreAzureCredentialsStorageSasToken>,
}

/// The connection string to be used
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterExternalClustersBarmanObjectStoreAzureCredentialsConnectionString {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// The storage account where to upload data
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterExternalClustersBarmanObjectStoreAzureCredentialsStorageAccount {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// The storage account key to be used in conjunction with the storage account name
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterExternalClustersBarmanObjectStoreAzureCredentialsStorageKey {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// A shared-access-signature to be used in conjunction with the storage account name
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterExternalClustersBarmanObjectStoreAzureCredentialsStorageSasToken {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// The configuration to be used to backup the data files When not defined, base backups files will be stored uncompressed and may be unencrypted in the object store, according to the bucket default policy.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterExternalClustersBarmanObjectStoreData {
    /// Compress a backup file (a tar file per tablespace) while streaming it to the object store. Available options are empty string (no compression, default), `gzip`, `bzip2` or `snappy`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub compression: Option<ClusterExternalClustersBarmanObjectStoreDataCompression>,
    /// Whenever to force the encryption of files (if the bucket is not already configured for that). Allowed options are empty string (use the bucket policy, default), `AES256` and `aws:kms`
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub encryption: Option<ClusterExternalClustersBarmanObjectStoreDataEncryption>,
    /// Control whether the I/O workload for the backup initial checkpoint will be limited, according to the `checkpoint_completion_target` setting on the PostgreSQL server. If set to true, an immediate checkpoint will be used, meaning PostgreSQL will complete the checkpoint as soon as possible. `false` by default.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "immediateCheckpoint"
    )]
    pub immediate_checkpoint: Option<bool>,
    /// The number of parallel jobs to be used to upload the backup, defaults to 2
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub jobs: Option<i32>,
}

/// The configuration to be used to backup the data files When not defined, base backups files will be stored uncompressed and may be unencrypted in the object store, according to the bucket default policy.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub enum ClusterExternalClustersBarmanObjectStoreDataCompression {
    #[serde(rename = "gzip")]
    Gzip,
    #[serde(rename = "bzip2")]
    Bzip2,
    #[serde(rename = "snappy")]
    Snappy,
}

/// The configuration to be used to backup the data files When not defined, base backups files will be stored uncompressed and may be unencrypted in the object store, according to the bucket default policy.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub enum ClusterExternalClustersBarmanObjectStoreDataEncryption {
    #[serde(rename = "AES256")]
    Aes256,
    #[serde(rename = "aws:kms")]
    AwsKms,
}

/// EndpointCA store the CA bundle of the barman endpoint. Useful when using self-signed certificates to avoid errors with certificate issuer and barman-cloud-wal-archive
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterExternalClustersBarmanObjectStoreEndpointCa {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// The credentials to use to upload data to Google Cloud Storage
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterExternalClustersBarmanObjectStoreGoogleCredentials {
    /// The secret containing the Google Cloud Storage JSON file with the credentials
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "applicationCredentials"
    )]
    pub application_credentials:
        Option<ClusterExternalClustersBarmanObjectStoreGoogleCredentialsApplicationCredentials>,
    /// If set to true, will presume that it's running inside a GKE environment, default to false.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "gkeEnvironment"
    )]
    pub gke_environment: Option<bool>,
}

/// The secret containing the Google Cloud Storage JSON file with the credentials
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterExternalClustersBarmanObjectStoreGoogleCredentialsApplicationCredentials {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// The credentials to use to upload data to S3
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterExternalClustersBarmanObjectStoreS3Credentials {
    /// The reference to the access key id
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "accessKeyId"
    )]
    pub access_key_id: Option<ClusterExternalClustersBarmanObjectStoreS3CredentialsAccessKeyId>,
    /// Use the role based authentication without providing explicitly the keys.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "inheritFromIAMRole"
    )]
    pub inherit_from_iam_role: Option<bool>,
    /// The reference to the secret containing the region name
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub region: Option<ClusterExternalClustersBarmanObjectStoreS3CredentialsRegion>,
    /// The reference to the secret access key
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "secretAccessKey"
    )]
    pub secret_access_key:
        Option<ClusterExternalClustersBarmanObjectStoreS3CredentialsSecretAccessKey>,
    /// The references to the session key
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "sessionToken"
    )]
    pub session_token: Option<ClusterExternalClustersBarmanObjectStoreS3CredentialsSessionToken>,
}

/// The reference to the access key id
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterExternalClustersBarmanObjectStoreS3CredentialsAccessKeyId {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// The reference to the secret containing the region name
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterExternalClustersBarmanObjectStoreS3CredentialsRegion {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// The reference to the secret access key
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterExternalClustersBarmanObjectStoreS3CredentialsSecretAccessKey {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// The references to the session key
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterExternalClustersBarmanObjectStoreS3CredentialsSessionToken {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// The configuration for the backup of the WAL stream. When not defined, WAL files will be stored uncompressed and may be unencrypted in the object store, according to the bucket default policy.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterExternalClustersBarmanObjectStoreWal {
    /// Compress a WAL file before sending it to the object store. Available options are empty string (no compression, default), `gzip`, `bzip2` or `snappy`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub compression: Option<ClusterExternalClustersBarmanObjectStoreWalCompression>,
    /// Whenever to force the encryption of files (if the bucket is not already configured for that). Allowed options are empty string (use the bucket policy, default), `AES256` and `aws:kms`
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub encryption: Option<ClusterExternalClustersBarmanObjectStoreWalEncryption>,
    /// Number of WAL files to be either archived in parallel (when the PostgreSQL instance is archiving to a backup object store) or restored in parallel (when a PostgreSQL standby is fetching WAL files from a recovery object store). If not specified, WAL files will be processed one at a time. It accepts a positive integer as a value - with 1 being the minimum accepted value.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "maxParallel"
    )]
    pub max_parallel: Option<i64>,
}

/// The configuration for the backup of the WAL stream. When not defined, WAL files will be stored uncompressed and may be unencrypted in the object store, according to the bucket default policy.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub enum ClusterExternalClustersBarmanObjectStoreWalCompression {
    #[serde(rename = "gzip")]
    Gzip,
    #[serde(rename = "bzip2")]
    Bzip2,
    #[serde(rename = "snappy")]
    Snappy,
}

/// The configuration for the backup of the WAL stream. When not defined, WAL files will be stored uncompressed and may be unencrypted in the object store, according to the bucket default policy.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub enum ClusterExternalClustersBarmanObjectStoreWalEncryption {
    #[serde(rename = "AES256")]
    Aes256,
    #[serde(rename = "aws:kms")]
    AwsKms,
}

/// The reference to the password to be used to connect to the server. If a password is provided, CloudNativePG creates a PostgreSQL passfile at `/controller/external/NAME/pass` (where "NAME" is the cluster's name). This passfile is automatically referenced in the connection string when establishing a connection to the remote PostgreSQL server from the current PostgreSQL `Cluster`. This ensures secure and efficient password management for external clusters.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterExternalClustersPassword {
    /// The key of the secret to select from.  Must be a valid secret key.
    pub key: String,
    /// Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the Secret or its key must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// The reference to an SSL certificate to be used to connect to this instance
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterExternalClustersSslCert {
    /// The key of the secret to select from.  Must be a valid secret key.
    pub key: String,
    /// Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the Secret or its key must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// The reference to an SSL private key to be used to connect to this instance
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterExternalClustersSslKey {
    /// The key of the secret to select from.  Must be a valid secret key.
    pub key: String,
    /// Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the Secret or its key must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// The reference to an SSL CA public key to be used to connect to this instance
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterExternalClustersSslRootCert {
    /// The key of the secret to select from.  Must be a valid secret key.
    pub key: String,
    /// Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the Secret or its key must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// LocalObjectReference contains enough information to let you locate a local object with a known type inside the same namespace
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterImagePullSecrets {
    /// Name of the referent.
    pub name: String,
}

/// Metadata that will be inherited by all objects related to the Cluster
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterInheritedMetadata {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub annotations: Option<BTreeMap<String, String>>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub labels: Option<BTreeMap<String, String>>,
}

/// Specification of the desired behavior of the cluster. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub enum ClusterLogLevel {
    #[serde(rename = "error")]
    Error,
    #[serde(rename = "warning")]
    Warning,
    #[serde(rename = "info")]
    Info,
    #[serde(rename = "debug")]
    Debug,
    #[serde(rename = "trace")]
    Trace,
}

/// The configuration that is used by the portions of PostgreSQL that are managed by the instance manager
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterManaged {
    /// Database roles managed by the `Cluster`
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub roles: Option<Vec<ClusterManagedRoles>>,
}

/// RoleConfiguration is the representation, in Kubernetes, of a PostgreSQL role with the additional field Ensure specifying whether to ensure the presence or absence of the role in the database
///  The defaults of the CREATE ROLE command are applied Reference: https://www.postgresql.org/docs/current/sql-createrole.html
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterManagedRoles {
    /// Whether a role bypasses every row-level security (RLS) policy. Default is `false`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub bypassrls: Option<bool>,
    /// Description of the role
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub comment: Option<String>,
    /// If the role can log in, this specifies how many concurrent connections the role can make. `-1` (the default) means no limit.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "connectionLimit"
    )]
    pub connection_limit: Option<i64>,
    /// When set to `true`, the role being defined will be allowed to create new databases. Specifying `false` (default) will deny a role the ability to create databases.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub createdb: Option<bool>,
    /// Whether the role will be permitted to create, alter, drop, comment on, change the security label for, and grant or revoke membership in other roles. Default is `false`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub createrole: Option<bool>,
    /// DisablePassword indicates that a role's password should be set to NULL in Postgres
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "disablePassword"
    )]
    pub disable_password: Option<bool>,
    /// Ensure the role is `present` or `absent` - defaults to "present"
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ensure: Option<ClusterManagedRolesEnsure>,
    /// List of one or more existing roles to which this role will be immediately added as a new member. Default empty.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "inRoles")]
    pub in_roles: Option<Vec<String>>,
    /// Whether a role "inherits" the privileges of roles it is a member of. Defaults is `true`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub inherit: Option<bool>,
    /// Whether the role is allowed to log in. A role having the `login` attribute can be thought of as a user. Roles without this attribute are useful for managing database privileges, but are not users in the usual sense of the word. Default is `false`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub login: Option<bool>,
    /// Name of the role
    pub name: String,
    /// Secret containing the password of the role (if present) If null, the password will be ignored unless DisablePassword is set
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "passwordSecret"
    )]
    pub password_secret: Option<ClusterManagedRolesPasswordSecret>,
    /// Whether a role is a replication role. A role must have this attribute (or be a superuser) in order to be able to connect to the server in replication mode (physical or logical replication) and in order to be able to create or drop replication slots. A role having the `replication` attribute is a very highly privileged role, and should only be used on roles actually used for replication. Default is `false`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub replication: Option<bool>,
    /// Whether the role is a `superuser` who can override all access restrictions within the database - superuser status is dangerous and should be used only when really needed. You must yourself be a superuser to create a new superuser. Defaults is `false`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub superuser: Option<bool>,
    /// Date and time after which the role's password is no longer valid. When omitted, the password will never expire (default).
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "validUntil"
    )]
    pub valid_until: Option<String>,
}

/// RoleConfiguration is the representation, in Kubernetes, of a PostgreSQL role with the additional field Ensure specifying whether to ensure the presence or absence of the role in the database
///  The defaults of the CREATE ROLE command are applied Reference: https://www.postgresql.org/docs/current/sql-createrole.html
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub enum ClusterManagedRolesEnsure {
    #[serde(rename = "present")]
    Present,
    #[serde(rename = "absent")]
    Absent,
}

/// Secret containing the password of the role (if present) If null, the password will be ignored unless DisablePassword is set
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterManagedRolesPasswordSecret {
    /// Name of the referent.
    pub name: String,
}

/// The configuration of the monitoring infrastructure of this cluster
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterMonitoring {
    /// The list of config maps containing the custom queries
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "customQueriesConfigMap"
    )]
    pub custom_queries_config_map: Option<Vec<ClusterMonitoringCustomQueriesConfigMap>>,
    /// The list of secrets containing the custom queries
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "customQueriesSecret"
    )]
    pub custom_queries_secret: Option<Vec<ClusterMonitoringCustomQueriesSecret>>,
    /// Whether the default queries should be injected. Set it to `true` if you don't want to inject default queries into the cluster. Default: false.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "disableDefaultQueries"
    )]
    pub disable_default_queries: Option<bool>,
    /// Enable or disable the `PodMonitor`
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "enablePodMonitor"
    )]
    pub enable_pod_monitor: Option<bool>,
    /// The list of metric relabelings for the `PodMonitor`. Applied to samples before ingestion.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "podMonitorMetricRelabelings"
    )]
    pub pod_monitor_metric_relabelings: Option<Vec<ClusterMonitoringPodMonitorMetricRelabelings>>,
    /// The list of relabelings for the `PodMonitor`. Applied to samples before scraping.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "podMonitorRelabelings"
    )]
    pub pod_monitor_relabelings: Option<Vec<ClusterMonitoringPodMonitorRelabelings>>,
}

/// ConfigMapKeySelector contains enough information to let you locate the key of a ConfigMap
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterMonitoringCustomQueriesConfigMap {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// SecretKeySelector contains enough information to let you locate the key of a Secret
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterMonitoringCustomQueriesSecret {
    /// The key to select
    pub key: String,
    /// Name of the referent.
    pub name: String,
}

/// RelabelConfig allows dynamic rewriting of the label set for targets, alerts, scraped samples and remote write samples.
///  More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterMonitoringPodMonitorMetricRelabelings {
    /// Action to perform based on the regex matching.
    ///  `Uppercase` and `Lowercase` actions require Prometheus >= v2.36.0. `DropEqual` and `KeepEqual` actions require Prometheus >= v2.41.0.
    ///  Default: "Replace"
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub action: Option<ClusterMonitoringPodMonitorMetricRelabelingsAction>,
    /// Modulus to take of the hash of the source label values.
    ///  Only applicable when the action is `HashMod`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub modulus: Option<i64>,
    /// Regular expression against which the extracted value is matched.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub regex: Option<String>,
    /// Replacement value against which a Replace action is performed if the regular expression matches.
    ///  Regex capture groups are available.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub replacement: Option<String>,
    /// Separator is the string between concatenated SourceLabels.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub separator: Option<String>,
    /// The source labels select values from existing labels. Their content is concatenated using the configured Separator and matched against the configured regular expression.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "sourceLabels"
    )]
    pub source_labels: Option<Vec<String>>,
    /// Label to which the resulting string is written in a replacement.
    ///  It is mandatory for `Replace`, `HashMod`, `Lowercase`, `Uppercase`, `KeepEqual` and `DropEqual` actions.
    ///  Regex capture groups are available.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "targetLabel"
    )]
    pub target_label: Option<String>,
}

/// RelabelConfig allows dynamic rewriting of the label set for targets, alerts, scraped samples and remote write samples.
///  More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub enum ClusterMonitoringPodMonitorMetricRelabelingsAction {
    #[serde(rename = "replace")]
    Replace,
    #[serde(rename = "keep")]
    Keep,
    #[serde(rename = "drop")]
    Drop,
    #[serde(rename = "hashmod")]
    HashMod,
    #[serde(rename = "labelmap")]
    LabelMap,
    #[serde(rename = "labeldrop")]
    LabelDrop,
    #[serde(rename = "labelkeep")]
    Labelkeep,
    #[serde(rename = "lowercase")]
    Lowercase,
    #[serde(rename = "uppercase")]
    Uppercase,
    #[serde(rename = "keepequal")]
    Keepequal,
    #[serde(rename = "dropequal")]
    Dropequal,
}

/// RelabelConfig allows dynamic rewriting of the label set for targets, alerts, scraped samples and remote write samples.
///  More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterMonitoringPodMonitorRelabelings {
    /// Action to perform based on the regex matching.
    ///  `Uppercase` and `Lowercase` actions require Prometheus >= v2.36.0. `DropEqual` and `KeepEqual` actions require Prometheus >= v2.41.0.
    ///  Default: "Replace"
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub action: Option<ClusterMonitoringPodMonitorRelabelingsAction>,
    /// Modulus to take of the hash of the source label values.
    ///  Only applicable when the action is `HashMod`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub modulus: Option<i64>,
    /// Regular expression against which the extracted value is matched.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub regex: Option<String>,
    /// Replacement value against which a Replace action is performed if the regular expression matches.
    ///  Regex capture groups are available.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub replacement: Option<String>,
    /// Separator is the string between concatenated SourceLabels.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub separator: Option<String>,
    /// The source labels select values from existing labels. Their content is concatenated using the configured Separator and matched against the configured regular expression.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "sourceLabels"
    )]
    pub source_labels: Option<Vec<String>>,
    /// Label to which the resulting string is written in a replacement.
    ///  It is mandatory for `Replace`, `HashMod`, `Lowercase`, `Uppercase`, `KeepEqual` and `DropEqual` actions.
    ///  Regex capture groups are available.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "targetLabel"
    )]
    pub target_label: Option<String>,
}

/// RelabelConfig allows dynamic rewriting of the label set for targets, alerts, scraped samples and remote write samples.
///  More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub enum ClusterMonitoringPodMonitorRelabelingsAction {
    #[serde(rename = "replace")]
    Replace,
    #[serde(rename = "keep")]
    Keep,
    #[serde(rename = "drop")]
    Drop,
    #[serde(rename = "hashmod")]
    Hashmod,
    #[serde(rename = "labelmap")]
    Labelmap,
    #[serde(rename = "labeldrop")]
    Labeldrop,
    #[serde(rename = "labelkeep")]
    Labelkeep,
    #[serde(rename = "lowercase")]
    Lowercase,
    #[serde(rename = "uppercase")]
    Uppercase,
    #[serde(rename = "keepequal")]
    Keepequal,
    #[serde(rename = "dropequal")]
    DropEqual,
}

/// Define a maintenance window for the Kubernetes nodes
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterNodeMaintenanceWindow {
    /// Is there a node maintenance activity in progress?
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "inProgress"
    )]
    pub in_progress: Option<bool>,
    /// Reuse the existing PVC (wait for the node to come up again) or not (recreate it elsewhere - when `instances` >1)
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "reusePVC")]
    pub reuse_pvc: Option<bool>,
}

/// Configuration of the PostgreSQL server
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterPostgresql {
    /// If this parameter is true, the user will be able to invoke `ALTER SYSTEM` on this CloudNativePG Cluster. This should only be used for debugging and troubleshooting. Defaults to false.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "enableAlterSystem"
    )]
    pub enable_alter_system: Option<bool>,
    /// Options to specify LDAP configuration
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ldap: Option<ClusterPostgresqlLdap>,
    /// PostgreSQL configuration options (postgresql.conf)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub parameters: Option<BTreeMap<String, String>>,
    /// PostgreSQL Host Based Authentication rules (lines to be appended to the pg_hba.conf file)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub pg_hba: Option<Vec<String>>,
    /// PostgreSQL User Name Maps rules (lines to be appended to the pg_ident.conf file)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub pg_ident: Option<Vec<String>>,
    /// Specifies the maximum number of seconds to wait when promoting an instance to primary. Default value is 40000000, greater than one year in seconds, big enough to simulate an infinite timeout
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "promotionTimeout"
    )]
    pub promotion_timeout: Option<i32>,
    /// Lists of shared preload libraries to add to the default ones
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub shared_preload_libraries: Option<Vec<String>>,
    /// Requirements to be met by sync replicas. This will affect how the "synchronous_standby_names" parameter will be set up.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "syncReplicaElectionConstraint"
    )]
    pub sync_replica_election_constraint: Option<ClusterPostgresqlSyncReplicaElectionConstraint>,
}

/// Options to specify LDAP configuration
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterPostgresqlLdap {
    /// Bind as authentication configuration
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "bindAsAuth"
    )]
    pub bind_as_auth: Option<ClusterPostgresqlLdapBindAsAuth>,
    /// Bind+Search authentication configuration
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "bindSearchAuth"
    )]
    pub bind_search_auth: Option<ClusterPostgresqlLdapBindSearchAuth>,
    /// LDAP server port
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub port: Option<i64>,
    /// LDAP schema to be used, possible options are `ldap` and `ldaps`
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub scheme: Option<ClusterPostgresqlLdapScheme>,
    /// LDAP hostname or IP address
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub server: Option<String>,
    /// Set to 'true' to enable LDAP over TLS. 'false' is default
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tls: Option<bool>,
}

/// Bind as authentication configuration
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterPostgresqlLdapBindAsAuth {
    /// Prefix for the bind authentication option
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub prefix: Option<String>,
    /// Suffix for the bind authentication option
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub suffix: Option<String>,
}

/// Bind+Search authentication configuration
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterPostgresqlLdapBindSearchAuth {
    /// Root DN to begin the user search
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "baseDN")]
    pub base_dn: Option<String>,
    /// DN of the user to bind to the directory
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "bindDN")]
    pub bind_dn: Option<String>,
    /// Secret with the password for the user to bind to the directory
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "bindPassword"
    )]
    pub bind_password: Option<ClusterPostgresqlLdapBindSearchAuthBindPassword>,
    /// Attribute to match against the username
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "searchAttribute"
    )]
    pub search_attribute: Option<String>,
    /// Search filter to use when doing the search+bind authentication
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "searchFilter"
    )]
    pub search_filter: Option<String>,
}

/// Secret with the password for the user to bind to the directory
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterPostgresqlLdapBindSearchAuthBindPassword {
    /// The key of the secret to select from.  Must be a valid secret key.
    pub key: String,
    /// Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the Secret or its key must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// Options to specify LDAP configuration
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub enum ClusterPostgresqlLdapScheme {
    #[serde(rename = "ldap")]
    Ldap,
    #[serde(rename = "ldaps")]
    Ldaps,
}

/// Requirements to be met by sync replicas. This will affect how the "synchronous_standby_names" parameter will be set up.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterPostgresqlSyncReplicaElectionConstraint {
    /// This flag enables the constraints for sync replicas
    pub enabled: bool,
    /// A list of node labels values to extract and compare to evaluate if the pods reside in the same topology or not
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "nodeLabelsAntiAffinity"
    )]
    pub node_labels_anti_affinity: Option<Vec<String>>,
}

/// Specification of the desired behavior of the cluster. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, PartialEq)]
pub enum ClusterPrimaryUpdateMethod {
    #[serde(rename = "switchover")]
    Switchover,
    #[serde(rename = "restart")]
    Restart,
}

/// Specification of the desired behavior of the cluster. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub enum ClusterPrimaryUpdateStrategy {
    #[serde(rename = "unsupervised")]
    Unsupervised,
    #[serde(rename = "supervised")]
    Supervised,
}

/// Template to be used to define projected volumes, projected volumes will be mounted under `/projected` base folder
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterProjectedVolumeTemplate {
    /// defaultMode are the mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "defaultMode"
    )]
    pub default_mode: Option<i32>,
    /// sources is the list of volume projections
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub sources: Option<Vec<ClusterProjectedVolumeTemplateSources>>,
}

/// Projection that may be projected along with other supported volume types
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterProjectedVolumeTemplateSources {
    /// configMap information about the configMap data to project
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMap")]
    pub config_map: Option<ClusterProjectedVolumeTemplateSourcesConfigMap>,
    /// downwardAPI information about the downwardAPI data to project
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "downwardAPI"
    )]
    pub downward_api: Option<ClusterProjectedVolumeTemplateSourcesDownwardApi>,
    /// secret information about the secret data to project
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub secret: Option<ClusterProjectedVolumeTemplateSourcesSecret>,
    /// serviceAccountToken is information about the serviceAccountToken data to project
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "serviceAccountToken"
    )]
    pub service_account_token: Option<ClusterProjectedVolumeTemplateSourcesServiceAccountToken>,
}

/// configMap information about the configMap data to project
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterProjectedVolumeTemplateSourcesConfigMap {
    /// items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub items: Option<Vec<ClusterProjectedVolumeTemplateSourcesConfigMapItems>>,
    /// Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// optional specify whether the ConfigMap or its keys must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// Maps a string key to a path within a volume.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterProjectedVolumeTemplateSourcesConfigMapItems {
    /// key is the key to project.
    pub key: String,
    /// mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub mode: Option<i32>,
    /// path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'.
    pub path: String,
}

/// downwardAPI information about the downwardAPI data to project
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterProjectedVolumeTemplateSourcesDownwardApi {
    /// Items is a list of DownwardAPIVolume file
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub items: Option<Vec<ClusterProjectedVolumeTemplateSourcesDownwardApiItems>>,
}

/// DownwardAPIVolumeFile represents information to create the file containing the pod field
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterProjectedVolumeTemplateSourcesDownwardApiItems {
    /// Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
    pub field_ref: Option<ClusterProjectedVolumeTemplateSourcesDownwardApiItemsFieldRef>,
    /// Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub mode: Option<i32>,
    /// Required: Path is  the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'
    pub path: String,
    /// Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "resourceFieldRef"
    )]
    pub resource_field_ref:
        Option<ClusterProjectedVolumeTemplateSourcesDownwardApiItemsResourceFieldRef>,
}

/// Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterProjectedVolumeTemplateSourcesDownwardApiItemsFieldRef {
    /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "apiVersion"
    )]
    pub api_version: Option<String>,
    /// Path of the field to select in the specified API version.
    #[serde(rename = "fieldPath")]
    pub field_path: String,
}

/// Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterProjectedVolumeTemplateSourcesDownwardApiItemsResourceFieldRef {
    /// Container name: required for volumes, optional for env vars
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "containerName"
    )]
    pub container_name: Option<String>,
    /// Specifies the output format of the exposed resources, defaults to "1"
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub divisor: Option<IntOrString>,
    /// Required: resource to select
    pub resource: String,
}

/// secret information about the secret data to project
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterProjectedVolumeTemplateSourcesSecret {
    /// items if unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub items: Option<Vec<ClusterProjectedVolumeTemplateSourcesSecretItems>>,
    /// Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// optional field specify whether the Secret or its key must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// Maps a string key to a path within a volume.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterProjectedVolumeTemplateSourcesSecretItems {
    /// key is the key to project.
    pub key: String,
    /// mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub mode: Option<i32>,
    /// path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'.
    pub path: String,
}

/// serviceAccountToken is information about the serviceAccountToken data to project
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterProjectedVolumeTemplateSourcesServiceAccountToken {
    /// audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub audience: Option<String>,
    /// expirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "expirationSeconds"
    )]
    pub expiration_seconds: Option<i64>,
    /// path is the path relative to the mount point of the file to project the token into.
    pub path: String,
}

/// Replica cluster configuration
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterReplica {
    /// If replica mode is enabled, this cluster will be a replica of an existing cluster. Replica cluster can be created from a recovery object store or via streaming through pg_basebackup. Refer to the Replica clusters page of the documentation for more information.
    pub enabled: bool,
    /// The name of the external cluster which is the replication origin
    pub source: String,
}

/// Replication slots management configuration
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterReplicationSlots {
    /// Replication slots for high availability configuration
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "highAvailability"
    )]
    pub high_availability: Option<ClusterReplicationSlotsHighAvailability>,
    /// Standby will update the status of the local replication slots every `updateInterval` seconds (default 30).
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "updateInterval"
    )]
    pub update_interval: Option<i64>,
}

/// Replication slots for high availability configuration
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterReplicationSlotsHighAvailability {
    /// If enabled (default), the operator will automatically manage replication slots on the primary instance and use them in streaming replication connections with all the standby instances that are part of the HA cluster. If disabled, the operator will not take advantage of replication slots in streaming connections with the replicas. This feature also controls replication slots in replica cluster, from the designated primary to its cascading replicas.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    /// Prefix for replication slots managed by the operator for HA. It may only contain lower case letters, numbers, and the underscore character. This can only be set at creation time. By default set to `_cnpg_`.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "slotPrefix"
    )]
    pub slot_prefix: Option<String>,
}

/// Resources requirements of every generated Pod. Please refer to https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ for more information.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterResources {
    /// Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container.
    ///  This is an alpha field and requires enabling the DynamicResourceAllocation feature gate.
    ///  This field is immutable. It can only be set for containers.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub claims: Option<Vec<ClusterResourcesClaims>>,
    /// Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub limits: Option<BTreeMap<String, Quantity>>,
    /// Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub requests: Option<BTreeMap<String, Quantity>>,
}

/// ResourceClaim references one entry in PodSpec.ResourceClaims.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterResourcesClaims {
    /// Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.
    pub name: String,
}

/// The SeccompProfile applied to every Pod and Container. Defaults to: `RuntimeDefault`
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterSeccompProfile {
    /// localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must be set if type is "Localhost". Must NOT be set for any other type.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "localhostProfile"
    )]
    pub localhost_profile: Option<String>,
    /// type indicates which kind of seccomp profile will be applied. Valid options are:
    ///  Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied.
    #[serde(rename = "type")]
    pub r#type: String,
}

/// Configure the generation of the service account
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterServiceAccountTemplate {
    /// Metadata are the metadata to be used for the generated service account
    pub metadata: ClusterServiceAccountTemplateMetadata,
}

/// Metadata are the metadata to be used for the generated service account
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterServiceAccountTemplateMetadata {
    /// Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub annotations: Option<BTreeMap<String, String>>,
    /// Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub labels: Option<BTreeMap<String, String>>,
}

/// Configuration of the storage of the instances
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterStorage {
    /// Template to be used to generate the Persistent Volume Claim
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "pvcTemplate"
    )]
    pub pvc_template: Option<ClusterStoragePvcTemplate>,
    /// Resize existent PVCs, defaults to true
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "resizeInUseVolumes"
    )]
    pub resize_in_use_volumes: Option<bool>,
    /// Size of the storage. Required if not already specified in the PVC template. Changes to this field are automatically reapplied to the created PVCs. Size cannot be decreased.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub size: Option<String>,
    /// StorageClass to use for PVCs. Applied after evaluating the PVC template, if available. If not specified, the generated PVCs will use the default storage class
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "storageClass"
    )]
    pub storage_class: Option<String>,
}

/// Template to be used to generate the Persistent Volume Claim
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterStoragePvcTemplate {
    /// accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "accessModes"
    )]
    pub access_modes: Option<Vec<String>>,
    /// dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "dataSource"
    )]
    pub data_source: Option<ClusterStoragePvcTemplateDataSource>,
    /// dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn't specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn't set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While dataSource ignores disallowed values (dropping them), dataSourceRef preserves all values, and generates an error if a disallowed value is specified. * While dataSource only allows local objects, dataSourceRef allows objects in any namespaces. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "dataSourceRef"
    )]
    pub data_source_ref: Option<ClusterStoragePvcTemplateDataSourceRef>,
    /// resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resources: Option<ClusterStoragePvcTemplateResources>,
    /// selector is a label query over volumes to consider for binding.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub selector: Option<ClusterStoragePvcTemplateSelector>,
    /// storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "storageClassName"
    )]
    pub storage_class_name: Option<String>,
    /// volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "volumeMode"
    )]
    pub volume_mode: Option<String>,
    /// volumeName is the binding reference to the PersistentVolume backing this claim.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "volumeName"
    )]
    pub volume_name: Option<String>,
}

/// dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterStoragePvcTemplateDataSource {
    /// APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiGroup")]
    pub api_group: Option<String>,
    /// Kind is the type of resource being referenced
    pub kind: String,
    /// Name is the name of resource being referenced
    pub name: String,
}

/// dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn't specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn't set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While dataSource ignores disallowed values (dropping them), dataSourceRef preserves all values, and generates an error if a disallowed value is specified. * While dataSource only allows local objects, dataSourceRef allows objects in any namespaces. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterStoragePvcTemplateDataSourceRef {
    /// APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiGroup")]
    pub api_group: Option<String>,
    /// Kind is the type of resource being referenced
    pub kind: String,
    /// Name is the name of resource being referenced
    pub name: String,
    /// Namespace is the namespace of resource being referenced Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
}

/// resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterStoragePvcTemplateResources {
    /// Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container.
    ///  This is an alpha field and requires enabling the DynamicResourceAllocation feature gate.
    ///  This field is immutable. It can only be set for containers.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub claims: Option<Vec<ClusterStoragePvcTemplateResourcesClaims>>,
    /// Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub limits: Option<BTreeMap<String, IntOrString>>,
    /// Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub requests: Option<BTreeMap<String, IntOrString>>,
}

/// ResourceClaim references one entry in PodSpec.ResourceClaims.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterStoragePvcTemplateResourcesClaims {
    /// Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.
    pub name: String,
}

/// selector is a label query over volumes to consider for binding.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterStoragePvcTemplateSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "matchExpressions"
    )]
    pub match_expressions: Option<Vec<ClusterStoragePvcTemplateSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "matchLabels"
    )]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterStoragePvcTemplateSelectorMatchExpressions {
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// The secret containing the superuser password. If not defined a new secret will be created with a randomly generated password
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterSuperuserSecret {
    /// Name of the referent.
    pub name: String,
}

/// TablespaceConfiguration is the configuration of a tablespace, and includes the storage specification for the tablespace
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterTablespaces {
    /// The name of the tablespace
    pub name: String,
    /// Owner is the PostgreSQL user owning the tablespace
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub owner: Option<ClusterTablespacesOwner>,
    /// The storage configuration for the tablespace
    pub storage: ClusterTablespacesStorage,
    /// When set to true, the tablespace will be added as a `temp_tablespaces` entry in PostgreSQL, and will be available to automatically house temp database objects, or other temporary files. Please refer to PostgreSQL documentation for more information on the `temp_tablespaces` GUC.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub temporary: Option<bool>,
}

/// Owner is the PostgreSQL user owning the tablespace
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterTablespacesOwner {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}

/// The storage configuration for the tablespace
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterTablespacesStorage {
    /// Template to be used to generate the Persistent Volume Claim
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "pvcTemplate"
    )]
    pub pvc_template: Option<ClusterTablespacesStoragePvcTemplate>,
    /// Resize existent PVCs, defaults to true
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "resizeInUseVolumes"
    )]
    pub resize_in_use_volumes: Option<bool>,
    /// Size of the storage. Required if not already specified in the PVC template. Changes to this field are automatically reapplied to the created PVCs. Size cannot be decreased.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub size: Option<String>,
    /// StorageClass to use for PVCs. Applied after evaluating the PVC template, if available. If not specified, the generated PVCs will use the default storage class
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "storageClass"
    )]
    pub storage_class: Option<String>,
}

/// Template to be used to generate the Persistent Volume Claim
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterTablespacesStoragePvcTemplate {
    /// accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "accessModes"
    )]
    pub access_modes: Option<Vec<String>>,
    /// dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "dataSource"
    )]
    pub data_source: Option<ClusterTablespacesStoragePvcTemplateDataSource>,
    /// dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn't specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn't set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While dataSource ignores disallowed values (dropping them), dataSourceRef preserves all values, and generates an error if a disallowed value is specified. * While dataSource only allows local objects, dataSourceRef allows objects in any namespaces. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "dataSourceRef"
    )]
    pub data_source_ref: Option<ClusterTablespacesStoragePvcTemplateDataSourceRef>,
    /// resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resources: Option<ClusterTablespacesStoragePvcTemplateResources>,
    /// selector is a label query over volumes to consider for binding.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub selector: Option<ClusterTablespacesStoragePvcTemplateSelector>,
    /// storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "storageClassName"
    )]
    pub storage_class_name: Option<String>,
    /// volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "volumeMode"
    )]
    pub volume_mode: Option<String>,
    /// volumeName is the binding reference to the PersistentVolume backing this claim.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "volumeName"
    )]
    pub volume_name: Option<String>,
}

/// dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterTablespacesStoragePvcTemplateDataSource {
    /// APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiGroup")]
    pub api_group: Option<String>,
    /// Kind is the type of resource being referenced
    pub kind: String,
    /// Name is the name of resource being referenced
    pub name: String,
}

/// dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn't specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn't set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While dataSource ignores disallowed values (dropping them), dataSourceRef preserves all values, and generates an error if a disallowed value is specified. * While dataSource only allows local objects, dataSourceRef allows objects in any namespaces. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterTablespacesStoragePvcTemplateDataSourceRef {
    /// APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiGroup")]
    pub api_group: Option<String>,
    /// Kind is the type of resource being referenced
    pub kind: String,
    /// Name is the name of resource being referenced
    pub name: String,
    /// Namespace is the namespace of resource being referenced Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
}

/// resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterTablespacesStoragePvcTemplateResources {
    /// Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container.
    ///  This is an alpha field and requires enabling the DynamicResourceAllocation feature gate.
    ///  This field is immutable. It can only be set for containers.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub claims: Option<Vec<ClusterTablespacesStoragePvcTemplateResourcesClaims>>,
    /// Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub limits: Option<BTreeMap<String, IntOrString>>,
    /// Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub requests: Option<BTreeMap<String, IntOrString>>,
}

/// ResourceClaim references one entry in PodSpec.ResourceClaims.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterTablespacesStoragePvcTemplateResourcesClaims {
    /// Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.
    pub name: String,
}

/// selector is a label query over volumes to consider for binding.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterTablespacesStoragePvcTemplateSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "matchExpressions"
    )]
    pub match_expressions:
        Option<Vec<ClusterTablespacesStoragePvcTemplateSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "matchLabels"
    )]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterTablespacesStoragePvcTemplateSelectorMatchExpressions {
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// TopologySpreadConstraint specifies how to spread matching pods among the given topology.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterTopologySpreadConstraints {
    /// LabelSelector is used to find matching pods. Pods that match this label selector are counted to determine the number of pods in their corresponding topology domain.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "labelSelector"
    )]
    pub label_selector: Option<ClusterTopologySpreadConstraintsLabelSelector>,
    /// MatchLabelKeys is a set of pod label keys to select the pods over which spreading will be calculated. The keys are used to lookup values from the incoming pod labels, those key-value labels are ANDed with labelSelector to select the group of existing pods over which spreading will be calculated for the incoming pod. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector. MatchLabelKeys cannot be set when LabelSelector isn't set. Keys that don't exist in the incoming pod labels will be ignored. A null or empty list means only match against labelSelector.
    ///  This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default).
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "matchLabelKeys"
    )]
    pub match_label_keys: Option<Vec<String>>,
    /// MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and the global minimum. The global minimum is the minimum number of matching pods in an eligible domain or zero if the number of eligible domains is less than MinDomains. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 2/2/1: In this case, the global minimum is 1. | zone1 | zone2 | zone3 | |  P P  |  P P  |   P   | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2; scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It's a required field. Default value is 1 and 0 is not allowed.
    #[serde(rename = "maxSkew")]
    pub max_skew: i32,
    /// MinDomains indicates a minimum number of eligible domains. When the number of eligible domains with matching topology keys is less than minDomains, Pod Topology Spread treats "global minimum" as 0, and then the calculation of Skew is performed. And when the number of eligible domains with matching topology keys equals or greater than minDomains, this value has no effect on scheduling. As a result, when the number of eligible domains is less than minDomains, scheduler won't schedule more than maxSkew Pods to those domains. If value is nil, the constraint behaves as if MinDomains is equal to 1. Valid values are integers greater than 0. When value is not nil, WhenUnsatisfiable must be DoNotSchedule.
    ///  For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same labelSelector spread as 2/2/2: | zone1 | zone2 | zone3 | |  P P  |  P P  |  P P  | The number of domains is less than 5(MinDomains), so "global minimum" is treated as 0. In this situation, new pod with the same labelSelector cannot be scheduled, because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones, it will violate MaxSkew.
    ///  This is a beta field and requires the MinDomainsInPodTopologySpread feature gate to be enabled (enabled by default).
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "minDomains"
    )]
    pub min_domains: Option<i32>,
    /// NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
    ///  If this value is nil, the behavior is equivalent to the Honor policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "nodeAffinityPolicy"
    )]
    pub node_affinity_policy: Option<String>,
    /// NodeTaintsPolicy indicates how we will treat node taints when calculating pod topology spread skew. Options are: - Honor: nodes without taints, along with tainted nodes for which the incoming pod has a toleration, are included. - Ignore: node taints are ignored. All nodes are included.
    ///  If this value is nil, the behavior is equivalent to the Ignore policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "nodeTaintsPolicy"
    )]
    pub node_taints_policy: Option<String>,
    /// TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each <key, value> as a "bucket", and try to put balanced number of pods into each bucket. We define a domain as a particular instance of a topology. Also, we define an eligible domain as a domain whose nodes meet the requirements of nodeAffinityPolicy and nodeTaintsPolicy. e.g. If TopologyKey is "kubernetes.io/hostname", each Node is a domain of that topology. And, if TopologyKey is "topology.kubernetes.io/zone", each zone is a domain of that topology. It's a required field.
    #[serde(rename = "topologyKey")]
    pub topology_key: String,
    /// WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location, but giving higher precedence to topologies that would help reduce the skew. A constraint is considered "Unsatisfiable" for an incoming pod if and only if every possible node assignment for that pod would violate "MaxSkew" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P |   P   |   P   | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won't make it *more* imbalanced. It's a required field.
    #[serde(rename = "whenUnsatisfiable")]
    pub when_unsatisfiable: String,
}

/// LabelSelector is used to find matching pods. Pods that match this label selector are counted to determine the number of pods in their corresponding topology domain.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterTopologySpreadConstraintsLabelSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "matchExpressions"
    )]
    pub match_expressions:
        Option<Vec<ClusterTopologySpreadConstraintsLabelSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "matchLabels"
    )]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterTopologySpreadConstraintsLabelSelectorMatchExpressions {
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// Configuration of the storage for PostgreSQL WAL (Write-Ahead Log)
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterWalStorage {
    /// Template to be used to generate the Persistent Volume Claim
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "pvcTemplate"
    )]
    pub pvc_template: Option<ClusterWalStoragePvcTemplate>,
    /// Resize existent PVCs, defaults to true
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "resizeInUseVolumes"
    )]
    pub resize_in_use_volumes: Option<bool>,
    /// Size of the storage. Required if not already specified in the PVC template. Changes to this field are automatically reapplied to the created PVCs. Size cannot be decreased.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub size: Option<String>,
    /// StorageClass to use for PVCs. Applied after evaluating the PVC template, if available. If not specified, the generated PVCs will use the default storage class
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "storageClass"
    )]
    pub storage_class: Option<String>,
}

/// Template to be used to generate the Persistent Volume Claim
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterWalStoragePvcTemplate {
    /// accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "accessModes"
    )]
    pub access_modes: Option<Vec<String>>,
    /// dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "dataSource"
    )]
    pub data_source: Option<ClusterWalStoragePvcTemplateDataSource>,
    /// dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn't specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn't set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While dataSource ignores disallowed values (dropping them), dataSourceRef preserves all values, and generates an error if a disallowed value is specified. * While dataSource only allows local objects, dataSourceRef allows objects in any namespaces. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "dataSourceRef"
    )]
    pub data_source_ref: Option<ClusterWalStoragePvcTemplateDataSourceRef>,
    /// resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub resources: Option<ClusterWalStoragePvcTemplateResources>,
    /// selector is a label query over volumes to consider for binding.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub selector: Option<ClusterWalStoragePvcTemplateSelector>,
    /// storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "storageClassName"
    )]
    pub storage_class_name: Option<String>,
    /// volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "volumeMode"
    )]
    pub volume_mode: Option<String>,
    /// volumeName is the binding reference to the PersistentVolume backing this claim.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "volumeName"
    )]
    pub volume_name: Option<String>,
}

/// dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterWalStoragePvcTemplateDataSource {
    /// APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiGroup")]
    pub api_group: Option<String>,
    /// Kind is the type of resource being referenced
    pub kind: String,
    /// Name is the name of resource being referenced
    pub name: String,
}

/// dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn't specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn't set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While dataSource ignores disallowed values (dropping them), dataSourceRef preserves all values, and generates an error if a disallowed value is specified. * While dataSource only allows local objects, dataSourceRef allows objects in any namespaces. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterWalStoragePvcTemplateDataSourceRef {
    /// APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiGroup")]
    pub api_group: Option<String>,
    /// Kind is the type of resource being referenced
    pub kind: String,
    /// Name is the name of resource being referenced
    pub name: String,
    /// Namespace is the namespace of resource being referenced Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
}

/// resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterWalStoragePvcTemplateResources {
    /// Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container.
    ///  This is an alpha field and requires enabling the DynamicResourceAllocation feature gate.
    ///  This field is immutable. It can only be set for containers.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub claims: Option<Vec<ClusterWalStoragePvcTemplateResourcesClaims>>,
    /// Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub limits: Option<BTreeMap<String, IntOrString>>,
    /// Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub requests: Option<BTreeMap<String, IntOrString>>,
}

/// ResourceClaim references one entry in PodSpec.ResourceClaims.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterWalStoragePvcTemplateResourcesClaims {
    /// Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.
    pub name: String,
}

/// selector is a label query over volumes to consider for binding.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterWalStoragePvcTemplateSelector {
    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "matchExpressions"
    )]
    pub match_expressions: Option<Vec<ClusterWalStoragePvcTemplateSelectorMatchExpressions>>,
    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "matchLabels"
    )]
    pub match_labels: Option<BTreeMap<String, String>>,
}

/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterWalStoragePvcTemplateSelectorMatchExpressions {
    /// key is the label key that the selector applies to.
    pub key: String,
    /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
    pub operator: String,
    /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// Most recently observed status of the cluster. This data may not be up to date. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterStatus {
    /// AzurePVCUpdateEnabled shows if the PVC online upgrade is enabled for this cluster
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "azurePVCUpdateEnabled"
    )]
    pub azure_pvc_update_enabled: Option<bool>,
    /// The configuration for the CA and related certificates, initialized with defaults.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub certificates: Option<ClusterStatusCertificates>,
    /// The commit hash number of which this operator running
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "cloudNativePGCommitHash"
    )]
    pub cloud_native_pg_commit_hash: Option<String>,
    /// The hash of the binary of the operator
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "cloudNativePGOperatorHash"
    )]
    pub cloud_native_pg_operator_hash: Option<String>,
    /// Conditions for cluster object
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub conditions: Option<Vec<ClusterStatusConditions>>,
    /// The list of resource versions of the configmaps, managed by the operator. Every change here is done in the interest of the instance manager, which will refresh the configmap data
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "configMapResourceVersion"
    )]
    pub config_map_resource_version: Option<ClusterStatusConfigMapResourceVersion>,
    /// Current primary instance
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "currentPrimary"
    )]
    pub current_primary: Option<String>,
    /// The timestamp when the primary was detected to be unhealthy This field is reported when `.spec.failoverDelay` is populated or during online upgrades
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "currentPrimaryFailingSinceTimestamp"
    )]
    pub current_primary_failing_since_timestamp: Option<String>,
    /// The timestamp when the last actual promotion to primary has occurred
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "currentPrimaryTimestamp"
    )]
    pub current_primary_timestamp: Option<String>,
    /// List of all the PVCs created by this cluster and still available which are not attached to a Pod
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "danglingPVC"
    )]
    pub dangling_pvc: Option<Vec<String>>,
    /// The first recoverability point, stored as a date in RFC3339 format. This field is calculated from the content of FirstRecoverabilityPointByMethod
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "firstRecoverabilityPoint"
    )]
    pub first_recoverability_point: Option<String>,
    /// The first recoverability point, stored as a date in RFC3339 format, per backup method type
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "firstRecoverabilityPointByMethod"
    )]
    pub first_recoverability_point_by_method: Option<BTreeMap<String, String>>,
    /// List of all the PVCs not dangling nor initializing
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "healthyPVC"
    )]
    pub healthy_pvc: Option<Vec<String>>,
    /// List of all the PVCs that are being initialized by this cluster
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "initializingPVC"
    )]
    pub initializing_pvc: Option<Vec<String>>,
    /// List of instance names in the cluster
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "instanceNames"
    )]
    pub instance_names: Option<Vec<String>>,
    /// The total number of PVC Groups detected in the cluster. It may differ from the number of existing instance pods.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub instances: Option<i64>,
    /// The reported state of the instances during the last reconciliation loop
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "instancesReportedState"
    )]
    pub instances_reported_state: Option<BTreeMap<String, ClusterStatusInstancesReportedState>>,
    /// InstancesStatus indicates in which status the instances are
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "instancesStatus"
    )]
    pub instances_status: Option<BTreeMap<String, Vec<String>>>,
    /// How many Jobs have been created by this cluster
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "jobCount")]
    pub job_count: Option<i32>,
    /// Stored as a date in RFC3339 format
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "lastFailedBackup"
    )]
    pub last_failed_backup: Option<String>,
    /// Last successful backup, stored as a date in RFC3339 format This field is calculated from the content of LastSuccessfulBackupByMethod
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "lastSuccessfulBackup"
    )]
    pub last_successful_backup: Option<String>,
    /// Last successful backup, stored as a date in RFC3339 format, per backup method type
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "lastSuccessfulBackupByMethod"
    )]
    pub last_successful_backup_by_method: Option<BTreeMap<String, String>>,
    /// ID of the latest generated node (used to avoid node name clashing)
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "latestGeneratedNode"
    )]
    pub latest_generated_node: Option<i64>,
    /// ManagedRolesStatus reports the state of the managed roles in the cluster
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "managedRolesStatus"
    )]
    pub managed_roles_status: Option<ClusterStatusManagedRolesStatus>,
    /// OnlineUpdateEnabled shows if the online upgrade is enabled inside the cluster
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "onlineUpdateEnabled"
    )]
    pub online_update_enabled: Option<bool>,
    /// Current phase of the cluster
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub phase: Option<String>,
    /// Reason for the current phase
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "phaseReason"
    )]
    pub phase_reason: Option<String>,
    /// The integration needed by poolers referencing the cluster
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "poolerIntegrations"
    )]
    pub pooler_integrations: Option<ClusterStatusPoolerIntegrations>,
    /// How many PVCs have been created by this cluster
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "pvcCount")]
    pub pvc_count: Option<i32>,
    /// Current list of read pods
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "readService"
    )]
    pub read_service: Option<String>,
    /// The total number of ready instances in the cluster. It is equal to the number of ready instance pods.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "readyInstances"
    )]
    pub ready_instances: Option<i64>,
    /// List of all the PVCs that have ResizingPVC condition.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "resizingPVC"
    )]
    pub resizing_pvc: Option<Vec<String>>,
    /// The list of resource versions of the secrets managed by the operator. Every change here is done in the interest of the instance manager, which will refresh the secret data
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "secretsResourceVersion"
    )]
    pub secrets_resource_version: Option<ClusterStatusSecretsResourceVersion>,
    /// TablespacesStatus reports the state of the declarative tablespaces in the cluster
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "tablespacesStatus"
    )]
    pub tablespaces_status: Option<Vec<ClusterStatusTablespacesStatus>>,
    /// Target primary instance, this is different from the previous one during a switchover or a failover
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "targetPrimary"
    )]
    pub target_primary: Option<String>,
    /// The timestamp when the last request for a new primary has occurred
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "targetPrimaryTimestamp"
    )]
    pub target_primary_timestamp: Option<String>,
    /// The timeline of the Postgres cluster
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "timelineID"
    )]
    pub timeline_id: Option<i64>,
    /// Instances topology.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub topology: Option<ClusterStatusTopology>,
    /// List of all the PVCs that are unusable because another PVC is missing
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "unusablePVC"
    )]
    pub unusable_pvc: Option<Vec<String>>,
    /// Current write pod
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "writeService"
    )]
    pub write_service: Option<String>,
}

/// The configuration for the CA and related certificates, initialized with defaults.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterStatusCertificates {
    /// The secret containing the Client CA certificate. If not defined, a new secret will be created with a self-signed CA and will be used to generate all the client certificates.<br /> <br /> Contains:<br /> <br /> - `ca.crt`: CA that should be used to validate the client certificates, used as `ssl_ca_file` of all the instances.<br /> - `ca.key`: key used to generate client certificates, if ReplicationTLSSecret is provided, this can be omitted.<br />
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "clientCASecret"
    )]
    pub client_ca_secret: Option<String>,
    /// Expiration dates for all certificates.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub expirations: Option<BTreeMap<String, String>>,
    /// The secret of type kubernetes.io/tls containing the client certificate to authenticate as the `streaming_replica` user. If not defined, ClientCASecret must provide also `ca.key`, and a new secret will be created using the provided CA.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "replicationTLSSecret"
    )]
    pub replication_tls_secret: Option<String>,
    /// The list of the server alternative DNS names to be added to the generated server TLS certificates, when required.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "serverAltDNSNames"
    )]
    pub server_alt_dns_names: Option<Vec<String>>,
    /// The secret containing the Server CA certificate. If not defined, a new secret will be created with a self-signed CA and will be used to generate the TLS certificate ServerTLSSecret.<br /> <br /> Contains:<br /> <br /> - `ca.crt`: CA that should be used to validate the server certificate, used as `sslrootcert` in client connection strings.<br /> - `ca.key`: key used to generate Server SSL certs, if ServerTLSSecret is provided, this can be omitted.<br />
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "serverCASecret"
    )]
    pub server_ca_secret: Option<String>,
    /// The secret of type kubernetes.io/tls containing the server TLS certificate and key that will be set as `ssl_cert_file` and `ssl_key_file` so that clients can connect to postgres securely. If not defined, ServerCASecret must provide also `ca.key` and a new secret will be created using the provided CA.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "serverTLSSecret"
    )]
    pub server_tls_secret: Option<String>,
}

/// Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions.  For example,
///  type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
///  // other fields }
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub struct ClusterStatusConditions {
    /// lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed.  If that is not known, then using the time when the API field changed is acceptable.
    #[serde(rename = "lastTransitionTime")]
    pub last_transition_time: String,
    /// message is a human readable message indicating details about the transition. This may be an empty string.
    pub message: String,
    /// observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "observedGeneration"
    )]
    pub observed_generation: Option<i64>,
    /// reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
    pub reason: String,
    /// status of the condition, one of True, False, Unknown.
    pub status: ClusterStatusConditionsStatus,
    /// type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
    #[serde(rename = "type")]
    pub r#type: String,
}

/// Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions.  For example,
///  type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
///  // other fields }
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, PartialEq)]
pub enum ClusterStatusConditionsStatus {
    True,
    False,
    Unknown,
}

/// The list of resource versions of the configmaps, managed by the operator. Every change here is done in the interest of the instance manager, which will refresh the configmap data
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterStatusConfigMapResourceVersion {
    /// A map with the versions of all the config maps used to pass metrics. Map keys are the config map names, map values are the versions
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub metrics: Option<BTreeMap<String, String>>,
}

/// The reported state of the instances during the last reconciliation loop
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterStatusInstancesReportedState {
    /// indicates if an instance is the primary one
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "isPrimary")]
    pub is_primary: Option<bool>,
    /// indicates on which TimelineId the instance is
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "timeLineID"
    )]
    pub time_line_id: Option<i64>,
}

/// ManagedRolesStatus reports the state of the managed roles in the cluster
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterStatusManagedRolesStatus {
    /// ByStatus gives the list of roles in each state
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "byStatus")]
    pub by_status: Option<BTreeMap<String, Vec<String>>>,
    /// CannotReconcile lists roles that cannot be reconciled in PostgreSQL, with an explanation of the cause
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "cannotReconcile"
    )]
    pub cannot_reconcile: Option<BTreeMap<String, Vec<String>>>,
    /// PasswordStatus gives the last transaction id and password secret version for each managed role
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "passwordStatus"
    )]
    pub password_status: Option<BTreeMap<String, ClusterStatusManagedRolesStatusPasswordStatus>>,
}

/// PasswordStatus gives the last transaction id and password secret version for each managed role
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterStatusManagedRolesStatusPasswordStatus {
    /// the resource version of the password secret
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "resourceVersion"
    )]
    pub resource_version: Option<String>,
    /// the last transaction ID to affect the role definition in PostgreSQL
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "transactionID"
    )]
    pub transaction_id: Option<i64>,
}

/// The integration needed by poolers referencing the cluster
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterStatusPoolerIntegrations {
    /// PgBouncerIntegrationStatus encapsulates the needed integration for the pgbouncer poolers referencing the cluster
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "pgBouncerIntegration"
    )]
    pub pg_bouncer_integration: Option<ClusterStatusPoolerIntegrationsPgBouncerIntegration>,
}

/// PgBouncerIntegrationStatus encapsulates the needed integration for the pgbouncer poolers referencing the cluster
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterStatusPoolerIntegrationsPgBouncerIntegration {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub secrets: Option<Vec<String>>,
}

/// The list of resource versions of the secrets managed by the operator. Every change here is done in the interest of the instance manager, which will refresh the secret data
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterStatusSecretsResourceVersion {
    /// The resource version of the "app" user secret
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "applicationSecretVersion"
    )]
    pub application_secret_version: Option<String>,
    /// The resource version of the Barman Endpoint CA if provided
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "barmanEndpointCA"
    )]
    pub barman_endpoint_ca: Option<String>,
    /// Unused. Retained for compatibility with old versions.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "caSecretVersion"
    )]
    pub ca_secret_version: Option<String>,
    /// The resource version of the PostgreSQL client-side CA secret version
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "clientCaSecretVersion"
    )]
    pub client_ca_secret_version: Option<String>,
    /// The resource versions of the external cluster secrets
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "externalClusterSecretVersion"
    )]
    pub external_cluster_secret_version: Option<BTreeMap<String, String>>,
    /// The resource versions of the managed roles secrets
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "managedRoleSecretVersion"
    )]
    pub managed_role_secret_version: Option<BTreeMap<String, String>>,
    /// A map with the versions of all the secrets used to pass metrics. Map keys are the secret names, map values are the versions
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub metrics: Option<BTreeMap<String, String>>,
    /// The resource version of the "streaming_replica" user secret
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "replicationSecretVersion"
    )]
    pub replication_secret_version: Option<String>,
    /// The resource version of the PostgreSQL server-side CA secret version
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "serverCaSecretVersion"
    )]
    pub server_ca_secret_version: Option<String>,
    /// The resource version of the PostgreSQL server-side secret version
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "serverSecretVersion"
    )]
    pub server_secret_version: Option<String>,
    /// The resource version of the "postgres" user secret
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "superuserSecretVersion"
    )]
    pub superuser_secret_version: Option<String>,
}

/// TablespaceState represents the state of a tablespace in a cluster
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterStatusTablespacesStatus {
    /// Error is the reconciliation error, if any
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub error: Option<String>,
    /// Name is the name of the tablespace
    pub name: String,
    /// Owner is the PostgreSQL user owning the tablespace
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub owner: Option<String>,
    /// State is the latest reconciliation state
    pub state: String,
}

/// Instances topology.
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterStatusTopology {
    /// Instances contains the pod topology of the instances
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub instances: Option<BTreeMap<String, ClusterStatusTopologyInstances>>,
    /// NodesUsed represents the count of distinct nodes accommodating the instances. A value of '1' suggests that all instances are hosted on a single node, implying the absence of High Availability (HA). Ideally, this value should be the same as the number of instances in the Postgres HA cluster, implying shared nothing architecture on the compute side.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodesUsed")]
    pub nodes_used: Option<i32>,
    /// SuccessfullyExtracted indicates if the topology data was extract. It is useful to enact fallback behaviors in synchronous replica election in case of failures
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "successfullyExtracted"
    )]
    pub successfully_extracted: Option<bool>,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)]
pub struct ClusterStatusTopologyInstances {}