// 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.azure.resourcemanager.kubernetesconfiguration.fluent.models.PatchExtensionProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** The Extension Patch Request object. */
@Fluent
public final class PatchExtension {
    /*
     * Updatable properties of an Extension Patch Request
     */
    @JsonProperty(value = "properties")
    private PatchExtensionProperties innerProperties;

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

    /**
     * Get the innerProperties property: Updatable properties of an Extension Patch Request.
     *
     * @return the innerProperties value.
     */
    private PatchExtensionProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the autoUpgradeMinorVersion property: Flag to note if this extension participates in auto upgrade of minor
     * version, or not.
     *
     * @return the autoUpgradeMinorVersion value.
     */
    public Boolean autoUpgradeMinorVersion() {
        return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeMinorVersion();
    }

    /**
     * Set the autoUpgradeMinorVersion property: Flag to note if this extension participates in auto upgrade of minor
     * version, or not.
     *
     * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set.
     * @return the PatchExtension object itself.
     */
    public PatchExtension withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PatchExtensionProperties();
        }
        this.innerProperties().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion);
        return this;
    }

    /**
     * Get the releaseTrain property: ReleaseTrain this extension participates in for auto-upgrade (e.g. Stable,
     * Preview, etc.) - only if autoUpgradeMinorVersion is 'true'.
     *
     * @return the releaseTrain value.
     */
    public String releaseTrain() {
        return this.innerProperties() == null ? null : this.innerProperties().releaseTrain();
    }

    /**
     * Set the releaseTrain property: ReleaseTrain this extension participates in for auto-upgrade (e.g. Stable,
     * Preview, etc.) - only if autoUpgradeMinorVersion is 'true'.
     *
     * @param releaseTrain the releaseTrain value to set.
     * @return the PatchExtension object itself.
     */
    public PatchExtension withReleaseTrain(String releaseTrain) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PatchExtensionProperties();
        }
        this.innerProperties().withReleaseTrain(releaseTrain);
        return this;
    }

    /**
     * Get the version property: Version of the extension for this extension, if it is 'pinned' to a specific version.
     * autoUpgradeMinorVersion must be 'false'.
     *
     * @return the version value.
     */
    public String version() {
        return this.innerProperties() == null ? null : this.innerProperties().version();
    }

    /**
     * Set the version property: Version of the extension for this extension, if it is 'pinned' to a specific version.
     * autoUpgradeMinorVersion must be 'false'.
     *
     * @param version the version value to set.
     * @return the PatchExtension object itself.
     */
    public PatchExtension withVersion(String version) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PatchExtensionProperties();
        }
        this.innerProperties().withVersion(version);
        return this;
    }

    /**
     * Get the configurationSettings property: Configuration settings, as name-value pairs for configuring this
     * extension.
     *
     * @return the configurationSettings value.
     */
    public Map<String, String> configurationSettings() {
        return this.innerProperties() == null ? null : this.innerProperties().configurationSettings();
    }

    /**
     * Set the configurationSettings property: Configuration settings, as name-value pairs for configuring this
     * extension.
     *
     * @param configurationSettings the configurationSettings value to set.
     * @return the PatchExtension object itself.
     */
    public PatchExtension withConfigurationSettings(Map<String, String> configurationSettings) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PatchExtensionProperties();
        }
        this.innerProperties().withConfigurationSettings(configurationSettings);
        return this;
    }

    /**
     * Get the configurationProtectedSettings property: Configuration settings that are sensitive, as name-value pairs
     * for configuring this extension.
     *
     * @return the configurationProtectedSettings value.
     */
    public Map<String, String> configurationProtectedSettings() {
        return this.innerProperties() == null ? null : this.innerProperties().configurationProtectedSettings();
    }

    /**
     * Set the configurationProtectedSettings property: Configuration settings that are sensitive, as name-value pairs
     * for configuring this extension.
     *
     * @param configurationProtectedSettings the configurationProtectedSettings value to set.
     * @return the PatchExtension object itself.
     */
    public PatchExtension withConfigurationProtectedSettings(Map<String, String> configurationProtectedSettings) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PatchExtensionProperties();
        }
        this.innerProperties().withConfigurationProtectedSettings(configurationProtectedSettings);
        return this;
    }

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