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

package com.azure.resourcemanager.peering.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The properties that define an exchange peering location. */
@Fluent
public final class PeeringLocationPropertiesExchange {
    /*
     * The list of exchange peering facilities at the peering location.
     */
    @JsonProperty(value = "peeringFacilities")
    private List<ExchangePeeringFacility> peeringFacilities;

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

    /**
     * Get the peeringFacilities property: The list of exchange peering facilities at the peering location.
     *
     * @return the peeringFacilities value.
     */
    public List<ExchangePeeringFacility> peeringFacilities() {
        return this.peeringFacilities;
    }

    /**
     * Set the peeringFacilities property: The list of exchange peering facilities at the peering location.
     *
     * @param peeringFacilities the peeringFacilities value to set.
     * @return the PeeringLocationPropertiesExchange object itself.
     */
    public PeeringLocationPropertiesExchange withPeeringFacilities(List<ExchangePeeringFacility> peeringFacilities) {
        this.peeringFacilities = peeringFacilities;
        return this;
    }

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