kcr_helm_toolkit_fluxcd_io 3.20260114.91456

Kubernetes Custom Resource Bindings
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
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
// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium --docs --derive=Default --derive=PartialEq --smart-derive-elision --filename crd-catalog/fluxcd/helm-controller/helm.toolkit.fluxcd.io/v2beta1/helmreleases.yaml
// kopium version: 0.22.5

#[allow(unused_imports)]
mod prelude {
    pub use kube::CustomResource;
    pub use serde::{Serialize, Deserialize};
    pub use std::collections::BTreeMap;
    pub use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
}
use self::prelude::*;

/// HelmReleaseSpec defines the desired state of a Helm release.
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, PartialEq)]
#[kube(group = "helm.toolkit.fluxcd.io", version = "v2beta1", kind = "HelmRelease", plural = "helmreleases")]
#[kube(namespaced)]
#[kube(status = "HelmReleaseStatus")]
#[kube(schema = "disabled")]
#[kube(derive="PartialEq")]
pub struct HelmReleaseSpec {
    /// Chart defines the template of the v1beta2.HelmChart that should be created
    /// for this HelmRelease.
    pub chart: HelmReleaseChart,
    /// ChartRef holds a reference to a source controller resource containing the
    /// Helm chart artifact.
    /// 
    /// Note: this field is provisional to the v2 API, and not actively used
    /// by v2beta1 HelmReleases.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "chartRef")]
    pub chart_ref: Option<HelmReleaseChartRef>,
    /// DependsOn may contain a meta.NamespacedObjectReference slice with
    /// references to HelmRelease resources that must be ready before this HelmRelease
    /// can be reconciled.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "dependsOn")]
    pub depends_on: Option<Vec<HelmReleaseDependsOn>>,
    /// DriftDetection holds the configuration for detecting and handling
    /// differences between the manifest in the Helm storage and the resources
    /// currently existing in the cluster.
    /// 
    /// Note: this field is provisional to the v2beta2 API, and not actively used
    /// by v2beta1 HelmReleases.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "driftDetection")]
    pub drift_detection: Option<HelmReleaseDriftDetection>,
    /// Install holds the configuration for Helm install actions for this HelmRelease.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub install: Option<HelmReleaseInstall>,
    /// Interval at which to reconcile the Helm release.
    /// This interval is approximate and may be subject to jitter to ensure
    /// efficient use of resources.
    pub interval: String,
    /// KubeConfig for reconciling the HelmRelease on a remote cluster.
    /// When used in combination with HelmReleaseSpec.ServiceAccountName,
    /// forces the controller to act on behalf of that Service Account at the
    /// target cluster.
    /// If the --default-service-account flag is set, its value will be used as
    /// a controller level fallback for when HelmReleaseSpec.ServiceAccountName
    /// is empty.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "kubeConfig")]
    pub kube_config: Option<HelmReleaseKubeConfig>,
    /// MaxHistory is the number of revisions saved by Helm for this HelmRelease.
    /// Use '0' for an unlimited number of revisions; defaults to '10'.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxHistory")]
    pub max_history: Option<i64>,
    /// PersistentClient tells the controller to use a persistent Kubernetes
    /// client for this release. When enabled, the client will be reused for the
    /// duration of the reconciliation, instead of being created and destroyed
    /// for each (step of a) Helm action.
    /// 
    /// This can improve performance, but may cause issues with some Helm charts
    /// that for example do create Custom Resource Definitions during installation
    /// outside Helm's CRD lifecycle hooks, which are then not observed to be
    /// available by e.g. post-install hooks.
    /// 
    /// If not set, it defaults to true.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "persistentClient")]
    pub persistent_client: Option<bool>,
    /// PostRenderers holds an array of Helm PostRenderers, which will be applied in order
    /// of their definition.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "postRenderers")]
    pub post_renderers: Option<Vec<HelmReleasePostRenderers>>,
    /// ReleaseName used for the Helm release. Defaults to a composition of
    /// '[TargetNamespace-]Name'.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "releaseName")]
    pub release_name: Option<String>,
    /// Rollback holds the configuration for Helm rollback actions for this HelmRelease.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub rollback: Option<HelmReleaseRollback>,
    /// The name of the Kubernetes service account to impersonate
    /// when reconciling this HelmRelease.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "serviceAccountName")]
    pub service_account_name: Option<String>,
    /// StorageNamespace used for the Helm storage.
    /// Defaults to the namespace of the HelmRelease.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "storageNamespace")]
    pub storage_namespace: Option<String>,
    /// Suspend tells the controller to suspend reconciliation for this HelmRelease,
    /// it does not apply to already started reconciliations. Defaults to false.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub suspend: Option<bool>,
    /// TargetNamespace to target when performing operations for the HelmRelease.
    /// Defaults to the namespace of the HelmRelease.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetNamespace")]
    pub target_namespace: Option<String>,
    /// Test holds the configuration for Helm test actions for this HelmRelease.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub test: Option<HelmReleaseTest>,
    /// Timeout is the time to wait for any individual Kubernetes operation (like Jobs
    /// for hooks) during the performance of a Helm action. Defaults to '5m0s'.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub timeout: Option<String>,
    /// Uninstall holds the configuration for Helm uninstall actions for this HelmRelease.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub uninstall: Option<HelmReleaseUninstall>,
    /// Upgrade holds the configuration for Helm upgrade actions for this HelmRelease.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub upgrade: Option<HelmReleaseUpgrade>,
    /// Values holds the values for this Helm release.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub values: Option<serde_json::Value>,
    /// ValuesFrom holds references to resources containing Helm values for this HelmRelease,
    /// and information about how they should be merged.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "valuesFrom")]
    pub values_from: Option<Vec<HelmReleaseValuesFrom>>,
}

