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

package com.azure.resourcemanager.webpubsub.models;

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

/** The billing information of the resource. */
@Fluent
public final class ResourceSku {
    /*
     * The name of the SKU. Required.
     *
     * Allowed values: Standard_S1, Free_F1, Premium_P1
     */
    @JsonProperty(value = "name", required = true)
    private String name;

    /*
     * Optional tier of this particular SKU. 'Standard' or 'Free'.
     *
     * `Basic` is deprecated, use `Standard` instead.
     */
    @JsonProperty(value = "tier")
    private WebPubSubSkuTier tier;

    /*
     * Not used. Retained for future use.
     */
    @JsonProperty(value = "size", access = JsonProperty.Access.WRITE_ONLY)
    private String size;

    /*
     * Not used. Retained for future use.
     */
    @JsonProperty(value = "family", access = JsonProperty.Access.WRITE_ONLY)
    private String family;

    /*
     * Optional, integer. The unit count of the resource. 1 by default.
     *
     * If present, following values are allowed:
     * Free: 1;
     * Standard: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100;
     * Premium:  1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100;
     */
    @JsonProperty(value = "capacity")
    private Integer capacity;

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

    /**
     * Get the name property: The name of the SKU. Required.
     *
     * <p>Allowed values: Standard_S1, Free_F1, Premium_P1.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: The name of the SKU. Required.
     *
     * <p>Allowed values: Standard_S1, Free_F1, Premium_P1.
     *
     * @param name the name value to set.
     * @return the ResourceSku object itself.
     */
    public ResourceSku withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the tier property: Optional tier of this particular SKU. 'Standard' or 'Free'.
     *
     * <p>`Basic` is deprecated, use `Standard` instead.
     *
     * @return the tier value.
     */
    public WebPubSubSkuTier tier() {
        return this.tier;
    }

    /**
     * Set the tier property: Optional tier of this particular SKU. 'Standard' or 'Free'.
     *
     * <p>`Basic` is deprecated, use `Standard` instead.
     *
     * @param tier the tier value to set.
     * @return the ResourceSku object itself.
     */
    public ResourceSku withTier(WebPubSubSkuTier tier) {
        this.tier = tier;
        return this;
    }

    /**
     * Get the size property: Not used. Retained for future use.
     *
     * @return the size value.
     */
    public String size() {
        return this.size;
    }

    /**
     * Get the family property: Not used. Retained for future use.
     *
     * @return the family value.
     */
    public String family() {
        return this.family;
    }

    /**
     * Get the capacity property: Optional, integer. The unit count of the resource. 1 by default.
     *
     * <p>If present, following values are allowed: Free: 1; Standard: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100;
     * Premium: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100;.
     *
     * @return the capacity value.
     */
    public Integer capacity() {
        return this.capacity;
    }

    /**
     * Set the capacity property: Optional, integer. The unit count of the resource. 1 by default.
     *
     * <p>If present, following values are allowed: Free: 1; Standard: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100;
     * Premium: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100;.
     *
     * @param capacity the capacity value to set.
     * @return the ResourceSku object itself.
     */
    public ResourceSku 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 ResourceSku"));
        }
    }

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