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

package com.azure.resourcemanager.vmwarecloudsimple.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 {
    /**
     * Implements list virtual machine within subscription method
     *
     * <p>Returns list virtual machine within 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 virtual machines as paginated response with {@link PagedIterable}.
     */
    PagedIterable<VirtualMachine> list();

    /**
     * Implements list virtual machine within subscription method
     *
     * <p>Returns list virtual machine within subscription.
     *
     * @param filter The filter to apply on the list operation.
     * @param top The maximum number of record sets to return.
     * @param skipToken to be used by nextLink implementation.
     * @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 virtual machines as paginated response with {@link PagedIterable}.
     */
    PagedIterable<VirtualMachine> list(String filter, Integer top, String skipToken, Context context);

    /**
     * Implements list virtual machine within RG method
     *
     * <p>Returns list of virtual machine within resource group.
     *
     * @param resourceGroupName The name of the resource group.
     * @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 virtual machines as paginated response with {@link PagedIterable}.
     */
    PagedIterable<VirtualMachine> listByResourceGroup(String resourceGroupName);

    /**
     * Implements list virtual machine within RG method
     *
     * <p>Returns list of virtual machine within resource group.
     *
     * @param resourceGroupName The name of the resource group.
     * @param filter The filter to apply on the list operation.
     * @param top The maximum number of record sets to return.
     * @param skipToken to be used by nextLink implementation.
     * @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 virtual machines as paginated response with {@link PagedIterable}.
     */
    PagedIterable<VirtualMachine> listByResourceGroup(
        String resourceGroupName, String filter, Integer top, String skipToken, Context context);

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

    /**
     * Implements virtual machine GET method
     *
     * <p>Get virtual machine.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualMachineName virtual machine 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 virtual machine.
     */
    VirtualMachine getByResourceGroup(String resourceGroupName, String virtualMachineName);

    /**
     * Implements virtual machine DELETE method
     *
     * <p>Delete virtual machine.
     *
     * @param resourceGroupName The name of the resource group.
     * @param referer referer url.
     * @param virtualMachineName virtual machine 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.
     */
    void delete(String resourceGroupName, String referer, String virtualMachineName);

    /**
     * Implements virtual machine DELETE method
     *
     * <p>Delete virtual machine.
     *
     * @param resourceGroupName The name of the resource group.
     * @param referer referer url.
     * @param virtualMachineName virtual machine 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.
     */
    void delete(String resourceGroupName, String referer, String virtualMachineName, Context context);

    /**
     * Implements a start method for a virtual machine
     *
     * <p>Power on virtual machine.
     *
     * @param resourceGroupName The name of the resource group.
     * @param referer referer url.
     * @param virtualMachineName virtual machine 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.
     */
    void start(String resourceGroupName, String referer, String virtualMachineName);

    /**
     * Implements a start method for a virtual machine
     *
     * <p>Power on virtual machine.
     *
     * @param resourceGroupName The name of the resource group.
     * @param referer referer url.
     * @param virtualMachineName virtual machine 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.
     */
    void start(String resourceGroupName, String referer, String virtualMachineName, Context context);

    /**
     * Implements shutdown, poweroff, and suspend method for a virtual machine
     *
     * <p>Power off virtual machine, options: shutdown, poweroff, and suspend.
     *
     * @param resourceGroupName The name of the resource group.
     * @param referer referer url.
     * @param virtualMachineName virtual machine 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.
     */
    void stop(String resourceGroupName, String referer, String virtualMachineName);

    /**
     * Implements shutdown, poweroff, and suspend method for a virtual machine
     *
     * <p>Power off virtual machine, options: shutdown, poweroff, and suspend.
     *
     * @param resourceGroupName The name of the resource group.
     * @param referer referer url.
     * @param virtualMachineName virtual machine name.
     * @param mode query stop mode parameter (reboot, shutdown, etc...).
     * @param m body stop mode parameter (reboot, shutdown, etc...).
     * @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 referer,
        String virtualMachineName,
        StopMode mode,
        VirtualMachineStopMode m,
        Context context);

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

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

    /**
     * Implements virtual machine DELETE method
     *
     * <p>Delete 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);

    /**
     * Implements virtual machine DELETE method
     *
     * <p>Delete virtual machine.
     *
     * @param id the resource ID.
     * @param referer referer url.
     * @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, String referer, 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);
}
