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

package com.azure.resourcemanager.databox.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Details of the data to be used for importing data to azure. */
@Fluent
public final class DataImportDetails {
    /*
     * Account details of the data to be transferred
     */
    @JsonProperty(value = "accountDetails", required = true)
    private DataAccountDetails accountDetails;

    /*
     * Level of the logs to be collected.
     */
    @JsonProperty(value = "logCollectionLevel")
    private LogCollectionLevel logCollectionLevel;

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

    /**
     * Get the accountDetails property: Account details of the data to be transferred.
     *
     * @return the accountDetails value.
     */
    public DataAccountDetails accountDetails() {
        return this.accountDetails;
    }

    /**
     * Set the accountDetails property: Account details of the data to be transferred.
     *
     * @param accountDetails the accountDetails value to set.
     * @return the DataImportDetails object itself.
     */
    public DataImportDetails withAccountDetails(DataAccountDetails accountDetails) {
        this.accountDetails = accountDetails;
        return this;
    }

    /**
     * Get the logCollectionLevel property: Level of the logs to be collected.
     *
     * @return the logCollectionLevel value.
     */
    public LogCollectionLevel logCollectionLevel() {
        return this.logCollectionLevel;
    }

    /**
     * Set the logCollectionLevel property: Level of the logs to be collected.
     *
     * @param logCollectionLevel the logCollectionLevel value to set.
     * @return the DataImportDetails object itself.
     */
    public DataImportDetails withLogCollectionLevel(LogCollectionLevel logCollectionLevel) {
        this.logCollectionLevel = logCollectionLevel;
        return this;
    }

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

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