/// Chart defines the template of the v1beta2.HelmChart that should be created
/// for this HelmRelease.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct HelmReleaseChart {
    /// ObjectMeta holds the template for metadata like labels and annotations.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub metadata: Option<HelmReleaseChartMetadata>,
    /// Spec holds the template for the v1beta2.HelmChartSpec for this HelmRelease.
    pub spec: HelmReleaseChartSpec,
}

/// ObjectMeta holds the template for metadata like labels and annotations.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleaseChartMetadata {
    /// 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: <https://kubernetes.io/docs/concepts/overview/working-with-objects/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.
    /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub labels: Option<BTreeMap<String, String>>,
}

/// Spec holds the template for the v1beta2.HelmChartSpec for this HelmRelease.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct HelmReleaseChartSpec {
    /// The name or path the Helm chart is available at in the SourceRef.
    pub chart: String,
    /// Interval at which to check the v1beta2.Source for updates. Defaults to
    /// 'HelmReleaseSpec.Interval'.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub interval: Option<String>,
    /// Determines what enables the creation of a new artifact. Valid values are
    /// ('ChartVersion', 'Revision').
    /// See the documentation of the values for an explanation on their behavior.
    /// Defaults to ChartVersion when omitted.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "reconcileStrategy")]
    pub reconcile_strategy: Option<HelmReleaseChartSpecReconcileStrategy>,
    /// The name and namespace of the v1beta2.Source the chart is available at.
    #[serde(rename = "sourceRef")]
    pub source_ref: HelmReleaseChartSpecSourceRef,
    /// Alternative values file to use as the default chart values, expected to
    /// be a relative path in the SourceRef. Deprecated in favor of ValuesFiles,
    /// for backwards compatibility the file defined here is merged before the
    /// ValuesFiles items. Ignored when omitted.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "valuesFile")]
    pub values_file: Option<String>,
    /// Alternative list of values files to use as the chart values (values.yaml
    /// is not included by default), expected to be a relative path in the SourceRef.
    /// Values files are merged in the order of this list with the last file overriding
    /// the first. Ignored when omitted.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "valuesFiles")]
    pub values_files: Option<Vec<String>>,
    /// Verify contains the secret name containing the trusted public keys
    /// used to verify the signature and specifies which provider to use to check
    /// whether OCI image is authentic.
    /// This field is only supported for OCI sources.
    /// Chart dependencies, which are not bundled in the umbrella chart artifact, are not verified.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub verify: Option<HelmReleaseChartSpecVerify>,
    /// Version semver expression, ignored for charts from v1beta2.GitRepository and
    /// v1beta2.Bucket sources. Defaults to latest when omitted.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub version: Option<String>,
}

/// Spec holds the template for the v1beta2.HelmChartSpec for this HelmRelease.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum HelmReleaseChartSpecReconcileStrategy {
    ChartVersion,
    Revision,
}

/// The name and namespace of the v1beta2.Source the chart is available at.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct HelmReleaseChartSpecSourceRef {
    /// APIVersion of the referent.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
    pub api_version: Option<String>,
    /// Kind of the referent.
    pub kind: HelmReleaseChartSpecSourceRefKind,
    /// Name of the referent.
    pub name: String,
    /// Namespace of the referent.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
}

/// The name and namespace of the v1beta2.Source the chart is available at.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum HelmReleaseChartSpecSourceRefKind {
    HelmRepository,
    GitRepository,
    Bucket,
}

/// Verify contains the secret name containing the trusted public keys
/// used to verify the signature and specifies which provider to use to check
/// whether OCI image is authentic.
/// This field is only supported for OCI sources.
/// Chart dependencies, which are not bundled in the umbrella chart artifact, are not verified.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct HelmReleaseChartSpecVerify {
    /// Provider specifies the technology used to sign the OCI Helm chart.
    pub provider: HelmReleaseChartSpecVerifyProvider,
    /// SecretRef specifies the Kubernetes Secret containing the
    /// trusted public keys.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretRef")]
    pub secret_ref: Option<HelmReleaseChartSpecVerifySecretRef>,
}

/// Verify contains the secret name containing the trusted public keys
/// used to verify the signature and specifies which provider to use to check
/// whether OCI image is authentic.
/// This field is only supported for OCI sources.
/// Chart dependencies, which are not bundled in the umbrella chart artifact, are not verified.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum HelmReleaseChartSpecVerifyProvider {
    #[serde(rename = "cosign")]
    Cosign,
}

/// SecretRef specifies the Kubernetes Secret containing the
/// trusted public keys.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleaseChartSpecVerifySecretRef {
    /// Name of the referent.
    pub name: String,
}

/// ChartRef holds a reference to a source controller resource containing the
/// Helm chart artifact.
/// 
/// Note: this field is provisional to the v2 API, and not actively used
/// by v2beta1 HelmReleases.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct HelmReleaseChartRef {
    /// APIVersion of the referent.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
    pub api_version: Option<String>,
    /// Kind of the referent.
    pub kind: HelmReleaseChartRefKind,
    /// Name of the referent.
    pub name: String,
    /// Namespace of the referent, defaults to the namespace of the Kubernetes
    /// resource object that contains the reference.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
}

/// ChartRef holds a reference to a source controller resource containing the
/// Helm chart artifact.
/// 
/// Note: this field is provisional to the v2 API, and not actively used
/// by v2beta1 HelmReleases.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum HelmReleaseChartRefKind {
    #[serde(rename = "OCIRepository")]
    OciRepository,
    HelmChart,
}

