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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.netapp.models.VolumeGroupMetadata;
import com.azure.resourcemanager.netapp.models.VolumeGroupVolumeProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Volume group properties. */
@Fluent
public final class VolumeGroupProperties {
    /*
     * Azure lifecycle management
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private String provisioningState;

    /*
     * Volume group details
     */
    @JsonProperty(value = "groupMetaData")
    private VolumeGroupMetadata groupMetadata;

    /*
     * List of volumes from group
     */
    @JsonProperty(value = "volumes")
    private List<VolumeGroupVolumeProperties> volumes;

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

    /**
     * Get the provisioningState property: Azure lifecycle management.
     *
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the groupMetadata property: Volume group details.
     *
     * @return the groupMetadata value.
     */
    public VolumeGroupMetadata groupMetadata() {
        return this.groupMetadata;
    }

    /**
     * Set the groupMetadata property: Volume group details.
     *
     * @param groupMetadata the groupMetadata value to set.
     * @return the VolumeGroupProperties object itself.
     */
    public VolumeGroupProperties withGroupMetadata(VolumeGroupMetadata groupMetadata) {
        this.groupMetadata = groupMetadata;
        return this;
    }

    /**
     * Get the volumes property: List of volumes from group.
     *
     * @return the volumes value.
     */
    public List<VolumeGroupVolumeProperties> volumes() {
        return this.volumes;
    }

    /**
     * Set the volumes property: List of volumes from group.
     *
     * @param volumes the volumes value to set.
     * @return the VolumeGroupProperties object itself.
     */
    public VolumeGroupProperties withVolumes(List<VolumeGroupVolumeProperties> volumes) {
        this.volumes = volumes;
        return this;
    }

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