// generated by cdk8s
import { ApiObject, ApiObjectMetadata, GroupVersionKind } from 'cdk8s';
import { Construct } from 'constructs';


/**
 * HelmRelease is the Schema for the helmreleases API
 *
 * @schema HelmRelease
 */
export class HelmRelease extends ApiObject {
  /**
   * Returns the apiVersion and kind for "HelmRelease"
   */
  public static readonly GVK: GroupVersionKind = {
    apiVersion: 'helm.toolkit.fluxcd.io/v2',
    kind: 'HelmRelease',
  }

  /**
   * Renders a Kubernetes manifest for "HelmRelease".
   *
   * This can be used to inline resource manifests inside other objects (e.g. as templates).
   *
   * @param props initialization props
   */
  public static manifest(props: HelmReleaseProps = {}): any {
    return {
      ...HelmRelease.GVK,
      ...toJson_HelmReleaseProps(props),
    };
  }

  /**
   * Defines a "HelmRelease" API object
   * @param scope the scope in which to define this object
   * @param id a scope-local name for the object
   * @param props initialization props
   */
  public constructor(scope: Construct, id: string, props: HelmReleaseProps = {}) {
    super(scope, id, {
      ...HelmRelease.GVK,
      ...props,
    });
  }

  /**
   * Renders the object to Kubernetes JSON.
   */
  public toJson(): any {
    const resolved = super.toJson();

    return {
      ...HelmRelease.GVK,
      ...toJson_HelmReleaseProps(resolved),
    };
  }
}

/**
 * HelmRelease is the Schema for the helmreleases API
 *
 * @schema HelmRelease
 */
export interface HelmReleaseProps {
  /**
   * @schema HelmRelease#metadata
   */
  readonly metadata?: ApiObjectMetadata;

  /**
   * HelmReleaseSpec defines the desired state of a Helm release.
   *
   * @schema HelmRelease#spec
   */
  readonly spec?: HelmReleaseSpec;

}

/**
 * Converts an object of type 'HelmReleaseProps' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseProps(obj: HelmReleaseProps | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'metadata': obj.metadata,
    'spec': toJson_HelmReleaseSpec(obj.spec),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * HelmReleaseSpec defines the desired state of a Helm release.
 *
 * @schema HelmReleaseSpec
 */
export interface HelmReleaseSpec {
  /**
   * Chart defines the template of the v1.HelmChart that should be created
   * for this HelmRelease.
   *
   * @schema HelmReleaseSpec#chart
   */
  readonly chart?: HelmReleaseSpecChart;

  /**
   * ChartRef holds a reference to a source controller resource containing the
   * Helm chart artifact.
   *
   * @schema HelmReleaseSpec#chartRef
   */
  readonly chartRef?: HelmReleaseSpecChartRef;

  /**
   * DependsOn may contain a meta.NamespacedObjectReference slice with
   * references to HelmRelease resources that must be ready before this HelmRelease
   * can be reconciled.
   *
   * @schema HelmReleaseSpec#dependsOn
   */
  readonly dependsOn?: HelmReleaseSpecDependsOn[];

  /**
   * DriftDetection holds the configuration for detecting and handling
   * differences between the manifest in the Helm storage and the resources
   * currently existing in the cluster.
   *
   * @schema HelmReleaseSpec#driftDetection
   */
  readonly driftDetection?: HelmReleaseSpecDriftDetection;

  /**
   * Install holds the configuration for Helm install actions for this HelmRelease.
   *
   * @schema HelmReleaseSpec#install
   */
  readonly install?: HelmReleaseSpecInstall;

  /**
   * Interval at which to reconcile the Helm release.
   *
   * @schema HelmReleaseSpec#interval
   */
  readonly 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.
   *
   * @schema HelmReleaseSpec#kubeConfig
   */
  readonly kubeConfig?: HelmReleaseSpecKubeConfig;

  /**
   * MaxHistory is the number of revisions saved by Helm for this HelmRelease.
   * Use '0' for an unlimited number of revisions; defaults to '5'.
   *
   * @schema HelmReleaseSpec#maxHistory
   */
  readonly maxHistory?: number;

  /**
   * 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.
   *
   * @schema HelmReleaseSpec#persistentClient
   */
  readonly persistentClient?: boolean;

  /**
   * PostRenderers holds an array of Helm PostRenderers, which will be applied in order
   * of their definition.
   *
   * @schema HelmReleaseSpec#postRenderers
   */
  readonly postRenderers?: HelmReleaseSpecPostRenderers[];

  /**
   * ReleaseName used for the Helm release. Defaults to a composition of
   * '[TargetNamespace-]Name'.
   *
   * @default a composition of
   * @schema HelmReleaseSpec#releaseName
   */
  readonly releaseName?: string;

  /**
   * Rollback holds the configuration for Helm rollback actions for this HelmRelease.
   *
   * @schema HelmReleaseSpec#rollback
   */
  readonly rollback?: HelmReleaseSpecRollback;

  /**
   * The name of the Kubernetes service account to impersonate
   * when reconciling this HelmRelease.
   *
   * @schema HelmReleaseSpec#serviceAccountName
   */
  readonly serviceAccountName?: string;

  /**
   * StorageNamespace used for the Helm storage.
   * Defaults to the namespace of the HelmRelease.
   *
   * @default the namespace of the HelmRelease.
   * @schema HelmReleaseSpec#storageNamespace
   */
  readonly storageNamespace?: string;

  /**
   * Suspend tells the controller to suspend reconciliation for this HelmRelease,
   * it does not apply to already started reconciliations. Defaults to false.
   *
   * @default false.
   * @schema HelmReleaseSpec#suspend
   */
  readonly suspend?: boolean;

  /**
   * TargetNamespace to target when performing operations for the HelmRelease.
   * Defaults to the namespace of the HelmRelease.
   *
   * @default the namespace of the HelmRelease.
   * @schema HelmReleaseSpec#targetNamespace
   */
  readonly targetNamespace?: string;

  /**
   * Test holds the configuration for Helm test actions for this HelmRelease.
   *
   * @schema HelmReleaseSpec#test
   */
  readonly test?: HelmReleaseSpecTest;

  /**
   * 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'.
   *
   * @default 5m0s'.
   * @schema HelmReleaseSpec#timeout
   */
  readonly timeout?: string;

  /**
   * Uninstall holds the configuration for Helm uninstall actions for this HelmRelease.
   *
   * @schema HelmReleaseSpec#uninstall
   */
  readonly uninstall?: HelmReleaseSpecUninstall;

  /**
   * Upgrade holds the configuration for Helm upgrade actions for this HelmRelease.
   *
   * @schema HelmReleaseSpec#upgrade
   */
  readonly upgrade?: HelmReleaseSpecUpgrade;

  /**
   * Values holds the values for this Helm release.
   *
   * @schema HelmReleaseSpec#values
   */
  readonly values?: any;

  /**
   * ValuesFrom holds references to resources containing Helm values for this HelmRelease,
   * and information about how they should be merged.
   *
   * @schema HelmReleaseSpec#valuesFrom
   */
  readonly valuesFrom?: HelmReleaseSpecValuesFrom[];

}

/**
 * Converts an object of type 'HelmReleaseSpec' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpec(obj: HelmReleaseSpec | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'chart': toJson_HelmReleaseSpecChart(obj.chart),
    'chartRef': toJson_HelmReleaseSpecChartRef(obj.chartRef),
    'dependsOn': obj.dependsOn?.map(y => toJson_HelmReleaseSpecDependsOn(y)),
    'driftDetection': toJson_HelmReleaseSpecDriftDetection(obj.driftDetection),
    'install': toJson_HelmReleaseSpecInstall(obj.install),
    'interval': obj.interval,
    'kubeConfig': toJson_HelmReleaseSpecKubeConfig(obj.kubeConfig),
    'maxHistory': obj.maxHistory,
    'persistentClient': obj.persistentClient,
    'postRenderers': obj.postRenderers?.map(y => toJson_HelmReleaseSpecPostRenderers(y)),
    'releaseName': obj.releaseName,
    'rollback': toJson_HelmReleaseSpecRollback(obj.rollback),
    'serviceAccountName': obj.serviceAccountName,
    'storageNamespace': obj.storageNamespace,
    'suspend': obj.suspend,
    'targetNamespace': obj.targetNamespace,
    'test': toJson_HelmReleaseSpecTest(obj.test),
    'timeout': obj.timeout,
    'uninstall': toJson_HelmReleaseSpecUninstall(obj.uninstall),
    'upgrade': toJson_HelmReleaseSpecUpgrade(obj.upgrade),
    'values': obj.values,
    'valuesFrom': obj.valuesFrom?.map(y => toJson_HelmReleaseSpecValuesFrom(y)),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Chart defines the template of the v1.HelmChart that should be created
 * for this HelmRelease.
 *
 * @schema HelmReleaseSpecChart
 */
export interface HelmReleaseSpecChart {
  /**
   * ObjectMeta holds the template for metadata like labels and annotations.
   *
   * @schema HelmReleaseSpecChart#metadata
   */
  readonly metadata?: HelmReleaseSpecChartMetadata;

  /**
   * Spec holds the template for the v1.HelmChartSpec for this HelmRelease.
   *
   * @schema HelmReleaseSpecChart#spec
   */
  readonly spec: HelmReleaseSpecChartSpec;

}

/**
 * Converts an object of type 'HelmReleaseSpecChart' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecChart(obj: HelmReleaseSpecChart | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'metadata': toJson_HelmReleaseSpecChartMetadata(obj.metadata),
    'spec': toJson_HelmReleaseSpecChartSpec(obj.spec),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * ChartRef holds a reference to a source controller resource containing the
 * Helm chart artifact.
 *
 * @schema HelmReleaseSpecChartRef
 */
export interface HelmReleaseSpecChartRef {
  /**
   * APIVersion of the referent.
   *
   * @schema HelmReleaseSpecChartRef#apiVersion
   */
  readonly apiVersion?: string;

  /**
   * Kind of the referent.
   *
   * @schema HelmReleaseSpecChartRef#kind
   */
  readonly kind: HelmReleaseSpecChartRefKind;

  /**
   * Name of the referent.
   *
   * @schema HelmReleaseSpecChartRef#name
   */
  readonly name: string;

  /**
   * Namespace of the referent, defaults to the namespace of the Kubernetes
   * resource object that contains the reference.
   *
   * @schema HelmReleaseSpecChartRef#namespace
   */
  readonly namespace?: string;

}

/**
 * Converts an object of type 'HelmReleaseSpecChartRef' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecChartRef(obj: HelmReleaseSpecChartRef | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'apiVersion': obj.apiVersion,
    'kind': obj.kind,
    'name': obj.name,
    'namespace': obj.namespace,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * NamespacedObjectReference contains enough information to locate the referenced Kubernetes resource object in any
 * namespace.
 *
 * @schema HelmReleaseSpecDependsOn
 */
export interface HelmReleaseSpecDependsOn {
  /**
   * Name of the referent.
   *
   * @schema HelmReleaseSpecDependsOn#name
   */
  readonly name: string;

  /**
   * Namespace of the referent, when not specified it acts as LocalObjectReference.
   *
   * @schema HelmReleaseSpecDependsOn#namespace
   */
  readonly namespace?: string;

}

/**
 * Converts an object of type 'HelmReleaseSpecDependsOn' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecDependsOn(obj: HelmReleaseSpecDependsOn | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'name': obj.name,
    'namespace': obj.namespace,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * DriftDetection holds the configuration for detecting and handling
 * differences between the manifest in the Helm storage and the resources
 * currently existing in the cluster.
 *
 * @schema HelmReleaseSpecDriftDetection
 */
export interface HelmReleaseSpecDriftDetection {
  /**
   * Ignore contains a list of rules for specifying which changes to ignore
   * during diffing.
   *
   * @schema HelmReleaseSpecDriftDetection#ignore
   */
  readonly ignore?: HelmReleaseSpecDriftDetectionIgnore[];

  /**
   * 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.
   *
   * @schema HelmReleaseSpecDriftDetection#mode
   */
  readonly mode?: HelmReleaseSpecDriftDetectionMode;

}

/**
 * Converts an object of type 'HelmReleaseSpecDriftDetection' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecDriftDetection(obj: HelmReleaseSpecDriftDetection | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'ignore': obj.ignore?.map(y => toJson_HelmReleaseSpecDriftDetectionIgnore(y)),
    'mode': obj.mode,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Install holds the configuration for Helm install actions for this HelmRelease.
 *
 * @schema HelmReleaseSpecInstall
 */
export interface HelmReleaseSpecInstall {
  /**
   * 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.
   *
   * @default Create` and if omitted
   * @schema HelmReleaseSpecInstall#crds
   */
  readonly crds?: HelmReleaseSpecInstallCrds;

  /**
   * 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.
   *
   * @schema HelmReleaseSpecInstall#createNamespace
   */
  readonly createNamespace?: boolean;

  /**
   * DisableHooks prevents hooks from running during the Helm install action.
   *
   * @schema HelmReleaseSpecInstall#disableHooks
   */
  readonly disableHooks?: boolean;

  /**
   * DisableOpenAPIValidation prevents the Helm install action from validating
   * rendered templates against the Kubernetes OpenAPI Schema.
   *
   * @schema HelmReleaseSpecInstall#disableOpenAPIValidation
   */
  readonly disableOpenApiValidation?: boolean;

  /**
   * DisableSchemaValidation prevents the Helm install action from validating
   * the values against the JSON Schema.
   *
   * @schema HelmReleaseSpecInstall#disableSchemaValidation
   */
  readonly disableSchemaValidation?: boolean;

  /**
   * DisableTakeOwnership disables taking ownership of existing resources
   * during the Helm install action. Defaults to false.
   *
   * @default false.
   * @schema HelmReleaseSpecInstall#disableTakeOwnership
   */
  readonly disableTakeOwnership?: boolean;

  /**
   * DisableWait disables the waiting for resources to be ready after a Helm
   * install has been performed.
   *
   * @schema HelmReleaseSpecInstall#disableWait
   */
  readonly disableWait?: boolean;

  /**
   * DisableWaitForJobs disables waiting for jobs to complete after a Helm
   * install has been performed.
   *
   * @schema HelmReleaseSpecInstall#disableWaitForJobs
   */
  readonly disableWaitForJobs?: boolean;

  /**
   * Remediation holds the remediation configuration for when the Helm install
   * action for the HelmRelease fails. The default is to not perform any action.
   *
   * @schema HelmReleaseSpecInstall#remediation
   */
  readonly remediation?: HelmReleaseSpecInstallRemediation;

  /**
   * 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.
   *
   * @schema HelmReleaseSpecInstall#replace
   */
  readonly replace?: boolean;

  /**
   * 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.
   *
   * @schema HelmReleaseSpecInstall#skipCRDs
   */
  readonly skipCrDs?: boolean;

  /**
   * 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'.
   *
   * @default HelmReleaseSpec.Timeout'.
   * @schema HelmReleaseSpecInstall#timeout
   */
  readonly timeout?: string;

}

/**
 * Converts an object of type 'HelmReleaseSpecInstall' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecInstall(obj: HelmReleaseSpecInstall | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'crds': obj.crds,
    'createNamespace': obj.createNamespace,
    'disableHooks': obj.disableHooks,
    'disableOpenAPIValidation': obj.disableOpenApiValidation,
    'disableSchemaValidation': obj.disableSchemaValidation,
    'disableTakeOwnership': obj.disableTakeOwnership,
    'disableWait': obj.disableWait,
    'disableWaitForJobs': obj.disableWaitForJobs,
    'remediation': toJson_HelmReleaseSpecInstallRemediation(obj.remediation),
    'replace': obj.replace,
    'skipCRDs': obj.skipCrDs,
    'timeout': obj.timeout,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * 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.
 *
 * @schema HelmReleaseSpecKubeConfig
 */
export interface HelmReleaseSpecKubeConfig {
  /**
   * SecretRef holds the 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'.
   * 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.
   *
   * @schema HelmReleaseSpecKubeConfig#secretRef
   */
  readonly secretRef: HelmReleaseSpecKubeConfigSecretRef;

}

/**
 * Converts an object of type 'HelmReleaseSpecKubeConfig' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecKubeConfig(obj: HelmReleaseSpecKubeConfig | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'secretRef': toJson_HelmReleaseSpecKubeConfigSecretRef(obj.secretRef),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * PostRenderer contains a Helm PostRenderer specification.
 *
 * @schema HelmReleaseSpecPostRenderers
 */
export interface HelmReleaseSpecPostRenderers {
  /**
   * Kustomization to apply as PostRenderer.
   *
   * @schema HelmReleaseSpecPostRenderers#kustomize
   */
  readonly kustomize?: HelmReleaseSpecPostRenderersKustomize;

}

/**
 * Converts an object of type 'HelmReleaseSpecPostRenderers' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecPostRenderers(obj: HelmReleaseSpecPostRenderers | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'kustomize': toJson_HelmReleaseSpecPostRenderersKustomize(obj.kustomize),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Rollback holds the configuration for Helm rollback actions for this HelmRelease.
 *
 * @schema HelmReleaseSpecRollback
 */
export interface HelmReleaseSpecRollback {
  /**
   * CleanupOnFail allows deletion of new resources created during the Helm
   * rollback action when it fails.
   *
   * @schema HelmReleaseSpecRollback#cleanupOnFail
   */
  readonly cleanupOnFail?: boolean;

  /**
   * DisableHooks prevents hooks from running during the Helm rollback action.
   *
   * @schema HelmReleaseSpecRollback#disableHooks
   */
  readonly disableHooks?: boolean;

  /**
   * DisableWait disables the waiting for resources to be ready after a Helm
   * rollback has been performed.
   *
   * @schema HelmReleaseSpecRollback#disableWait
   */
  readonly disableWait?: boolean;

  /**
   * DisableWaitForJobs disables waiting for jobs to complete after a Helm
   * rollback has been performed.
   *
   * @schema HelmReleaseSpecRollback#disableWaitForJobs
   */
  readonly disableWaitForJobs?: boolean;

  /**
   * Force forces resource updates through a replacement strategy.
   *
   * @schema HelmReleaseSpecRollback#force
   */
  readonly force?: boolean;

  /**
   * Recreate performs pod restarts for the resource if applicable.
   *
   * @schema HelmReleaseSpecRollback#recreate
   */
  readonly recreate?: boolean;

  /**
   * 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'.
   *
   * @default HelmReleaseSpec.Timeout'.
   * @schema HelmReleaseSpecRollback#timeout
   */
  readonly timeout?: string;

}

