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

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.logic.models.IntegrationServiceEnvironmentNetworkDependency;
import com.azure.resourcemanager.logic.models.IntegrationServiceEnvironmentNetworkDependencyHealth;
import com.azure.resourcemanager.logic.models.IntegrationServiceEnvironmentNetworkEndPointAccessibilityState;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The integration service environment subnet network health. */
@Fluent
public final class IntegrationServiceEnvironmentSubnetNetworkHealthInner {
    /*
     * The outbound network dependencies.
     */
    @JsonProperty(value = "outboundNetworkDependencies")
    private List<IntegrationServiceEnvironmentNetworkDependency> outboundNetworkDependencies;

    /*
     * The integration service environment network health.
     */
    @JsonProperty(value = "outboundNetworkHealth")
    private IntegrationServiceEnvironmentNetworkDependencyHealth outboundNetworkHealth;

    /*
     * The integration service environment network health state.
     */
    @JsonProperty(value = "networkDependencyHealthState", required = true)
    private IntegrationServiceEnvironmentNetworkEndPointAccessibilityState networkDependencyHealthState;

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

    /**
     * Get the outboundNetworkDependencies property: The outbound network dependencies.
     *
     * @return the outboundNetworkDependencies value.
     */
    public List<IntegrationServiceEnvironmentNetworkDependency> outboundNetworkDependencies() {
        return this.outboundNetworkDependencies;
    }

    /**
     * Set the outboundNetworkDependencies property: The outbound network dependencies.
     *
     * @param outboundNetworkDependencies the outboundNetworkDependencies value to set.
     * @return the IntegrationServiceEnvironmentSubnetNetworkHealthInner object itself.
     */
    public IntegrationServiceEnvironmentSubnetNetworkHealthInner withOutboundNetworkDependencies(
        List<IntegrationServiceEnvironmentNetworkDependency> outboundNetworkDependencies) {
        this.outboundNetworkDependencies = outboundNetworkDependencies;
        return this;
    }

    /**
     * Get the outboundNetworkHealth property: The integration service environment network health.
     *
     * @return the outboundNetworkHealth value.
     */
    public IntegrationServiceEnvironmentNetworkDependencyHealth outboundNetworkHealth() {
        return this.outboundNetworkHealth;
    }

    /**
     * Set the outboundNetworkHealth property: The integration service environment network health.
     *
     * @param outboundNetworkHealth the outboundNetworkHealth value to set.
     * @return the IntegrationServiceEnvironmentSubnetNetworkHealthInner object itself.
     */
    public IntegrationServiceEnvironmentSubnetNetworkHealthInner withOutboundNetworkHealth(
        IntegrationServiceEnvironmentNetworkDependencyHealth outboundNetworkHealth) {
        this.outboundNetworkHealth = outboundNetworkHealth;
        return this;
    }

    /**
     * Get the networkDependencyHealthState property: The integration service environment network health state.
     *
     * @return the networkDependencyHealthState value.
     */
    public IntegrationServiceEnvironmentNetworkEndPointAccessibilityState networkDependencyHealthState() {
        return this.networkDependencyHealthState;
    }

    /**
     * Set the networkDependencyHealthState property: The integration service environment network health state.
     *
     * @param networkDependencyHealthState the networkDependencyHealthState value to set.
     * @return the IntegrationServiceEnvironmentSubnetNetworkHealthInner object itself.
     */
    public IntegrationServiceEnvironmentSubnetNetworkHealthInner withNetworkDependencyHealthState(
        IntegrationServiceEnvironmentNetworkEndPointAccessibilityState networkDependencyHealthState) {
        this.networkDependencyHealthState = networkDependencyHealthState;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (outboundNetworkDependencies() != null) {
            outboundNetworkDependencies().forEach(e -> e.validate());
        }
        if (outboundNetworkHealth() != null) {
            outboundNetworkHealth().validate();
        }
        if (networkDependencyHealthState() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property networkDependencyHealthState in model"
                            + " IntegrationServiceEnvironmentSubnetNetworkHealthInner"));
        }
    }

    private static final ClientLogger LOGGER =
        new ClientLogger(IntegrationServiceEnvironmentSubnetNetworkHealthInner.class);
}
