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

package com.azure.resourcemanager.networkcloud.models;

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

/** StorageProfile represents information about a disk. */
@Fluent
public final class StorageProfile {
    /*
     * OsDisk represents configuration of the boot disk.
     *
     * The disk to use with this virtual machine.
     */
    @JsonProperty(value = "osDisk", required = true)
    private OsDisk osDisk;

    /*
     * The resource IDs of volumes that are requested to be attached to the virtual machine.
     */
    @JsonProperty(value = "volumeAttachments")
    private List<String> volumeAttachments;

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

    /**
     * Get the osDisk property: OsDisk represents configuration of the boot disk.
     *
     * <p>The disk to use with this virtual machine.
     *
     * @return the osDisk value.
     */
    public OsDisk osDisk() {
        return this.osDisk;
    }

    /**
     * Set the osDisk property: OsDisk represents configuration of the boot disk.
     *
     * <p>The disk to use with this virtual machine.
     *
     * @param osDisk the osDisk value to set.
     * @return the StorageProfile object itself.
     */
    public StorageProfile withOsDisk(OsDisk osDisk) {
        this.osDisk = osDisk;
        return this;
    }

    /**
     * Get the volumeAttachments property: The resource IDs of volumes that are requested to be attached to the virtual
     * machine.
     *
     * @return the volumeAttachments value.
     */
    public List<String> volumeAttachments() {
        return this.volumeAttachments;
    }

    /**
     * Set the volumeAttachments property: The resource IDs of volumes that are requested to be attached to the virtual
     * machine.
     *
     * @param volumeAttachments the volumeAttachments value to set.
     * @return the StorageProfile object itself.
     */
    public StorageProfile withVolumeAttachments(List<String> volumeAttachments) {
        this.volumeAttachments = volumeAttachments;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (osDisk() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property osDisk in model StorageProfile"));
        } else {
            osDisk().validate();
        }
    }

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