// 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;

/** Input for testing all routes. */
@Fluent
public final class TestAllRoutesInput {
    /*
     * Routing source
     */
    @JsonProperty(value = "routingSource")
    private RoutingSource routingSource;

    /*
     * Routing message
     */
    @JsonProperty(value = "message")
    private RoutingMessage message;

    /*
     * Routing Twin Reference
     */
    @JsonProperty(value = "twin")
    private RoutingTwin twin;

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

    /**
     * Get the routingSource property: Routing source.
     *
     * @return the routingSource value.
     */
    public RoutingSource routingSource() {
        return this.routingSource;
    }

    /**
     * Set the routingSource property: Routing source.
     *
     * @param routingSource the routingSource value to set.
     * @return the TestAllRoutesInput object itself.
     */
    public TestAllRoutesInput withRoutingSource(RoutingSource routingSource) {
        this.routingSource = routingSource;
        return this;
    }

    /**
     * Get the message property: Routing message.
     *
     * @return the message value.
     */
    public RoutingMessage message() {
        return this.message;
    }

    /**
     * Set the message property: Routing message.
     *
     * @param message the message value to set.
     * @return the TestAllRoutesInput object itself.
     */
    public TestAllRoutesInput withMessage(RoutingMessage message) {
        this.message = message;
        return this;
    }

    /**
     * Get the twin property: Routing Twin Reference.
     *
     * @return the twin value.
     */
    public RoutingTwin twin() {
        return this.twin;
    }

    /**
     * Set the twin property: Routing Twin Reference.
     *
     * @param twin the twin value to set.
     * @return the TestAllRoutesInput object itself.
     */
    public TestAllRoutesInput withTwin(RoutingTwin twin) {
        this.twin = twin;
        return this;
    }

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