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

package com.azure.resourcemanager.cognitiveservices.models;

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

/** Check Domain availability parameter. */
@Fluent
public final class CheckDomainAvailabilityParameter {
    /*
     * The subdomain name to use.
     */
    @JsonProperty(value = "subdomainName", required = true)
    private String subdomainName;

    /*
     * The Type of the resource.
     */
    @JsonProperty(value = "type", required = true)
    private String type;

    /*
     * The Kind of the resource.
     */
    @JsonProperty(value = "kind")
    private String kind;

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

    /**
     * Get the subdomainName property: The subdomain name to use.
     *
     * @return the subdomainName value.
     */
    public String subdomainName() {
        return this.subdomainName;
    }

    /**
     * Set the subdomainName property: The subdomain name to use.
     *
     * @param subdomainName the subdomainName value to set.
     * @return the CheckDomainAvailabilityParameter object itself.
     */
    public CheckDomainAvailabilityParameter withSubdomainName(String subdomainName) {
        this.subdomainName = subdomainName;
        return this;
    }

    /**
     * Get the type property: The Type of the resource.
     *
     * @return the type value.
     */
    public String type() {
        return this.type;
    }

    /**
     * Set the type property: The Type of the resource.
     *
     * @param type the type value to set.
     * @return the CheckDomainAvailabilityParameter object itself.
     */
    public CheckDomainAvailabilityParameter withType(String type) {
        this.type = type;
        return this;
    }

    /**
     * Get the kind property: The Kind of the resource.
     *
     * @return the kind value.
     */
    public String kind() {
        return this.kind;
    }

    /**
     * Set the kind property: The Kind of the resource.
     *
     * @param kind the kind value to set.
     * @return the CheckDomainAvailabilityParameter object itself.
     */
    public CheckDomainAvailabilityParameter withKind(String kind) {
        this.kind = kind;
        return this;
    }

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

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