/**
 * Converts an object of type 'HelmReleaseSpecRollback' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecRollback(obj: HelmReleaseSpecRollback | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'cleanupOnFail': obj.cleanupOnFail,
    'disableHooks': obj.disableHooks,
    'disableWait': obj.disableWait,
    'disableWaitForJobs': obj.disableWaitForJobs,
    'force': obj.force,
    'recreate': obj.recreate,
    'timeout': obj.timeout,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Test holds the configuration for Helm test actions for this HelmRelease.
 *
 * @schema HelmReleaseSpecTest
 */
export interface HelmReleaseSpecTest {
  /**
   * Enable enables Helm test actions for this HelmRelease after an Helm install
   * or upgrade action has been performed.
   *
   * @schema HelmReleaseSpecTest#enable
   */
  readonly enable?: boolean;

  /**
   * Filters is a list of tests to run or exclude from running.
   *
   * @schema HelmReleaseSpecTest#filters
   */
  readonly filters?: HelmReleaseSpecTestFilters[];

  /**
   * 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'.
   *
   * @schema HelmReleaseSpecTest#ignoreFailures
   */
  readonly ignoreFailures?: boolean;

  /**
   * Timeout is the time to wait for any individual Kubernetes operation during
   * the performance of a Helm test action. Defaults to 'HelmReleaseSpec.Timeout'.
   *
   * @default HelmReleaseSpec.Timeout'.
   * @schema HelmReleaseSpecTest#timeout
   */
  readonly timeout?: string;

}

/**
 * Converts an object of type 'HelmReleaseSpecTest' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecTest(obj: HelmReleaseSpecTest | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'enable': obj.enable,
    'filters': obj.filters?.map(y => toJson_HelmReleaseSpecTestFilters(y)),
    'ignoreFailures': obj.ignoreFailures,
    'timeout': obj.timeout,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Uninstall holds the configuration for Helm uninstall actions for this HelmRelease.
 *
 * @schema HelmReleaseSpecUninstall
 */
export interface HelmReleaseSpecUninstall {
  /**
   * DeletionPropagation specifies the deletion propagation policy when
   * a Helm uninstall is performed.
   *
   * @schema HelmReleaseSpecUninstall#deletionPropagation
   */
  readonly deletionPropagation?: HelmReleaseSpecUninstallDeletionPropagation;

  /**
   * DisableHooks prevents hooks from running during the Helm rollback action.
   *
   * @schema HelmReleaseSpecUninstall#disableHooks
   */
  readonly disableHooks?: boolean;

  /**
   * DisableWait disables waiting for all the resources to be deleted after
   * a Helm uninstall is performed.
   *
   * @schema HelmReleaseSpecUninstall#disableWait
   */
  readonly disableWait?: boolean;

  /**
   * KeepHistory tells Helm to remove all associated resources and mark the
   * release as deleted, but retain the release history.
   *
   * @schema HelmReleaseSpecUninstall#keepHistory
   */
  readonly keepHistory?: boolean;

  /**
   * 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'.
   *
   * @default HelmReleaseSpec.Timeout'.
   * @schema HelmReleaseSpecUninstall#timeout
   */
  readonly timeout?: string;

}

/**
 * Converts an object of type 'HelmReleaseSpecUninstall' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecUninstall(obj: HelmReleaseSpecUninstall | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'deletionPropagation': obj.deletionPropagation,
    'disableHooks': obj.disableHooks,
    'disableWait': obj.disableWait,
    'keepHistory': obj.keepHistory,
    'timeout': obj.timeout,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Upgrade holds the configuration for Helm upgrade actions for this HelmRelease.
 *
 * @schema HelmReleaseSpecUpgrade
 */
export interface HelmReleaseSpecUpgrade {
  /**
   * CleanupOnFail allows deletion of new resources created during the Helm
   * upgrade action when it fails.
   *
   * @schema HelmReleaseSpecUpgrade#cleanupOnFail
   */
  readonly cleanupOnFail?: boolean;

  /**
   * 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.
   *
   * @default Skip` and if omitted
   * @schema HelmReleaseSpecUpgrade#crds
   */
  readonly crds?: HelmReleaseSpecUpgradeCrds;

  /**
   * DisableHooks prevents hooks from running during the Helm upgrade action.
   *
   * @schema HelmReleaseSpecUpgrade#disableHooks
   */
  readonly disableHooks?: boolean;

  /**
   * DisableOpenAPIValidation prevents the Helm upgrade action from validating
   * rendered templates against the Kubernetes OpenAPI Schema.
   *
   * @schema HelmReleaseSpecUpgrade#disableOpenAPIValidation
   */
  readonly disableOpenApiValidation?: boolean;

  /**
   * DisableSchemaValidation prevents the Helm upgrade action from validating
   * the values against the JSON Schema.
   *
   * @schema HelmReleaseSpecUpgrade#disableSchemaValidation
   */
  readonly disableSchemaValidation?: boolean;

  /**
   * DisableTakeOwnership disables taking ownership of existing resources
   * during the Helm upgrade action. Defaults to false.
   *
   * @default false.
   * @schema HelmReleaseSpecUpgrade#disableTakeOwnership
   */
  readonly disableTakeOwnership?: boolean;

  /**
   * DisableWait disables the waiting for resources to be ready after a Helm
   * upgrade has been performed.
   *
   * @schema HelmReleaseSpecUpgrade#disableWait
   */
  readonly disableWait?: boolean;

  /**
   * DisableWaitForJobs disables waiting for jobs to complete after a Helm
   * upgrade has been performed.
   *
   * @schema HelmReleaseSpecUpgrade#disableWaitForJobs
   */
  readonly disableWaitForJobs?: boolean;

  /**
   * Force forces resource updates through a replacement strategy.
   *
   * @schema HelmReleaseSpecUpgrade#force
   */
  readonly force?: boolean;

  /**
   * PreserveValues will make Helm reuse the last release's values and merge in
   * overrides from 'Values'. Setting this flag makes the HelmRelease
   * non-declarative.
   *
   * @schema HelmReleaseSpecUpgrade#preserveValues
   */
  readonly preserveValues?: boolean;

  /**
   * Remediation holds the remediation configuration for when the Helm upgrade
   * action for the HelmRelease fails. The default is to not perform any action.
   *
   * @schema HelmReleaseSpecUpgrade#remediation
   */
  readonly remediation?: HelmReleaseSpecUpgradeRemediation;

  /**
   * 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'.
   *
   * @default HelmReleaseSpec.Timeout'.
   * @schema HelmReleaseSpecUpgrade#timeout
   */
  readonly timeout?: string;

}

/**
 * Converts an object of type 'HelmReleaseSpecUpgrade' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecUpgrade(obj: HelmReleaseSpecUpgrade | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'cleanupOnFail': obj.cleanupOnFail,
    'crds': obj.crds,
    'disableHooks': obj.disableHooks,
    'disableOpenAPIValidation': obj.disableOpenApiValidation,
    'disableSchemaValidation': obj.disableSchemaValidation,
    'disableTakeOwnership': obj.disableTakeOwnership,
    'disableWait': obj.disableWait,
    'disableWaitForJobs': obj.disableWaitForJobs,
    'force': obj.force,
    'preserveValues': obj.preserveValues,
    'remediation': toJson_HelmReleaseSpecUpgradeRemediation(obj.remediation),
    'timeout': obj.timeout,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * ValuesReference contains a reference to a resource containing Helm values,
 * and optionally the key they can be found at.
 *
 * @schema HelmReleaseSpecValuesFrom
 */
export interface HelmReleaseSpecValuesFrom {
  /**
   * Kind of the values referent, valid values are ('Secret', 'ConfigMap').
   *
   * @schema HelmReleaseSpecValuesFrom#kind
   */
  readonly kind: HelmReleaseSpecValuesFromKind;

  /**
   * Name of the values referent. Should reside in the same namespace as the
   * referring resource.
   *
   * @schema HelmReleaseSpecValuesFrom#name
   */
  readonly 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.
   *
   * @schema HelmReleaseSpecValuesFrom#optional
   */
  readonly optional?: boolean;

  /**
   * 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.
   *
   * @default None',
   * @schema HelmReleaseSpecValuesFrom#targetPath
   */
  readonly targetPath?: string;

  /**
   * ValuesKey is the data key where the values.yaml or a specific value can be
   * found at. Defaults to 'values.yaml'.
   *
   * @default values.yaml'.
   * @schema HelmReleaseSpecValuesFrom#valuesKey
   */
  readonly valuesKey?: string;

}

/**
 * Converts an object of type 'HelmReleaseSpecValuesFrom' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecValuesFrom(obj: HelmReleaseSpecValuesFrom | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'kind': obj.kind,
    'name': obj.name,
    'optional': obj.optional,
    'targetPath': obj.targetPath,
    'valuesKey': obj.valuesKey,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * ObjectMeta holds the template for metadata like labels and annotations.
 *
 * @schema HelmReleaseSpecChartMetadata
 */
