// 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 a direct peering location. */
@Fluent
public final class PeeringLocationPropertiesDirect {
    /*
     * The list of direct peering facilities at the peering location.
     */
    @JsonProperty(value = "peeringFacilities")
    private List<DirectPeeringFacility> peeringFacilities;

    /*
     * The list of bandwidth offers available at the peering location.
     */
    @JsonProperty(value = "bandwidthOffers")
    private List<PeeringBandwidthOffer> bandwidthOffers;

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

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

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

    /**
     * Get the bandwidthOffers property: The list of bandwidth offers available at the peering location.
     *
     * @return the bandwidthOffers value.
     */
    public List<PeeringBandwidthOffer> bandwidthOffers() {
        return this.bandwidthOffers;
    }

    /**
     * Set the bandwidthOffers property: The list of bandwidth offers available at the peering location.
     *
     * @param bandwidthOffers the bandwidthOffers value to set.
     * @return the PeeringLocationPropertiesDirect object itself.
     */
    public PeeringLocationPropertiesDirect withBandwidthOffers(List<PeeringBandwidthOffer> bandwidthOffers) {
        this.bandwidthOffers = bandwidthOffers;
        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());
        }
        if (bandwidthOffers() != null) {
            bandwidthOffers().forEach(e -> e.validate());
        }
    }
}
