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

package com.azure.resourcemanager.hybridcontainerservice.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The profile of an orchestrator and its available versions. */
@Fluent
public final class OrchestratorVersionProfile {
    /*
     * Whether Kubernetes version is currently in preview.
     */
    @JsonProperty(value = "isPreview", access = JsonProperty.Access.WRITE_ONLY)
    private Boolean isPreview;

    /*
     * Installed by default if version is not specified.
     */
    @JsonProperty(value = "default", access = JsonProperty.Access.WRITE_ONLY)
    private Boolean defaultProperty;

    /*
     * Orchestrator type.
     */
    @JsonProperty(value = "orchestratorType", access = JsonProperty.Access.WRITE_ONLY)
    private String orchestratorType;

    /*
     * Orchestrator version major.minor.patch, for example 1.21.9
     */
    @JsonProperty(value = "orchestratorVersion", access = JsonProperty.Access.WRITE_ONLY)
    private String orchestratorVersion;

    /*
     * The list of available upgrade versions.
     */
    @JsonProperty(value = "upgrades")
    private List<OrchestratorProfile> upgrades;

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

    /**
     * Get the isPreview property: Whether Kubernetes version is currently in preview.
     *
     * @return the isPreview value.
     */
    public Boolean isPreview() {
        return this.isPreview;
    }

    /**
     * Get the defaultProperty property: Installed by default if version is not specified.
     *
     * @return the defaultProperty value.
     */
    public Boolean defaultProperty() {
        return this.defaultProperty;
    }

    /**
     * Get the orchestratorType property: Orchestrator type.
     *
     * @return the orchestratorType value.
     */
    public String orchestratorType() {
        return this.orchestratorType;
    }

    /**
     * Get the orchestratorVersion property: Orchestrator version major.minor.patch, for example 1.21.9.
     *
     * @return the orchestratorVersion value.
     */
    public String orchestratorVersion() {
        return this.orchestratorVersion;
    }

    /**
     * Get the upgrades property: The list of available upgrade versions.
     *
     * @return the upgrades value.
     */
    public List<OrchestratorProfile> upgrades() {
        return this.upgrades;
    }

    /**
     * Set the upgrades property: The list of available upgrade versions.
     *
     * @param upgrades the upgrades value to set.
     * @return the OrchestratorVersionProfile object itself.
     */
    public OrchestratorVersionProfile withUpgrades(List<OrchestratorProfile> upgrades) {
        this.upgrades = upgrades;
        return this;
    }

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