/// NamespacedObjectReference contains enough information to locate the referenced Kubernetes resource object in any
/// namespace.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleaseDependsOn {
    /// Name of the referent.
    pub name: String,
    /// Namespace of the referent, when not specified it acts as LocalObjectReference.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
}

/// DriftDetection holds the configuration for detecting and handling
/// differences between the manifest in the Helm storage and the resources
/// currently existing in the cluster.
/// 
/// Note: this field is provisional to the v2beta2 API, and not actively used
/// by v2beta1 HelmReleases.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleaseDriftDetection {
    /// Ignore contains a list of rules for specifying which changes to ignore
    /// during diffing.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ignore: Option<Vec<HelmReleaseDriftDetectionIgnore>>,
    /// Mode defines how differences should be handled between the Helm manifest
    /// and the manifest currently applied to the cluster.
    /// If not explicitly set, it defaults to DiffModeDisabled.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub mode: Option<HelmReleaseDriftDetectionMode>,
}

/// IgnoreRule defines a rule to selectively disregard specific changes during
/// the drift detection process.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleaseDriftDetectionIgnore {
    /// Paths is a list of JSON Pointer (RFC 6901) paths to be excluded from
    /// consideration in a Kubernetes object.
    pub paths: Vec<String>,
    /// Target is a selector for specifying Kubernetes objects to which this
    /// rule applies.
    /// If Target is not set, the Paths will be ignored for all Kubernetes
    /// objects within the manifest of the Helm release.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub target: Option<HelmReleaseDriftDetectionIgnoreTarget>,
}

/// Target is a selector for specifying Kubernetes objects to which this
/// rule applies.
/// If Target is not set, the Paths will be ignored for all Kubernetes
/// objects within the manifest of the Helm release.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleaseDriftDetectionIgnoreTarget {
    /// AnnotationSelector is a string that follows the label selection expression
    /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api>
    /// It matches with the resource annotations.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "annotationSelector")]
    pub annotation_selector: Option<String>,
    /// Group is the API group to select resources from.
    /// Together with Version and Kind it is capable of unambiguously identifying and/or selecting resources.
    /// <https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub group: Option<String>,
    /// Kind of the API Group to select resources from.
    /// Together with Group and Version it is capable of unambiguously
    /// identifying and/or selecting resources.
    /// <https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// LabelSelector is a string that follows the label selection expression
    /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api>
    /// It matches with the resource labels.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
    pub label_selector: Option<String>,
    /// Name to match resources with.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Namespace to select resources from.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
    /// Version of the API Group to select resources from.
    /// Together with Group and Kind it is capable of unambiguously identifying and/or selecting resources.
    /// <https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub version: Option<String>,
}

/// DriftDetection holds the configuration for detecting and handling
/// differences between the manifest in the Helm storage and the resources
/// currently existing in the cluster.
/// 
/// Note: this field is provisional to the v2beta2 API, and not actively used
/// by v2beta1 HelmReleases.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum HelmReleaseDriftDetectionMode {
    #[serde(rename = "enabled")]
    Enabled,
    #[serde(rename = "warn")]
    Warn,
    #[serde(rename = "disabled")]
    Disabled,
}

/// Install holds the configuration for Helm install actions for this HelmRelease.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleaseInstall {
    /// CRDs upgrade CRDs from the Helm Chart's crds directory according
    /// to the CRD upgrade policy provided here. Valid values are `Skip`,
    /// `Create` or `CreateReplace`. Default is `Create` and if omitted
    /// CRDs are installed but not updated.
    /// 
    /// Skip: do neither install nor replace (update) any CRDs.
    /// 
    /// Create: new CRDs are created, existing CRDs are neither updated nor deleted.
    /// 
    /// CreateReplace: new CRDs are created, existing CRDs are updated (replaced)
    /// but not deleted.
    /// 
    /// By default, CRDs are applied (installed) during Helm install action.
    /// With this option users can opt-in to CRD replace existing CRDs on Helm
    /// install actions, which is not (yet) natively supported by Helm.
    /// <https://helm.sh/docs/chart_best_practices/custom_resource_definitions.>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub crds: Option<HelmReleaseInstallCrds>,
    /// CreateNamespace tells the Helm install action to create the
    /// HelmReleaseSpec.TargetNamespace if it does not exist yet.
    /// On uninstall, the namespace will not be garbage collected.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "createNamespace")]
    pub create_namespace: Option<bool>,
    /// DisableHooks prevents hooks from running during the Helm install action.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "disableHooks")]
    pub disable_hooks: Option<bool>,
    /// DisableOpenAPIValidation prevents the Helm install action from validating
    /// rendered templates against the Kubernetes OpenAPI Schema.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "disableOpenAPIValidation")]
    pub disable_open_api_validation: Option<bool>,
    /// DisableWait disables the waiting for resources to be ready after a Helm
    /// install has been performed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "disableWait")]
    pub disable_wait: Option<bool>,
    /// DisableWaitForJobs disables waiting for jobs to complete after a Helm
    /// install has been performed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "disableWaitForJobs")]
    pub disable_wait_for_jobs: Option<bool>,
    /// Remediation holds the remediation configuration for when the Helm install
    /// action for the HelmRelease fails. The default is to not perform any action.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub remediation: Option<HelmReleaseInstallRemediation>,
    /// Replace tells the Helm install action to re-use the 'ReleaseName', but only
    /// if that name is a deleted release which remains in the history.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub replace: Option<bool>,
    /// SkipCRDs tells the Helm install action to not install any CRDs. By default,
    /// CRDs are installed if not already present.
    /// 
    /// Deprecated use CRD policy (`crds`) attribute with value `Skip` instead.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "skipCRDs")]
    pub skip_cr_ds: Option<bool>,
    /// Timeout is the time to wait for any individual Kubernetes operation (like
    /// Jobs for hooks) during the performance of a Helm install action. Defaults to
    /// 'HelmReleaseSpec.Timeout'.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub timeout: Option<String>,
}

