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

package com.azure.resourcemanager.datamigration.models;

import com.azure.core.annotation.Immutable;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;

/**
 * Database level output for the task that validates connection to SQL Server and also validates source server
 * requirements.
 */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType")
@JsonTypeName("DatabaseLevelOutput")
@Immutable
public final class ConnectToSourceSqlServerTaskOutputDatabaseLevel extends ConnectToSourceSqlServerTaskOutput {
    /*
     * Database name
     */
    @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
    private String name;

    /*
     * Size of the file in megabytes
     */
    @JsonProperty(value = "sizeMB", access = JsonProperty.Access.WRITE_ONLY)
    private Double sizeMB;

    /*
     * The list of database files
     */
    @JsonProperty(value = "databaseFiles", access = JsonProperty.Access.WRITE_ONLY)
    private List<DatabaseFileInfo> databaseFiles;

    /*
     * SQL Server compatibility level of database
     */
    @JsonProperty(value = "compatibilityLevel", access = JsonProperty.Access.WRITE_ONLY)
    private DatabaseCompatLevel compatibilityLevel;

    /*
     * State of the database
     */
    @JsonProperty(value = "databaseState", access = JsonProperty.Access.WRITE_ONLY)
    private DatabaseState databaseState;

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

    /**
     * Get the name property: Database name.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Get the sizeMB property: Size of the file in megabytes.
     *
     * @return the sizeMB value.
     */
    public Double sizeMB() {
        return this.sizeMB;
    }

    /**
     * Get the databaseFiles property: The list of database files.
     *
     * @return the databaseFiles value.
     */
    public List<DatabaseFileInfo> databaseFiles() {
        return this.databaseFiles;
    }

    /**
     * Get the compatibilityLevel property: SQL Server compatibility level of database.
     *
     * @return the compatibilityLevel value.
     */
    public DatabaseCompatLevel compatibilityLevel() {
        return this.compatibilityLevel;
    }

    /**
     * Get the databaseState property: State of the database.
     *
     * @return the databaseState value.
     */
    public DatabaseState databaseState() {
        return this.databaseState;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (databaseFiles() != null) {
            databaseFiles().forEach(e -> e.validate());
        }
    }
}
