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

package com.azure.resourcemanager.logic.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The integration service environment subnet network health. */
@Fluent
public final class IntegrationServiceEnvironmentNetworkDependencyHealth {
    /*
     * The error if any occurred during the operation.
     */
    @JsonProperty(value = "error")
    private ExtendedErrorInfo error;

    /*
     * The network dependency health state.
     */
    @JsonProperty(value = "state")
    private IntegrationServiceEnvironmentNetworkDependencyHealthState state;

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

    /**
     * Get the error property: The error if any occurred during the operation.
     *
     * @return the error value.
     */
    public ExtendedErrorInfo error() {
        return this.error;
    }

    /**
     * Set the error property: The error if any occurred during the operation.
     *
     * @param error the error value to set.
     * @return the IntegrationServiceEnvironmentNetworkDependencyHealth object itself.
     */
    public IntegrationServiceEnvironmentNetworkDependencyHealth withError(ExtendedErrorInfo error) {
        this.error = error;
        return this;
    }

    /**
     * Get the state property: The network dependency health state.
     *
     * @return the state value.
     */
    public IntegrationServiceEnvironmentNetworkDependencyHealthState state() {
        return this.state;
    }

    /**
     * Set the state property: The network dependency health state.
     *
     * @param state the state value to set.
     * @return the IntegrationServiceEnvironmentNetworkDependencyHealth object itself.
     */
    public IntegrationServiceEnvironmentNetworkDependencyHealth withState(
        IntegrationServiceEnvironmentNetworkDependencyHealthState state) {
        this.state = state;
        return this;
    }

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