// 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.IntegrationAccountMapPropertiesParametersSchema;
import com.azure.resourcemanager.logic.models.MapType;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** The integration account map. */
@Fluent
public final class IntegrationAccountMapProperties {
    /*
     * The map type.
     */
    @JsonProperty(value = "mapType", required = true)
    private MapType mapType;

    /*
     * The parameters schema of integration account map.
     */
    @JsonProperty(value = "parametersSchema")
    private IntegrationAccountMapPropertiesParametersSchema parametersSchema;

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

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

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

    /**
     * Get the mapType property: The map type.
     *
     * @return the mapType value.
     */
    public MapType mapType() {
        return this.mapType;
    }

    /**
     * Set the mapType property: The map type.
     *
     * @param mapType the mapType value to set.
     * @return the IntegrationAccountMapProperties object itself.
     */
    public IntegrationAccountMapProperties withMapType(MapType mapType) {
        this.mapType = mapType;
        return this;
    }

    /**
     * Get the parametersSchema property: The parameters schema of integration account map.
     *
     * @return the parametersSchema value.
     */
    public IntegrationAccountMapPropertiesParametersSchema parametersSchema() {
        return this.parametersSchema;
    }

    /**
     * Set the parametersSchema property: The parameters schema of integration account map.
     *
     * @param parametersSchema the parametersSchema value to set.
     * @return the IntegrationAccountMapProperties object itself.
     */
    public IntegrationAccountMapProperties withParametersSchema(
        IntegrationAccountMapPropertiesParametersSchema parametersSchema) {
        this.parametersSchema = parametersSchema;
        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 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 IntegrationAccountMapProperties object itself.
     */
    public IntegrationAccountMapProperties 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 IntegrationAccountMapProperties object itself.
     */
    public IntegrationAccountMapProperties 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;
    }

    /**
     * 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 IntegrationAccountMapProperties object itself.
     */
    public IntegrationAccountMapProperties withMetadata(Object metadata) {
        this.metadata = metadata;
        return this;
    }

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

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