/// Install holds the configuration for Helm install actions for this HelmRelease.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum HelmReleaseInstallCrds {
    Skip,
    Create,
    CreateReplace,
}

/// Remediation holds the remediation configuration for when the Helm install
/// action for the HelmRelease fails. The default is to not perform any action.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleaseInstallRemediation {
    /// IgnoreTestFailures tells the controller to skip remediation when the Helm
    /// tests are run after an install action but fail. Defaults to
    /// 'Test.IgnoreFailures'.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "ignoreTestFailures")]
    pub ignore_test_failures: Option<bool>,
    /// RemediateLastFailure tells the controller to remediate the last failure, when
    /// no retries remain. Defaults to 'false'.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "remediateLastFailure")]
    pub remediate_last_failure: Option<bool>,
    /// Retries is the number of retries that should be attempted on failures before
    /// bailing. Remediation, using an uninstall, is performed between each attempt.
    /// Defaults to '0', a negative integer equals to unlimited retries.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub retries: Option<i64>,
}

/// KubeConfig for reconciling the HelmRelease on a remote cluster.
/// When used in combination with HelmReleaseSpec.ServiceAccountName,
/// forces the controller to act on behalf of that Service Account at the
/// target cluster.
/// If the --default-service-account flag is set, its value will be used as
/// a controller level fallback for when HelmReleaseSpec.ServiceAccountName
/// is empty.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleaseKubeConfig {
    /// ConfigMapRef holds an optional name of a ConfigMap that contains
    /// the following keys:
    /// 
    /// - `provider`: the provider to use. One of `aws`, `azure`, `gcp`, or
    ///    `generic`. Required.
    /// - `cluster`: the fully qualified resource name of the Kubernetes
    ///    cluster in the cloud provider API. Not used by the `generic`
    ///    provider. Required when one of `address` or `ca.crt` is not set.
    /// - `address`: the address of the Kubernetes API server. Required
    ///    for `generic`. For the other providers, if not specified, the
    ///    first address in the cluster resource will be used, and if
    ///    specified, it must match one of the addresses in the cluster
    ///    resource.
    ///    If audiences is not set, will be used as the audience for the
    ///    `generic` provider.
    /// - `ca.crt`: the optional PEM-encoded CA certificate for the
    ///    Kubernetes API server. If not set, the controller will use the
    ///    CA certificate from the cluster resource.
    /// - `audiences`: the optional audiences as a list of
    ///    line-break-separated strings for the Kubernetes ServiceAccount
    ///    token. Defaults to the `address` for the `generic` provider, or
    ///    to specific values for the other providers depending on the
    ///    provider.
    /// -  `serviceAccountName`: the optional name of the Kubernetes
    ///    ServiceAccount in the same namespace that should be used
    ///    for authentication. If not specified, the controller
    ///    ServiceAccount will be used.
    /// 
    /// Mutually exclusive with SecretRef.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapRef")]
    pub config_map_ref: Option<HelmReleaseKubeConfigConfigMapRef>,
    /// SecretRef holds an optional name of a secret that contains a key with
    /// the kubeconfig file as the value. If no key is set, the key will default
    /// to 'value'. Mutually exclusive with ConfigMapRef.
    /// It is recommended that the kubeconfig is self-contained, and the secret
    /// is regularly updated if credentials such as a cloud-access-token expire.
    /// Cloud specific `cmd-path` auth helpers will not function without adding
    /// binaries and credentials to the Pod that is responsible for reconciling
    /// Kubernetes resources. Supported only for the generic provider.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretRef")]
    pub secret_ref: Option<HelmReleaseKubeConfigSecretRef>,
}

/// ConfigMapRef holds an optional name of a ConfigMap that contains
/// the following keys:
/// 
/// - `provider`: the provider to use. One of `aws`, `azure`, `gcp`, or
///    `generic`. Required.
/// - `cluster`: the fully qualified resource name of the Kubernetes
///    cluster in the cloud provider API. Not used by the `generic`
///    provider. Required when one of `address` or `ca.crt` is not set.
/// - `address`: the address of the Kubernetes API server. Required
///    for `generic`. For the other providers, if not specified, the
///    first address in the cluster resource will be used, and if
///    specified, it must match one of the addresses in the cluster
///    resource.
///    If audiences is not set, will be used as the audience for the
///    `generic` provider.
/// - `ca.crt`: the optional PEM-encoded CA certificate for the
///    Kubernetes API server. If not set, the controller will use the
///    CA certificate from the cluster resource.
/// - `audiences`: the optional audiences as a list of
///    line-break-separated strings for the Kubernetes ServiceAccount
///    token. Defaults to the `address` for the `generic` provider, or
///    to specific values for the other providers depending on the
///    provider.
/// -  `serviceAccountName`: the optional name of the Kubernetes
///    ServiceAccount in the same namespace that should be used
///    for authentication. If not specified, the controller
///    ServiceAccount will be used.
/// 
/// Mutually exclusive with SecretRef.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleaseKubeConfigConfigMapRef {
    /// Name of the referent.
    pub name: String,
}

