//! Auto-generated models for kustomize-controller
//! Generated from: kustomize-controller.crds.yaml
//! DO NOT EDIT - This file is auto-generated by kopium
#![allow(clippy::all)]

// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium --filename /tmp/tmp.uD1q3HCSkN/doc1.yaml --derive Default --derive PartialEq --docs --smart-derive-elision
// kopium version: 0.23.0

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

use self::prelude::*;

/// KustomizationSpec defines the configuration to calculate the desired state
/// from a Source using Kustomize.
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, PartialEq)]
#[kube(
    group = "kustomize.toolkit.fluxcd.io",
    version = "v1",
    kind = "Kustomization",
    plural = "kustomizations"
)]
#[kube(namespaced)]
#[kube(status = "KustomizationStatus")]
#[kube(schema = "disabled")]
#[kube(derive = "PartialEq")]
pub struct KustomizationSpec {
    /// CommonMetadata specifies the common labels and annotations that are
    /// applied to all resources. Any existing label or annotation will be
    /// overridden if its key matches a common one.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "commonMetadata"
    )]
    pub common_metadata: Option<KustomizationCommonMetadata>,
    /// Components specifies relative paths to kustomize Components.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub components: Option<Vec<String>>,
    /// Decrypt Kubernetes secrets before applying them on the cluster.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub decryption: Option<KustomizationDecryption>,
    /// DeletionPolicy can be used to control garbage collection when this
    /// Kustomization is deleted. Valid values are ('MirrorPrune', 'Delete',
    /// 'WaitForTermination', 'Orphan'). 'MirrorPrune' mirrors the Prune field
    /// (orphan if false, delete if true). Defaults to 'MirrorPrune'.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "deletionPolicy"
    )]
    pub deletion_policy: Option<KustomizationDeletionPolicy>,
    /// DependsOn may contain a DependencyReference slice
    /// with references to Kustomization resources that must be ready before this
    /// Kustomization can be reconciled.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "dependsOn")]
    pub depends_on: Option<Vec<KustomizationDependsOn>>,
    /// Force instructs the controller to recreate resources
    /// when patching fails due to an immutable field change.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub force: Option<bool>,
    /// HealthCheckExprs is a list of healthcheck expressions for evaluating the
    /// health of custom resources using Common Expression Language (CEL).
    /// The expressions are evaluated only when Wait or HealthChecks are specified.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "healthCheckExprs"
    )]
    pub health_check_exprs: Option<Vec<KustomizationHealthCheckExprs>>,
    /// A list of resources to be included in the health assessment.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "healthChecks"
    )]
    pub health_checks: Option<Vec<KustomizationHealthChecks>>,
    /// IgnoreMissingComponents instructs the controller to ignore Components paths
    /// not found in source by removing them from the generated kustomization.yaml
    /// before running kustomize build.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "ignoreMissingComponents"
    )]
    pub ignore_missing_components: Option<bool>,
    /// 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<KustomizationImages>>,
    /// The interval at which to reconcile the Kustomization.
    /// This interval is approximate and may be subject to jitter to ensure
    /// efficient use of resources.
    pub interval: String,
    /// The KubeConfig for reconciling the Kustomization on a remote cluster.
    /// When used in combination with KustomizationSpec.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 KustomizationSpec.ServiceAccountName
    /// is empty.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "kubeConfig"
    )]
    pub kube_config: Option<KustomizationKubeConfig>,
    /// NamePrefix will prefix the names of all managed resources.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "namePrefix"
    )]
    pub name_prefix: Option<String>,
    /// NameSuffix will suffix the names of all managed resources.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "nameSuffix"
    )]
    pub name_suffix: Option<String>,
    /// 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<KustomizationPatches>>,
    /// Path to the directory containing the kustomization.yaml file, or the
    /// set of plain YAMLs a kustomization.yaml should be generated for.
    /// Defaults to 'None', which translates to the root path of the SourceRef.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub path: Option<String>,
    /// PostBuild describes which actions to perform on the YAML manifest
    /// generated by building the kustomize overlay.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "postBuild")]
    pub post_build: Option<KustomizationPostBuild>,
    /// Prune enables garbage collection.
    pub prune: bool,
    /// The interval at which to retry a previously failed reconciliation.
    /// When not specified, the controller uses the KustomizationSpec.Interval
    /// value to retry failures.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "retryInterval"
    )]
    pub retry_interval: Option<String>,
    /// The name of the Kubernetes service account to impersonate
    /// when reconciling this Kustomization.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "serviceAccountName"
    )]
    pub service_account_name: Option<String>,
    /// Reference of the source where the kustomization file is.
    #[serde(rename = "sourceRef")]
    pub source_ref: KustomizationSourceRef,
    /// This flag tells the controller to suspend subsequent kustomize executions,
    /// it does not apply to already started executions. Defaults to false.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub suspend: Option<bool>,
    /// TargetNamespace sets or overrides the namespace in the
    /// kustomization.yaml file.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "targetNamespace"
    )]
    pub target_namespace: Option<String>,
    /// Timeout for validation, apply and health checking operations.
    /// Defaults to 'Interval' duration.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub timeout: Option<String>,
    /// Wait instructs the controller to check the health of all the reconciled
    /// resources. When enabled, the HealthChecks are ignored. Defaults to false.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub wait: Option<bool>,
}

