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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.avs.models.ClusterZone;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** List of all zones and associated hosts for a cluster. */
@Fluent
public final class ClusterZoneListInner {
    /*
     * Zone and associated hosts info
     */
    @JsonProperty(value = "zones")
    private List<ClusterZone> zones;

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

    /**
     * Get the zones property: Zone and associated hosts info.
     *
     * @return the zones value.
     */
    public List<ClusterZone> zones() {
        return this.zones;
    }

    /**
     * Set the zones property: Zone and associated hosts info.
     *
     * @param zones the zones value to set.
     * @return the ClusterZoneListInner object itself.
     */
    public ClusterZoneListInner withZones(List<ClusterZone> zones) {
        this.zones = zones;
        return this;
    }

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