// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.kubernetesconfiguration.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Properties for HelmRelease objects. */
@Fluent
public final class HelmReleasePropertiesDefinition {
    /*
     * The revision number of the last released object change
     */
    @JsonProperty(value = "lastRevisionApplied")
    private Long lastRevisionApplied;

    /*
     * The reference to the HelmChart object used as the source to this HelmRelease
     */
    @JsonProperty(value = "helmChartRef")
    private ObjectReferenceDefinition helmChartRef;

    /*
     * Total number of times that the HelmRelease failed to install or upgrade
     */
    @JsonProperty(value = "failureCount")
    private Long failureCount;

    /*
     * Number of times that the HelmRelease failed to install
     */
    @JsonProperty(value = "installFailureCount")
    private Long installFailureCount;

    /*
     * Number of times that the HelmRelease failed to upgrade
     */
    @JsonProperty(value = "upgradeFailureCount")
    private Long upgradeFailureCount;

    /** Creates an instance of HelmReleasePropertiesDefinition class. */
    public HelmReleasePropertiesDefinition() {
    }

    /**
     * Get the lastRevisionApplied property: The revision number of the last released object change.
     *
     * @return the lastRevisionApplied value.
     */
    public Long lastRevisionApplied() {
        return this.lastRevisionApplied;
    }

    /**
     * Set the lastRevisionApplied property: The revision number of the last released object change.
     *
     * @param lastRevisionApplied the lastRevisionApplied value to set.
     * @return the HelmReleasePropertiesDefinition object itself.
     */
    public HelmReleasePropertiesDefinition withLastRevisionApplied(Long lastRevisionApplied) {
        this.lastRevisionApplied = lastRevisionApplied;
        return this;
    }

    /**
     * Get the helmChartRef property: The reference to the HelmChart object used as the source to this HelmRelease.
     *
     * @return the helmChartRef value.
     */
    public ObjectReferenceDefinition helmChartRef() {
        return this.helmChartRef;
    }

    /**
     * Set the helmChartRef property: The reference to the HelmChart object used as the source to this HelmRelease.
     *
     * @param helmChartRef the helmChartRef value to set.
     * @return the HelmReleasePropertiesDefinition object itself.
     */
    public HelmReleasePropertiesDefinition withHelmChartRef(ObjectReferenceDefinition helmChartRef) {
        this.helmChartRef = helmChartRef;
        return this;
    }

    /**
     * Get the failureCount property: Total number of times that the HelmRelease failed to install or upgrade.
     *
     * @return the failureCount value.
     */
    public Long failureCount() {
        return this.failureCount;
    }

    /**
     * Set the failureCount property: Total number of times that the HelmRelease failed to install or upgrade.
     *
     * @param failureCount the failureCount value to set.
     * @return the HelmReleasePropertiesDefinition object itself.
     */
    public HelmReleasePropertiesDefinition withFailureCount(Long failureCount) {
        this.failureCount = failureCount;
        return this;
    }

    /**
     * Get the installFailureCount property: Number of times that the HelmRelease failed to install.
     *
     * @return the installFailureCount value.
     */
    public Long installFailureCount() {
        return this.installFailureCount;
    }

    /**
     * Set the installFailureCount property: Number of times that the HelmRelease failed to install.
     *
     * @param installFailureCount the installFailureCount value to set.
     * @return the HelmReleasePropertiesDefinition object itself.
     */
    public HelmReleasePropertiesDefinition withInstallFailureCount(Long installFailureCount) {
        this.installFailureCount = installFailureCount;
        return this;
    }

    /**
     * Get the upgradeFailureCount property: Number of times that the HelmRelease failed to upgrade.
     *
     * @return the upgradeFailureCount value.
     */
    public Long upgradeFailureCount() {
        return this.upgradeFailureCount;
    }

    /**
     * Set the upgradeFailureCount property: Number of times that the HelmRelease failed to upgrade.
     *
     * @param upgradeFailureCount the upgradeFailureCount value to set.
     * @return the HelmReleasePropertiesDefinition object itself.
     */
    public HelmReleasePropertiesDefinition withUpgradeFailureCount(Long upgradeFailureCount) {
        this.upgradeFailureCount = upgradeFailureCount;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (helmChartRef() != null) {
            helmChartRef().validate();
        }
    }
}
