// 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.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;

/** Resource collection API of VirtualMachines. */
public interface VirtualMachines {
    /**
     * List virtual machines in the subscription.
     *
     * <p>Get a list of virtual machines in the provided subscription.
     *
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of virtual machines in the provided subscription as paginated response with {@link PagedIterable}.
     */
    PagedIterable<VirtualMachine> list();

    /**
     * List virtual machines in the subscription.
     *
     * <p>Get a list of virtual machines in the provided subscription.
     *
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of virtual machines in the provided subscription as paginated response with {@link PagedIterable}.
     */
    PagedIterable<VirtualMachine> list(Context context);

    /**
     * List virtual machines in the resource group.
     *
     * <p>Get a list of virtual machines in the provided resource group.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of virtual machines in the provided resource group as paginated response with {@link
     *     PagedIterable}.
     */
    PagedIterable<VirtualMachine> listByResourceGroup(String resourceGroupName);

    /**
     * List virtual machines in the resource group.
     *
     * <p>Get a list of virtual machines in the provided resource group.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of virtual machines in the provided resource group as paginated response with {@link
     *     PagedIterable}.
     */
    PagedIterable<VirtualMachine> listByResourceGroup(String resourceGroupName, Context context);

    /**
     * Retrieve the virtual machine.
     *
     * <p>Get properties of the provided virtual machine.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param virtualMachineName The name of the virtual machine.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return properties of the provided virtual machine along with {@link Response}.
     */
    Response<VirtualMachine> getByResourceGroupWithResponse(
        String resourceGroupName, String virtualMachineName, Context context);

    /**
     * Retrieve the virtual machine.
     *
     * <p>Get properties of the provided virtual machine.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param virtualMachineName The name of the virtual machine.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return properties of the provided virtual machine.
     */
    VirtualMachine getByResourceGroup(String resourceGroupName, String virtualMachineName);

    /**
     * Delete the virtual machine.
     *
     * <p>Delete the provided virtual machine.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param virtualMachineName The name of the virtual machine.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void deleteByResourceGroup(String resourceGroupName, String virtualMachineName);

    /**
     * Delete the virtual machine.
     *
     * <p>Delete the provided virtual machine.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param virtualMachineName The name of the virtual machine.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void delete(String resourceGroupName, String virtualMachineName, Context context);

    /**
     * Attach volume to the virtual machine.
     *
     * <p>Attach volume to the provided virtual machine.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param virtualMachineName The name of the virtual machine.
     * @param virtualMachineAttachVolumeParameters The request body.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void attachVolume(
        String resourceGroupName,
        String virtualMachineName,
        VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters);

    /**
     * Attach volume to the virtual machine.
     *
     * <p>Attach volume to the provided virtual machine.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param virtualMachineName The name of the virtual machine.
     * @param virtualMachineAttachVolumeParameters The request body.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void attachVolume(
        String resourceGroupName,
        String virtualMachineName,
        VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters,
        Context context);

    /**
     * Detach volume from the virtual machine.
     *
     * <p>Detach volume from the provided virtual machine.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param virtualMachineName The name of the virtual machine.
     * @param virtualMachineDetachVolumeParameters The request body.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void detachVolume(
        String resourceGroupName,
        String virtualMachineName,
        VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters);

    /**
     * Detach volume from the virtual machine.
     *
     * <p>Detach volume from the provided virtual machine.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param virtualMachineName The name of the virtual machine.
     * @param virtualMachineDetachVolumeParameters The request body.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void detachVolume(
        String resourceGroupName,
        String virtualMachineName,
        VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters,
        Context context);

    /**
     * Power off the virtual machine.
     *
     * <p>Power off the provided virtual machine.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param virtualMachineName The name of the virtual machine.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void powerOff(String resourceGroupName, String virtualMachineName);

    /**
     * Power off the virtual machine.
     *
     * <p>Power off the provided virtual machine.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param virtualMachineName The name of the virtual machine.
     * @param virtualMachinePowerOffParameters The request body.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void powerOff(
        String resourceGroupName,
        String virtualMachineName,
        VirtualMachinePowerOffParameters virtualMachinePowerOffParameters,
        Context context);

    /**
     * Reimage the virtual machine.
     *
     * <p>Reimage the provided virtual machine.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param virtualMachineName The name of the virtual machine.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void reimage(String resourceGroupName, String virtualMachineName);

    /**
     * Reimage the virtual machine.
     *
     * <p>Reimage the provided virtual machine.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param virtualMachineName The name of the virtual machine.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void reimage(String resourceGroupName, String virtualMachineName, Context context);

    /**
     * Restart the virtual machine.
     *
     * <p>Restart the provided virtual machine.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param virtualMachineName The name of the virtual machine.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void restart(String resourceGroupName, String virtualMachineName);

    /**
     * Restart the virtual machine.
     *
     * <p>Restart the provided virtual machine.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param virtualMachineName The name of the virtual machine.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void restart(String resourceGroupName, String virtualMachineName, Context context);

    /**
     * Start the virtual machine.
     *
     * <p>Start the provided virtual machine.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param virtualMachineName The name of the virtual machine.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void start(String resourceGroupName, String virtualMachineName);

    /**
     * Start the virtual machine.
     *
     * <p>Start the provided virtual machine.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param virtualMachineName The name of the virtual machine.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void start(String resourceGroupName, String virtualMachineName, Context context);

    /**
     * Retrieve the virtual machine.
     *
     * <p>Get properties of the provided virtual machine.
     *
     * @param id the resource ID.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return properties of the provided virtual machine along with {@link Response}.
     */
    VirtualMachine getById(String id);

    /**
     * Retrieve the virtual machine.
     *
     * <p>Get properties of the provided virtual machine.
     *
     * @param id the resource ID.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return properties of the provided virtual machine along with {@link Response}.
     */
    Response<VirtualMachine> getByIdWithResponse(String id, Context context);

    /**
     * Delete the virtual machine.
     *
     * <p>Delete the provided virtual machine.
     *
     * @param id the resource ID.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void deleteById(String id);

    /**
     * Delete the virtual machine.
     *
     * <p>Delete the provided virtual machine.
     *
     * @param id the resource ID.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void deleteByIdWithResponse(String id, Context context);

    /**
     * Begins definition for a new VirtualMachine resource.
     *
     * @param name resource name.
     * @return the first stage of the new VirtualMachine definition.
     */
    VirtualMachine.DefinitionStages.Blank define(String name);
}
