// 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.models;

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

/** Product profile. */
@Fluent
public final class ProductTagResourceContractProperties extends ProductEntityBaseParameters {
    /*
     * Identifier of the product in the form of /products/{productId}
     */
    @JsonProperty(value = "id")
    private String id;

    /*
     * Product name.
     */
    @JsonProperty(value = "name", required = true)
    private String name;

    /**
     * Get the id property: Identifier of the product in the form of /products/{productId}.
     *
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

    /**
     * Set the id property: Identifier of the product in the form of /products/{productId}.
     *
     * @param id the id value to set.
     * @return the ProductTagResourceContractProperties object itself.
     */
    public ProductTagResourceContractProperties withId(String id) {
        this.id = id;
        return this;
    }

    /**
     * Get the name property: Product name.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: Product name.
     *
     * @param name the name value to set.
     * @return the ProductTagResourceContractProperties object itself.
     */
    public ProductTagResourceContractProperties withName(String name) {
        this.name = name;
        return this;
    }

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

    /** {@inheritDoc} */
    @Override
    public ProductTagResourceContractProperties withTerms(String terms) {
        super.withTerms(terms);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ProductTagResourceContractProperties withSubscriptionRequired(Boolean subscriptionRequired) {
        super.withSubscriptionRequired(subscriptionRequired);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ProductTagResourceContractProperties withApprovalRequired(Boolean approvalRequired) {
        super.withApprovalRequired(approvalRequired);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ProductTagResourceContractProperties withSubscriptionsLimit(Integer subscriptionsLimit) {
        super.withSubscriptionsLimit(subscriptionsLimit);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ProductTagResourceContractProperties withState(ProductState state) {
        super.withState(state);
        return this;
    }

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

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