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

package com.azure.resourcemanager.notificationhubs.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.notificationhubs.models.Sku;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** Description of a CheckAvailability resource. */
@Fluent
public final class CheckAvailabilityResultInner extends Resource {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckAvailabilityResultInner.class);

    /*
     * True if the name is available and can be used to create new
     * Namespace/NotificationHub. Otherwise false.
     */
    @JsonProperty(value = "isAvailiable")
    private Boolean isAvailiable;

    /*
     * The sku of the created namespace
     */
    @JsonProperty(value = "sku")
    private Sku sku;

    /**
     * Get the isAvailiable property: True if the name is available and can be used to create new
     * Namespace/NotificationHub. Otherwise false.
     *
     * @return the isAvailiable value.
     */
    public Boolean isAvailiable() {
        return this.isAvailiable;
    }

    /**
     * Set the isAvailiable property: True if the name is available and can be used to create new
     * Namespace/NotificationHub. Otherwise false.
     *
     * @param isAvailiable the isAvailiable value to set.
     * @return the CheckAvailabilityResultInner object itself.
     */
    public CheckAvailabilityResultInner withIsAvailiable(Boolean isAvailiable) {
        this.isAvailiable = isAvailiable;
        return this;
    }

    /**
     * Get the sku property: The sku of the created namespace.
     *
     * @return the sku value.
     */
    public Sku sku() {
        return this.sku;
    }

    /**
     * Set the sku property: The sku of the created namespace.
     *
     * @param sku the sku value to set.
     * @return the CheckAvailabilityResultInner object itself.
     */
    public CheckAvailabilityResultInner withSku(Sku sku) {
        this.sku = sku;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public CheckAvailabilityResultInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public CheckAvailabilityResultInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

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