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

package com.azure.resourcemanager.appservice.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.appservice.models.VnetValidationTestFailure;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** VnetValidationFailureDetails resource specific properties. */
@Fluent
public final class VnetValidationFailureDetailsProperties {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(VnetValidationFailureDetailsProperties.class);

    /*
     * A flag describing whether or not validation failed.
     */
    @JsonProperty(value = "failed")
    private Boolean failed;

    /*
     * A list of tests that failed in the validation.
     */
    @JsonProperty(value = "failedTests")
    private List<VnetValidationTestFailure> failedTests;

    /**
     * Get the failed property: A flag describing whether or not validation failed.
     *
     * @return the failed value.
     */
    public Boolean failed() {
        return this.failed;
    }

    /**
     * Set the failed property: A flag describing whether or not validation failed.
     *
     * @param failed the failed value to set.
     * @return the VnetValidationFailureDetailsProperties object itself.
     */
    public VnetValidationFailureDetailsProperties withFailed(Boolean failed) {
        this.failed = failed;
        return this;
    }

    /**
     * Get the failedTests property: A list of tests that failed in the validation.
     *
     * @return the failedTests value.
     */
    public List<VnetValidationTestFailure> failedTests() {
        return this.failedTests;
    }

    /**
     * Set the failedTests property: A list of tests that failed in the validation.
     *
     * @param failedTests the failedTests value to set.
     * @return the VnetValidationFailureDetailsProperties object itself.
     */
    public VnetValidationFailureDetailsProperties withFailedTests(List<VnetValidationTestFailure> failedTests) {
        this.failedTests = failedTests;
        return this;
    }

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