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

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

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

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

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

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

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

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

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

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

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

    /**
     * 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 IntegrationAccountMapInner"));
        } else {
            innerProperties().validate();
        }
    }

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