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

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.vmwarecloudsimple.fluent.models.VirtualMachineInner;
import com.azure.resourcemanager.vmwarecloudsimple.models.PatchPayload;
import com.azure.resourcemanager.vmwarecloudsimple.models.StopMode;
import com.azure.resourcemanager.vmwarecloudsimple.models.VirtualMachineStopMode;

/** An instance of this class provides access to all the operations defined in VirtualMachinesClient. */
public interface VirtualMachinesClient {
    /**
     * 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}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<VirtualMachineInner> 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}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<VirtualMachineInner> 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}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<VirtualMachineInner> 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}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<VirtualMachineInner> 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}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<VirtualMachineInner> 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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    VirtualMachineInner getByResourceGroup(String resourceGroupName, String virtualMachineName);

    /**
     * Implements virtual machine PUT method
     *
     * <p>Create Or Update Virtual Machine.
     *
     * @param resourceGroupName The name of the resource group.
     * @param referer referer url.
     * @param virtualMachineName virtual machine name.
     * @param virtualMachineRequest Create or Update Virtual Machine request.
     * @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 {@link SyncPoller} for polling of virtual machine model.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<VirtualMachineInner>, VirtualMachineInner> beginCreateOrUpdate(
        String resourceGroupName, String referer, String virtualMachineName, VirtualMachineInner virtualMachineRequest);

    /**
     * Implements virtual machine PUT method
     *
     * <p>Create Or Update Virtual Machine.
     *
     * @param resourceGroupName The name of the resource group.
     * @param referer referer url.
     * @param virtualMachineName virtual machine name.
     * @param virtualMachineRequest Create or Update Virtual Machine request.
     * @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 {@link SyncPoller} for polling of virtual machine model.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<VirtualMachineInner>, VirtualMachineInner> beginCreateOrUpdate(
        String resourceGroupName,
        String referer,
        String virtualMachineName,
        VirtualMachineInner virtualMachineRequest,
        Context context);

    /**
     * Implements virtual machine PUT method
     *
     * <p>Create Or Update Virtual Machine.
     *
     * @param resourceGroupName The name of the resource group.
     * @param referer referer url.
     * @param virtualMachineName virtual machine name.
     * @param virtualMachineRequest Create or Update Virtual Machine request.
     * @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 model.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    VirtualMachineInner createOrUpdate(
        String resourceGroupName, String referer, String virtualMachineName, VirtualMachineInner virtualMachineRequest);

    /**
     * Implements virtual machine PUT method
     *
     * <p>Create Or Update Virtual Machine.
     *
     * @param resourceGroupName The name of the resource group.
     * @param referer referer url.
     * @param virtualMachineName virtual machine name.
     * @param virtualMachineRequest Create or Update Virtual Machine request.
     * @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 model.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    VirtualMachineInner createOrUpdate(
        String resourceGroupName,
        String referer,
        String virtualMachineName,
        VirtualMachineInner virtualMachineRequest,
        Context context);

    /**
     * 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.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginDelete(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.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginDelete(
        String resourceGroupName, String referer, String virtualMachineName, Context context);

    /**
     * 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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void delete(String resourceGroupName, String referer, String virtualMachineName, Context context);

    /**
     * Implements virtual machine PATCH method
     *
     * <p>Patch virtual machine properties.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualMachineName virtual machine name.
     * @param virtualMachineRequest Patch virtual machine request.
     * @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 {@link SyncPoller} for polling of virtual machine model.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<VirtualMachineInner>, VirtualMachineInner> beginUpdate(
        String resourceGroupName, String virtualMachineName, PatchPayload virtualMachineRequest);

    /**
     * Implements virtual machine PATCH method
     *
     * <p>Patch virtual machine properties.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualMachineName virtual machine name.
     * @param virtualMachineRequest Patch virtual machine request.
     * @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 {@link SyncPoller} for polling of virtual machine model.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<VirtualMachineInner>, VirtualMachineInner> beginUpdate(
        String resourceGroupName, String virtualMachineName, PatchPayload virtualMachineRequest, Context context);

    /**
     * Implements virtual machine PATCH method
     *
     * <p>Patch virtual machine properties.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualMachineName virtual machine name.
     * @param virtualMachineRequest Patch virtual machine request.
     * @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 model.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    VirtualMachineInner update(String resourceGroupName, String virtualMachineName, PatchPayload virtualMachineRequest);

    /**
     * Implements virtual machine PATCH method
     *
     * <p>Patch virtual machine properties.
     *
     * @param resourceGroupName The name of the resource group.
     * @param virtualMachineName virtual machine name.
     * @param virtualMachineRequest Patch virtual machine request.
     * @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 model.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    VirtualMachineInner update(
        String resourceGroupName, String virtualMachineName, PatchPayload virtualMachineRequest, 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.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginStart(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.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginStart(
        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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    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.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginStop(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.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginStop(
        String resourceGroupName,
        String referer,
        String virtualMachineName,
        StopMode mode,
        VirtualMachineStopMode m,
        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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void stop(
        String resourceGroupName,
        String referer,
        String virtualMachineName,
        StopMode mode,
        VirtualMachineStopMode m,
        Context context);
}
