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

package com.azure.resourcemanager.recoveryservicessiterecovery.models;

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

/** This class contains monitoring details of all the inconsistent Protected Entities in Vmm. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType")
@JsonTypeName("ConsistencyCheckTaskDetails")
@Fluent
public final class ConsistencyCheckTaskDetails extends TaskTypeDetails {
    /*
     * The list of inconsistent Vm details.
     */
    @JsonProperty(value = "vmDetails")
    private List<InconsistentVmDetails> vmDetails;

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

    /**
     * Get the vmDetails property: The list of inconsistent Vm details.
     *
     * @return the vmDetails value.
     */
    public List<InconsistentVmDetails> vmDetails() {
        return this.vmDetails;
    }

    /**
     * Set the vmDetails property: The list of inconsistent Vm details.
     *
     * @param vmDetails the vmDetails value to set.
     * @return the ConsistencyCheckTaskDetails object itself.
     */
    public ConsistencyCheckTaskDetails withVmDetails(List<InconsistentVmDetails> vmDetails) {
        this.vmDetails = vmDetails;
        return this;
    }

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