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

package com.azure.resourcemanager.networkcloud.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/** ClusterUpdateVersionParameters represents the body of the request to update cluster version. */
@Fluent
public final class ClusterUpdateVersionParameters {
    /*
     * The version to be applied to the cluster during update.
     */
    @JsonProperty(value = "targetClusterVersion", required = true)
    private String targetClusterVersion;

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

    /**
     * Get the targetClusterVersion property: The version to be applied to the cluster during update.
     *
     * @return the targetClusterVersion value.
     */
    public String targetClusterVersion() {
        return this.targetClusterVersion;
    }

    /**
     * Set the targetClusterVersion property: The version to be applied to the cluster during update.
     *
     * @param targetClusterVersion the targetClusterVersion value to set.
     * @return the ClusterUpdateVersionParameters object itself.
     */
    public ClusterUpdateVersionParameters withTargetClusterVersion(String targetClusterVersion) {
        this.targetClusterVersion = targetClusterVersion;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (targetClusterVersion() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property targetClusterVersion in model ClusterUpdateVersionParameters"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(ClusterUpdateVersionParameters.class);
}
