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

/** The integration account partner properties. */
@Fluent
public final class IntegrationAccountPartnerProperties {
    /*
     * The partner type.
     */
    @JsonProperty(value = "partnerType", required = true)
    private PartnerType partnerType;

    /*
     * 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 partner content.
     */
    @JsonProperty(value = "content", required = true)
    private PartnerContent content;

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

    /**
     * Get the partnerType property: The partner type.
     *
     * @return the partnerType value.
     */
    public PartnerType partnerType() {
        return this.partnerType;
    }

    /**
     * Set the partnerType property: The partner type.
     *
     * @param partnerType the partnerType value to set.
     * @return the IntegrationAccountPartnerProperties object itself.
     */
    public IntegrationAccountPartnerProperties withPartnerType(PartnerType partnerType) {
        this.partnerType = partnerType;
        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 IntegrationAccountPartnerProperties object itself.
     */
    public IntegrationAccountPartnerProperties withMetadata(Object metadata) {
        this.metadata = metadata;
        return this;
    }

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

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

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

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