// 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;

/**
 * VirtualMachineVolumeParameters represents the body of the request to handle attachment and detachment of volumes for
 * the virtual machine.
 */
@Fluent
public final class VirtualMachineVolumeParameters {
    /*
     * The resource ID of the volume.
     */
    @JsonProperty(value = "volumeId", required = true)
    private String volumeId;

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

    /**
     * Get the volumeId property: The resource ID of the volume.
     *
     * @return the volumeId value.
     */
    public String volumeId() {
        return this.volumeId;
    }

    /**
     * Set the volumeId property: The resource ID of the volume.
     *
     * @param volumeId the volumeId value to set.
     * @return the VirtualMachineVolumeParameters object itself.
     */
    public VirtualMachineVolumeParameters withVolumeId(String volumeId) {
        this.volumeId = volumeId;
        return this;
    }

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

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