/// CommonMetadata specifies the common labels and annotations that are
/// applied to all resources. Any existing label or annotation will be
/// overridden if its key matches a common one.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct KustomizationCommonMetadata {
    /// Annotations to be added to the object's metadata.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub annotations: Option<BTreeMap<String, String>>,
    /// Labels to be added to the object's metadata.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub labels: Option<BTreeMap<String, String>>,
}

/// Decrypt Kubernetes secrets before applying them on the cluster.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct KustomizationDecryption {
    /// Provider is the name of the decryption engine.
    pub provider: KustomizationDecryptionProvider,
    /// The secret name containing the private OpenPGP keys used for decryption.
    /// A static credential for a cloud provider defined inside the Secret
    /// takes priority to secret-less authentication with the ServiceAccountName
    /// field.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretRef")]
    pub secret_ref: Option<KustomizationDecryptionSecretRef>,
    /// ServiceAccountName is the name of the service account used to
    /// authenticate with KMS services from cloud providers. If a
    /// static credential for a given cloud provider is defined
    /// inside the Secret referenced by SecretRef, that static
    /// credential takes priority.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "serviceAccountName"
    )]
    pub service_account_name: Option<String>,
}

/// Decrypt Kubernetes secrets before applying them on the cluster.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum KustomizationDecryptionProvider {
    #[serde(rename = "sops")]
    Sops,
}

/// The secret name containing the private OpenPGP keys used for decryption.
/// A static credential for a cloud provider defined inside the Secret
/// takes priority to secret-less authentication with the ServiceAccountName
/// field.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct KustomizationDecryptionSecretRef {
    /// Name of the referent.
    pub name: String,
}

/// KustomizationSpec defines the configuration to calculate the desired state
/// from a Source using Kustomize.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum KustomizationDeletionPolicy {
    MirrorPrune,
    Delete,
    WaitForTermination,
    Orphan,
}

/// DependencyReference defines a Kustomization dependency on another Kustomization resource.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct KustomizationDependsOn {
    /// Name of the referent.
    pub name: String,
    /// Namespace of the referent, defaults to the namespace of the Kustomization
    /// resource object that contains the reference.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
    /// ReadyExpr is a CEL expression that can be used to assess the readiness
    /// of a dependency. When specified, the built-in readiness check
    /// is replaced by the logic defined in the CEL expression.
    /// To make the CEL expression additive to the built-in readiness check,
    /// the feature gate `AdditiveCELDependencyCheck` must be set to `true`.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "readyExpr")]
    pub ready_expr: Option<String>,
}

/// CustomHealthCheck defines the health check for custom resources.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct KustomizationHealthCheckExprs {
    /// APIVersion of the custom resource under evaluation.
    #[serde(rename = "apiVersion")]
    pub api_version: String,
    /// Current is the CEL expression that determines if the status
    /// of the custom resource has reached the desired state.
    pub current: String,
    /// Failed is the CEL expression that determines if the status
    /// of the custom resource has failed to reach the desired state.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub failed: Option<String>,
    /// InProgress is the CEL expression that determines if the status
    /// of the custom resource has not yet reached the desired state.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "inProgress"
    )]
    pub in_progress: Option<String>,
    /// Kind of the custom resource under evaluation.
    pub kind: String,
}

/// NamespacedObjectKindReference contains enough information to locate the typed referenced Kubernetes resource object
/// in any namespace.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct KustomizationHealthChecks {
    /// API version of the referent, if not specified the Kubernetes preferred version will be used.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "apiVersion"
    )]
    pub api_version: Option<String>,
    /// Kind of the referent.
    pub kind: String,
    /// 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>,
}

/// 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 KustomizationImages {
    /// 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>,
}

/// The KubeConfig for reconciling the Kustomization on a remote cluster.
/// When used in combination with KustomizationSpec.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 KustomizationSpec.ServiceAccountName
/// is empty.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct KustomizationKubeConfig {
    /// 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<KustomizationKubeConfigConfigMapRef>,
    /// 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<KustomizationKubeConfigSecretRef>,
}

/// 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 KustomizationKubeConfigConfigMapRef {
    /// 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 KustomizationKubeConfigSecretRef {
    /// 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,
}

/// 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 KustomizationPatches {
    /// 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<KustomizationPatchesTarget>,
}

/// Target points to the resources that the patch document should be applied to.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct KustomizationPatchesTarget {
    /// 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>,
}

