// 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.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Represents the SKU name and Azure pricing tier for PowerBI Dedicated capacity resource. */
@Fluent
public final class CapacitySku {
    /*
     * Name of the SKU level.
     */
    @JsonProperty(value = "name", required = true)
    private String name;

    /*
     * The name of the Azure pricing tier to which the SKU applies.
     */
    @JsonProperty(value = "tier")
    private CapacitySkuTier tier;

    /*
     * The capacity of the SKU.
     */
    @JsonProperty(value = "capacity")
    private Integer capacity;

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

    /**
     * Get the name property: Name of the SKU level.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: Name of the SKU level.
     *
     * @param name the name value to set.
     * @return the CapacitySku object itself.
     */
    public CapacitySku withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the tier property: The name of the Azure pricing tier to which the SKU applies.
     *
     * @return the tier value.
     */
    public CapacitySkuTier tier() {
        return this.tier;
    }

    /**
     * Set the tier property: The name of the Azure pricing tier to which the SKU applies.
     *
     * @param tier the tier value to set.
     * @return the CapacitySku object itself.
     */
    public CapacitySku withTier(CapacitySkuTier tier) {
        this.tier = tier;
        return this;
    }

    /**
     * Get the capacity property: The capacity of the SKU.
     *
     * @return the capacity value.
     */
    public Integer capacity() {
        return this.capacity;
    }

    /**
     * Set the capacity property: The capacity of the SKU.
     *
     * @param capacity the capacity value to set.
     * @return the CapacitySku object itself.
     */
    public CapacitySku withCapacity(Integer capacity) {
        this.capacity = capacity;
        return this;
    }

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

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