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

/** The integration account schema properties. */
@Fluent
public final class IntegrationAccountSchemaProperties {
    /*
     * The schema type.
     */
    @JsonProperty(value = "schemaType", required = true)
    private SchemaType schemaType;

    /*
     * The target namespace of the schema.
     */
    @JsonProperty(value = "targetNamespace")
    private String targetNamespace;

    /*
     * The document name.
     */
    @JsonProperty(value = "documentName")
    private String documentName;

    /*
     * The file name.
     */
    @JsonProperty(value = "fileName")
    private String fileName;

    /*
     * The created time.
     */
    @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime createdTime;

    /*
     * The changed time.
     */
    @JsonProperty(value = "changedTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime changedTime;

    /*
     * The metadata.
     */
    @JsonProperty(value = "metadata")
    private Object metadata;

    /*
     * The content.
     */
    @JsonProperty(value = "content")
    private String content;

    /*
     * The content type.
     */
    @JsonProperty(value = "contentType")
    private String contentType;

    /*
     * The content link.
     */
    @JsonProperty(value = "contentLink", access = JsonProperty.Access.WRITE_ONLY)
    private ContentLink contentLink;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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