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

package com.azure.resourcemanager.powerbidedicated.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.powerbidedicated.fluent.models.AutoScaleVCoreMutableProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** Update request specification. */
@Fluent
public final class AutoScaleVCoreUpdateParameters {
    /*
     * The SKU of the auto scale v-core resource.
     */
    @JsonProperty(value = "sku")
    private AutoScaleVCoreSku sku;

    /*
     * Key-value pairs of additional provisioning properties.
     */
    @JsonProperty(value = "tags")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> tags;

    /*
     * Properties of the update operation request.
     */
    @JsonProperty(value = "properties")
    private AutoScaleVCoreMutableProperties innerProperties;

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

    /**
     * Get the sku property: The SKU of the auto scale v-core resource.
     *
     * @return the sku value.
     */
    public AutoScaleVCoreSku sku() {
        return this.sku;
    }

    /**
     * Set the sku property: The SKU of the auto scale v-core resource.
     *
     * @param sku the sku value to set.
     * @return the AutoScaleVCoreUpdateParameters object itself.
     */
    public AutoScaleVCoreUpdateParameters withSku(AutoScaleVCoreSku sku) {
        this.sku = sku;
        return this;
    }

    /**
     * Get the tags property: Key-value pairs of additional provisioning properties.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.tags;
    }

    /**
     * Set the tags property: Key-value pairs of additional provisioning properties.
     *
     * @param tags the tags value to set.
     * @return the AutoScaleVCoreUpdateParameters object itself.
     */
    public AutoScaleVCoreUpdateParameters withTags(Map<String, String> tags) {
        this.tags = tags;
        return this;
    }

    /**
     * Get the innerProperties property: Properties of the update operation request.
     *
     * @return the innerProperties value.
     */
    private AutoScaleVCoreMutableProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the capacityLimit property: The maximum capacity of an auto scale v-core resource.
     *
     * @return the capacityLimit value.
     */
    public Integer capacityLimit() {
        return this.innerProperties() == null ? null : this.innerProperties().capacityLimit();
    }

    /**
     * Set the capacityLimit property: The maximum capacity of an auto scale v-core resource.
     *
     * @param capacityLimit the capacityLimit value to set.
     * @return the AutoScaleVCoreUpdateParameters object itself.
     */
    public AutoScaleVCoreUpdateParameters withCapacityLimit(Integer capacityLimit) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AutoScaleVCoreMutableProperties();
        }
        this.innerProperties().withCapacityLimit(capacityLimit);
        return this;
    }

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