// 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.iothub.models.MatchedRoute;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Result of testing all routes. */
@Fluent
public final class TestAllRoutesResultInner {
    /*
     * JSON-serialized array of matched routes
     */
    @JsonProperty(value = "routes")
    private List<MatchedRoute> routes;

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

    /**
     * Get the routes property: JSON-serialized array of matched routes.
     *
     * @return the routes value.
     */
    public List<MatchedRoute> routes() {
        return this.routes;
    }

    /**
     * Set the routes property: JSON-serialized array of matched routes.
     *
     * @param routes the routes value to set.
     * @return the TestAllRoutesResultInner object itself.
     */
    public TestAllRoutesResultInner withRoutes(List<MatchedRoute> routes) {
        this.routes = routes;
        return this;
    }

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