/// SecretRef holds an optional name of a secret that contains a key with
/// the kubeconfig file as the value. If no key is set, the key will default
/// to 'value'. Mutually exclusive with ConfigMapRef.
/// It is recommended that the kubeconfig is self-contained, and the secret
/// is regularly updated if credentials such as a cloud-access-token expire.
/// Cloud specific `cmd-path` auth helpers will not function without adding
/// binaries and credentials to the Pod that is responsible for reconciling
/// Kubernetes resources. Supported only for the generic provider.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleaseKubeConfigSecretRef {
    /// Key in the Secret, when not specified an implementation-specific default key is used.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub key: Option<String>,
    /// Name of the Secret.
    pub name: String,
}

/// PostRenderer contains a Helm PostRenderer specification.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleasePostRenderers {
    /// Kustomization to apply as PostRenderer.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub kustomize: Option<HelmReleasePostRenderersKustomize>,
}

/// Kustomization to apply as PostRenderer.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleasePostRenderersKustomize {
    /// Images is a list of (image name, new name, new tag or digest)
    /// for changing image names, tags or digests. This can also be achieved with a
    /// patch, but this operator is simpler to specify.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub images: Option<Vec<HelmReleasePostRenderersKustomizeImages>>,
    /// Strategic merge and JSON patches, defined as inline YAML objects,
    /// capable of targeting objects based on kind, label and annotation selectors.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub patches: Option<Vec<HelmReleasePostRenderersKustomizePatches>>,
    /// JSON 6902 patches, defined as inline YAML objects.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "patchesJson6902")]
    pub patches_json6902: Option<Vec<HelmReleasePostRenderersKustomizePatchesJson6902>>,
    /// Strategic merge patches, defined as inline YAML objects.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "patchesStrategicMerge")]
    pub patches_strategic_merge: Option<Vec<serde_json::Value>>,
}

/// Image contains an image name, a new name, a new tag or digest, which will replace the original name and tag.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleasePostRenderersKustomizeImages {
    /// Digest is the value used to replace the original image tag.
    /// If digest is present NewTag value is ignored.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub digest: Option<String>,
    /// Name is a tag-less image name.
    pub name: String,
    /// NewName is the value used to replace the original name.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "newName")]
    pub new_name: Option<String>,
    /// NewTag is the value used to replace the original tag.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "newTag")]
    pub new_tag: Option<String>,
}

/// Patch contains an inline StrategicMerge or JSON6902 patch, and the target the patch should
/// be applied to.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleasePostRenderersKustomizePatches {
    /// Patch contains an inline StrategicMerge patch or an inline JSON6902 patch with
    /// an array of operation objects.
    pub patch: String,
    /// Target points to the resources that the patch document should be applied to.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub target: Option<HelmReleasePostRenderersKustomizePatchesTarget>,
}

/// Target points to the resources that the patch document should be applied to.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleasePostRenderersKustomizePatchesTarget {
    /// AnnotationSelector is a string that follows the label selection expression
    /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api>
    /// It matches with the resource annotations.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "annotationSelector")]
    pub annotation_selector: Option<String>,
    /// Group is the API group to select resources from.
    /// Together with Version and Kind it is capable of unambiguously identifying and/or selecting resources.
    /// <https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub group: Option<String>,
    /// Kind of the API Group to select resources from.
    /// Together with Group and Version it is capable of unambiguously
    /// identifying and/or selecting resources.
    /// <https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// LabelSelector is a string that follows the label selection expression
    /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api>
    /// It matches with the resource labels.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
    pub label_selector: Option<String>,
    /// Name to match resources with.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Namespace to select resources from.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
    /// Version of the API Group to select resources from.
    /// Together with Group and Kind it is capable of unambiguously identifying and/or selecting resources.
    /// <https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub version: Option<String>,
}

/// JSON6902Patch contains a JSON6902 patch and the target the patch should be applied to.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleasePostRenderersKustomizePatchesJson6902 {
    /// Patch contains the JSON6902 patch document with an array of operation objects.
    pub patch: Vec<HelmReleasePostRenderersKustomizePatchesJson6902Patch>,
    /// Target points to the resources that the patch document should be applied to.
    pub target: HelmReleasePostRenderersKustomizePatchesJson6902Target,
}

/// JSON6902 is a JSON6902 operation object.
/// <https://datatracker.ietf.org/doc/html/rfc6902#section-4>
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct HelmReleasePostRenderersKustomizePatchesJson6902Patch {
    /// From contains a JSON-pointer value that references a location within the target document where the operation is
    /// performed. The meaning of the value depends on the value of Op, and is NOT taken into account by all operations.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub from: Option<String>,
    /// Op indicates the operation to perform. Its value MUST be one of "add", "remove", "replace", "move", "copy", or
    /// "test".
    /// <https://datatracker.ietf.org/doc/html/rfc6902#section-4>
    pub op: HelmReleasePostRenderersKustomizePatchesJson6902PatchOp,
    /// Path contains the JSON-pointer value that references a location within the target document where the operation
    /// is performed. The meaning of the value depends on the value of Op.
    pub path: String,
    /// Value contains a valid JSON structure. The meaning of the value depends on the value of Op, and is NOT taken into
    /// account by all operations.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value: Option<serde_json::Value>,
}

/// JSON6902 is a JSON6902 operation object.
/// <https://datatracker.ietf.org/doc/html/rfc6902#section-4>
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum HelmReleasePostRenderersKustomizePatchesJson6902PatchOp {
    #[serde(rename = "test")]
    Test,
    #[serde(rename = "remove")]
    Remove,
    #[serde(rename = "add")]
    Add,
    #[serde(rename = "replace")]
    Replace,
    #[serde(rename = "move")]
    Move,
    #[serde(rename = "copy")]
    Copy,
}

