// 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.management.ProxyResource;
import com.azure.resourcemanager.apimanagement.models.SchemaType;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Global Schema Contract details. */
@Fluent
public final class GlobalSchemaContractInner extends ProxyResource {
    /*
     * Properties of the Global Schema.
     */
    @JsonProperty(value = "properties")
    private GlobalSchemaContractProperties innerProperties;

    /**
     * Get the innerProperties property: Properties of the Global Schema.
     *
     * @return the innerProperties value.
     */
    private GlobalSchemaContractProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the schemaType property: Schema Type. Immutable.
     *
     * @return the schemaType value.
     */
    public SchemaType schemaType() {
        return this.innerProperties() == null ? null : this.innerProperties().schemaType();
    }

    /**
     * Set the schemaType property: Schema Type. Immutable.
     *
     * @param schemaType the schemaType value to set.
     * @return the GlobalSchemaContractInner object itself.
     */
    public GlobalSchemaContractInner withSchemaType(SchemaType schemaType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new GlobalSchemaContractProperties();
        }
        this.innerProperties().withSchemaType(schemaType);
        return this;
    }

    /**
     * Get the description property: Free-form schema entity description.
     *
     * @return the description value.
     */
    public String description() {
        return this.innerProperties() == null ? null : this.innerProperties().description();
    }

    /**
     * Set the description property: Free-form schema entity description.
     *
     * @param description the description value to set.
     * @return the GlobalSchemaContractInner object itself.
     */
    public GlobalSchemaContractInner withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new GlobalSchemaContractProperties();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

    /**
     * Get the value property: Json-encoded string for non json-based schema.
     *
     * @return the value value.
     */
    public Object value() {
        return this.innerProperties() == null ? null : this.innerProperties().value();
    }

    /**
     * Set the value property: Json-encoded string for non json-based schema.
     *
     * @param value the value value to set.
     * @return the GlobalSchemaContractInner object itself.
     */
    public GlobalSchemaContractInner withValue(Object value) {
        if (this.innerProperties() == null) {
            this.innerProperties = new GlobalSchemaContractProperties();
        }
        this.innerProperties().withValue(value);
        return this;
    }

    /**
     * Get the document property: Global Schema document object for json-based schema formats(e.g. json schema).
     *
     * @return the document value.
     */
    public Object document() {
        return this.innerProperties() == null ? null : this.innerProperties().document();
    }

    /**
     * Set the document property: Global Schema document object for json-based schema formats(e.g. json schema).
     *
     * @param document the document value to set.
     * @return the GlobalSchemaContractInner object itself.
     */
    public GlobalSchemaContractInner withDocument(Object document) {
        if (this.innerProperties() == null) {
            this.innerProperties = new GlobalSchemaContractProperties();
        }
        this.innerProperties().withDocument(document);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }
}
