// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.databoxedge.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.databoxedge.models.AzureContainerDataFormat;
import com.azure.resourcemanager.databoxedge.models.ContainerStatus;
import com.azure.resourcemanager.databoxedge.models.RefreshDetails;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** The container properties. */
@Fluent
public final class ContainerProperties {
    /*
     * Current status of the container.
     */
    @JsonProperty(value = "containerStatus", access = JsonProperty.Access.WRITE_ONLY)
    private ContainerStatus containerStatus;

    /*
     * DataFormat for Container
     */
    @JsonProperty(value = "dataFormat", required = true)
    private AzureContainerDataFormat dataFormat;

    /*
     * Details of the refresh job on this container.
     */
    @JsonProperty(value = "refreshDetails", access = JsonProperty.Access.WRITE_ONLY)
    private RefreshDetails refreshDetails;

    /*
     * The UTC time when container got created.
     */
    @JsonProperty(value = "createdDateTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime createdDateTime;

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

    /**
     * Get the containerStatus property: Current status of the container.
     *
     * @return the containerStatus value.
     */
    public ContainerStatus containerStatus() {
        return this.containerStatus;
    }

    /**
     * Get the dataFormat property: DataFormat for Container.
     *
     * @return the dataFormat value.
     */
    public AzureContainerDataFormat dataFormat() {
        return this.dataFormat;
    }

    /**
     * Set the dataFormat property: DataFormat for Container.
     *
     * @param dataFormat the dataFormat value to set.
     * @return the ContainerProperties object itself.
     */
    public ContainerProperties withDataFormat(AzureContainerDataFormat dataFormat) {
        this.dataFormat = dataFormat;
        return this;
    }

    /**
     * Get the refreshDetails property: Details of the refresh job on this container.
     *
     * @return the refreshDetails value.
     */
    public RefreshDetails refreshDetails() {
        return this.refreshDetails;
    }

    /**
     * Get the createdDateTime property: The UTC time when container got created.
     *
     * @return the createdDateTime value.
     */
    public OffsetDateTime createdDateTime() {
        return this.createdDateTime;
    }

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

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