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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.logic.models.ContentLink;
import com.azure.resourcemanager.logic.models.SchemaType;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.Map;

/** The integration account schema. */
@Fluent
public final class IntegrationAccountSchemaInner extends Resource {
    /*
     * The integration account schema properties.
     */
    @JsonProperty(value = "properties", required = true)
    private IntegrationAccountSchemaProperties innerProperties = new IntegrationAccountSchemaProperties();

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

    /**
     * Get the innerProperties property: The integration account schema properties.
     *
     * @return the innerProperties value.
     */
    private IntegrationAccountSchemaProperties innerProperties() {
        return this.innerProperties;
    }

    /** {@inheritDoc} */
    @Override
    public IntegrationAccountSchemaInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public IntegrationAccountSchemaInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * Get the schemaType property: The schema type.
     *
     * @return the schemaType value.
     */
    public SchemaType schemaType() {
        return this.innerProperties() == null ? null : this.innerProperties().schemaType();
    }

    /**
     * Set the schemaType property: The schema type.
     *
     * @param schemaType the schemaType value to set.
     * @return the IntegrationAccountSchemaInner object itself.
     */
    public IntegrationAccountSchemaInner withSchemaType(SchemaType schemaType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new IntegrationAccountSchemaProperties();
        }
        this.innerProperties().withSchemaType(schemaType);
        return this;
    }

    /**
     * Get the targetNamespace property: The target namespace of the schema.
     *
     * @return the targetNamespace value.
     */
    public String targetNamespace() {
        return this.innerProperties() == null ? null : this.innerProperties().targetNamespace();
    }

    /**
     * Set the targetNamespace property: The target namespace of the schema.
     *
     * @param targetNamespace the targetNamespace value to set.
     * @return the IntegrationAccountSchemaInner object itself.
     */
    public IntegrationAccountSchemaInner withTargetNamespace(String targetNamespace) {
        if (this.innerProperties() == null) {
            this.innerProperties = new IntegrationAccountSchemaProperties();
        }
        this.innerProperties().withTargetNamespace(targetNamespace);
        return this;
    }

    /**
     * Get the documentName property: The document name.
     *
     * @return the documentName value.
     */
    public String documentName() {
        return this.innerProperties() == null ? null : this.innerProperties().documentName();
    }

    /**
     * Set the documentName property: The document name.
     *
     * @param documentName the documentName value to set.
     * @return the IntegrationAccountSchemaInner object itself.
     */
    public IntegrationAccountSchemaInner withDocumentName(String documentName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new IntegrationAccountSchemaProperties();
        }
        this.innerProperties().withDocumentName(documentName);
        return this;
    }

    /**
     * Get the fileName property: The file name.
     *
     * @return the fileName value.
     */
    public String fileName() {
        return this.innerProperties() == null ? null : this.innerProperties().fileName();
    }

    /**
     * Set the fileName property: The file name.
     *
     * @param fileName the fileName value to set.
     * @return the IntegrationAccountSchemaInner object itself.
     */
    public IntegrationAccountSchemaInner withFileName(String fileName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new IntegrationAccountSchemaProperties();
        }
        this.innerProperties().withFileName(fileName);
        return this;
    }

    /**
     * Get the createdTime property: The created time.
     *
     * @return the createdTime value.
     */
    public OffsetDateTime createdTime() {
        return this.innerProperties() == null ? null : this.innerProperties().createdTime();
    }

    /**
     * Get the changedTime property: The changed time.
     *
     * @return the changedTime value.
     */
    public OffsetDateTime changedTime() {
        return this.innerProperties() == null ? null : this.innerProperties().changedTime();
    }

    /**
     * Get the metadata property: The metadata.
     *
     * @return the metadata value.
     */
    public Object metadata() {
        return this.innerProperties() == null ? null : this.innerProperties().metadata();
    }

    /**
     * Set the metadata property: The metadata.
     *
     * @param metadata the metadata value to set.
     * @return the IntegrationAccountSchemaInner object itself.
     */
    public IntegrationAccountSchemaInner withMetadata(Object metadata) {
        if (this.innerProperties() == null) {
            this.innerProperties = new IntegrationAccountSchemaProperties();
        }
        this.innerProperties().withMetadata(metadata);
        return this;
    }

    /**
     * Get the content property: The content.
     *
     * @return the content value.
     */
    public String content() {
        return this.innerProperties() == null ? null : this.innerProperties().content();
    }

    /**
     * Set the content property: The content.
     *
     * @param content the content value to set.
     * @return the IntegrationAccountSchemaInner object itself.
     */
    public IntegrationAccountSchemaInner withContent(String content) {
        if (this.innerProperties() == null) {
            this.innerProperties = new IntegrationAccountSchemaProperties();
        }
        this.innerProperties().withContent(content);
        return this;
    }

    /**
     * Get the contentType property: The content type.
     *
     * @return the contentType value.
     */
    public String contentType() {
        return this.innerProperties() == null ? null : this.innerProperties().contentType();
    }

    /**
     * Set the contentType property: The content type.
     *
     * @param contentType the contentType value to set.
     * @return the IntegrationAccountSchemaInner object itself.
     */
    public IntegrationAccountSchemaInner withContentType(String contentType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new IntegrationAccountSchemaProperties();
        }
        this.innerProperties().withContentType(contentType);
        return this;
    }

    /**
     * Get the contentLink property: The content link.
     *
     * @return the contentLink value.
     */
    public ContentLink contentLink() {
        return this.innerProperties() == null ? null : this.innerProperties().contentLink();
    }

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

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