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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.storagepool.models.Disk;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Properties for Disk Pool create or update request. */
@Fluent
public final class DiskPoolCreateProperties {
    /*
     * Logical zone for Disk Pool resource; example: ["1"].
     */
    @JsonProperty(value = "availabilityZones")
    private List<String> availabilityZones;

    /*
     * List of Azure Managed Disks to attach to a Disk Pool.
     */
    @JsonProperty(value = "disks")
    private List<Disk> disks;

    /*
     * Azure Resource ID of a Subnet for the Disk Pool.
     */
    @JsonProperty(value = "subnetId", required = true)
    private String subnetId;

    /*
     * List of additional capabilities for a Disk Pool.
     */
    @JsonProperty(value = "additionalCapabilities")
    private List<String> additionalCapabilities;

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

    /**
     * Get the availabilityZones property: Logical zone for Disk Pool resource; example: ["1"].
     *
     * @return the availabilityZones value.
     */
    public List<String> availabilityZones() {
        return this.availabilityZones;
    }

    /**
     * Set the availabilityZones property: Logical zone for Disk Pool resource; example: ["1"].
     *
     * @param availabilityZones the availabilityZones value to set.
     * @return the DiskPoolCreateProperties object itself.
     */
    public DiskPoolCreateProperties withAvailabilityZones(List<String> availabilityZones) {
        this.availabilityZones = availabilityZones;
        return this;
    }

    /**
     * Get the disks property: List of Azure Managed Disks to attach to a Disk Pool.
     *
     * @return the disks value.
     */
    public List<Disk> disks() {
        return this.disks;
    }

    /**
     * Set the disks property: List of Azure Managed Disks to attach to a Disk Pool.
     *
     * @param disks the disks value to set.
     * @return the DiskPoolCreateProperties object itself.
     */
    public DiskPoolCreateProperties withDisks(List<Disk> disks) {
        this.disks = disks;
        return this;
    }

    /**
     * Get the subnetId property: Azure Resource ID of a Subnet for the Disk Pool.
     *
     * @return the subnetId value.
     */
    public String subnetId() {
        return this.subnetId;
    }

    /**
     * Set the subnetId property: Azure Resource ID of a Subnet for the Disk Pool.
     *
     * @param subnetId the subnetId value to set.
     * @return the DiskPoolCreateProperties object itself.
     */
    public DiskPoolCreateProperties withSubnetId(String subnetId) {
        this.subnetId = subnetId;
        return this;
    }

    /**
     * Get the additionalCapabilities property: List of additional capabilities for a Disk Pool.
     *
     * @return the additionalCapabilities value.
     */
    public List<String> additionalCapabilities() {
        return this.additionalCapabilities;
    }

    /**
     * Set the additionalCapabilities property: List of additional capabilities for a Disk Pool.
     *
     * @param additionalCapabilities the additionalCapabilities value to set.
     * @return the DiskPoolCreateProperties object itself.
     */
    public DiskPoolCreateProperties withAdditionalCapabilities(List<String> additionalCapabilities) {
        this.additionalCapabilities = additionalCapabilities;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (disks() != null) {
            disks().forEach(e -> e.validate());
        }
        if (subnetId() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property subnetId in model DiskPoolCreateProperties"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(DiskPoolCreateProperties.class);
}
