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

package com.azure.resourcemanager.iothub.models;

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

/** Detailed result of testing a route. */
@Fluent
public final class TestRouteResultDetails {
    /*
     * JSON-serialized list of route compilation errors
     */
    @JsonProperty(value = "compilationErrors")
    private List<RouteCompilationError> compilationErrors;

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

    /**
     * Get the compilationErrors property: JSON-serialized list of route compilation errors.
     *
     * @return the compilationErrors value.
     */
    public List<RouteCompilationError> compilationErrors() {
        return this.compilationErrors;
    }

    /**
     * Set the compilationErrors property: JSON-serialized list of route compilation errors.
     *
     * @param compilationErrors the compilationErrors value to set.
     * @return the TestRouteResultDetails object itself.
     */
    public TestRouteResultDetails withCompilationErrors(List<RouteCompilationError> compilationErrors) {
        this.compilationErrors = compilationErrors;
        return this;
    }

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