/// Target points to the resources that the patch document should be applied to.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleasePostRenderersKustomizePatchesJson6902Target {
    /// AnnotationSelector is a string that follows the label selection expression
    /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api>
    /// It matches with the resource annotations.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "annotationSelector")]
    pub annotation_selector: Option<String>,
    /// Group is the API group to select resources from.
    /// Together with Version and Kind it is capable of unambiguously identifying and/or selecting resources.
    /// <https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub group: Option<String>,
    /// Kind of the API Group to select resources from.
    /// Together with Group and Version it is capable of unambiguously
    /// identifying and/or selecting resources.
    /// <https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// LabelSelector is a string that follows the label selection expression
    /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api>
    /// It matches with the resource labels.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
    pub label_selector: Option<String>,
    /// Name to match resources with.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Namespace to select resources from.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
    /// Version of the API Group to select resources from.
    /// Together with Group and Kind it is capable of unambiguously identifying and/or selecting resources.
    /// <https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/api-group.md>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub version: Option<String>,
}

/// Rollback holds the configuration for Helm rollback actions for this HelmRelease.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleaseRollback {
    /// CleanupOnFail allows deletion of new resources created during the Helm
    /// rollback action when it fails.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "cleanupOnFail")]
    pub cleanup_on_fail: Option<bool>,
    /// DisableHooks prevents hooks from running during the Helm rollback action.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "disableHooks")]
    pub disable_hooks: Option<bool>,
    /// DisableWait disables the waiting for resources to be ready after a Helm
    /// rollback has been performed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "disableWait")]
    pub disable_wait: Option<bool>,
    /// DisableWaitForJobs disables waiting for jobs to complete after a Helm
    /// rollback has been performed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "disableWaitForJobs")]
    pub disable_wait_for_jobs: Option<bool>,
    /// Force forces resource updates through a replacement strategy.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub force: Option<bool>,
    /// Recreate performs pod restarts for the resource if applicable.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub recreate: Option<bool>,
    /// Timeout is the time to wait for any individual Kubernetes operation (like
    /// Jobs for hooks) during the performance of a Helm rollback action. Defaults to
    /// 'HelmReleaseSpec.Timeout'.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub timeout: Option<String>,
}

/// Test holds the configuration for Helm test actions for this HelmRelease.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleaseTest {
    /// Enable enables Helm test actions for this HelmRelease after an Helm install
    /// or upgrade action has been performed.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub enable: Option<bool>,
    /// IgnoreFailures tells the controller to skip remediation when the Helm tests
    /// are run but fail. Can be overwritten for tests run after install or upgrade
    /// actions in 'Install.IgnoreTestFailures' and 'Upgrade.IgnoreTestFailures'.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "ignoreFailures")]
    pub ignore_failures: Option<bool>,
    /// Timeout is the time to wait for any individual Kubernetes operation during
    /// the performance of a Helm test action. Defaults to 'HelmReleaseSpec.Timeout'.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub timeout: Option<String>,
}

/// Uninstall holds the configuration for Helm uninstall actions for this HelmRelease.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleaseUninstall {
    /// DeletionPropagation specifies the deletion propagation policy when
    /// a Helm uninstall is performed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "deletionPropagation")]
    pub deletion_propagation: Option<HelmReleaseUninstallDeletionPropagation>,
    /// DisableHooks prevents hooks from running during the Helm rollback action.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "disableHooks")]
    pub disable_hooks: Option<bool>,
    /// DisableWait disables waiting for all the resources to be deleted after
    /// a Helm uninstall is performed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "disableWait")]
    pub disable_wait: Option<bool>,
    /// KeepHistory tells Helm to remove all associated resources and mark the
    /// release as deleted, but retain the release history.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "keepHistory")]
    pub keep_history: Option<bool>,
    /// Timeout is the time to wait for any individual Kubernetes operation (like
    /// Jobs for hooks) during the performance of a Helm uninstall action. Defaults
    /// to 'HelmReleaseSpec.Timeout'.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub timeout: Option<String>,
}

/// Uninstall holds the configuration for Helm uninstall actions for this HelmRelease.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum HelmReleaseUninstallDeletionPropagation {
    #[serde(rename = "background")]
    Background,
    #[serde(rename = "foreground")]
    Foreground,
    #[serde(rename = "orphan")]
    Orphan,
}

