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

package com.azure.resourcemanager.connectedvmware.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 {
    /**
     * The operation to assess patches on a vSphere VMware machine identity in Azure.
     *
     * @param resourceGroupName The name of the resource group.
     * @param name The name of the vSphere VMware 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 describes the properties of an AssessPatches result.
     */
    VirtualMachineAssessPatchesResult assessPatches(String resourceGroupName, String name);

    /**
     * The operation to assess patches on a vSphere VMware machine identity in Azure.
     *
     * @param resourceGroupName The name of the resource group.
     * @param name The name of the vSphere VMware 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 describes the properties of an AssessPatches result.
     */
    VirtualMachineAssessPatchesResult assessPatches(String resourceGroupName, String name, Context context);

    /**
     * The operation to install patches on a vSphere VMware machine identity in Azure.
     *
     * @param resourceGroupName The name of the resource group.
     * @param name The name of the vSphere VMware machine.
     * @param installPatchesInput Input for InstallPatches as directly received by the API.
     * @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 the result summary of an installation operation.
     */
    VirtualMachineInstallPatchesResult installPatches(
        String resourceGroupName, String name, VirtualMachineInstallPatchesParameters installPatchesInput);

    /**
     * The operation to install patches on a vSphere VMware machine identity in Azure.
     *
     * @param resourceGroupName The name of the resource group.
     * @param name The name of the vSphere VMware machine.
     * @param installPatchesInput Input for InstallPatches as directly received by the API.
     * @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 the result summary of an installation operation.
     */
    VirtualMachineInstallPatchesResult installPatches(
        String resourceGroupName,
        String name,
        VirtualMachineInstallPatchesParameters installPatchesInput,
        Context context);

    /**
     * Gets a virtual machine.
     *
     * <p>Implements virtual machine GET method.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param virtualMachineName Name of the virtual machine resource.
     * @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 define the virtualMachine.
     */
    VirtualMachine getByResourceGroup(String resourceGroupName, String virtualMachineName);

    /**
     * Gets a virtual machine.
     *
     * <p>Implements virtual machine GET method.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param virtualMachineName Name of the virtual machine resource.
     * @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 define the virtualMachine along with {@link Response}.
     */
    Response<VirtualMachine> getByResourceGroupWithResponse(
        String resourceGroupName, String virtualMachineName, Context context);

    /**
     * Deletes an virtual machine.
     *
     * <p>Implements virtual machine DELETE method.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param virtualMachineName Name of the virtual machine resource.
     * @param force Whether force delete was specified.
     * @param retain Whether to just disable the VM from azure and retain the VM in the VMM.
     * @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, Boolean force, Boolean retain);

    /**
     * Deletes an virtual machine.
     *
     * <p>Implements virtual machine DELETE method.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param virtualMachineName Name of the virtual machine resource.
     * @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);

    /**
     * Deletes an virtual machine.
     *
     * <p>Implements virtual machine DELETE method.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param virtualMachineName Name of the virtual machine resource.
     * @param force Whether force delete was specified.
     * @param retain Whether to just disable the VM from azure and retain the VM in the VMM.
     * @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, Boolean force, Boolean retain, Context context);

    /**
     * Implements the operation to stop a virtual machine.
     *
     * <p>Stop virtual machine.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param virtualMachineName Name of the virtual machine resource.
     * @param body Virtualmachine stop action payload.
     * @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 stop(String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body);

    /**
     * Implements the operation to stop a virtual machine.
     *
     * <p>Stop virtual machine.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param virtualMachineName Name of the virtual machine resource.
     * @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 stop(String resourceGroupName, String virtualMachineName);

    /**
     * Implements the operation to stop a virtual machine.
     *
     * <p>Stop virtual machine.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param virtualMachineName Name of the virtual machine resource.
     * @param body Virtualmachine stop action payload.
     * @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 stop(String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body, Context context);

    /**
     * Implements the operation to start a virtual machine.
     *
     * <p>Start virtual machine.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param virtualMachineName Name of the virtual machine resource.
     * @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);

    /**
     * Implements the operation to start a virtual machine.
     *
     * <p>Start virtual machine.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param virtualMachineName Name of the virtual machine resource.
     * @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);

    /**
     * Implements the operation to restart a virtual machine.
     *
     * <p>Restart virtual machine.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param virtualMachineName Name of the virtual machine resource.
     * @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);

    /**
     * Implements the operation to restart a virtual machine.
     *
     * <p>Restart virtual machine.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param virtualMachineName Name of the virtual machine resource.
     * @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);

    /**
     * Implements GET virtualMachines in a subscription.
     *
     * <p>List of virtualMachines in a 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 list of VirtualMachines as paginated response with {@link PagedIterable}.
     */
    PagedIterable<VirtualMachine> list();

    /**
     * Implements GET virtualMachines in a subscription.
     *
     * <p>List of virtualMachines in a 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 list of VirtualMachines as paginated response with {@link PagedIterable}.
     */
    PagedIterable<VirtualMachine> list(Context context);

    /**
     * Implements GET virtualMachines in a resource group.
     *
     * <p>List of virtualMachines in a resource group.
     *
     * @param resourceGroupName The Resource Group Name.
     * @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 list of VirtualMachines as paginated response with {@link PagedIterable}.
     */
    PagedIterable<VirtualMachine> listByResourceGroup(String resourceGroupName);

    /**
     * Implements GET virtualMachines in a resource group.
     *
     * <p>List of virtualMachines in a resource group.
     *
     * @param resourceGroupName The Resource Group Name.
     * @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 list of VirtualMachines as paginated response with {@link PagedIterable}.
     */
    PagedIterable<VirtualMachine> listByResourceGroup(String resourceGroupName, Context context);

    /**
     * Gets a virtual machine.
     *
     * <p>Implements virtual machine GET method.
     *
     * @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 define the virtualMachine along with {@link Response}.
     */
    VirtualMachine getById(String id);

    /**
     * Gets a virtual machine.
     *
     * <p>Implements virtual machine GET method.
     *
     * @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 define the virtualMachine along with {@link Response}.
     */
    Response<VirtualMachine> getByIdWithResponse(String id, Context context);

    /**
     * Deletes an virtual machine.
     *
     * <p>Implements virtual machine DELETE method.
     *
     * @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);

    /**
     * Deletes an virtual machine.
     *
     * <p>Implements virtual machine DELETE method.
     *
     * @param id the resource ID.
     * @param force Whether force delete was specified.
     * @param retain Whether to just disable the VM from azure and retain the VM in the VMM.
     * @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, Boolean force, Boolean retain, 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);
}
