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

/** Output for command that completes online migration for an Azure SQL Database Managed Instance. */
@Fluent
public final class MigrateMISyncCompleteCommandOutput {
    /*
     * List of errors that happened during the command execution
     */
    @JsonProperty(value = "errors")
    private List<ReportableException> errors;

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

    /**
     * Get the errors property: List of errors that happened during the command execution.
     *
     * @return the errors value.
     */
    public List<ReportableException> errors() {
        return this.errors;
    }

    /**
     * Set the errors property: List of errors that happened during the command execution.
     *
     * @param errors the errors value to set.
     * @return the MigrateMISyncCompleteCommandOutput object itself.
     */
    public MigrateMISyncCompleteCommandOutput withErrors(List<ReportableException> errors) {
        this.errors = errors;
        return this;
    }

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