/// Upgrade holds the configuration for Helm upgrade actions for this HelmRelease.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleaseUpgrade {
    /// CleanupOnFail allows deletion of new resources created during the Helm
    /// upgrade action when it fails.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "cleanupOnFail")]
    pub cleanup_on_fail: Option<bool>,
    /// CRDs upgrade CRDs from the Helm Chart's crds directory according
    /// to the CRD upgrade policy provided here. Valid values are `Skip`,
    /// `Create` or `CreateReplace`. Default is `Skip` and if omitted
    /// CRDs are neither installed nor upgraded.
    /// 
    /// Skip: do neither install nor replace (update) any CRDs.
    /// 
    /// Create: new CRDs are created, existing CRDs are neither updated nor deleted.
    /// 
    /// CreateReplace: new CRDs are created, existing CRDs are updated (replaced)
    /// but not deleted.
    /// 
    /// By default, CRDs are not applied during Helm upgrade action. With this
    /// option users can opt-in to CRD upgrade, which is not (yet) natively supported by Helm.
    /// <https://helm.sh/docs/chart_best_practices/custom_resource_definitions.>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub crds: Option<HelmReleaseUpgradeCrds>,
    /// DisableHooks prevents hooks from running during the Helm upgrade action.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "disableHooks")]
    pub disable_hooks: Option<bool>,
    /// DisableOpenAPIValidation prevents the Helm upgrade action from validating
    /// rendered templates against the Kubernetes OpenAPI Schema.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "disableOpenAPIValidation")]
    pub disable_open_api_validation: Option<bool>,
    /// DisableWait disables the waiting for resources to be ready after a Helm
    /// upgrade has been performed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "disableWait")]
    pub disable_wait: Option<bool>,
    /// DisableWaitForJobs disables waiting for jobs to complete after a Helm
    /// upgrade has been performed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "disableWaitForJobs")]
    pub disable_wait_for_jobs: Option<bool>,
    /// Force forces resource updates through a replacement strategy.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub force: Option<bool>,
    /// PreserveValues will make Helm reuse the last release's values and merge in
    /// overrides from 'Values'. Setting this flag makes the HelmRelease
    /// non-declarative.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "preserveValues")]
    pub preserve_values: Option<bool>,
    /// Remediation holds the remediation configuration for when the Helm upgrade
    /// action for the HelmRelease fails. The default is to not perform any action.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub remediation: Option<HelmReleaseUpgradeRemediation>,
    /// Timeout is the time to wait for any individual Kubernetes operation (like
    /// Jobs for hooks) during the performance of a Helm upgrade action. Defaults to
    /// 'HelmReleaseSpec.Timeout'.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub timeout: Option<String>,
}

/// Upgrade holds the configuration for Helm upgrade actions for this HelmRelease.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum HelmReleaseUpgradeCrds {
    Skip,
    Create,
    CreateReplace,
}

/// Remediation holds the remediation configuration for when the Helm upgrade
/// action for the HelmRelease fails. The default is to not perform any action.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleaseUpgradeRemediation {
    /// IgnoreTestFailures tells the controller to skip remediation when the Helm
    /// tests are run after an upgrade action but fail.
    /// Defaults to 'Test.IgnoreFailures'.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "ignoreTestFailures")]
    pub ignore_test_failures: Option<bool>,
    /// RemediateLastFailure tells the controller to remediate the last failure, when
    /// no retries remain. Defaults to 'false' unless 'Retries' is greater than 0.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "remediateLastFailure")]
    pub remediate_last_failure: Option<bool>,
    /// Retries is the number of retries that should be attempted on failures before
    /// bailing. Remediation, using 'Strategy', is performed between each attempt.
    /// Defaults to '0', a negative integer equals to unlimited retries.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub retries: Option<i64>,
    /// Strategy to use for failure remediation. Defaults to 'rollback'.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub strategy: Option<HelmReleaseUpgradeRemediationStrategy>,
}

/// Remediation holds the remediation configuration for when the Helm upgrade
/// action for the HelmRelease fails. The default is to not perform any action.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum HelmReleaseUpgradeRemediationStrategy {
    #[serde(rename = "rollback")]
    Rollback,
    #[serde(rename = "uninstall")]
    Uninstall,
}

/// ValuesReference contains a reference to a resource containing Helm values,
/// and optionally the key they can be found at.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct HelmReleaseValuesFrom {
    /// Kind of the values referent, valid values are ('Secret', 'ConfigMap').
    pub kind: HelmReleaseValuesFromKind,
    /// Name of the values referent. Should reside in the same namespace as the
    /// referring resource.
    pub name: String,
    /// Optional marks this ValuesReference as optional. When set, a not found error
    /// for the values reference is ignored, but any ValuesKey, TargetPath or
    /// transient error will still result in a reconciliation failure.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
    /// TargetPath is the YAML dot notation path the value should be merged at. When
    /// set, the ValuesKey is expected to be a single flat value. Defaults to 'None',
    /// which results in the values getting merged at the root.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetPath")]
    pub target_path: Option<String>,
    /// ValuesKey is the data key where the values.yaml or a specific value can be
    /// found at. Defaults to 'values.yaml'.
    /// When set, must be a valid Data Key, consisting of alphanumeric characters,
    /// '-', '_' or '.'.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "valuesKey")]
    pub values_key: Option<String>,
}

/// ValuesReference contains a reference to a resource containing Helm values,
/// and optionally the key they can be found at.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum HelmReleaseValuesFromKind {
    Secret,
    ConfigMap,
}

