// 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.TestResultStatus;
import com.azure.resourcemanager.iothub.models.TestRouteResultDetails;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Result of testing one route. */
@Fluent
public final class TestRouteResultInner {
    /*
     * Result of testing route
     */
    @JsonProperty(value = "result")
    private TestResultStatus result;

    /*
     * Detailed result of testing route
     */
    @JsonProperty(value = "details")
    private TestRouteResultDetails details;

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

    /**
     * Get the result property: Result of testing route.
     *
     * @return the result value.
     */
    public TestResultStatus result() {
        return this.result;
    }

    /**
     * Set the result property: Result of testing route.
     *
     * @param result the result value to set.
     * @return the TestRouteResultInner object itself.
     */
    public TestRouteResultInner withResult(TestResultStatus result) {
        this.result = result;
        return this;
    }

    /**
     * Get the details property: Detailed result of testing route.
     *
     * @return the details value.
     */
    public TestRouteResultDetails details() {
        return this.details;
    }

    /**
     * Set the details property: Detailed result of testing route.
     *
     * @param details the details value to set.
     * @return the TestRouteResultInner object itself.
     */
    public TestRouteResultInner withDetails(TestRouteResultDetails details) {
        this.details = details;
        return this;
    }

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