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

/** The integration account certificate properties. */
@Fluent
public final class IntegrationAccountCertificateProperties {
    /*
     * 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 key details in the key vault.
     */
    @JsonProperty(value = "key")
    private KeyVaultKeyReference key;

    /*
     * The public certificate.
     */
    @JsonProperty(value = "publicCertificate")
    private String publicCertificate;

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

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

    /**
     * Get the key property: The key details in the key vault.
     *
     * @return the key value.
     */
    public KeyVaultKeyReference key() {
        return this.key;
    }

    /**
     * Set the key property: The key details in the key vault.
     *
     * @param key the key value to set.
     * @return the IntegrationAccountCertificateProperties object itself.
     */
    public IntegrationAccountCertificateProperties withKey(KeyVaultKeyReference key) {
        this.key = key;
        return this;
    }

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

    /**
     * Set the publicCertificate property: The public certificate.
     *
     * @param publicCertificate the publicCertificate value to set.
     * @return the IntegrationAccountCertificateProperties object itself.
     */
    public IntegrationAccountCertificateProperties withPublicCertificate(String publicCertificate) {
        this.publicCertificate = publicCertificate;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (key() != null) {
            key().validate();
        }
    }
}