/// HelmReleaseStatus defines the observed state of a HelmRelease.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleaseStatus {
    /// Conditions holds the conditions for the HelmRelease.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub conditions: Option<Vec<Condition>>,
    /// Failures is the reconciliation failure count against the latest desired
    /// state. It is reset after a successful reconciliation.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub failures: Option<i64>,
    /// HelmChart is the namespaced name of the HelmChart resource created by
    /// the controller for the HelmRelease.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "helmChart")]
    pub helm_chart: Option<String>,
    /// History holds the history of Helm releases performed for this HelmRelease
    /// up to the last successfully completed release.
    /// 
    /// Note: this field is provisional to the v2beta2 API, and not actively used
    /// by v2beta1 HelmReleases.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub history: Option<Vec<HelmReleaseStatusHistory>>,
    /// InstallFailures is the install failure count against the latest desired
    /// state. It is reset after a successful reconciliation.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "installFailures")]
    pub install_failures: Option<i64>,
    /// LastAppliedRevision is the revision of the last successfully applied source.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastAppliedRevision")]
    pub last_applied_revision: Option<String>,
    /// LastAttemptedConfigDigest is the digest for the config (better known as
    /// "values") of the last reconciliation attempt.
    /// 
    /// Note: this field is provisional to the v2beta2 API, and not actively used
    /// by v2beta1 HelmReleases.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastAttemptedConfigDigest")]
    pub last_attempted_config_digest: Option<String>,
    /// LastAttemptedGeneration is the last generation the controller attempted
    /// to reconcile.
    /// 
    /// Note: this field is provisional to the v2beta2 API, and not actively used
    /// by v2beta1 HelmReleases.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastAttemptedGeneration")]
    pub last_attempted_generation: Option<i64>,
    /// LastAttemptedReleaseAction is the last release action performed for this
    /// HelmRelease. It is used to determine the active remediation strategy.
    /// 
    /// Note: this field is provisional to the v2beta2 API, and not actively used
    /// by v2beta1 HelmReleases.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastAttemptedReleaseAction")]
    pub last_attempted_release_action: Option<String>,
    /// LastAttemptedRevision is the revision of the last reconciliation attempt.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastAttemptedRevision")]
    pub last_attempted_revision: Option<String>,
    /// LastAttemptedValuesChecksum is the SHA1 checksum of the values of the last
    /// reconciliation attempt.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastAttemptedValuesChecksum")]
    pub last_attempted_values_checksum: Option<String>,
    /// LastHandledForceAt holds the value of the most recent force request
    /// value, so a change of the annotation value can be detected.
    /// 
    /// Note: this field is provisional to the v2beta2 API, and not actively used
    /// by v2beta1 HelmReleases.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastHandledForceAt")]
    pub last_handled_force_at: Option<String>,
    /// LastHandledReconcileAt holds the value of the most recent
    /// reconcile request value, so a change of the annotation value
    /// can be detected.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastHandledReconcileAt")]
    pub last_handled_reconcile_at: Option<String>,
    /// LastHandledResetAt holds the value of the most recent reset request
    /// value, so a change of the annotation value can be detected.
    /// 
    /// Note: this field is provisional to the v2beta2 API, and not actively used
    /// by v2beta1 HelmReleases.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastHandledResetAt")]
    pub last_handled_reset_at: Option<String>,
    /// LastReleaseRevision is the revision of the last successful Helm release.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastReleaseRevision")]
    pub last_release_revision: Option<i64>,
    /// ObservedGeneration is the last observed generation.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "observedGeneration")]
    pub observed_generation: Option<i64>,
    /// ObservedPostRenderersDigest is the digest for the post-renderers of
    /// the last successful reconciliation attempt.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "observedPostRenderersDigest")]
    pub observed_post_renderers_digest: Option<String>,
    /// StorageNamespace is the namespace of the Helm release storage for the
    /// current release.
    /// 
    /// Note: this field is provisional to the v2beta2 API, and not actively used
    /// by v2beta1 HelmReleases.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "storageNamespace")]
    pub storage_namespace: Option<String>,
    /// UpgradeFailures is the upgrade failure count against the latest desired
    /// state. It is reset after a successful reconciliation.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "upgradeFailures")]
    pub upgrade_failures: Option<i64>,
}

/// Snapshot captures a point-in-time copy of the status information for a Helm release,
/// as managed by the controller.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleaseStatusHistory {
    /// APIVersion is the API version of the Snapshot.
    /// Provisional: when the calculation method of the Digest field is changed,
    /// this field will be used to distinguish between the old and new methods.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
    pub api_version: Option<String>,
    /// AppVersion is the chart app version of the release object in storage.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "appVersion")]
    pub app_version: Option<String>,
    /// ChartName is the chart name of the release object in storage.
    #[serde(rename = "chartName")]
    pub chart_name: String,
    /// ChartVersion is the chart version of the release object in
    /// storage.
    #[serde(rename = "chartVersion")]
    pub chart_version: String,
    /// ConfigDigest is the checksum of the config (better known as
    /// "values") of the release object in storage.
    /// It has the format of `<algo>:<checksum>`.
    #[serde(rename = "configDigest")]
    pub config_digest: String,
    /// Deleted is when the release was deleted.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub deleted: Option<String>,
    /// Digest is the checksum of the release object in storage.
    /// It has the format of `<algo>:<checksum>`.
    pub digest: String,
    /// FirstDeployed is when the release was first deployed.
    #[serde(rename = "firstDeployed")]
    pub first_deployed: String,
    /// LastDeployed is when the release was last deployed.
    #[serde(rename = "lastDeployed")]
    pub last_deployed: String,
    /// Name is the name of the release.
    pub name: String,
    /// Namespace is the namespace the release is deployed to.
    pub namespace: String,
    /// OCIDigest is the digest of the OCI artifact associated with the release.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "ociDigest")]
    pub oci_digest: Option<String>,
    /// Status is the current state of the release.
    pub status: String,
    /// TestHooks is the list of test hooks for the release as observed to be
    /// run by the controller.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "testHooks")]
    pub test_hooks: Option<BTreeMap<String, HelmReleaseStatusHistoryTestHooks>>,
    /// Version is the version of the release object in storage.
    pub version: i64,
}

/// TestHooks is the list of test hooks for the release as observed to be
/// run by the controller.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct HelmReleaseStatusHistoryTestHooks {
    /// LastCompleted is the time the test hook last completed.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastCompleted")]
    pub last_completed: Option<String>,
    /// LastStarted is the time the test hook was last started.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastStarted")]
    pub last_started: Option<String>,
    /// Phase the test hook was observed to be in.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub phase: Option<String>,
}