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

package com.azure.resourcemanager.devcenter.fluent.models;

import com.azure.core.annotation.Immutable;
import com.azure.resourcemanager.devcenter.models.EndpointDependency;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** A collection of related endpoints from the same service for which the agent requires outbound access. */
@Immutable
public final class OutboundEnvironmentEndpointInner {
    /*
     * The type of service that the agent connects to.
     */
    @JsonProperty(value = "category", access = JsonProperty.Access.WRITE_ONLY)
    private String category;

    /*
     * The endpoints for this service for which the agent requires outbound access.
     */
    @JsonProperty(value = "endpoints", access = JsonProperty.Access.WRITE_ONLY)
    private List<EndpointDependency> endpoints;

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

    /**
     * Get the category property: The type of service that the agent connects to.
     *
     * @return the category value.
     */
    public String category() {
        return this.category;
    }

    /**
     * Get the endpoints property: The endpoints for this service for which the agent requires outbound access.
     *
     * @return the endpoints value.
     */
    public List<EndpointDependency> endpoints() {
        return this.endpoints;
    }

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