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

package com.azure.resourcemanager.policyinsights.models;

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

/** The information about the resource that will be evaluated. */
@Fluent
public final class CheckRestrictionsResourceDetails {
    /*
     * The resource content. This should include whatever properties are already known and can be a partial set of all
     * resource properties.
     */
    @JsonProperty(value = "resourceContent", required = true)
    private Object resourceContent;

    /*
     * The api-version of the resource content.
     */
    @JsonProperty(value = "apiVersion")
    private String apiVersion;

    /*
     * The scope where the resource is being created. For example, if the resource is a child resource this would be
     * the parent resource's resource ID.
     */
    @JsonProperty(value = "scope")
    private String scope;

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

    /**
     * Get the resourceContent property: The resource content. This should include whatever properties are already known
     * and can be a partial set of all resource properties.
     *
     * @return the resourceContent value.
     */
    public Object resourceContent() {
        return this.resourceContent;
    }

    /**
     * Set the resourceContent property: The resource content. This should include whatever properties are already known
     * and can be a partial set of all resource properties.
     *
     * @param resourceContent the resourceContent value to set.
     * @return the CheckRestrictionsResourceDetails object itself.
     */
    public CheckRestrictionsResourceDetails withResourceContent(Object resourceContent) {
        this.resourceContent = resourceContent;
        return this;
    }

    /**
     * Get the apiVersion property: The api-version of the resource content.
     *
     * @return the apiVersion value.
     */
    public String apiVersion() {
        return this.apiVersion;
    }

    /**
     * Set the apiVersion property: The api-version of the resource content.
     *
     * @param apiVersion the apiVersion value to set.
     * @return the CheckRestrictionsResourceDetails object itself.
     */
    public CheckRestrictionsResourceDetails withApiVersion(String apiVersion) {
        this.apiVersion = apiVersion;
        return this;
    }

    /**
     * Get the scope property: The scope where the resource is being created. For example, if the resource is a child
     * resource this would be the parent resource's resource ID.
     *
     * @return the scope value.
     */
    public String scope() {
        return this.scope;
    }

    /**
     * Set the scope property: The scope where the resource is being created. For example, if the resource is a child
     * resource this would be the parent resource's resource ID.
     *
     * @param scope the scope value to set.
     * @return the CheckRestrictionsResourceDetails object itself.
     */
    public CheckRestrictionsResourceDetails withScope(String scope) {
        this.scope = scope;
        return this;
    }

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

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