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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.apimanagement.models.ApiVersionSetEntityBase;
import com.azure.resourcemanager.apimanagement.models.VersioningScheme;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Properties of an API Version Set. */
@Fluent
public final class ApiVersionSetContractProperties extends ApiVersionSetEntityBase {
    /*
     * Name of API Version Set
     */
    @JsonProperty(value = "displayName", required = true)
    private String displayName;

    /*
     * An value that determines where the API Version identifier will be
     * located in a HTTP request.
     */
    @JsonProperty(value = "versioningScheme", required = true)
    private VersioningScheme versioningScheme;

    /**
     * Get the displayName property: Name of API Version Set.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.displayName;
    }

    /**
     * Set the displayName property: Name of API Version Set.
     *
     * @param displayName the displayName value to set.
     * @return the ApiVersionSetContractProperties object itself.
     */
    public ApiVersionSetContractProperties withDisplayName(String displayName) {
        this.displayName = displayName;
        return this;
    }

    /**
     * Get the versioningScheme property: An value that determines where the API Version identifier will be located in a
     * HTTP request.
     *
     * @return the versioningScheme value.
     */
    public VersioningScheme versioningScheme() {
        return this.versioningScheme;
    }

    /**
     * Set the versioningScheme property: An value that determines where the API Version identifier will be located in a
     * HTTP request.
     *
     * @param versioningScheme the versioningScheme value to set.
     * @return the ApiVersionSetContractProperties object itself.
     */
    public ApiVersionSetContractProperties withVersioningScheme(VersioningScheme versioningScheme) {
        this.versioningScheme = versioningScheme;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ApiVersionSetContractProperties withDescription(String description) {
        super.withDescription(description);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ApiVersionSetContractProperties withVersionQueryName(String versionQueryName) {
        super.withVersionQueryName(versionQueryName);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ApiVersionSetContractProperties withVersionHeaderName(String versionHeaderName) {
        super.withVersionHeaderName(versionHeaderName);
        return this;
    }

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

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