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

package com.azure.resourcemanager.providerhub.models;

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

/** The ResourceProviderCapabilities model. */
@Fluent
public final class ResourceProviderCapabilities {
    /*
     * The quotaId property.
     */
    @JsonProperty(value = "quotaId", required = true)
    private String quotaId;

    /*
     * The effect property.
     */
    @JsonProperty(value = "effect", required = true)
    private ResourceProviderCapabilitiesEffect effect;

    /*
     * The requiredFeatures property.
     */
    @JsonProperty(value = "requiredFeatures")
    private List<String> requiredFeatures;

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

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

    /**
     * Set the quotaId property: The quotaId property.
     *
     * @param quotaId the quotaId value to set.
     * @return the ResourceProviderCapabilities object itself.
     */
    public ResourceProviderCapabilities withQuotaId(String quotaId) {
        this.quotaId = quotaId;
        return this;
    }

    /**
     * Get the effect property: The effect property.
     *
     * @return the effect value.
     */
    public ResourceProviderCapabilitiesEffect effect() {
        return this.effect;
    }

    /**
     * Set the effect property: The effect property.
     *
     * @param effect the effect value to set.
     * @return the ResourceProviderCapabilities object itself.
     */
    public ResourceProviderCapabilities withEffect(ResourceProviderCapabilitiesEffect effect) {
        this.effect = effect;
        return this;
    }

    /**
     * Get the requiredFeatures property: The requiredFeatures property.
     *
     * @return the requiredFeatures value.
     */
    public List<String> requiredFeatures() {
        return this.requiredFeatures;
    }

    /**
     * Set the requiredFeatures property: The requiredFeatures property.
     *
     * @param requiredFeatures the requiredFeatures value to set.
     * @return the ResourceProviderCapabilities object itself.
     */
    public ResourceProviderCapabilities withRequiredFeatures(List<String> requiredFeatures) {
        this.requiredFeatures = requiredFeatures;
        return this;
    }

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

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