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

package com.azure.resourcemanager.resourceconnector.models;

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

/** The Upgrade Graph Properties for appliance. */
@Immutable
public final class UpgradeGraphProperties {
    /*
     * The current appliance version
     */
    @JsonProperty(value = "applianceVersion", access = JsonProperty.Access.WRITE_ONLY)
    private String applianceVersion;

    /*
     * This contains the current version and supported upgrade versions.
     */
    @JsonProperty(value = "supportedVersions", access = JsonProperty.Access.WRITE_ONLY)
    private List<SupportedVersion> supportedVersions;

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

    /**
     * Get the applianceVersion property: The current appliance version.
     *
     * @return the applianceVersion value.
     */
    public String applianceVersion() {
        return this.applianceVersion;
    }

    /**
     * Get the supportedVersions property: This contains the current version and supported upgrade versions.
     *
     * @return the supportedVersions value.
     */
    public List<SupportedVersion> supportedVersions() {
        return this.supportedVersions;
    }

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