// 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.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.Map;

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

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

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

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

    /** {@inheritDoc} */
    @Override
    public IntegrationAccountSessionInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        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 session content.
     *
     * @return the content value.
     */
    public Object content() {
        return this.innerProperties() == null ? null : this.innerProperties().content();
    }

    /**
     * Set the content property: The session content.
     *
     * @param content the content value to set.
     * @return the IntegrationAccountSessionInner object itself.
     */
    public IntegrationAccountSessionInner withContent(Object content) {
        if (this.innerProperties() == null) {
            this.innerProperties = new IntegrationAccountSessionProperties();
        }
        this.innerProperties().withContent(content);
        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 IntegrationAccountSessionInner"));
        } else {
            innerProperties().validate();
        }
    }

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