/// PostBuild describes which actions to perform on the YAML manifest
/// generated by building the kustomize overlay.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct KustomizationPostBuild {
    /// Substitute holds a map of key/value pairs.
    /// The variables defined in your YAML manifests that match any of the keys
    /// defined in the map will be substituted with the set value.
    /// Includes support for bash string replacement functions
    /// e.g. ${var:=default}, ${var:position} and ${var/substring/replacement}.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub substitute: Option<BTreeMap<String, String>>,
    /// SubstituteFrom holds references to ConfigMaps and Secrets containing
    /// the variables and their values to be substituted in the YAML manifests.
    /// The ConfigMap and the Secret data keys represent the var names, and they
    /// must match the vars declared in the manifests for the substitution to
    /// happen.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "substituteFrom"
    )]
    pub substitute_from: Option<Vec<KustomizationPostBuildSubstituteFrom>>,
}

/// SubstituteReference contains a reference to a resource containing
/// the variables name and value.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct KustomizationPostBuildSubstituteFrom {
    /// Kind of the values referent, valid values are ('Secret', 'ConfigMap').
    pub kind: KustomizationPostBuildSubstituteFromKind,
    /// Name of the values referent. Should reside in the same namespace as the
    /// referring resource.
    pub name: String,
    /// Optional indicates whether the referenced resource must exist, or whether to
    /// tolerate its absence. If true and the referenced resource is absent, proceed
    /// as if the resource was present but empty, without any variables defined.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// SubstituteReference contains a reference to a resource containing
/// the variables name and value.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum KustomizationPostBuildSubstituteFromKind {
    Secret,
    ConfigMap,
}

/// Reference of the source where the kustomization file is.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct KustomizationSourceRef {
    /// API version of the referent.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "apiVersion"
    )]
    pub api_version: Option<String>,
    /// Kind of the referent.
    pub kind: KustomizationSourceRefKind,
    /// 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>,
}

/// Reference of the source where the kustomization file is.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum KustomizationSourceRefKind {
    #[serde(rename = "OCIRepository")]
    OciRepository,
    GitRepository,
    Bucket,
    ExternalArtifact,
}

/// KustomizationStatus defines the observed state of a kustomization.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct KustomizationStatus {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub conditions: Option<Vec<Condition>>,
    /// History contains a set of snapshots of the last reconciliation attempts
    /// tracking the revision, the state and the duration of each attempt.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub history: Option<Vec<KustomizationStatusHistory>>,
    /// Inventory contains the list of Kubernetes resource object references that
    /// have been successfully applied.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub inventory: Option<KustomizationStatusInventory>,
    /// The last successfully applied origin revision.
    /// Equals the origin revision of the applied Artifact from the referenced Source.
    /// Usually present on the Metadata of the applied Artifact and depends on the
    /// Source type, e.g. for OCI it's the value associated with the key
    /// "org.opencontainers.image.revision".
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "lastAppliedOriginRevision"
    )]
    pub last_applied_origin_revision: Option<String>,
    /// The last successfully applied revision.
    /// Equals the Revision of the applied Artifact from the referenced Source.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "lastAppliedRevision"
    )]
    pub last_applied_revision: 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>,
    /// 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>,
    /// ObservedGeneration is the last reconciled generation.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "observedGeneration"
    )]
    pub observed_generation: Option<i64>,
}

/// Snapshot represents a point-in-time record of a group of resources reconciliation,
/// including timing information, status, and a unique digest identifier.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct KustomizationStatusHistory {
    /// Digest is the checksum in the format `<algo>:<hex>` of the resources in this snapshot.
    pub digest: String,
    /// FirstReconciled is the time when this revision was first reconciled to the cluster.
    #[serde(rename = "firstReconciled")]
    pub first_reconciled: String,
    /// LastReconciled is the time when this revision was last reconciled to the cluster.
    #[serde(rename = "lastReconciled")]
    pub last_reconciled: String,
    /// LastReconciledDuration is time it took to reconcile the resources in this revision.
    #[serde(rename = "lastReconciledDuration")]
    pub last_reconciled_duration: String,
    /// LastReconciledStatus is the status of the last reconciliation.
    #[serde(rename = "lastReconciledStatus")]
    pub last_reconciled_status: String,
    /// Metadata contains additional information about the snapshot.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub metadata: Option<BTreeMap<String, String>>,
    /// TotalReconciliations is the total number of reconciliations that have occurred for this snapshot.
    #[serde(rename = "totalReconciliations")]
    pub total_reconciliations: i64,
}

/// Inventory contains the list of Kubernetes resource object references that
/// have been successfully applied.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct KustomizationStatusInventory {
    /// Entries of Kubernetes resource object references.
    pub entries: Vec<KustomizationStatusInventoryEntries>,
}

/// ResourceRef contains the information necessary to locate a resource within a cluster.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct KustomizationStatusInventoryEntries {
    /// ID is the string representation of the Kubernetes resource object's metadata,
    /// in the format '<namespace>_<name>_<group>_<kind>'.
    pub id: String,
    /// Version is the API version of the Kubernetes resource object's kind.
    pub v: String,
}
