// 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;
import java.util.List;

/** The azure async operation resource. */
@Fluent
public final class IntegrationServiceEnvironmentNetworkDependency {
    /*
     * The network dependency category type.
     */
    @JsonProperty(value = "category")
    private IntegrationServiceEnvironmentNetworkDependencyCategoryType category;

    /*
     * The display name.
     */
    @JsonProperty(value = "displayName")
    private String displayName;

    /*
     * The endpoints.
     */
    @JsonProperty(value = "endpoints")
    private List<IntegrationServiceEnvironmentNetworkEndpoint> endpoints;

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

    /**
     * Get the category property: The network dependency category type.
     *
     * @return the category value.
     */
    public IntegrationServiceEnvironmentNetworkDependencyCategoryType category() {
        return this.category;
    }

    /**
     * Set the category property: The network dependency category type.
     *
     * @param category the category value to set.
     * @return the IntegrationServiceEnvironmentNetworkDependency object itself.
     */
    public IntegrationServiceEnvironmentNetworkDependency withCategory(
        IntegrationServiceEnvironmentNetworkDependencyCategoryType category) {
        this.category = category;
        return this;
    }

    /**
     * Get the displayName property: The display name.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.displayName;
    }

    /**
     * Set the displayName property: The display name.
     *
     * @param displayName the displayName value to set.
     * @return the IntegrationServiceEnvironmentNetworkDependency object itself.
     */
    public IntegrationServiceEnvironmentNetworkDependency withDisplayName(String displayName) {
        this.displayName = displayName;
        return this;
    }

    /**
     * Get the endpoints property: The endpoints.
     *
     * @return the endpoints value.
     */
    public List<IntegrationServiceEnvironmentNetworkEndpoint> endpoints() {
        return this.endpoints;
    }

    /**
     * Set the endpoints property: The endpoints.
     *
     * @param endpoints the endpoints value to set.
     * @return the IntegrationServiceEnvironmentNetworkDependency object itself.
     */
    public IntegrationServiceEnvironmentNetworkDependency withEndpoints(
        List<IntegrationServiceEnvironmentNetworkEndpoint> endpoints) {
        this.endpoints = endpoints;
        return this;
    }

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