// 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.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** Results for checksum based Data Integrity validation results. */
@Immutable
public final class DataIntegrityValidationResult {
    /*
     * List of failed table names of source and target pair
     */
    @JsonProperty(value = "failedObjects", access = JsonProperty.Access.WRITE_ONLY)
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> failedObjects;

    /*
     * List of errors that happened while performing data integrity validation
     */
    @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY)
    private ValidationError validationErrors;

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

    /**
     * Get the failedObjects property: List of failed table names of source and target pair.
     *
     * @return the failedObjects value.
     */
    public Map<String, String> failedObjects() {
        return this.failedObjects;
    }

    /**
     * Get the validationErrors property: List of errors that happened while performing data integrity validation.
     *
     * @return the validationErrors value.
     */
    public ValidationError validationErrors() {
        return this.validationErrors;
    }

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