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

package com.azure.resourcemanager.avs.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.avs.fluent.models.ClusterUpdateProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** An update of a cluster resource. */
@Fluent
public final class ClusterUpdate {
    /*
     * The properties of a cluster resource that may be updated
     */
    @JsonProperty(value = "properties")
    private ClusterUpdateProperties innerProperties;

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

    /**
     * Get the innerProperties property: The properties of a cluster resource that may be updated.
     *
     * @return the innerProperties value.
     */
    private ClusterUpdateProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the clusterSize property: The cluster size.
     *
     * @return the clusterSize value.
     */
    public Integer clusterSize() {
        return this.innerProperties() == null ? null : this.innerProperties().clusterSize();
    }

    /**
     * Set the clusterSize property: The cluster size.
     *
     * @param clusterSize the clusterSize value to set.
     * @return the ClusterUpdate object itself.
     */
    public ClusterUpdate withClusterSize(Integer clusterSize) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterUpdateProperties();
        }
        this.innerProperties().withClusterSize(clusterSize);
        return this;
    }

    /**
     * Get the hosts property: The hosts.
     *
     * @return the hosts value.
     */
    public List<String> hosts() {
        return this.innerProperties() == null ? null : this.innerProperties().hosts();
    }

    /**
     * Set the hosts property: The hosts.
     *
     * @param hosts the hosts value to set.
     * @return the ClusterUpdate object itself.
     */
    public ClusterUpdate withHosts(List<String> hosts) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterUpdateProperties();
        }
        this.innerProperties().withHosts(hosts);
        return this;
    }

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