// 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 java.util.List;

/** Output of the task that collects user tables for the given list of databases. */
@Immutable
public final class GetUserTablesSqlSyncTaskOutput {
    /*
     * Mapping from database name to list of source tables
     */
    @JsonProperty(value = "databasesToSourceTables", access = JsonProperty.Access.WRITE_ONLY)
    private String databasesToSourceTables;

    /*
     * Mapping from database name to list of target tables
     */
    @JsonProperty(value = "databasesToTargetTables", access = JsonProperty.Access.WRITE_ONLY)
    private String databasesToTargetTables;

    /*
     * Mapping from database name to list of validation errors
     */
    @JsonProperty(value = "tableValidationErrors", access = JsonProperty.Access.WRITE_ONLY)
    private String tableValidationErrors;

    /*
     * Validation errors
     */
    @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY)
    private List<ReportableException> validationErrors;

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

    /**
     * Get the databasesToSourceTables property: Mapping from database name to list of source tables.
     *
     * @return the databasesToSourceTables value.
     */
    public String databasesToSourceTables() {
        return this.databasesToSourceTables;
    }

    /**
     * Get the databasesToTargetTables property: Mapping from database name to list of target tables.
     *
     * @return the databasesToTargetTables value.
     */
    public String databasesToTargetTables() {
        return this.databasesToTargetTables;
    }

    /**
     * Get the tableValidationErrors property: Mapping from database name to list of validation errors.
     *
     * @return the tableValidationErrors value.
     */
    public String tableValidationErrors() {
        return this.tableValidationErrors;
    }

    /**
     * Get the validationErrors property: Validation errors.
     *
     * @return the validationErrors value.
     */
    public List<ReportableException> validationErrors() {
        return this.validationErrors;
    }

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