export interface HelmReleaseSpecChartMetadata {
  /**
   * 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/
   *
   * @schema HelmReleaseSpecChartMetadata#annotations
   */
  readonly annotations?: { [key: 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/
   *
   * @schema HelmReleaseSpecChartMetadata#labels
   */
  readonly labels?: { [key: string]: string };

}

/**
 * Converts an object of type 'HelmReleaseSpecChartMetadata' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecChartMetadata(obj: HelmReleaseSpecChartMetadata | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'annotations': ((obj.annotations) === undefined) ? undefined : (Object.entries(obj.annotations).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {})),
    'labels': ((obj.labels) === undefined) ? undefined : (Object.entries(obj.labels).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {})),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Spec holds the template for the v1.HelmChartSpec for this HelmRelease.
 *
 * @schema HelmReleaseSpecChartSpec
 */
export interface HelmReleaseSpecChartSpec {
  /**
   * The name or path the Helm chart is available at in the SourceRef.
   *
   * @schema HelmReleaseSpecChartSpec#chart
   */
  readonly chart: string;

  /**
   * IgnoreMissingValuesFiles controls whether to silently ignore missing values files rather than failing.
   *
   * @schema HelmReleaseSpecChartSpec#ignoreMissingValuesFiles
   */
  readonly ignoreMissingValuesFiles?: boolean;

  /**
   * Interval at which to check the v1.Source for updates. Defaults to
   * 'HelmReleaseSpec.Interval'.
   *
   * @default HelmReleaseSpec.Interval'.
   * @schema HelmReleaseSpecChartSpec#interval
   */
  readonly interval?: 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.
   *
   * @default ChartVersion when omitted.
   * @schema HelmReleaseSpecChartSpec#reconcileStrategy
   */
  readonly reconcileStrategy?: HelmReleaseSpecChartSpecReconcileStrategy;

  /**
   * The name and namespace of the v1.Source the chart is available at.
   *
   * @schema HelmReleaseSpecChartSpec#sourceRef
   */
  readonly sourceRef: HelmReleaseSpecChartSpecSourceRef;

  /**
   * 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.
   *
   * @schema HelmReleaseSpecChartSpec#valuesFiles
   */
  readonly valuesFiles?: 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.
   *
   * @schema HelmReleaseSpecChartSpec#verify
   */
  readonly verify?: HelmReleaseSpecChartSpecVerify;

  /**
   * Version semver expression, ignored for charts from v1.GitRepository and
   * v1beta2.Bucket sources. Defaults to latest when omitted.
   *
   * @default latest when omitted.
   * @schema HelmReleaseSpecChartSpec#version
   */
  readonly version?: string;

}

/**
 * Converts an object of type 'HelmReleaseSpecChartSpec' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecChartSpec(obj: HelmReleaseSpecChartSpec | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'chart': obj.chart,
    'ignoreMissingValuesFiles': obj.ignoreMissingValuesFiles,
    'interval': obj.interval,
    'reconcileStrategy': obj.reconcileStrategy,
    'sourceRef': toJson_HelmReleaseSpecChartSpecSourceRef(obj.sourceRef),
    'valuesFiles': obj.valuesFiles?.map(y => y),
    'verify': toJson_HelmReleaseSpecChartSpecVerify(obj.verify),
    'version': obj.version,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Kind of the referent.
 *
 * @schema HelmReleaseSpecChartRefKind
 */
export enum HelmReleaseSpecChartRefKind {
  /** OCIRepository */
  OCI_REPOSITORY = "OCIRepository",
  /** HelmChart */
  HELM_CHART = "HelmChart",
}

/**
 * IgnoreRule defines a rule to selectively disregard specific changes during
 * the drift detection process.
 *
 * @schema HelmReleaseSpecDriftDetectionIgnore
 */
export interface HelmReleaseSpecDriftDetectionIgnore {
  /**
   * Paths is a list of JSON Pointer (RFC 6901) paths to be excluded from
   * consideration in a Kubernetes object.
   *
   * @schema HelmReleaseSpecDriftDetectionIgnore#paths
   */
  readonly paths: 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.
   *
   * @schema HelmReleaseSpecDriftDetectionIgnore#target
   */
  readonly target?: HelmReleaseSpecDriftDetectionIgnoreTarget;

}

/**
 * Converts an object of type 'HelmReleaseSpecDriftDetectionIgnore' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecDriftDetectionIgnore(obj: HelmReleaseSpecDriftDetectionIgnore | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'paths': obj.paths?.map(y => y),
    'target': toJson_HelmReleaseSpecDriftDetectionIgnoreTarget(obj.target),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * 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.
 *
 * @schema HelmReleaseSpecDriftDetectionMode
 */
export enum HelmReleaseSpecDriftDetectionMode {
  /** enabled */
  ENABLED = "enabled",
  /** warn */
  WARN = "warn",
  /** disabled */
  DISABLED = "disabled",
}

/**
 * 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.
 *
 * @default Create` and if omitted
 * @schema HelmReleaseSpecInstallCrds
 */
export enum HelmReleaseSpecInstallCrds {
  /** Skip */
  SKIP = "Skip",
  /** Create */
  CREATE = "Create",
  /** CreateReplace */
  CREATE_REPLACE = "CreateReplace",
}

/**
 * Remediation holds the remediation configuration for when the Helm install
 * action for the HelmRelease fails. The default is to not perform any action.
 *
 * @schema HelmReleaseSpecInstallRemediation
 */
export interface HelmReleaseSpecInstallRemediation {
  /**
   * IgnoreTestFailures tells the controller to skip remediation when the Helm
   * tests are run after an install action but fail. Defaults to
   * 'Test.IgnoreFailures'.
   *
   * @default Test.IgnoreFailures'.
   * @schema HelmReleaseSpecInstallRemediation#ignoreTestFailures
   */
  readonly ignoreTestFailures?: boolean;

  /**
   * RemediateLastFailure tells the controller to remediate the last failure, when
   * no retries remain. Defaults to 'false'.
   *
   * @default false'.
   * @schema HelmReleaseSpecInstallRemediation#remediateLastFailure
   */
  readonly remediateLastFailure?: boolean;

  /**
   * 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.
   *
   * @default 0', a negative integer equals to unlimited retries.
   * @schema HelmReleaseSpecInstallRemediation#retries
   */
  readonly retries?: number;

}

/**
 * Converts an object of type 'HelmReleaseSpecInstallRemediation' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecInstallRemediation(obj: HelmReleaseSpecInstallRemediation | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'ignoreTestFailures': obj.ignoreTestFailures,
    'remediateLastFailure': obj.remediateLastFailure,
    'retries': obj.retries,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * SecretRef holds the 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'.
 * 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.
 *
 * @schema HelmReleaseSpecKubeConfigSecretRef
 */
export interface HelmReleaseSpecKubeConfigSecretRef {
  /**
   * Key in the Secret, when not specified an implementation-specific default key is used.
   *
   * @schema HelmReleaseSpecKubeConfigSecretRef#key
   */
  readonly key?: string;

  /**
   * Name of the Secret.
   *
   * @schema HelmReleaseSpecKubeConfigSecretRef#name
   */
  readonly name: string;

}

/**
 * Converts an object of type 'HelmReleaseSpecKubeConfigSecretRef' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecKubeConfigSecretRef(obj: HelmReleaseSpecKubeConfigSecretRef | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'key': obj.key,
    'name': obj.name,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Kustomization to apply as PostRenderer.
 *
 * @schema HelmReleaseSpecPostRenderersKustomize
 */
export interface HelmReleaseSpecPostRenderersKustomize {
  /**
   * 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.
   *
   * @schema HelmReleaseSpecPostRenderersKustomize#images
   */
  readonly images?: HelmReleaseSpecPostRenderersKustomizeImages[];

  /**
   * Strategic merge and JSON patches, defined as inline YAML objects,
   * capable of targeting objects based on kind, label and annotation selectors.
   *
   * @schema HelmReleaseSpecPostRenderersKustomize#patches
   */
  readonly patches?: HelmReleaseSpecPostRenderersKustomizePatches[];

}

/**
 * Converts an object of type 'HelmReleaseSpecPostRenderersKustomize' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecPostRenderersKustomize(obj: HelmReleaseSpecPostRenderersKustomize | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'images': obj.images?.map(y => toJson_HelmReleaseSpecPostRenderersKustomizeImages(y)),
    'patches': obj.patches?.map(y => toJson_HelmReleaseSpecPostRenderersKustomizePatches(y)),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Filter holds the configuration for individual Helm test filters.
 *
 * @schema HelmReleaseSpecTestFilters
 */
export interface HelmReleaseSpecTestFilters {
  /**
   * Exclude specifies whether the named test should be excluded.
   *
   * @schema HelmReleaseSpecTestFilters#exclude
   */
  readonly exclude?: boolean;

  /**
   * Name is the name of the test.
   *
   * @schema HelmReleaseSpecTestFilters#name
   */
  readonly name: string;

}

/**
 * Converts an object of type 'HelmReleaseSpecTestFilters' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecTestFilters(obj: HelmReleaseSpecTestFilters | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'exclude': obj.exclude,
    'name': obj.name,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * DeletionPropagation specifies the deletion propagation policy when
 * a Helm uninstall is performed.
 *
 * @schema HelmReleaseSpecUninstallDeletionPropagation
 */
export enum HelmReleaseSpecUninstallDeletionPropagation {
  /** background */
  BACKGROUND = "background",
  /** foreground */
  FOREGROUND = "foreground",
  /** orphan */
  ORPHAN = "orphan",
}

/**
 * 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.
 *
 * @default Skip` and if omitted
 * @schema HelmReleaseSpecUpgradeCrds
 */
export enum HelmReleaseSpecUpgradeCrds {
  /** Skip */
  SKIP = "Skip",
  /** Create */
  CREATE = "Create",
  /** CreateReplace */
  CREATE_REPLACE = "CreateReplace",
}

/**
 * Remediation holds the remediation configuration for when the Helm upgrade
 * action for the HelmRelease fails. The default is to not perform any action.
 *
 * @schema HelmReleaseSpecUpgradeRemediation
 */
export interface HelmReleaseSpecUpgradeRemediation {
  /**
   * IgnoreTestFailures tells the controller to skip remediation when the Helm
   * tests are run after an upgrade action but fail.
   * Defaults to 'Test.IgnoreFailures'.
   *
   * @default Test.IgnoreFailures'.
   * @schema HelmReleaseSpecUpgradeRemediation#ignoreTestFailures
   */
  readonly ignoreTestFailures?: boolean;

  /**
   * RemediateLastFailure tells the controller to remediate the last failure, when
   * no retries remain. Defaults to 'false' unless 'Retries' is greater than 0.
   *
   * @default false' unless 'Retries' is greater than 0.
   * @schema HelmReleaseSpecUpgradeRemediation#remediateLastFailure
   */
  readonly remediateLastFailure?: boolean;

  /**
   * 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.
   *
   * @default 0', a negative integer equals to unlimited retries.
   * @schema HelmReleaseSpecUpgradeRemediation#retries
   */
  readonly retries?: number;

  /**
   * Strategy to use for failure remediation. Defaults to 'rollback'.
   *
   * @default rollback'.
   * @schema HelmReleaseSpecUpgradeRemediation#strategy
   */
  readonly strategy?: HelmReleaseSpecUpgradeRemediationStrategy;

}

/**
 * Converts an object of type 'HelmReleaseSpecUpgradeRemediation' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecUpgradeRemediation(obj: HelmReleaseSpecUpgradeRemediation | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'ignoreTestFailures': obj.ignoreTestFailures,
    'remediateLastFailure': obj.remediateLastFailure,
    'retries': obj.retries,
    'strategy': obj.strategy,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Kind of the values referent, valid values are ('Secret', 'ConfigMap').
 *
 * @schema HelmReleaseSpecValuesFromKind
 */
export enum HelmReleaseSpecValuesFromKind {
  /** Secret */
  SECRET = "Secret",
  /** ConfigMap */
  CONFIG_MAP = "ConfigMap",
}

/**
 * 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.
 *
 * @default ChartVersion when omitted.
 * @schema HelmReleaseSpecChartSpecReconcileStrategy
 */
export enum HelmReleaseSpecChartSpecReconcileStrategy {
  /** ChartVersion */
  CHART_VERSION = "ChartVersion",
  /** Revision */
  REVISION = "Revision",
}

/**
 * The name and namespace of the v1.Source the chart is available at.
 *
 * @schema HelmReleaseSpecChartSpecSourceRef
 */
export interface HelmReleaseSpecChartSpecSourceRef {
  /**
   * APIVersion of the referent.
   *
   * @schema HelmReleaseSpecChartSpecSourceRef#apiVersion
   */
  readonly apiVersion?: string;

  /**
   * Kind of the referent.
   *
   * @schema HelmReleaseSpecChartSpecSourceRef#kind
   */
  readonly kind: HelmReleaseSpecChartSpecSourceRefKind;

  /**
   * Name of the referent.
   *
   * @schema HelmReleaseSpecChartSpecSourceRef#name
   */
  readonly name: string;

  /**
   * Namespace of the referent.
   *
   * @schema HelmReleaseSpecChartSpecSourceRef#namespace
   */
  readonly namespace?: string;

}

/**
 * Converts an object of type 'HelmReleaseSpecChartSpecSourceRef' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecChartSpecSourceRef(obj: HelmReleaseSpecChartSpecSourceRef | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'apiVersion': obj.apiVersion,
    'kind': obj.kind,
    'name': obj.name,
    'namespace': obj.namespace,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * 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.
 *
 * @schema HelmReleaseSpecChartSpecVerify
 */
export interface HelmReleaseSpecChartSpecVerify {
  /**
   * Provider specifies the technology used to sign the OCI Helm chart.
   *
   * @schema HelmReleaseSpecChartSpecVerify#provider
   */
  readonly provider: HelmReleaseSpecChartSpecVerifyProvider;

  /**
   * SecretRef specifies the Kubernetes Secret containing the
   * trusted public keys.
   *
   * @schema HelmReleaseSpecChartSpecVerify#secretRef
   */
  readonly secretRef?: HelmReleaseSpecChartSpecVerifySecretRef;

}

/**
 * Converts an object of type 'HelmReleaseSpecChartSpecVerify' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecChartSpecVerify(obj: HelmReleaseSpecChartSpecVerify | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'provider': obj.provider,
    'secretRef': toJson_HelmReleaseSpecChartSpecVerifySecretRef(obj.secretRef),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * 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.
 *
 * @schema HelmReleaseSpecDriftDetectionIgnoreTarget
 */
export interface HelmReleaseSpecDriftDetectionIgnoreTarget {
  /**
   * 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.
   *
   * @schema HelmReleaseSpecDriftDetectionIgnoreTarget#annotationSelector
   */
  readonly annotationSelector?: 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
   *
   * @schema HelmReleaseSpecDriftDetectionIgnoreTarget#group
   */
  readonly group?: 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
   *
   * @schema HelmReleaseSpecDriftDetectionIgnoreTarget#kind
   */
  readonly kind?: 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.
   *
   * @schema HelmReleaseSpecDriftDetectionIgnoreTarget#labelSelector
   */
  readonly labelSelector?: string;

  /**
   * Name to match resources with.
   *
   * @schema HelmReleaseSpecDriftDetectionIgnoreTarget#name
   */
  readonly name?: string;

  /**
   * Namespace to select resources from.
   *
   * @schema HelmReleaseSpecDriftDetectionIgnoreTarget#namespace
   */
  readonly namespace?: 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
   *
   * @schema HelmReleaseSpecDriftDetectionIgnoreTarget#version
   */
  readonly version?: string;

}

/**
 * Converts an object of type 'HelmReleaseSpecDriftDetectionIgnoreTarget' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecDriftDetectionIgnoreTarget(obj: HelmReleaseSpecDriftDetectionIgnoreTarget | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'annotationSelector': obj.annotationSelector,
    'group': obj.group,
    'kind': obj.kind,
    'labelSelector': obj.labelSelector,
    'name': obj.name,
    'namespace': obj.namespace,
    'version': obj.version,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Image contains an image name, a new name, a new tag or digest, which will replace the original name and tag.
 *
 * @schema HelmReleaseSpecPostRenderersKustomizeImages
 */
export interface HelmReleaseSpecPostRenderersKustomizeImages {
  /**
   * Digest is the value used to replace the original image tag.
   * If digest is present NewTag value is ignored.
   *
   * @schema HelmReleaseSpecPostRenderersKustomizeImages#digest
   */
  readonly digest?: string;

  /**
   * Name is a tag-less image name.
   *
   * @schema HelmReleaseSpecPostRenderersKustomizeImages#name
   */
  readonly name: string;

  /**
   * NewName is the value used to replace the original name.
   *
   * @schema HelmReleaseSpecPostRenderersKustomizeImages#newName
   */
  readonly newName?: string;

  /**
   * NewTag is the value used to replace the original tag.
   *
   * @schema HelmReleaseSpecPostRenderersKustomizeImages#newTag
   */
  readonly newTag?: string;

}

/**
 * Converts an object of type 'HelmReleaseSpecPostRenderersKustomizeImages' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecPostRenderersKustomizeImages(obj: HelmReleaseSpecPostRenderersKustomizeImages | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'digest': obj.digest,
    'name': obj.name,
    'newName': obj.newName,
    'newTag': obj.newTag,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Patch contains an inline StrategicMerge or JSON6902 patch, and the target the patch should
 * be applied to.
 *
 * @schema HelmReleaseSpecPostRenderersKustomizePatches
 */
export interface HelmReleaseSpecPostRenderersKustomizePatches {
  /**
   * Patch contains an inline StrategicMerge patch or an inline JSON6902 patch with
   * an array of operation objects.
   *
   * @schema HelmReleaseSpecPostRenderersKustomizePatches#patch
   */
  readonly patch: string;

  /**
   * Target points to the resources that the patch document should be applied to.
   *
   * @schema HelmReleaseSpecPostRenderersKustomizePatches#target
   */
  readonly target?: HelmReleaseSpecPostRenderersKustomizePatchesTarget;

}

/**
 * Converts an object of type 'HelmReleaseSpecPostRenderersKustomizePatches' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecPostRenderersKustomizePatches(obj: HelmReleaseSpecPostRenderersKustomizePatches | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'patch': obj.patch,
    'target': toJson_HelmReleaseSpecPostRenderersKustomizePatchesTarget(obj.target),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Strategy to use for failure remediation. Defaults to 'rollback'.
 *
 * @default rollback'.
 * @schema HelmReleaseSpecUpgradeRemediationStrategy
 */
export enum HelmReleaseSpecUpgradeRemediationStrategy {
  /** rollback */
  ROLLBACK = "rollback",
  /** uninstall */
  UNINSTALL = "uninstall",
}

/**
 * Kind of the referent.
 *
 * @schema HelmReleaseSpecChartSpecSourceRefKind
 */
export enum HelmReleaseSpecChartSpecSourceRefKind {
  /** HelmRepository */
  HELM_REPOSITORY = "HelmRepository",
  /** GitRepository */
  GIT_REPOSITORY = "GitRepository",
  /** Bucket */
  BUCKET = "Bucket",
}

/**
 * Provider specifies the technology used to sign the OCI Helm chart.
 *
 * @schema HelmReleaseSpecChartSpecVerifyProvider
 */
export enum HelmReleaseSpecChartSpecVerifyProvider {
  /** cosign */
  COSIGN = "cosign",
  /** notation */
  NOTATION = "notation",
}

/**
 * SecretRef specifies the Kubernetes Secret containing the
 * trusted public keys.
 *
 * @schema HelmReleaseSpecChartSpecVerifySecretRef
 */
export interface HelmReleaseSpecChartSpecVerifySecretRef {
  /**
   * Name of the referent.
   *
   * @schema HelmReleaseSpecChartSpecVerifySecretRef#name
   */
  readonly name: string;

}

/**
 * Converts an object of type 'HelmReleaseSpecChartSpecVerifySecretRef' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecChartSpecVerifySecretRef(obj: HelmReleaseSpecChartSpecVerifySecretRef | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'name': obj.name,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Target points to the resources that the patch document should be applied to.
 *
 * @schema HelmReleaseSpecPostRenderersKustomizePatchesTarget
 */
export interface HelmReleaseSpecPostRenderersKustomizePatchesTarget {
  /**
   * 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.
   *
   * @schema HelmReleaseSpecPostRenderersKustomizePatchesTarget#annotationSelector
   */
  readonly annotationSelector?: 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
   *
   * @schema HelmReleaseSpecPostRenderersKustomizePatchesTarget#group
   */
  readonly group?: 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
   *
   * @schema HelmReleaseSpecPostRenderersKustomizePatchesTarget#kind
   */
  readonly kind?: 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.
   *
   * @schema HelmReleaseSpecPostRenderersKustomizePatchesTarget#labelSelector
   */
  readonly labelSelector?: string;

  /**
   * Name to match resources with.
   *
   * @schema HelmReleaseSpecPostRenderersKustomizePatchesTarget#name
   */
  readonly name?: string;

  /**
   * Namespace to select resources from.
   *
   * @schema HelmReleaseSpecPostRenderersKustomizePatchesTarget#namespace
   */
  readonly namespace?: 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
   *
   * @schema HelmReleaseSpecPostRenderersKustomizePatchesTarget#version
   */
  readonly version?: string;

}

/**
 * Converts an object of type 'HelmReleaseSpecPostRenderersKustomizePatchesTarget' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseSpecPostRenderersKustomizePatchesTarget(obj: HelmReleaseSpecPostRenderersKustomizePatchesTarget | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'annotationSelector': obj.annotationSelector,
    'group': obj.group,
    'kind': obj.kind,
    'labelSelector': obj.labelSelector,
    'name': obj.name,
    'namespace': obj.namespace,
    'version': obj.version,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */


/**
 * HelmRelease is the Schema for the helmreleases API
 *
 * @schema HelmReleaseV2Beta1
 */
export class HelmReleaseV2Beta1 extends ApiObject {
  /**
   * Returns the apiVersion and kind for "HelmReleaseV2Beta1"
   */
  public static readonly GVK: GroupVersionKind = {
    apiVersion: 'helm.toolkit.fluxcd.io/v2beta1',
    kind: 'HelmRelease',
  }

  /**
   * Renders a Kubernetes manifest for "HelmReleaseV2Beta1".
   *
   * This can be used to inline resource manifests inside other objects (e.g. as templates).
   *
   * @param props initialization props
   */
  public static manifest(props: HelmReleaseV2Beta1Props = {}): any {
    return {
      ...HelmReleaseV2Beta1.GVK,
      ...toJson_HelmReleaseV2Beta1Props(props),
    };
  }

  /**
   * Defines a "HelmReleaseV2Beta1" API object
   * @param scope the scope in which to define this object
   * @param id a scope-local name for the object
   * @param props initialization props
   */
  public constructor(scope: Construct, id: string, props: HelmReleaseV2Beta1Props = {}) {
    super(scope, id, {
      ...HelmReleaseV2Beta1.GVK,
      ...props,
    });
  }

  /**
   * Renders the object to Kubernetes JSON.
   */
  public toJson(): any {
    const resolved = super.toJson();

    return {
      ...HelmReleaseV2Beta1.GVK,
      ...toJson_HelmReleaseV2Beta1Props(resolved),
    };
  }
}

/**
 * HelmRelease is the Schema for the helmreleases API
 *
 * @schema HelmReleaseV2Beta1
 */
export interface HelmReleaseV2Beta1Props {
  /**
   * @schema HelmReleaseV2Beta1#metadata
   */
  readonly metadata?: ApiObjectMetadata;

  /**
   * HelmReleaseSpec defines the desired state of a Helm release.
   *
   * @schema HelmReleaseV2Beta1#spec
   */
  readonly spec?: HelmReleaseV2Beta1Spec;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1Props' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1Props(obj: HelmReleaseV2Beta1Props | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'metadata': obj.metadata,
    'spec': toJson_HelmReleaseV2Beta1Spec(obj.spec),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * HelmReleaseSpec defines the desired state of a Helm release.
 *
 * @schema HelmReleaseV2Beta1Spec
 */
export interface HelmReleaseV2Beta1Spec {
  /**
   * Chart defines the template of the v1beta2.HelmChart that should be created
   * for this HelmRelease.
   *
   * @schema HelmReleaseV2Beta1Spec#chart
   */
  readonly chart: HelmReleaseV2Beta1SpecChart;

  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta1Spec#chartRef
   */
  readonly chartRef?: HelmReleaseV2Beta1SpecChartRef;

  /**
   * DependsOn may contain a meta.NamespacedObjectReference slice with
   * references to HelmRelease resources that must be ready before this HelmRelease
   * can be reconciled.
   *
   * @schema HelmReleaseV2Beta1Spec#dependsOn
   */
  readonly dependsOn?: HelmReleaseV2Beta1SpecDependsOn[];

  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta1Spec#driftDetection
   */
  readonly driftDetection?: HelmReleaseV2Beta1SpecDriftDetection;

  /**
   * Install holds the configuration for Helm install actions for this HelmRelease.
   *
   * @schema HelmReleaseV2Beta1Spec#install
   */
  readonly install?: HelmReleaseV2Beta1SpecInstall;

  /**
   * Interval at which to reconcile the Helm release.
   * This interval is approximate and may be subject to jitter to ensure
   * efficient use of resources.
   *
   * @schema HelmReleaseV2Beta1Spec#interval
   */
  readonly 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.
   *
   * @schema HelmReleaseV2Beta1Spec#kubeConfig
   */
  readonly kubeConfig?: HelmReleaseV2Beta1SpecKubeConfig;

  /**
   * MaxHistory is the number of revisions saved by Helm for this HelmRelease.
   * Use '0' for an unlimited number of revisions; defaults to '10'.
   *
   * @schema HelmReleaseV2Beta1Spec#maxHistory
   */
  readonly maxHistory?: number;

  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta1Spec#persistentClient
   */
  readonly persistentClient?: boolean;

  /**
   * PostRenderers holds an array of Helm PostRenderers, which will be applied in order
   * of their definition.
   *
   * @schema HelmReleaseV2Beta1Spec#postRenderers
   */
  readonly postRenderers?: HelmReleaseV2Beta1SpecPostRenderers[];

  /**
   * ReleaseName used for the Helm release. Defaults to a composition of
   * '[TargetNamespace-]Name'.
   *
   * @default a composition of
   * @schema HelmReleaseV2Beta1Spec#releaseName
   */
  readonly releaseName?: string;

  /**
   * Rollback holds the configuration for Helm rollback actions for this HelmRelease.
   *
   * @schema HelmReleaseV2Beta1Spec#rollback
   */
  readonly rollback?: HelmReleaseV2Beta1SpecRollback;

  /**
   * The name of the Kubernetes service account to impersonate
   * when reconciling this HelmRelease.
   *
   * @schema HelmReleaseV2Beta1Spec#serviceAccountName
   */
  readonly serviceAccountName?: string;

  /**
   * StorageNamespace used for the Helm storage.
   * Defaults to the namespace of the HelmRelease.
   *
   * @default the namespace of the HelmRelease.
   * @schema HelmReleaseV2Beta1Spec#storageNamespace
   */
  readonly storageNamespace?: string;

  /**
   * Suspend tells the controller to suspend reconciliation for this HelmRelease,
   * it does not apply to already started reconciliations. Defaults to false.
   *
   * @default false.
   * @schema HelmReleaseV2Beta1Spec#suspend
   */
  readonly suspend?: boolean;

  /**
   * TargetNamespace to target when performing operations for the HelmRelease.
   * Defaults to the namespace of the HelmRelease.
   *
   * @default the namespace of the HelmRelease.
   * @schema HelmReleaseV2Beta1Spec#targetNamespace
   */
  readonly targetNamespace?: string;

  /**
   * Test holds the configuration for Helm test actions for this HelmRelease.
   *
   * @schema HelmReleaseV2Beta1Spec#test
   */
  readonly test?: HelmReleaseV2Beta1SpecTest;

  /**
   * 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'.
   *
   * @default 5m0s'.
   * @schema HelmReleaseV2Beta1Spec#timeout
   */
  readonly timeout?: string;

  /**
   * Uninstall holds the configuration for Helm uninstall actions for this HelmRelease.
   *
   * @schema HelmReleaseV2Beta1Spec#uninstall
   */
  readonly uninstall?: HelmReleaseV2Beta1SpecUninstall;

  /**
   * Upgrade holds the configuration for Helm upgrade actions for this HelmRelease.
   *
   * @schema HelmReleaseV2Beta1Spec#upgrade
   */
  readonly upgrade?: HelmReleaseV2Beta1SpecUpgrade;

  /**
   * Values holds the values for this Helm release.
   *
   * @schema HelmReleaseV2Beta1Spec#values
   */
  readonly values?: any;

  /**
   * ValuesFrom holds references to resources containing Helm values for this HelmRelease,
   * and information about how they should be merged.
   *
   * @schema HelmReleaseV2Beta1Spec#valuesFrom
   */
  readonly valuesFrom?: HelmReleaseV2Beta1SpecValuesFrom[];

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1Spec' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1Spec(obj: HelmReleaseV2Beta1Spec | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'chart': toJson_HelmReleaseV2Beta1SpecChart(obj.chart),
    'chartRef': toJson_HelmReleaseV2Beta1SpecChartRef(obj.chartRef),
    'dependsOn': obj.dependsOn?.map(y => toJson_HelmReleaseV2Beta1SpecDependsOn(y)),
    'driftDetection': toJson_HelmReleaseV2Beta1SpecDriftDetection(obj.driftDetection),
    'install': toJson_HelmReleaseV2Beta1SpecInstall(obj.install),
    'interval': obj.interval,
    'kubeConfig': toJson_HelmReleaseV2Beta1SpecKubeConfig(obj.kubeConfig),
    'maxHistory': obj.maxHistory,
    'persistentClient': obj.persistentClient,
    'postRenderers': obj.postRenderers?.map(y => toJson_HelmReleaseV2Beta1SpecPostRenderers(y)),
    'releaseName': obj.releaseName,
    'rollback': toJson_HelmReleaseV2Beta1SpecRollback(obj.rollback),
    'serviceAccountName': obj.serviceAccountName,
    'storageNamespace': obj.storageNamespace,
    'suspend': obj.suspend,
    'targetNamespace': obj.targetNamespace,
    'test': toJson_HelmReleaseV2Beta1SpecTest(obj.test),
    'timeout': obj.timeout,
    'uninstall': toJson_HelmReleaseV2Beta1SpecUninstall(obj.uninstall),
    'upgrade': toJson_HelmReleaseV2Beta1SpecUpgrade(obj.upgrade),
    'values': obj.values,
    'valuesFrom': obj.valuesFrom?.map(y => toJson_HelmReleaseV2Beta1SpecValuesFrom(y)),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Chart defines the template of the v1beta2.HelmChart that should be created
 * for this HelmRelease.
 *
 * @schema HelmReleaseV2Beta1SpecChart
 */
export interface HelmReleaseV2Beta1SpecChart {
  /**
   * ObjectMeta holds the template for metadata like labels and annotations.
   *
   * @schema HelmReleaseV2Beta1SpecChart#metadata
   */
  readonly metadata?: HelmReleaseV2Beta1SpecChartMetadata;

  /**
   * Spec holds the template for the v1beta2.HelmChartSpec for this HelmRelease.
   *
   * @schema HelmReleaseV2Beta1SpecChart#spec
   */
  readonly spec: HelmReleaseV2Beta1SpecChartSpec;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecChart' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecChart(obj: HelmReleaseV2Beta1SpecChart | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'metadata': toJson_HelmReleaseV2Beta1SpecChartMetadata(obj.metadata),
    'spec': toJson_HelmReleaseV2Beta1SpecChartSpec(obj.spec),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * 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.
 *
 * @schema HelmReleaseV2Beta1SpecChartRef
 */
export interface HelmReleaseV2Beta1SpecChartRef {
  /**
   * APIVersion of the referent.
   *
   * @schema HelmReleaseV2Beta1SpecChartRef#apiVersion
   */
  readonly apiVersion?: string;

  /**
   * Kind of the referent.
   *
   * @schema HelmReleaseV2Beta1SpecChartRef#kind
   */
  readonly kind: HelmReleaseV2Beta1SpecChartRefKind;

  /**
   * Name of the referent.
   *
   * @schema HelmReleaseV2Beta1SpecChartRef#name
   */
  readonly name: string;

  /**
   * Namespace of the referent, defaults to the namespace of the Kubernetes
   * resource object that contains the reference.
   *
   * @schema HelmReleaseV2Beta1SpecChartRef#namespace
   */
  readonly namespace?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecChartRef' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecChartRef(obj: HelmReleaseV2Beta1SpecChartRef | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'apiVersion': obj.apiVersion,
    'kind': obj.kind,
    'name': obj.name,
    'namespace': obj.namespace,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * NamespacedObjectReference contains enough information to locate the referenced Kubernetes resource object in any
 * namespace.
 *
 * @schema HelmReleaseV2Beta1SpecDependsOn
 */
export interface HelmReleaseV2Beta1SpecDependsOn {
  /**
   * Name of the referent.
   *
   * @schema HelmReleaseV2Beta1SpecDependsOn#name
   */
  readonly name: string;

  /**
   * Namespace of the referent, when not specified it acts as LocalObjectReference.
   *
   * @schema HelmReleaseV2Beta1SpecDependsOn#namespace
   */
  readonly namespace?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecDependsOn' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecDependsOn(obj: HelmReleaseV2Beta1SpecDependsOn | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'name': obj.name,
    'namespace': obj.namespace,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * 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.
 *
 * @schema HelmReleaseV2Beta1SpecDriftDetection
 */
export interface HelmReleaseV2Beta1SpecDriftDetection {
  /**
   * Ignore contains a list of rules for specifying which changes to ignore
   * during diffing.
   *
   * @schema HelmReleaseV2Beta1SpecDriftDetection#ignore
   */
  readonly ignore?: HelmReleaseV2Beta1SpecDriftDetectionIgnore[];

  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta1SpecDriftDetection#mode
   */
  readonly mode?: HelmReleaseV2Beta1SpecDriftDetectionMode;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecDriftDetection' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecDriftDetection(obj: HelmReleaseV2Beta1SpecDriftDetection | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'ignore': obj.ignore?.map(y => toJson_HelmReleaseV2Beta1SpecDriftDetectionIgnore(y)),
    'mode': obj.mode,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Install holds the configuration for Helm install actions for this HelmRelease.
 *
 * @schema HelmReleaseV2Beta1SpecInstall
 */
export interface HelmReleaseV2Beta1SpecInstall {
  /**
   * 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.
   *
   * @default Create` and if omitted
   * @schema HelmReleaseV2Beta1SpecInstall#crds
   */
  readonly crds?: HelmReleaseV2Beta1SpecInstallCrds;

  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta1SpecInstall#createNamespace
   */
  readonly createNamespace?: boolean;

  /**
   * DisableHooks prevents hooks from running during the Helm install action.
   *
   * @schema HelmReleaseV2Beta1SpecInstall#disableHooks
   */
  readonly disableHooks?: boolean;

  /**
   * DisableOpenAPIValidation prevents the Helm install action from validating
   * rendered templates against the Kubernetes OpenAPI Schema.
   *
   * @schema HelmReleaseV2Beta1SpecInstall#disableOpenAPIValidation
   */
  readonly disableOpenApiValidation?: boolean;

  /**
   * DisableWait disables the waiting for resources to be ready after a Helm
   * install has been performed.
   *
   * @schema HelmReleaseV2Beta1SpecInstall#disableWait
   */
  readonly disableWait?: boolean;

  /**
   * DisableWaitForJobs disables waiting for jobs to complete after a Helm
   * install has been performed.
   *
   * @schema HelmReleaseV2Beta1SpecInstall#disableWaitForJobs
   */
  readonly disableWaitForJobs?: boolean;

  /**
   * Remediation holds the remediation configuration for when the Helm install
   * action for the HelmRelease fails. The default is to not perform any action.
   *
   * @schema HelmReleaseV2Beta1SpecInstall#remediation
   */
  readonly remediation?: HelmReleaseV2Beta1SpecInstallRemediation;

  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta1SpecInstall#replace
   */
  readonly replace?: boolean;

  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta1SpecInstall#skipCRDs
   */
  readonly skipCrDs?: boolean;

  /**
   * 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'.
   *
   * @default HelmReleaseSpec.Timeout'.
   * @schema HelmReleaseV2Beta1SpecInstall#timeout
   */
  readonly timeout?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecInstall' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecInstall(obj: HelmReleaseV2Beta1SpecInstall | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'crds': obj.crds,
    'createNamespace': obj.createNamespace,
    'disableHooks': obj.disableHooks,
    'disableOpenAPIValidation': obj.disableOpenApiValidation,
    'disableWait': obj.disableWait,
    'disableWaitForJobs': obj.disableWaitForJobs,
    'remediation': toJson_HelmReleaseV2Beta1SpecInstallRemediation(obj.remediation),
    'replace': obj.replace,
    'skipCRDs': obj.skipCrDs,
    'timeout': obj.timeout,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * 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.
 *
 * @schema HelmReleaseV2Beta1SpecKubeConfig
 */
export interface HelmReleaseV2Beta1SpecKubeConfig {
  /**
   * SecretRef holds the 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'.
   * 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.
   *
   * @schema HelmReleaseV2Beta1SpecKubeConfig#secretRef
   */
  readonly secretRef: HelmReleaseV2Beta1SpecKubeConfigSecretRef;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecKubeConfig' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecKubeConfig(obj: HelmReleaseV2Beta1SpecKubeConfig | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'secretRef': toJson_HelmReleaseV2Beta1SpecKubeConfigSecretRef(obj.secretRef),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * PostRenderer contains a Helm PostRenderer specification.
 *
 * @schema HelmReleaseV2Beta1SpecPostRenderers
 */
export interface HelmReleaseV2Beta1SpecPostRenderers {
  /**
   * Kustomization to apply as PostRenderer.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderers#kustomize
   */
  readonly kustomize?: HelmReleaseV2Beta1SpecPostRenderersKustomize;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecPostRenderers' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecPostRenderers(obj: HelmReleaseV2Beta1SpecPostRenderers | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'kustomize': toJson_HelmReleaseV2Beta1SpecPostRenderersKustomize(obj.kustomize),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Rollback holds the configuration for Helm rollback actions for this HelmRelease.
 *
 * @schema HelmReleaseV2Beta1SpecRollback
 */
export interface HelmReleaseV2Beta1SpecRollback {
  /**
   * CleanupOnFail allows deletion of new resources created during the Helm
   * rollback action when it fails.
   *
   * @schema HelmReleaseV2Beta1SpecRollback#cleanupOnFail
   */
  readonly cleanupOnFail?: boolean;

  /**
   * DisableHooks prevents hooks from running during the Helm rollback action.
   *
   * @schema HelmReleaseV2Beta1SpecRollback#disableHooks
   */
  readonly disableHooks?: boolean;

  /**
   * DisableWait disables the waiting for resources to be ready after a Helm
   * rollback has been performed.
   *
   * @schema HelmReleaseV2Beta1SpecRollback#disableWait
   */
  readonly disableWait?: boolean;

  /**
   * DisableWaitForJobs disables waiting for jobs to complete after a Helm
   * rollback has been performed.
   *
   * @schema HelmReleaseV2Beta1SpecRollback#disableWaitForJobs
   */
  readonly disableWaitForJobs?: boolean;

  /**
   * Force forces resource updates through a replacement strategy.
   *
   * @schema HelmReleaseV2Beta1SpecRollback#force
   */
  readonly force?: boolean;

  /**
   * Recreate performs pod restarts for the resource if applicable.
   *
   * @schema HelmReleaseV2Beta1SpecRollback#recreate
   */
  readonly recreate?: boolean;

  /**
   * 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'.
   *
   * @default HelmReleaseSpec.Timeout'.
   * @schema HelmReleaseV2Beta1SpecRollback#timeout
   */
  readonly timeout?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecRollback' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecRollback(obj: HelmReleaseV2Beta1SpecRollback | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'cleanupOnFail': obj.cleanupOnFail,
    'disableHooks': obj.disableHooks,
    'disableWait': obj.disableWait,
    'disableWaitForJobs': obj.disableWaitForJobs,
    'force': obj.force,
    'recreate': obj.recreate,
    'timeout': obj.timeout,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Test holds the configuration for Helm test actions for this HelmRelease.
 *
 * @schema HelmReleaseV2Beta1SpecTest
 */
export interface HelmReleaseV2Beta1SpecTest {
  /**
   * Enable enables Helm test actions for this HelmRelease after an Helm install
   * or upgrade action has been performed.
   *
   * @schema HelmReleaseV2Beta1SpecTest#enable
   */
  readonly enable?: boolean;

  /**
   * 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'.
   *
   * @schema HelmReleaseV2Beta1SpecTest#ignoreFailures
   */
  readonly ignoreFailures?: boolean;

  /**
   * Timeout is the time to wait for any individual Kubernetes operation during
   * the performance of a Helm test action. Defaults to 'HelmReleaseSpec.Timeout'.
   *
   * @default HelmReleaseSpec.Timeout'.
   * @schema HelmReleaseV2Beta1SpecTest#timeout
   */
  readonly timeout?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecTest' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecTest(obj: HelmReleaseV2Beta1SpecTest | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'enable': obj.enable,
    'ignoreFailures': obj.ignoreFailures,
    'timeout': obj.timeout,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Uninstall holds the configuration for Helm uninstall actions for this HelmRelease.
 *
 * @schema HelmReleaseV2Beta1SpecUninstall
 */
export interface HelmReleaseV2Beta1SpecUninstall {
  /**
   * DeletionPropagation specifies the deletion propagation policy when
   * a Helm uninstall is performed.
   *
   * @schema HelmReleaseV2Beta1SpecUninstall#deletionPropagation
   */
  readonly deletionPropagation?: HelmReleaseV2Beta1SpecUninstallDeletionPropagation;

  /**
   * DisableHooks prevents hooks from running during the Helm rollback action.
   *
   * @schema HelmReleaseV2Beta1SpecUninstall#disableHooks
   */
  readonly disableHooks?: boolean;

  /**
   * DisableWait disables waiting for all the resources to be deleted after
   * a Helm uninstall is performed.
   *
   * @schema HelmReleaseV2Beta1SpecUninstall#disableWait
   */
  readonly disableWait?: boolean;

  /**
   * KeepHistory tells Helm to remove all associated resources and mark the
   * release as deleted, but retain the release history.
   *
   * @schema HelmReleaseV2Beta1SpecUninstall#keepHistory
   */
  readonly keepHistory?: boolean;

  /**
   * 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'.
   *
   * @default HelmReleaseSpec.Timeout'.
   * @schema HelmReleaseV2Beta1SpecUninstall#timeout
   */
  readonly timeout?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecUninstall' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecUninstall(obj: HelmReleaseV2Beta1SpecUninstall | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'deletionPropagation': obj.deletionPropagation,
    'disableHooks': obj.disableHooks,
    'disableWait': obj.disableWait,
    'keepHistory': obj.keepHistory,
    'timeout': obj.timeout,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Upgrade holds the configuration for Helm upgrade actions for this HelmRelease.
 *
 * @schema HelmReleaseV2Beta1SpecUpgrade
 */
export interface HelmReleaseV2Beta1SpecUpgrade {
  /**
   * CleanupOnFail allows deletion of new resources created during the Helm
   * upgrade action when it fails.
   *
   * @schema HelmReleaseV2Beta1SpecUpgrade#cleanupOnFail
   */
  readonly cleanupOnFail?: boolean;

  /**
   * 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.
   *
   * @default Skip` and if omitted
   * @schema HelmReleaseV2Beta1SpecUpgrade#crds
   */
  readonly crds?: HelmReleaseV2Beta1SpecUpgradeCrds;

  /**
   * DisableHooks prevents hooks from running during the Helm upgrade action.
   *
   * @schema HelmReleaseV2Beta1SpecUpgrade#disableHooks
   */
  readonly disableHooks?: boolean;

  /**
   * DisableOpenAPIValidation prevents the Helm upgrade action from validating
   * rendered templates against the Kubernetes OpenAPI Schema.
   *
   * @schema HelmReleaseV2Beta1SpecUpgrade#disableOpenAPIValidation
   */
  readonly disableOpenApiValidation?: boolean;

  /**
   * DisableWait disables the waiting for resources to be ready after a Helm
   * upgrade has been performed.
   *
   * @schema HelmReleaseV2Beta1SpecUpgrade#disableWait
   */
  readonly disableWait?: boolean;

  /**
   * DisableWaitForJobs disables waiting for jobs to complete after a Helm
   * upgrade has been performed.
   *
   * @schema HelmReleaseV2Beta1SpecUpgrade#disableWaitForJobs
   */
  readonly disableWaitForJobs?: boolean;

  /**
   * Force forces resource updates through a replacement strategy.
   *
   * @schema HelmReleaseV2Beta1SpecUpgrade#force
   */
  readonly force?: boolean;

  /**
   * PreserveValues will make Helm reuse the last release's values and merge in
   * overrides from 'Values'. Setting this flag makes the HelmRelease
   * non-declarative.
   *
   * @schema HelmReleaseV2Beta1SpecUpgrade#preserveValues
   */
  readonly preserveValues?: boolean;

  /**
   * Remediation holds the remediation configuration for when the Helm upgrade
   * action for the HelmRelease fails. The default is to not perform any action.
   *
   * @schema HelmReleaseV2Beta1SpecUpgrade#remediation
   */
  readonly remediation?: HelmReleaseV2Beta1SpecUpgradeRemediation;

  /**
   * 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'.
   *
   * @default HelmReleaseSpec.Timeout'.
   * @schema HelmReleaseV2Beta1SpecUpgrade#timeout
   */
  readonly timeout?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecUpgrade' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecUpgrade(obj: HelmReleaseV2Beta1SpecUpgrade | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'cleanupOnFail': obj.cleanupOnFail,
    'crds': obj.crds,
    'disableHooks': obj.disableHooks,
    'disableOpenAPIValidation': obj.disableOpenApiValidation,
    'disableWait': obj.disableWait,
    'disableWaitForJobs': obj.disableWaitForJobs,
    'force': obj.force,
    'preserveValues': obj.preserveValues,
    'remediation': toJson_HelmReleaseV2Beta1SpecUpgradeRemediation(obj.remediation),
    'timeout': obj.timeout,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * ValuesReference contains a reference to a resource containing Helm values,
 * and optionally the key they can be found at.
 *
 * @schema HelmReleaseV2Beta1SpecValuesFrom
 */
export interface HelmReleaseV2Beta1SpecValuesFrom {
  /**
   * Kind of the values referent, valid values are ('Secret', 'ConfigMap').
   *
   * @schema HelmReleaseV2Beta1SpecValuesFrom#kind
   */
  readonly kind: HelmReleaseV2Beta1SpecValuesFromKind;

  /**
   * Name of the values referent. Should reside in the same namespace as the
   * referring resource.
   *
   * @schema HelmReleaseV2Beta1SpecValuesFrom#name
   */
  readonly 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.
   *
   * @schema HelmReleaseV2Beta1SpecValuesFrom#optional
   */
  readonly optional?: boolean;

  /**
   * 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.
   *
   * @default None',
   * @schema HelmReleaseV2Beta1SpecValuesFrom#targetPath
   */
  readonly targetPath?: 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 '.'.
   *
   * @default values.yaml'.
   * @schema HelmReleaseV2Beta1SpecValuesFrom#valuesKey
   */
  readonly valuesKey?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecValuesFrom' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecValuesFrom(obj: HelmReleaseV2Beta1SpecValuesFrom | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'kind': obj.kind,
    'name': obj.name,
    'optional': obj.optional,
    'targetPath': obj.targetPath,
    'valuesKey': obj.valuesKey,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * ObjectMeta holds the template for metadata like labels and annotations.
 *
 * @schema HelmReleaseV2Beta1SpecChartMetadata
 */
export interface HelmReleaseV2Beta1SpecChartMetadata {
  /**
   * 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/
   *
   * @schema HelmReleaseV2Beta1SpecChartMetadata#annotations
   */
  readonly annotations?: { [key: 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/
   *
   * @schema HelmReleaseV2Beta1SpecChartMetadata#labels
   */
  readonly labels?: { [key: string]: string };

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecChartMetadata' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecChartMetadata(obj: HelmReleaseV2Beta1SpecChartMetadata | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'annotations': ((obj.annotations) === undefined) ? undefined : (Object.entries(obj.annotations).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {})),
    'labels': ((obj.labels) === undefined) ? undefined : (Object.entries(obj.labels).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {})),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Spec holds the template for the v1beta2.HelmChartSpec for this HelmRelease.
 *
 * @schema HelmReleaseV2Beta1SpecChartSpec
 */
export interface HelmReleaseV2Beta1SpecChartSpec {
  /**
   * The name or path the Helm chart is available at in the SourceRef.
   *
   * @schema HelmReleaseV2Beta1SpecChartSpec#chart
   */
  readonly chart: string;

  /**
   * Interval at which to check the v1beta2.Source for updates. Defaults to
   * 'HelmReleaseSpec.Interval'.
   *
   * @default HelmReleaseSpec.Interval'.
   * @schema HelmReleaseV2Beta1SpecChartSpec#interval
   */
  readonly interval?: 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.
   *
   * @default ChartVersion when omitted.
   * @schema HelmReleaseV2Beta1SpecChartSpec#reconcileStrategy
   */
  readonly reconcileStrategy?: HelmReleaseV2Beta1SpecChartSpecReconcileStrategy;

  /**
   * The name and namespace of the v1beta2.Source the chart is available at.
   *
   * @schema HelmReleaseV2Beta1SpecChartSpec#sourceRef
   */
  readonly sourceRef: HelmReleaseV2Beta1SpecChartSpecSourceRef;

  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta1SpecChartSpec#valuesFile
   */
  readonly valuesFile?: 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.
   *
   * @schema HelmReleaseV2Beta1SpecChartSpec#valuesFiles
   */
  readonly valuesFiles?: 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.
   *
   * @schema HelmReleaseV2Beta1SpecChartSpec#verify
   */
  readonly verify?: HelmReleaseV2Beta1SpecChartSpecVerify;

  /**
   * Version semver expression, ignored for charts from v1beta2.GitRepository and
   * v1beta2.Bucket sources. Defaults to latest when omitted.
   *
   * @default latest when omitted.
   * @schema HelmReleaseV2Beta1SpecChartSpec#version
   */
  readonly version?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecChartSpec' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecChartSpec(obj: HelmReleaseV2Beta1SpecChartSpec | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'chart': obj.chart,
    'interval': obj.interval,
    'reconcileStrategy': obj.reconcileStrategy,
    'sourceRef': toJson_HelmReleaseV2Beta1SpecChartSpecSourceRef(obj.sourceRef),
    'valuesFile': obj.valuesFile,
    'valuesFiles': obj.valuesFiles?.map(y => y),
    'verify': toJson_HelmReleaseV2Beta1SpecChartSpecVerify(obj.verify),
    'version': obj.version,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Kind of the referent.
 *
 * @schema HelmReleaseV2Beta1SpecChartRefKind
 */
export enum HelmReleaseV2Beta1SpecChartRefKind {
  /** OCIRepository */
  OCI_REPOSITORY = "OCIRepository",
  /** HelmChart */
  HELM_CHART = "HelmChart",
}

/**
 * IgnoreRule defines a rule to selectively disregard specific changes during
 * the drift detection process.
 *
 * @schema HelmReleaseV2Beta1SpecDriftDetectionIgnore
 */
export interface HelmReleaseV2Beta1SpecDriftDetectionIgnore {
  /**
   * Paths is a list of JSON Pointer (RFC 6901) paths to be excluded from
   * consideration in a Kubernetes object.
   *
   * @schema HelmReleaseV2Beta1SpecDriftDetectionIgnore#paths
   */
  readonly paths: 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.
   *
   * @schema HelmReleaseV2Beta1SpecDriftDetectionIgnore#target
   */
  readonly target?: HelmReleaseV2Beta1SpecDriftDetectionIgnoreTarget;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecDriftDetectionIgnore' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecDriftDetectionIgnore(obj: HelmReleaseV2Beta1SpecDriftDetectionIgnore | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'paths': obj.paths?.map(y => y),
    'target': toJson_HelmReleaseV2Beta1SpecDriftDetectionIgnoreTarget(obj.target),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * 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.
 *
 * @schema HelmReleaseV2Beta1SpecDriftDetectionMode
 */
export enum HelmReleaseV2Beta1SpecDriftDetectionMode {
  /** enabled */
  ENABLED = "enabled",
  /** warn */
  WARN = "warn",
  /** disabled */
  DISABLED = "disabled",
}

/**
 * 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.
 *
 * @default Create` and if omitted
 * @schema HelmReleaseV2Beta1SpecInstallCrds
 */
export enum HelmReleaseV2Beta1SpecInstallCrds {
  /** Skip */
  SKIP = "Skip",
  /** Create */
  CREATE = "Create",
  /** CreateReplace */
  CREATE_REPLACE = "CreateReplace",
}

/**
 * Remediation holds the remediation configuration for when the Helm install
 * action for the HelmRelease fails. The default is to not perform any action.
 *
 * @schema HelmReleaseV2Beta1SpecInstallRemediation
 */
export interface HelmReleaseV2Beta1SpecInstallRemediation {
  /**
   * IgnoreTestFailures tells the controller to skip remediation when the Helm
   * tests are run after an install action but fail. Defaults to
   * 'Test.IgnoreFailures'.
   *
   * @default Test.IgnoreFailures'.
   * @schema HelmReleaseV2Beta1SpecInstallRemediation#ignoreTestFailures
   */
  readonly ignoreTestFailures?: boolean;

  /**
   * RemediateLastFailure tells the controller to remediate the last failure, when
   * no retries remain. Defaults to 'false'.
   *
   * @default false'.
   * @schema HelmReleaseV2Beta1SpecInstallRemediation#remediateLastFailure
   */
  readonly remediateLastFailure?: boolean;

  /**
   * 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.
   *
   * @default 0', a negative integer equals to unlimited retries.
   * @schema HelmReleaseV2Beta1SpecInstallRemediation#retries
   */
  readonly retries?: number;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecInstallRemediation' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecInstallRemediation(obj: HelmReleaseV2Beta1SpecInstallRemediation | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'ignoreTestFailures': obj.ignoreTestFailures,
    'remediateLastFailure': obj.remediateLastFailure,
    'retries': obj.retries,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * SecretRef holds the 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'.
 * 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.
 *
 * @schema HelmReleaseV2Beta1SpecKubeConfigSecretRef
 */
export interface HelmReleaseV2Beta1SpecKubeConfigSecretRef {
  /**
   * Key in the Secret, when not specified an implementation-specific default key is used.
   *
   * @schema HelmReleaseV2Beta1SpecKubeConfigSecretRef#key
   */
  readonly key?: string;

  /**
   * Name of the Secret.
   *
   * @schema HelmReleaseV2Beta1SpecKubeConfigSecretRef#name
   */
  readonly name: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecKubeConfigSecretRef' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecKubeConfigSecretRef(obj: HelmReleaseV2Beta1SpecKubeConfigSecretRef | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'key': obj.key,
    'name': obj.name,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Kustomization to apply as PostRenderer.
 *
 * @schema HelmReleaseV2Beta1SpecPostRenderersKustomize
 */
export interface HelmReleaseV2Beta1SpecPostRenderersKustomize {
  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomize#images
   */
  readonly images?: HelmReleaseV2Beta1SpecPostRenderersKustomizeImages[];

  /**
   * Strategic merge and JSON patches, defined as inline YAML objects,
   * capable of targeting objects based on kind, label and annotation selectors.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomize#patches
   */
  readonly patches?: HelmReleaseV2Beta1SpecPostRenderersKustomizePatches[];

  /**
   * JSON 6902 patches, defined as inline YAML objects.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomize#patchesJson6902
   */
  readonly patchesJson6902?: HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902[];

  /**
   * Strategic merge patches, defined as inline YAML objects.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomize#patchesStrategicMerge
   */
  readonly patchesStrategicMerge?: any[];

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecPostRenderersKustomize' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecPostRenderersKustomize(obj: HelmReleaseV2Beta1SpecPostRenderersKustomize | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'images': obj.images?.map(y => toJson_HelmReleaseV2Beta1SpecPostRenderersKustomizeImages(y)),
    'patches': obj.patches?.map(y => toJson_HelmReleaseV2Beta1SpecPostRenderersKustomizePatches(y)),
    'patchesJson6902': obj.patchesJson6902?.map(y => toJson_HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902(y)),
    'patchesStrategicMerge': obj.patchesStrategicMerge?.map(y => y),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * DeletionPropagation specifies the deletion propagation policy when
 * a Helm uninstall is performed.
 *
 * @schema HelmReleaseV2Beta1SpecUninstallDeletionPropagation
 */
export enum HelmReleaseV2Beta1SpecUninstallDeletionPropagation {
  /** background */
  BACKGROUND = "background",
  /** foreground */
  FOREGROUND = "foreground",
  /** orphan */
  ORPHAN = "orphan",
}

/**
 * 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.
 *
 * @default Skip` and if omitted
 * @schema HelmReleaseV2Beta1SpecUpgradeCrds
 */
export enum HelmReleaseV2Beta1SpecUpgradeCrds {
  /** Skip */
  SKIP = "Skip",
  /** Create */
  CREATE = "Create",
  /** CreateReplace */
  CREATE_REPLACE = "CreateReplace",
}

/**
 * Remediation holds the remediation configuration for when the Helm upgrade
 * action for the HelmRelease fails. The default is to not perform any action.
 *
 * @schema HelmReleaseV2Beta1SpecUpgradeRemediation
 */
export interface HelmReleaseV2Beta1SpecUpgradeRemediation {
  /**
   * IgnoreTestFailures tells the controller to skip remediation when the Helm
   * tests are run after an upgrade action but fail.
   * Defaults to 'Test.IgnoreFailures'.
   *
   * @default Test.IgnoreFailures'.
   * @schema HelmReleaseV2Beta1SpecUpgradeRemediation#ignoreTestFailures
   */
  readonly ignoreTestFailures?: boolean;

  /**
   * RemediateLastFailure tells the controller to remediate the last failure, when
   * no retries remain. Defaults to 'false' unless 'Retries' is greater than 0.
   *
   * @default false' unless 'Retries' is greater than 0.
   * @schema HelmReleaseV2Beta1SpecUpgradeRemediation#remediateLastFailure
   */
  readonly remediateLastFailure?: boolean;

  /**
   * 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.
   *
   * @default 0', a negative integer equals to unlimited retries.
   * @schema HelmReleaseV2Beta1SpecUpgradeRemediation#retries
   */
  readonly retries?: number;

  /**
   * Strategy to use for failure remediation. Defaults to 'rollback'.
   *
   * @default rollback'.
   * @schema HelmReleaseV2Beta1SpecUpgradeRemediation#strategy
   */
  readonly strategy?: HelmReleaseV2Beta1SpecUpgradeRemediationStrategy;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecUpgradeRemediation' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecUpgradeRemediation(obj: HelmReleaseV2Beta1SpecUpgradeRemediation | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'ignoreTestFailures': obj.ignoreTestFailures,
    'remediateLastFailure': obj.remediateLastFailure,
    'retries': obj.retries,
    'strategy': obj.strategy,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Kind of the values referent, valid values are ('Secret', 'ConfigMap').
 *
 * @schema HelmReleaseV2Beta1SpecValuesFromKind
 */
export enum HelmReleaseV2Beta1SpecValuesFromKind {
  /** Secret */
  SECRET = "Secret",
  /** ConfigMap */
  CONFIG_MAP = "ConfigMap",
}

/**
 * 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.
 *
 * @default ChartVersion when omitted.
 * @schema HelmReleaseV2Beta1SpecChartSpecReconcileStrategy
 */
export enum HelmReleaseV2Beta1SpecChartSpecReconcileStrategy {
  /** ChartVersion */
  CHART_VERSION = "ChartVersion",
  /** Revision */
  REVISION = "Revision",
}

/**
 * The name and namespace of the v1beta2.Source the chart is available at.
 *
 * @schema HelmReleaseV2Beta1SpecChartSpecSourceRef
 */
export interface HelmReleaseV2Beta1SpecChartSpecSourceRef {
  /**
   * APIVersion of the referent.
   *
   * @schema HelmReleaseV2Beta1SpecChartSpecSourceRef#apiVersion
   */
  readonly apiVersion?: string;

  /**
   * Kind of the referent.
   *
   * @schema HelmReleaseV2Beta1SpecChartSpecSourceRef#kind
   */
  readonly kind: HelmReleaseV2Beta1SpecChartSpecSourceRefKind;

  /**
   * Name of the referent.
   *
   * @schema HelmReleaseV2Beta1SpecChartSpecSourceRef#name
   */
  readonly name: string;

  /**
   * Namespace of the referent.
   *
   * @schema HelmReleaseV2Beta1SpecChartSpecSourceRef#namespace
   */
  readonly namespace?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecChartSpecSourceRef' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecChartSpecSourceRef(obj: HelmReleaseV2Beta1SpecChartSpecSourceRef | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'apiVersion': obj.apiVersion,
    'kind': obj.kind,
    'name': obj.name,
    'namespace': obj.namespace,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * 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.
 *
 * @schema HelmReleaseV2Beta1SpecChartSpecVerify
 */
export interface HelmReleaseV2Beta1SpecChartSpecVerify {
  /**
   * Provider specifies the technology used to sign the OCI Helm chart.
   *
   * @schema HelmReleaseV2Beta1SpecChartSpecVerify#provider
   */
  readonly provider: HelmReleaseV2Beta1SpecChartSpecVerifyProvider;

  /**
   * SecretRef specifies the Kubernetes Secret containing the
   * trusted public keys.
   *
   * @schema HelmReleaseV2Beta1SpecChartSpecVerify#secretRef
   */
  readonly secretRef?: HelmReleaseV2Beta1SpecChartSpecVerifySecretRef;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecChartSpecVerify' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecChartSpecVerify(obj: HelmReleaseV2Beta1SpecChartSpecVerify | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'provider': obj.provider,
    'secretRef': toJson_HelmReleaseV2Beta1SpecChartSpecVerifySecretRef(obj.secretRef),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * 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.
 *
 * @schema HelmReleaseV2Beta1SpecDriftDetectionIgnoreTarget
 */
export interface HelmReleaseV2Beta1SpecDriftDetectionIgnoreTarget {
  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta1SpecDriftDetectionIgnoreTarget#annotationSelector
   */
  readonly annotationSelector?: 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
   *
   * @schema HelmReleaseV2Beta1SpecDriftDetectionIgnoreTarget#group
   */
  readonly group?: 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
   *
   * @schema HelmReleaseV2Beta1SpecDriftDetectionIgnoreTarget#kind
   */
  readonly kind?: 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.
   *
   * @schema HelmReleaseV2Beta1SpecDriftDetectionIgnoreTarget#labelSelector
   */
  readonly labelSelector?: string;

  /**
   * Name to match resources with.
   *
   * @schema HelmReleaseV2Beta1SpecDriftDetectionIgnoreTarget#name
   */
  readonly name?: string;

  /**
   * Namespace to select resources from.
   *
   * @schema HelmReleaseV2Beta1SpecDriftDetectionIgnoreTarget#namespace
   */
  readonly namespace?: 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
   *
   * @schema HelmReleaseV2Beta1SpecDriftDetectionIgnoreTarget#version
   */
  readonly version?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecDriftDetectionIgnoreTarget' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecDriftDetectionIgnoreTarget(obj: HelmReleaseV2Beta1SpecDriftDetectionIgnoreTarget | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'annotationSelector': obj.annotationSelector,
    'group': obj.group,
    'kind': obj.kind,
    'labelSelector': obj.labelSelector,
    'name': obj.name,
    'namespace': obj.namespace,
    'version': obj.version,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Image contains an image name, a new name, a new tag or digest, which will replace the original name and tag.
 *
 * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizeImages
 */
export interface HelmReleaseV2Beta1SpecPostRenderersKustomizeImages {
  /**
   * Digest is the value used to replace the original image tag.
   * If digest is present NewTag value is ignored.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizeImages#digest
   */
  readonly digest?: string;

  /**
   * Name is a tag-less image name.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizeImages#name
   */
  readonly name: string;

  /**
   * NewName is the value used to replace the original name.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizeImages#newName
   */
  readonly newName?: string;

  /**
   * NewTag is the value used to replace the original tag.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizeImages#newTag
   */
  readonly newTag?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecPostRenderersKustomizeImages' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecPostRenderersKustomizeImages(obj: HelmReleaseV2Beta1SpecPostRenderersKustomizeImages | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'digest': obj.digest,
    'name': obj.name,
    'newName': obj.newName,
    'newTag': obj.newTag,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Patch contains an inline StrategicMerge or JSON6902 patch, and the target the patch should
 * be applied to.
 *
 * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatches
 */
export interface HelmReleaseV2Beta1SpecPostRenderersKustomizePatches {
  /**
   * Patch contains an inline StrategicMerge patch or an inline JSON6902 patch with
   * an array of operation objects.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatches#patch
   */
  readonly patch: string;

  /**
   * Target points to the resources that the patch document should be applied to.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatches#target
   */
  readonly target?: HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesTarget;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecPostRenderersKustomizePatches' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecPostRenderersKustomizePatches(obj: HelmReleaseV2Beta1SpecPostRenderersKustomizePatches | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'patch': obj.patch,
    'target': toJson_HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesTarget(obj.target),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * JSON6902Patch contains a JSON6902 patch and the target the patch should be applied to.
 *
 * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902
 */
export interface HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902 {
  /**
   * Patch contains the JSON6902 patch document with an array of operation objects.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902#patch
   */
  readonly patch: HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Patch[];

  /**
   * Target points to the resources that the patch document should be applied to.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902#target
   */
  readonly target: HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Target;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902(obj: HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902 | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'patch': obj.patch?.map(y => toJson_HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Patch(y)),
    'target': toJson_HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Target(obj.target),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Strategy to use for failure remediation. Defaults to 'rollback'.
 *
 * @default rollback'.
 * @schema HelmReleaseV2Beta1SpecUpgradeRemediationStrategy
 */
export enum HelmReleaseV2Beta1SpecUpgradeRemediationStrategy {
  /** rollback */
  ROLLBACK = "rollback",
  /** uninstall */
  UNINSTALL = "uninstall",
}

/**
 * Kind of the referent.
 *
 * @schema HelmReleaseV2Beta1SpecChartSpecSourceRefKind
 */
export enum HelmReleaseV2Beta1SpecChartSpecSourceRefKind {
  /** HelmRepository */
  HELM_REPOSITORY = "HelmRepository",
  /** GitRepository */
  GIT_REPOSITORY = "GitRepository",
  /** Bucket */
  BUCKET = "Bucket",
}

/**
 * Provider specifies the technology used to sign the OCI Helm chart.
 *
 * @schema HelmReleaseV2Beta1SpecChartSpecVerifyProvider
 */
export enum HelmReleaseV2Beta1SpecChartSpecVerifyProvider {
  /** cosign */
  COSIGN = "cosign",
}

/**
 * SecretRef specifies the Kubernetes Secret containing the
 * trusted public keys.
 *
 * @schema HelmReleaseV2Beta1SpecChartSpecVerifySecretRef
 */
export interface HelmReleaseV2Beta1SpecChartSpecVerifySecretRef {
  /**
   * Name of the referent.
   *
   * @schema HelmReleaseV2Beta1SpecChartSpecVerifySecretRef#name
   */
  readonly name: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecChartSpecVerifySecretRef' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecChartSpecVerifySecretRef(obj: HelmReleaseV2Beta1SpecChartSpecVerifySecretRef | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'name': obj.name,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Target points to the resources that the patch document should be applied to.
 *
 * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesTarget
 */
export interface HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesTarget {
  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesTarget#annotationSelector
   */
  readonly annotationSelector?: 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
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesTarget#group
   */
  readonly group?: 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
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesTarget#kind
   */
  readonly kind?: 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.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesTarget#labelSelector
   */
  readonly labelSelector?: string;

  /**
   * Name to match resources with.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesTarget#name
   */
  readonly name?: string;

  /**
   * Namespace to select resources from.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesTarget#namespace
   */
  readonly namespace?: 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
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesTarget#version
   */
  readonly version?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesTarget' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesTarget(obj: HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesTarget | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'annotationSelector': obj.annotationSelector,
    'group': obj.group,
    'kind': obj.kind,
    'labelSelector': obj.labelSelector,
    'name': obj.name,
    'namespace': obj.namespace,
    'version': obj.version,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * JSON6902 is a JSON6902 operation object.
 * https://datatracker.ietf.org/doc/html/rfc6902#section-4
 *
 * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Patch
 */
export interface HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Patch {
  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Patch#from
   */
  readonly from?: 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
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Patch#op
   */
  readonly op: HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902PatchOp;

  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Patch#path
   */
  readonly 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.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Patch#value
   */
  readonly value?: any;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Patch' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Patch(obj: HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Patch | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'from': obj.from,
    'op': obj.op,
    'path': obj.path,
    'value': obj.value,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Target points to the resources that the patch document should be applied to.
 *
 * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Target
 */
export interface HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Target {
  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Target#annotationSelector
   */
  readonly annotationSelector?: 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
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Target#group
   */
  readonly group?: 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
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Target#kind
   */
  readonly kind?: 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.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Target#labelSelector
   */
  readonly labelSelector?: string;

  /**
   * Name to match resources with.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Target#name
   */
  readonly name?: string;

  /**
   * Namespace to select resources from.
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Target#namespace
   */
  readonly namespace?: 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
   *
   * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Target#version
   */
  readonly version?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Target' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Target(obj: HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902Target | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'annotationSelector': obj.annotationSelector,
    'group': obj.group,
    'kind': obj.kind,
    'labelSelector': obj.labelSelector,
    'name': obj.name,
    'namespace': obj.namespace,
    'version': obj.version,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * 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
 *
 * @schema HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902PatchOp
 */
export enum HelmReleaseV2Beta1SpecPostRenderersKustomizePatchesJson6902PatchOp {
  /** test */
  TEST = "test",
  /** remove */
  REMOVE = "remove",
  /** add */
  ADD = "add",
  /** replace */
  REPLACE = "replace",
  /** move */
  MOVE = "move",
  /** copy */
  COPY = "copy",
}


/**
 * HelmRelease is the Schema for the helmreleases API
 *
 * @schema HelmReleaseV2Beta2
 */
export class HelmReleaseV2Beta2 extends ApiObject {
  /**
   * Returns the apiVersion and kind for "HelmReleaseV2Beta2"
   */
  public static readonly GVK: GroupVersionKind = {
    apiVersion: 'helm.toolkit.fluxcd.io/v2beta2',
    kind: 'HelmRelease',
  }

  /**
   * Renders a Kubernetes manifest for "HelmReleaseV2Beta2".
   *
   * This can be used to inline resource manifests inside other objects (e.g. as templates).
   *
   * @param props initialization props
   */
  public static manifest(props: HelmReleaseV2Beta2Props = {}): any {
    return {
      ...HelmReleaseV2Beta2.GVK,
      ...toJson_HelmReleaseV2Beta2Props(props),
    };
  }

  /**
   * Defines a "HelmReleaseV2Beta2" API object
   * @param scope the scope in which to define this object
   * @param id a scope-local name for the object
   * @param props initialization props
   */
  public constructor(scope: Construct, id: string, props: HelmReleaseV2Beta2Props = {}) {
    super(scope, id, {
      ...HelmReleaseV2Beta2.GVK,
      ...props,
    });
  }

  /**
   * Renders the object to Kubernetes JSON.
   */
  public toJson(): any {
    const resolved = super.toJson();

    return {
      ...HelmReleaseV2Beta2.GVK,
      ...toJson_HelmReleaseV2Beta2Props(resolved),
    };
  }
}

/**
 * HelmRelease is the Schema for the helmreleases API
 *
 * @schema HelmReleaseV2Beta2
 */
export interface HelmReleaseV2Beta2Props {
  /**
   * @schema HelmReleaseV2Beta2#metadata
   */
  readonly metadata?: ApiObjectMetadata;

  /**
   * HelmReleaseSpec defines the desired state of a Helm release.
   *
   * @schema HelmReleaseV2Beta2#spec
   */
  readonly spec?: HelmReleaseV2Beta2Spec;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2Props' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2Props(obj: HelmReleaseV2Beta2Props | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'metadata': obj.metadata,
    'spec': toJson_HelmReleaseV2Beta2Spec(obj.spec),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * HelmReleaseSpec defines the desired state of a Helm release.
 *
 * @schema HelmReleaseV2Beta2Spec
 */
export interface HelmReleaseV2Beta2Spec {
  /**
   * Chart defines the template of the v1beta2.HelmChart that should be created
   * for this HelmRelease.
   *
   * @schema HelmReleaseV2Beta2Spec#chart
   */
  readonly chart?: HelmReleaseV2Beta2SpecChart;

  /**
   * 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 v2beta2 HelmReleases.
   *
   * @schema HelmReleaseV2Beta2Spec#chartRef
   */
  readonly chartRef?: HelmReleaseV2Beta2SpecChartRef;

  /**
   * DependsOn may contain a meta.NamespacedObjectReference slice with
   * references to HelmRelease resources that must be ready before this HelmRelease
   * can be reconciled.
   *
   * @schema HelmReleaseV2Beta2Spec#dependsOn
   */
  readonly dependsOn?: HelmReleaseV2Beta2SpecDependsOn[];

  /**
   * DriftDetection holds the configuration for detecting and handling
   * differences between the manifest in the Helm storage and the resources
   * currently existing in the cluster.
   *
   * @schema HelmReleaseV2Beta2Spec#driftDetection
   */
  readonly driftDetection?: HelmReleaseV2Beta2SpecDriftDetection;

  /**
   * Install holds the configuration for Helm install actions for this HelmRelease.
   *
   * @schema HelmReleaseV2Beta2Spec#install
   */
  readonly install?: HelmReleaseV2Beta2SpecInstall;

  /**
   * Interval at which to reconcile the Helm release.
   *
   * @schema HelmReleaseV2Beta2Spec#interval
   */
  readonly 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.
   *
   * @schema HelmReleaseV2Beta2Spec#kubeConfig
   */
  readonly kubeConfig?: HelmReleaseV2Beta2SpecKubeConfig;

  /**
   * MaxHistory is the number of revisions saved by Helm for this HelmRelease.
   * Use '0' for an unlimited number of revisions; defaults to '5'.
   *
   * @schema HelmReleaseV2Beta2Spec#maxHistory
   */
  readonly maxHistory?: number;

  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta2Spec#persistentClient
   */
  readonly persistentClient?: boolean;

  /**
   * PostRenderers holds an array of Helm PostRenderers, which will be applied in order
   * of their definition.
   *
   * @schema HelmReleaseV2Beta2Spec#postRenderers
   */
  readonly postRenderers?: HelmReleaseV2Beta2SpecPostRenderers[];

  /**
   * ReleaseName used for the Helm release. Defaults to a composition of
   * '[TargetNamespace-]Name'.
   *
   * @default a composition of
   * @schema HelmReleaseV2Beta2Spec#releaseName
   */
  readonly releaseName?: string;

  /**
   * Rollback holds the configuration for Helm rollback actions for this HelmRelease.
   *
   * @schema HelmReleaseV2Beta2Spec#rollback
   */
  readonly rollback?: HelmReleaseV2Beta2SpecRollback;

  /**
   * The name of the Kubernetes service account to impersonate
   * when reconciling this HelmRelease.
   *
   * @schema HelmReleaseV2Beta2Spec#serviceAccountName
   */
  readonly serviceAccountName?: string;

  /**
   * StorageNamespace used for the Helm storage.
   * Defaults to the namespace of the HelmRelease.
   *
   * @default the namespace of the HelmRelease.
   * @schema HelmReleaseV2Beta2Spec#storageNamespace
   */
  readonly storageNamespace?: string;

  /**
   * Suspend tells the controller to suspend reconciliation for this HelmRelease,
   * it does not apply to already started reconciliations. Defaults to false.
   *
   * @default false.
   * @schema HelmReleaseV2Beta2Spec#suspend
   */
  readonly suspend?: boolean;

  /**
   * TargetNamespace to target when performing operations for the HelmRelease.
   * Defaults to the namespace of the HelmRelease.
   *
   * @default the namespace of the HelmRelease.
   * @schema HelmReleaseV2Beta2Spec#targetNamespace
   */
  readonly targetNamespace?: string;

  /**
   * Test holds the configuration for Helm test actions for this HelmRelease.
   *
   * @schema HelmReleaseV2Beta2Spec#test
   */
  readonly test?: HelmReleaseV2Beta2SpecTest;

  /**
   * 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'.
   *
   * @default 5m0s'.
   * @schema HelmReleaseV2Beta2Spec#timeout
   */
  readonly timeout?: string;

  /**
   * Uninstall holds the configuration for Helm uninstall actions for this HelmRelease.
   *
   * @schema HelmReleaseV2Beta2Spec#uninstall
   */
  readonly uninstall?: HelmReleaseV2Beta2SpecUninstall;

  /**
   * Upgrade holds the configuration for Helm upgrade actions for this HelmRelease.
   *
   * @schema HelmReleaseV2Beta2Spec#upgrade
   */
  readonly upgrade?: HelmReleaseV2Beta2SpecUpgrade;

  /**
   * Values holds the values for this Helm release.
   *
   * @schema HelmReleaseV2Beta2Spec#values
   */
  readonly values?: any;

  /**
   * ValuesFrom holds references to resources containing Helm values for this HelmRelease,
   * and information about how they should be merged.
   *
   * @schema HelmReleaseV2Beta2Spec#valuesFrom
   */
  readonly valuesFrom?: HelmReleaseV2Beta2SpecValuesFrom[];

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2Spec' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2Spec(obj: HelmReleaseV2Beta2Spec | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'chart': toJson_HelmReleaseV2Beta2SpecChart(obj.chart),
    'chartRef': toJson_HelmReleaseV2Beta2SpecChartRef(obj.chartRef),
    'dependsOn': obj.dependsOn?.map(y => toJson_HelmReleaseV2Beta2SpecDependsOn(y)),
    'driftDetection': toJson_HelmReleaseV2Beta2SpecDriftDetection(obj.driftDetection),
    'install': toJson_HelmReleaseV2Beta2SpecInstall(obj.install),
    'interval': obj.interval,
    'kubeConfig': toJson_HelmReleaseV2Beta2SpecKubeConfig(obj.kubeConfig),
    'maxHistory': obj.maxHistory,
    'persistentClient': obj.persistentClient,
    'postRenderers': obj.postRenderers?.map(y => toJson_HelmReleaseV2Beta2SpecPostRenderers(y)),
    'releaseName': obj.releaseName,
    'rollback': toJson_HelmReleaseV2Beta2SpecRollback(obj.rollback),
    'serviceAccountName': obj.serviceAccountName,
    'storageNamespace': obj.storageNamespace,
    'suspend': obj.suspend,
    'targetNamespace': obj.targetNamespace,
    'test': toJson_HelmReleaseV2Beta2SpecTest(obj.test),
    'timeout': obj.timeout,
    'uninstall': toJson_HelmReleaseV2Beta2SpecUninstall(obj.uninstall),
    'upgrade': toJson_HelmReleaseV2Beta2SpecUpgrade(obj.upgrade),
    'values': obj.values,
    'valuesFrom': obj.valuesFrom?.map(y => toJson_HelmReleaseV2Beta2SpecValuesFrom(y)),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Chart defines the template of the v1beta2.HelmChart that should be created
 * for this HelmRelease.
 *
 * @schema HelmReleaseV2Beta2SpecChart
 */
export interface HelmReleaseV2Beta2SpecChart {
  /**
   * ObjectMeta holds the template for metadata like labels and annotations.
   *
   * @schema HelmReleaseV2Beta2SpecChart#metadata
   */
  readonly metadata?: HelmReleaseV2Beta2SpecChartMetadata;

  /**
   * Spec holds the template for the v1beta2.HelmChartSpec for this HelmRelease.
   *
   * @schema HelmReleaseV2Beta2SpecChart#spec
   */
  readonly spec: HelmReleaseV2Beta2SpecChartSpec;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecChart' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecChart(obj: HelmReleaseV2Beta2SpecChart | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'metadata': toJson_HelmReleaseV2Beta2SpecChartMetadata(obj.metadata),
    'spec': toJson_HelmReleaseV2Beta2SpecChartSpec(obj.spec),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * 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 v2beta2 HelmReleases.
 *
 * @schema HelmReleaseV2Beta2SpecChartRef
 */
export interface HelmReleaseV2Beta2SpecChartRef {
  /**
   * APIVersion of the referent.
   *
   * @schema HelmReleaseV2Beta2SpecChartRef#apiVersion
   */
  readonly apiVersion?: string;

  /**
   * Kind of the referent.
   *
   * @schema HelmReleaseV2Beta2SpecChartRef#kind
   */
  readonly kind: HelmReleaseV2Beta2SpecChartRefKind;

  /**
   * Name of the referent.
   *
   * @schema HelmReleaseV2Beta2SpecChartRef#name
   */
  readonly name: string;

  /**
   * Namespace of the referent, defaults to the namespace of the Kubernetes
   * resource object that contains the reference.
   *
   * @schema HelmReleaseV2Beta2SpecChartRef#namespace
   */
  readonly namespace?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecChartRef' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecChartRef(obj: HelmReleaseV2Beta2SpecChartRef | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'apiVersion': obj.apiVersion,
    'kind': obj.kind,
    'name': obj.name,
    'namespace': obj.namespace,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * NamespacedObjectReference contains enough information to locate the referenced Kubernetes resource object in any
 * namespace.
 *
 * @schema HelmReleaseV2Beta2SpecDependsOn
 */
export interface HelmReleaseV2Beta2SpecDependsOn {
  /**
   * Name of the referent.
   *
   * @schema HelmReleaseV2Beta2SpecDependsOn#name
   */
  readonly name: string;

  /**
   * Namespace of the referent, when not specified it acts as LocalObjectReference.
   *
   * @schema HelmReleaseV2Beta2SpecDependsOn#namespace
   */
  readonly namespace?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecDependsOn' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecDependsOn(obj: HelmReleaseV2Beta2SpecDependsOn | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'name': obj.name,
    'namespace': obj.namespace,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * DriftDetection holds the configuration for detecting and handling
 * differences between the manifest in the Helm storage and the resources
 * currently existing in the cluster.
 *
 * @schema HelmReleaseV2Beta2SpecDriftDetection
 */
export interface HelmReleaseV2Beta2SpecDriftDetection {
  /**
   * Ignore contains a list of rules for specifying which changes to ignore
   * during diffing.
   *
   * @schema HelmReleaseV2Beta2SpecDriftDetection#ignore
   */
  readonly ignore?: HelmReleaseV2Beta2SpecDriftDetectionIgnore[];

  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta2SpecDriftDetection#mode
   */
  readonly mode?: HelmReleaseV2Beta2SpecDriftDetectionMode;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecDriftDetection' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecDriftDetection(obj: HelmReleaseV2Beta2SpecDriftDetection | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'ignore': obj.ignore?.map(y => toJson_HelmReleaseV2Beta2SpecDriftDetectionIgnore(y)),
    'mode': obj.mode,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Install holds the configuration for Helm install actions for this HelmRelease.
 *
 * @schema HelmReleaseV2Beta2SpecInstall
 */
export interface HelmReleaseV2Beta2SpecInstall {
  /**
   * 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.
   *
   * @default Create` and if omitted
   * @schema HelmReleaseV2Beta2SpecInstall#crds
   */
  readonly crds?: HelmReleaseV2Beta2SpecInstallCrds;

  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta2SpecInstall#createNamespace
   */
  readonly createNamespace?: boolean;

  /**
   * DisableHooks prevents hooks from running during the Helm install action.
   *
   * @schema HelmReleaseV2Beta2SpecInstall#disableHooks
   */
  readonly disableHooks?: boolean;

  /**
   * DisableOpenAPIValidation prevents the Helm install action from validating
   * rendered templates against the Kubernetes OpenAPI Schema.
   *
   * @schema HelmReleaseV2Beta2SpecInstall#disableOpenAPIValidation
   */
  readonly disableOpenApiValidation?: boolean;

  /**
   * DisableWait disables the waiting for resources to be ready after a Helm
   * install has been performed.
   *
   * @schema HelmReleaseV2Beta2SpecInstall#disableWait
   */
  readonly disableWait?: boolean;

  /**
   * DisableWaitForJobs disables waiting for jobs to complete after a Helm
   * install has been performed.
   *
   * @schema HelmReleaseV2Beta2SpecInstall#disableWaitForJobs
   */
  readonly disableWaitForJobs?: boolean;

  /**
   * Remediation holds the remediation configuration for when the Helm install
   * action for the HelmRelease fails. The default is to not perform any action.
   *
   * @schema HelmReleaseV2Beta2SpecInstall#remediation
   */
  readonly remediation?: HelmReleaseV2Beta2SpecInstallRemediation;

  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta2SpecInstall#replace
   */
  readonly replace?: boolean;

  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta2SpecInstall#skipCRDs
   */
  readonly skipCrDs?: boolean;

  /**
   * 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'.
   *
   * @default HelmReleaseSpec.Timeout'.
   * @schema HelmReleaseV2Beta2SpecInstall#timeout
   */
  readonly timeout?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecInstall' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecInstall(obj: HelmReleaseV2Beta2SpecInstall | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'crds': obj.crds,
    'createNamespace': obj.createNamespace,
    'disableHooks': obj.disableHooks,
    'disableOpenAPIValidation': obj.disableOpenApiValidation,
    'disableWait': obj.disableWait,
    'disableWaitForJobs': obj.disableWaitForJobs,
    'remediation': toJson_HelmReleaseV2Beta2SpecInstallRemediation(obj.remediation),
    'replace': obj.replace,
    'skipCRDs': obj.skipCrDs,
    'timeout': obj.timeout,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * 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.
 *
 * @schema HelmReleaseV2Beta2SpecKubeConfig
 */
export interface HelmReleaseV2Beta2SpecKubeConfig {
  /**
   * SecretRef holds the 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'.
   * 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.
   *
   * @schema HelmReleaseV2Beta2SpecKubeConfig#secretRef
   */
  readonly secretRef: HelmReleaseV2Beta2SpecKubeConfigSecretRef;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecKubeConfig' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecKubeConfig(obj: HelmReleaseV2Beta2SpecKubeConfig | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'secretRef': toJson_HelmReleaseV2Beta2SpecKubeConfigSecretRef(obj.secretRef),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * PostRenderer contains a Helm PostRenderer specification.
 *
 * @schema HelmReleaseV2Beta2SpecPostRenderers
 */
export interface HelmReleaseV2Beta2SpecPostRenderers {
  /**
   * Kustomization to apply as PostRenderer.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderers#kustomize
   */
  readonly kustomize?: HelmReleaseV2Beta2SpecPostRenderersKustomize;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecPostRenderers' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecPostRenderers(obj: HelmReleaseV2Beta2SpecPostRenderers | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'kustomize': toJson_HelmReleaseV2Beta2SpecPostRenderersKustomize(obj.kustomize),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Rollback holds the configuration for Helm rollback actions for this HelmRelease.
 *
 * @schema HelmReleaseV2Beta2SpecRollback
 */
export interface HelmReleaseV2Beta2SpecRollback {
  /**
   * CleanupOnFail allows deletion of new resources created during the Helm
   * rollback action when it fails.
   *
   * @schema HelmReleaseV2Beta2SpecRollback#cleanupOnFail
   */
  readonly cleanupOnFail?: boolean;

  /**
   * DisableHooks prevents hooks from running during the Helm rollback action.
   *
   * @schema HelmReleaseV2Beta2SpecRollback#disableHooks
   */
  readonly disableHooks?: boolean;

  /**
   * DisableWait disables the waiting for resources to be ready after a Helm
   * rollback has been performed.
   *
   * @schema HelmReleaseV2Beta2SpecRollback#disableWait
   */
  readonly disableWait?: boolean;

  /**
   * DisableWaitForJobs disables waiting for jobs to complete after a Helm
   * rollback has been performed.
   *
   * @schema HelmReleaseV2Beta2SpecRollback#disableWaitForJobs
   */
  readonly disableWaitForJobs?: boolean;

  /**
   * Force forces resource updates through a replacement strategy.
   *
   * @schema HelmReleaseV2Beta2SpecRollback#force
   */
  readonly force?: boolean;

  /**
   * Recreate performs pod restarts for the resource if applicable.
   *
   * @schema HelmReleaseV2Beta2SpecRollback#recreate
   */
  readonly recreate?: boolean;

  /**
   * 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'.
   *
   * @default HelmReleaseSpec.Timeout'.
   * @schema HelmReleaseV2Beta2SpecRollback#timeout
   */
  readonly timeout?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecRollback' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecRollback(obj: HelmReleaseV2Beta2SpecRollback | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'cleanupOnFail': obj.cleanupOnFail,
    'disableHooks': obj.disableHooks,
    'disableWait': obj.disableWait,
    'disableWaitForJobs': obj.disableWaitForJobs,
    'force': obj.force,
    'recreate': obj.recreate,
    'timeout': obj.timeout,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Test holds the configuration for Helm test actions for this HelmRelease.
 *
 * @schema HelmReleaseV2Beta2SpecTest
 */
export interface HelmReleaseV2Beta2SpecTest {
  /**
   * Enable enables Helm test actions for this HelmRelease after an Helm install
   * or upgrade action has been performed.
   *
   * @schema HelmReleaseV2Beta2SpecTest#enable
   */
  readonly enable?: boolean;

  /**
   * Filters is a list of tests to run or exclude from running.
   *
   * @schema HelmReleaseV2Beta2SpecTest#filters
   */
  readonly filters?: HelmReleaseV2Beta2SpecTestFilters[];

  /**
   * 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'.
   *
   * @schema HelmReleaseV2Beta2SpecTest#ignoreFailures
   */
  readonly ignoreFailures?: boolean;

  /**
   * Timeout is the time to wait for any individual Kubernetes operation during
   * the performance of a Helm test action. Defaults to 'HelmReleaseSpec.Timeout'.
   *
   * @default HelmReleaseSpec.Timeout'.
   * @schema HelmReleaseV2Beta2SpecTest#timeout
   */
  readonly timeout?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecTest' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecTest(obj: HelmReleaseV2Beta2SpecTest | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'enable': obj.enable,
    'filters': obj.filters?.map(y => toJson_HelmReleaseV2Beta2SpecTestFilters(y)),
    'ignoreFailures': obj.ignoreFailures,
    'timeout': obj.timeout,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Uninstall holds the configuration for Helm uninstall actions for this HelmRelease.
 *
 * @schema HelmReleaseV2Beta2SpecUninstall
 */
export interface HelmReleaseV2Beta2SpecUninstall {
  /**
   * DeletionPropagation specifies the deletion propagation policy when
   * a Helm uninstall is performed.
   *
   * @schema HelmReleaseV2Beta2SpecUninstall#deletionPropagation
   */
  readonly deletionPropagation?: HelmReleaseV2Beta2SpecUninstallDeletionPropagation;

  /**
   * DisableHooks prevents hooks from running during the Helm rollback action.
   *
   * @schema HelmReleaseV2Beta2SpecUninstall#disableHooks
   */
  readonly disableHooks?: boolean;

  /**
   * DisableWait disables waiting for all the resources to be deleted after
   * a Helm uninstall is performed.
   *
   * @schema HelmReleaseV2Beta2SpecUninstall#disableWait
   */
  readonly disableWait?: boolean;

  /**
   * KeepHistory tells Helm to remove all associated resources and mark the
   * release as deleted, but retain the release history.
   *
   * @schema HelmReleaseV2Beta2SpecUninstall#keepHistory
   */
  readonly keepHistory?: boolean;

  /**
   * 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'.
   *
   * @default HelmReleaseSpec.Timeout'.
   * @schema HelmReleaseV2Beta2SpecUninstall#timeout
   */
  readonly timeout?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecUninstall' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecUninstall(obj: HelmReleaseV2Beta2SpecUninstall | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'deletionPropagation': obj.deletionPropagation,
    'disableHooks': obj.disableHooks,
    'disableWait': obj.disableWait,
    'keepHistory': obj.keepHistory,
    'timeout': obj.timeout,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Upgrade holds the configuration for Helm upgrade actions for this HelmRelease.
 *
 * @schema HelmReleaseV2Beta2SpecUpgrade
 */
export interface HelmReleaseV2Beta2SpecUpgrade {
  /**
   * CleanupOnFail allows deletion of new resources created during the Helm
   * upgrade action when it fails.
   *
   * @schema HelmReleaseV2Beta2SpecUpgrade#cleanupOnFail
   */
  readonly cleanupOnFail?: boolean;

  /**
   * 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.
   *
   * @default Skip` and if omitted
   * @schema HelmReleaseV2Beta2SpecUpgrade#crds
   */
  readonly crds?: HelmReleaseV2Beta2SpecUpgradeCrds;

  /**
   * DisableHooks prevents hooks from running during the Helm upgrade action.
   *
   * @schema HelmReleaseV2Beta2SpecUpgrade#disableHooks
   */
  readonly disableHooks?: boolean;

  /**
   * DisableOpenAPIValidation prevents the Helm upgrade action from validating
   * rendered templates against the Kubernetes OpenAPI Schema.
   *
   * @schema HelmReleaseV2Beta2SpecUpgrade#disableOpenAPIValidation
   */
  readonly disableOpenApiValidation?: boolean;

  /**
   * DisableWait disables the waiting for resources to be ready after a Helm
   * upgrade has been performed.
   *
   * @schema HelmReleaseV2Beta2SpecUpgrade#disableWait
   */
  readonly disableWait?: boolean;

  /**
   * DisableWaitForJobs disables waiting for jobs to complete after a Helm
   * upgrade has been performed.
   *
   * @schema HelmReleaseV2Beta2SpecUpgrade#disableWaitForJobs
   */
  readonly disableWaitForJobs?: boolean;

  /**
   * Force forces resource updates through a replacement strategy.
   *
   * @schema HelmReleaseV2Beta2SpecUpgrade#force
   */
  readonly force?: boolean;

  /**
   * PreserveValues will make Helm reuse the last release's values and merge in
   * overrides from 'Values'. Setting this flag makes the HelmRelease
   * non-declarative.
   *
   * @schema HelmReleaseV2Beta2SpecUpgrade#preserveValues
   */
  readonly preserveValues?: boolean;

  /**
   * Remediation holds the remediation configuration for when the Helm upgrade
   * action for the HelmRelease fails. The default is to not perform any action.
   *
   * @schema HelmReleaseV2Beta2SpecUpgrade#remediation
   */
  readonly remediation?: HelmReleaseV2Beta2SpecUpgradeRemediation;

  /**
   * 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'.
   *
   * @default HelmReleaseSpec.Timeout'.
   * @schema HelmReleaseV2Beta2SpecUpgrade#timeout
   */
  readonly timeout?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecUpgrade' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecUpgrade(obj: HelmReleaseV2Beta2SpecUpgrade | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'cleanupOnFail': obj.cleanupOnFail,
    'crds': obj.crds,
    'disableHooks': obj.disableHooks,
    'disableOpenAPIValidation': obj.disableOpenApiValidation,
    'disableWait': obj.disableWait,
    'disableWaitForJobs': obj.disableWaitForJobs,
    'force': obj.force,
    'preserveValues': obj.preserveValues,
    'remediation': toJson_HelmReleaseV2Beta2SpecUpgradeRemediation(obj.remediation),
    'timeout': obj.timeout,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * ValuesReference contains a reference to a resource containing Helm values,
 * and optionally the key they can be found at.
 *
 * @schema HelmReleaseV2Beta2SpecValuesFrom
 */
export interface HelmReleaseV2Beta2SpecValuesFrom {
  /**
   * Kind of the values referent, valid values are ('Secret', 'ConfigMap').
   *
   * @schema HelmReleaseV2Beta2SpecValuesFrom#kind
   */
  readonly kind: HelmReleaseV2Beta2SpecValuesFromKind;

  /**
   * Name of the values referent. Should reside in the same namespace as the
   * referring resource.
   *
   * @schema HelmReleaseV2Beta2SpecValuesFrom#name
   */
  readonly 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.
   *
   * @schema HelmReleaseV2Beta2SpecValuesFrom#optional
   */
  readonly optional?: boolean;

  /**
   * 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.
   *
   * @default None',
   * @schema HelmReleaseV2Beta2SpecValuesFrom#targetPath
   */
  readonly targetPath?: string;

  /**
   * ValuesKey is the data key where the values.yaml or a specific value can be
   * found at. Defaults to 'values.yaml'.
   *
   * @default values.yaml'.
   * @schema HelmReleaseV2Beta2SpecValuesFrom#valuesKey
   */
  readonly valuesKey?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecValuesFrom' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecValuesFrom(obj: HelmReleaseV2Beta2SpecValuesFrom | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'kind': obj.kind,
    'name': obj.name,
    'optional': obj.optional,
    'targetPath': obj.targetPath,
    'valuesKey': obj.valuesKey,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * ObjectMeta holds the template for metadata like labels and annotations.
 *
 * @schema HelmReleaseV2Beta2SpecChartMetadata
 */
export interface HelmReleaseV2Beta2SpecChartMetadata {
  /**
   * 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/
   *
   * @schema HelmReleaseV2Beta2SpecChartMetadata#annotations
   */
  readonly annotations?: { [key: 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/
   *
   * @schema HelmReleaseV2Beta2SpecChartMetadata#labels
   */
  readonly labels?: { [key: string]: string };

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecChartMetadata' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecChartMetadata(obj: HelmReleaseV2Beta2SpecChartMetadata | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'annotations': ((obj.annotations) === undefined) ? undefined : (Object.entries(obj.annotations).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {})),
    'labels': ((obj.labels) === undefined) ? undefined : (Object.entries(obj.labels).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {})),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Spec holds the template for the v1beta2.HelmChartSpec for this HelmRelease.
 *
 * @schema HelmReleaseV2Beta2SpecChartSpec
 */
export interface HelmReleaseV2Beta2SpecChartSpec {
  /**
   * The name or path the Helm chart is available at in the SourceRef.
   *
   * @schema HelmReleaseV2Beta2SpecChartSpec#chart
   */
  readonly chart: string;

  /**
   * IgnoreMissingValuesFiles controls whether to silently ignore missing values files rather than failing.
   *
   * @schema HelmReleaseV2Beta2SpecChartSpec#ignoreMissingValuesFiles
   */
  readonly ignoreMissingValuesFiles?: boolean;

  /**
   * Interval at which to check the v1.Source for updates. Defaults to
   * 'HelmReleaseSpec.Interval'.
   *
   * @default HelmReleaseSpec.Interval'.
   * @schema HelmReleaseV2Beta2SpecChartSpec#interval
   */
  readonly interval?: 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.
   *
   * @default ChartVersion when omitted.
   * @schema HelmReleaseV2Beta2SpecChartSpec#reconcileStrategy
   */
  readonly reconcileStrategy?: HelmReleaseV2Beta2SpecChartSpecReconcileStrategy;

  /**
   * The name and namespace of the v1.Source the chart is available at.
   *
   * @schema HelmReleaseV2Beta2SpecChartSpec#sourceRef
   */
  readonly sourceRef: HelmReleaseV2Beta2SpecChartSpecSourceRef;

  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta2SpecChartSpec#valuesFile
   */
  readonly valuesFile?: 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.
   *
   * @schema HelmReleaseV2Beta2SpecChartSpec#valuesFiles
   */
  readonly valuesFiles?: 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.
   *
   * @schema HelmReleaseV2Beta2SpecChartSpec#verify
   */
  readonly verify?: HelmReleaseV2Beta2SpecChartSpecVerify;

  /**
   * Version semver expression, ignored for charts from v1beta2.GitRepository and
   * v1beta2.Bucket sources. Defaults to latest when omitted.
   *
   * @default latest when omitted.
   * @schema HelmReleaseV2Beta2SpecChartSpec#version
   */
  readonly version?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecChartSpec' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecChartSpec(obj: HelmReleaseV2Beta2SpecChartSpec | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'chart': obj.chart,
    'ignoreMissingValuesFiles': obj.ignoreMissingValuesFiles,
    'interval': obj.interval,
    'reconcileStrategy': obj.reconcileStrategy,
    'sourceRef': toJson_HelmReleaseV2Beta2SpecChartSpecSourceRef(obj.sourceRef),
    'valuesFile': obj.valuesFile,
    'valuesFiles': obj.valuesFiles?.map(y => y),
    'verify': toJson_HelmReleaseV2Beta2SpecChartSpecVerify(obj.verify),
    'version': obj.version,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Kind of the referent.
 *
 * @schema HelmReleaseV2Beta2SpecChartRefKind
 */
export enum HelmReleaseV2Beta2SpecChartRefKind {
  /** OCIRepository */
  OCI_REPOSITORY = "OCIRepository",
  /** HelmChart */
  HELM_CHART = "HelmChart",
}

/**
 * IgnoreRule defines a rule to selectively disregard specific changes during
 * the drift detection process.
 *
 * @schema HelmReleaseV2Beta2SpecDriftDetectionIgnore
 */
export interface HelmReleaseV2Beta2SpecDriftDetectionIgnore {
  /**
   * Paths is a list of JSON Pointer (RFC 6901) paths to be excluded from
   * consideration in a Kubernetes object.
   *
   * @schema HelmReleaseV2Beta2SpecDriftDetectionIgnore#paths
   */
  readonly paths: 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.
   *
   * @schema HelmReleaseV2Beta2SpecDriftDetectionIgnore#target
   */
  readonly target?: HelmReleaseV2Beta2SpecDriftDetectionIgnoreTarget;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecDriftDetectionIgnore' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecDriftDetectionIgnore(obj: HelmReleaseV2Beta2SpecDriftDetectionIgnore | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'paths': obj.paths?.map(y => y),
    'target': toJson_HelmReleaseV2Beta2SpecDriftDetectionIgnoreTarget(obj.target),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * 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.
 *
 * @schema HelmReleaseV2Beta2SpecDriftDetectionMode
 */
export enum HelmReleaseV2Beta2SpecDriftDetectionMode {
  /** enabled */
  ENABLED = "enabled",
  /** warn */
  WARN = "warn",
  /** disabled */
  DISABLED = "disabled",
}

/**
 * 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.
 *
 * @default Create` and if omitted
 * @schema HelmReleaseV2Beta2SpecInstallCrds
 */
export enum HelmReleaseV2Beta2SpecInstallCrds {
  /** Skip */
  SKIP = "Skip",
  /** Create */
  CREATE = "Create",
  /** CreateReplace */
  CREATE_REPLACE = "CreateReplace",
}

/**
 * Remediation holds the remediation configuration for when the Helm install
 * action for the HelmRelease fails. The default is to not perform any action.
 *
 * @schema HelmReleaseV2Beta2SpecInstallRemediation
 */
export interface HelmReleaseV2Beta2SpecInstallRemediation {
  /**
   * IgnoreTestFailures tells the controller to skip remediation when the Helm
   * tests are run after an install action but fail. Defaults to
   * 'Test.IgnoreFailures'.
   *
   * @default Test.IgnoreFailures'.
   * @schema HelmReleaseV2Beta2SpecInstallRemediation#ignoreTestFailures
   */
  readonly ignoreTestFailures?: boolean;

  /**
   * RemediateLastFailure tells the controller to remediate the last failure, when
   * no retries remain. Defaults to 'false'.
   *
   * @default false'.
   * @schema HelmReleaseV2Beta2SpecInstallRemediation#remediateLastFailure
   */
  readonly remediateLastFailure?: boolean;

  /**
   * 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.
   *
   * @default 0', a negative integer equals to unlimited retries.
   * @schema HelmReleaseV2Beta2SpecInstallRemediation#retries
   */
  readonly retries?: number;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecInstallRemediation' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecInstallRemediation(obj: HelmReleaseV2Beta2SpecInstallRemediation | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'ignoreTestFailures': obj.ignoreTestFailures,
    'remediateLastFailure': obj.remediateLastFailure,
    'retries': obj.retries,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * SecretRef holds the 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'.
 * 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.
 *
 * @schema HelmReleaseV2Beta2SpecKubeConfigSecretRef
 */
export interface HelmReleaseV2Beta2SpecKubeConfigSecretRef {
  /**
   * Key in the Secret, when not specified an implementation-specific default key is used.
   *
   * @schema HelmReleaseV2Beta2SpecKubeConfigSecretRef#key
   */
  readonly key?: string;

  /**
   * Name of the Secret.
   *
   * @schema HelmReleaseV2Beta2SpecKubeConfigSecretRef#name
   */
  readonly name: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecKubeConfigSecretRef' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecKubeConfigSecretRef(obj: HelmReleaseV2Beta2SpecKubeConfigSecretRef | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'key': obj.key,
    'name': obj.name,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Kustomization to apply as PostRenderer.
 *
 * @schema HelmReleaseV2Beta2SpecPostRenderersKustomize
 */
export interface HelmReleaseV2Beta2SpecPostRenderersKustomize {
  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomize#images
   */
  readonly images?: HelmReleaseV2Beta2SpecPostRenderersKustomizeImages[];

  /**
   * Strategic merge and JSON patches, defined as inline YAML objects,
   * capable of targeting objects based on kind, label and annotation selectors.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomize#patches
   */
  readonly patches?: HelmReleaseV2Beta2SpecPostRenderersKustomizePatches[];

  /**
   * JSON 6902 patches, defined as inline YAML objects.
   * Deprecated: use Patches instead.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomize#patchesJson6902
   */
  readonly patchesJson6902?: HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902[];

  /**
   * Strategic merge patches, defined as inline YAML objects.
   * Deprecated: use Patches instead.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomize#patchesStrategicMerge
   */
  readonly patchesStrategicMerge?: any[];

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecPostRenderersKustomize' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecPostRenderersKustomize(obj: HelmReleaseV2Beta2SpecPostRenderersKustomize | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'images': obj.images?.map(y => toJson_HelmReleaseV2Beta2SpecPostRenderersKustomizeImages(y)),
    'patches': obj.patches?.map(y => toJson_HelmReleaseV2Beta2SpecPostRenderersKustomizePatches(y)),
    'patchesJson6902': obj.patchesJson6902?.map(y => toJson_HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902(y)),
    'patchesStrategicMerge': obj.patchesStrategicMerge?.map(y => y),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Filter holds the configuration for individual Helm test filters.
 *
 * @schema HelmReleaseV2Beta2SpecTestFilters
 */
export interface HelmReleaseV2Beta2SpecTestFilters {
  /**
   * Exclude specifies whether the named test should be excluded.
   *
   * @schema HelmReleaseV2Beta2SpecTestFilters#exclude
   */
  readonly exclude?: boolean;

  /**
   * Name is the name of the test.
   *
   * @schema HelmReleaseV2Beta2SpecTestFilters#name
   */
  readonly name: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecTestFilters' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecTestFilters(obj: HelmReleaseV2Beta2SpecTestFilters | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'exclude': obj.exclude,
    'name': obj.name,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * DeletionPropagation specifies the deletion propagation policy when
 * a Helm uninstall is performed.
 *
 * @schema HelmReleaseV2Beta2SpecUninstallDeletionPropagation
 */
export enum HelmReleaseV2Beta2SpecUninstallDeletionPropagation {
  /** background */
  BACKGROUND = "background",
  /** foreground */
  FOREGROUND = "foreground",
  /** orphan */
  ORPHAN = "orphan",
}

/**
 * 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.
 *
 * @default Skip` and if omitted
 * @schema HelmReleaseV2Beta2SpecUpgradeCrds
 */
export enum HelmReleaseV2Beta2SpecUpgradeCrds {
  /** Skip */
  SKIP = "Skip",
  /** Create */
  CREATE = "Create",
  /** CreateReplace */
  CREATE_REPLACE = "CreateReplace",
}

/**
 * Remediation holds the remediation configuration for when the Helm upgrade
 * action for the HelmRelease fails. The default is to not perform any action.
 *
 * @schema HelmReleaseV2Beta2SpecUpgradeRemediation
 */
export interface HelmReleaseV2Beta2SpecUpgradeRemediation {
  /**
   * IgnoreTestFailures tells the controller to skip remediation when the Helm
   * tests are run after an upgrade action but fail.
   * Defaults to 'Test.IgnoreFailures'.
   *
   * @default Test.IgnoreFailures'.
   * @schema HelmReleaseV2Beta2SpecUpgradeRemediation#ignoreTestFailures
   */
  readonly ignoreTestFailures?: boolean;

  /**
   * RemediateLastFailure tells the controller to remediate the last failure, when
   * no retries remain. Defaults to 'false' unless 'Retries' is greater than 0.
   *
   * @default false' unless 'Retries' is greater than 0.
   * @schema HelmReleaseV2Beta2SpecUpgradeRemediation#remediateLastFailure
   */
  readonly remediateLastFailure?: boolean;

  /**
   * 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.
   *
   * @default 0', a negative integer equals to unlimited retries.
   * @schema HelmReleaseV2Beta2SpecUpgradeRemediation#retries
   */
  readonly retries?: number;

  /**
   * Strategy to use for failure remediation. Defaults to 'rollback'.
   *
   * @default rollback'.
   * @schema HelmReleaseV2Beta2SpecUpgradeRemediation#strategy
   */
  readonly strategy?: HelmReleaseV2Beta2SpecUpgradeRemediationStrategy;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecUpgradeRemediation' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecUpgradeRemediation(obj: HelmReleaseV2Beta2SpecUpgradeRemediation | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'ignoreTestFailures': obj.ignoreTestFailures,
    'remediateLastFailure': obj.remediateLastFailure,
    'retries': obj.retries,
    'strategy': obj.strategy,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Kind of the values referent, valid values are ('Secret', 'ConfigMap').
 *
 * @schema HelmReleaseV2Beta2SpecValuesFromKind
 */
export enum HelmReleaseV2Beta2SpecValuesFromKind {
  /** Secret */
  SECRET = "Secret",
  /** ConfigMap */
  CONFIG_MAP = "ConfigMap",
}

/**
 * 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.
 *
 * @default ChartVersion when omitted.
 * @schema HelmReleaseV2Beta2SpecChartSpecReconcileStrategy
 */
export enum HelmReleaseV2Beta2SpecChartSpecReconcileStrategy {
  /** ChartVersion */
  CHART_VERSION = "ChartVersion",
  /** Revision */
  REVISION = "Revision",
}

/**
 * The name and namespace of the v1.Source the chart is available at.
 *
 * @schema HelmReleaseV2Beta2SpecChartSpecSourceRef
 */
export interface HelmReleaseV2Beta2SpecChartSpecSourceRef {
  /**
   * APIVersion of the referent.
   *
   * @schema HelmReleaseV2Beta2SpecChartSpecSourceRef#apiVersion
   */
  readonly apiVersion?: string;

  /**
   * Kind of the referent.
   *
   * @schema HelmReleaseV2Beta2SpecChartSpecSourceRef#kind
   */
  readonly kind: HelmReleaseV2Beta2SpecChartSpecSourceRefKind;

  /**
   * Name of the referent.
   *
   * @schema HelmReleaseV2Beta2SpecChartSpecSourceRef#name
   */
  readonly name: string;

  /**
   * Namespace of the referent.
   *
   * @schema HelmReleaseV2Beta2SpecChartSpecSourceRef#namespace
   */
  readonly namespace?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecChartSpecSourceRef' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecChartSpecSourceRef(obj: HelmReleaseV2Beta2SpecChartSpecSourceRef | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'apiVersion': obj.apiVersion,
    'kind': obj.kind,
    'name': obj.name,
    'namespace': obj.namespace,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * 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.
 *
 * @schema HelmReleaseV2Beta2SpecChartSpecVerify
 */
export interface HelmReleaseV2Beta2SpecChartSpecVerify {
  /**
   * Provider specifies the technology used to sign the OCI Helm chart.
   *
   * @schema HelmReleaseV2Beta2SpecChartSpecVerify#provider
   */
  readonly provider: HelmReleaseV2Beta2SpecChartSpecVerifyProvider;

  /**
   * SecretRef specifies the Kubernetes Secret containing the
   * trusted public keys.
   *
   * @schema HelmReleaseV2Beta2SpecChartSpecVerify#secretRef
   */
  readonly secretRef?: HelmReleaseV2Beta2SpecChartSpecVerifySecretRef;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecChartSpecVerify' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecChartSpecVerify(obj: HelmReleaseV2Beta2SpecChartSpecVerify | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'provider': obj.provider,
    'secretRef': toJson_HelmReleaseV2Beta2SpecChartSpecVerifySecretRef(obj.secretRef),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * 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.
 *
 * @schema HelmReleaseV2Beta2SpecDriftDetectionIgnoreTarget
 */
export interface HelmReleaseV2Beta2SpecDriftDetectionIgnoreTarget {
  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta2SpecDriftDetectionIgnoreTarget#annotationSelector
   */
  readonly annotationSelector?: 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
   *
   * @schema HelmReleaseV2Beta2SpecDriftDetectionIgnoreTarget#group
   */
  readonly group?: 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
   *
   * @schema HelmReleaseV2Beta2SpecDriftDetectionIgnoreTarget#kind
   */
  readonly kind?: 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.
   *
   * @schema HelmReleaseV2Beta2SpecDriftDetectionIgnoreTarget#labelSelector
   */
  readonly labelSelector?: string;

  /**
   * Name to match resources with.
   *
   * @schema HelmReleaseV2Beta2SpecDriftDetectionIgnoreTarget#name
   */
  readonly name?: string;

  /**
   * Namespace to select resources from.
   *
   * @schema HelmReleaseV2Beta2SpecDriftDetectionIgnoreTarget#namespace
   */
  readonly namespace?: 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
   *
   * @schema HelmReleaseV2Beta2SpecDriftDetectionIgnoreTarget#version
   */
  readonly version?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecDriftDetectionIgnoreTarget' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecDriftDetectionIgnoreTarget(obj: HelmReleaseV2Beta2SpecDriftDetectionIgnoreTarget | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'annotationSelector': obj.annotationSelector,
    'group': obj.group,
    'kind': obj.kind,
    'labelSelector': obj.labelSelector,
    'name': obj.name,
    'namespace': obj.namespace,
    'version': obj.version,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Image contains an image name, a new name, a new tag or digest, which will replace the original name and tag.
 *
 * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizeImages
 */
export interface HelmReleaseV2Beta2SpecPostRenderersKustomizeImages {
  /**
   * Digest is the value used to replace the original image tag.
   * If digest is present NewTag value is ignored.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizeImages#digest
   */
  readonly digest?: string;

  /**
   * Name is a tag-less image name.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizeImages#name
   */
  readonly name: string;

  /**
   * NewName is the value used to replace the original name.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizeImages#newName
   */
  readonly newName?: string;

  /**
   * NewTag is the value used to replace the original tag.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizeImages#newTag
   */
  readonly newTag?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecPostRenderersKustomizeImages' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecPostRenderersKustomizeImages(obj: HelmReleaseV2Beta2SpecPostRenderersKustomizeImages | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'digest': obj.digest,
    'name': obj.name,
    'newName': obj.newName,
    'newTag': obj.newTag,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Patch contains an inline StrategicMerge or JSON6902 patch, and the target the patch should
 * be applied to.
 *
 * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatches
 */
export interface HelmReleaseV2Beta2SpecPostRenderersKustomizePatches {
  /**
   * Patch contains an inline StrategicMerge patch or an inline JSON6902 patch with
   * an array of operation objects.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatches#patch
   */
  readonly patch: string;

  /**
   * Target points to the resources that the patch document should be applied to.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatches#target
   */
  readonly target?: HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesTarget;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecPostRenderersKustomizePatches' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecPostRenderersKustomizePatches(obj: HelmReleaseV2Beta2SpecPostRenderersKustomizePatches | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'patch': obj.patch,
    'target': toJson_HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesTarget(obj.target),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * JSON6902Patch contains a JSON6902 patch and the target the patch should be applied to.
 *
 * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902
 */
export interface HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902 {
  /**
   * Patch contains the JSON6902 patch document with an array of operation objects.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902#patch
   */
  readonly patch: HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Patch[];

  /**
   * Target points to the resources that the patch document should be applied to.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902#target
   */
  readonly target: HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Target;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902(obj: HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902 | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'patch': obj.patch?.map(y => toJson_HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Patch(y)),
    'target': toJson_HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Target(obj.target),
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Strategy to use for failure remediation. Defaults to 'rollback'.
 *
 * @default rollback'.
 * @schema HelmReleaseV2Beta2SpecUpgradeRemediationStrategy
 */
export enum HelmReleaseV2Beta2SpecUpgradeRemediationStrategy {
  /** rollback */
  ROLLBACK = "rollback",
  /** uninstall */
  UNINSTALL = "uninstall",
}

/**
 * Kind of the referent.
 *
 * @schema HelmReleaseV2Beta2SpecChartSpecSourceRefKind
 */
export enum HelmReleaseV2Beta2SpecChartSpecSourceRefKind {
  /** HelmRepository */
  HELM_REPOSITORY = "HelmRepository",
  /** GitRepository */
  GIT_REPOSITORY = "GitRepository",
  /** Bucket */
  BUCKET = "Bucket",
}

/**
 * Provider specifies the technology used to sign the OCI Helm chart.
 *
 * @schema HelmReleaseV2Beta2SpecChartSpecVerifyProvider
 */
export enum HelmReleaseV2Beta2SpecChartSpecVerifyProvider {
  /** cosign */
  COSIGN = "cosign",
  /** notation */
  NOTATION = "notation",
}

/**
 * SecretRef specifies the Kubernetes Secret containing the
 * trusted public keys.
 *
 * @schema HelmReleaseV2Beta2SpecChartSpecVerifySecretRef
 */
export interface HelmReleaseV2Beta2SpecChartSpecVerifySecretRef {
  /**
   * Name of the referent.
   *
   * @schema HelmReleaseV2Beta2SpecChartSpecVerifySecretRef#name
   */
  readonly name: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecChartSpecVerifySecretRef' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecChartSpecVerifySecretRef(obj: HelmReleaseV2Beta2SpecChartSpecVerifySecretRef | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'name': obj.name,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Target points to the resources that the patch document should be applied to.
 *
 * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesTarget
 */
export interface HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesTarget {
  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesTarget#annotationSelector
   */
  readonly annotationSelector?: 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
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesTarget#group
   */
  readonly group?: 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
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesTarget#kind
   */
  readonly kind?: 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.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesTarget#labelSelector
   */
  readonly labelSelector?: string;

  /**
   * Name to match resources with.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesTarget#name
   */
  readonly name?: string;

  /**
   * Namespace to select resources from.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesTarget#namespace
   */
  readonly namespace?: 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
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesTarget#version
   */
  readonly version?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesTarget' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesTarget(obj: HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesTarget | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'annotationSelector': obj.annotationSelector,
    'group': obj.group,
    'kind': obj.kind,
    'labelSelector': obj.labelSelector,
    'name': obj.name,
    'namespace': obj.namespace,
    'version': obj.version,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * JSON6902 is a JSON6902 operation object.
 * https://datatracker.ietf.org/doc/html/rfc6902#section-4
 *
 * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Patch
 */
export interface HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Patch {
  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Patch#from
   */
  readonly from?: 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
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Patch#op
   */
  readonly op: HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902PatchOp;

  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Patch#path
   */
  readonly 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.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Patch#value
   */
  readonly value?: any;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Patch' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Patch(obj: HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Patch | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'from': obj.from,
    'op': obj.op,
    'path': obj.path,
    'value': obj.value,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * Target points to the resources that the patch document should be applied to.
 *
 * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Target
 */
export interface HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Target {
  /**
   * 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.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Target#annotationSelector
   */
  readonly annotationSelector?: 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
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Target#group
   */
  readonly group?: 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
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Target#kind
   */
  readonly kind?: 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.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Target#labelSelector
   */
  readonly labelSelector?: string;

  /**
   * Name to match resources with.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Target#name
   */
  readonly name?: string;

  /**
   * Namespace to select resources from.
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Target#namespace
   */
  readonly namespace?: 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
   *
   * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Target#version
   */
  readonly version?: string;

}

/**
 * Converts an object of type 'HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Target' to JSON representation.
 */
/* eslint-disable max-len, quote-props */
export function toJson_HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Target(obj: HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902Target | undefined): Record<string, any> | undefined {
  if (obj === undefined) { return undefined; }
  const result = {
    'annotationSelector': obj.annotationSelector,
    'group': obj.group,
    'kind': obj.kind,
    'labelSelector': obj.labelSelector,
    'name': obj.name,
    'namespace': obj.namespace,
    'version': obj.version,
  };
  // filter undefined values
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
}
/* eslint-enable max-len, quote-props */

/**
 * 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
 *
 * @schema HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902PatchOp
 */
export enum HelmReleaseV2Beta2SpecPostRenderersKustomizePatchesJson6902PatchOp {
  /** test */
  TEST = "test",
  /** remove */
  REMOVE = "remove",
  /** add */
  ADD = "add",
  /** replace */
  REPLACE = "replace",
  /** move */
  MOVE = "move",
  /** copy */
  COPY = "copy",
}

