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

package com.azure.resourcemanager.loadtesting.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.loadtesting.fluent.models.LoadTestResourceInner;
import com.azure.resourcemanager.loadtesting.fluent.models.OutboundEnvironmentEndpointInner;
import com.azure.resourcemanager.loadtesting.models.LoadTestResourcePatchRequestBody;

/** An instance of this class provides access to all the operations defined in LoadTestsClient. */
public interface LoadTestsClient {
    /**
     * Lists loadtests resources 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 resources page result as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<LoadTestResourceInner> list();

    /**
     * Lists loadtests resources 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 resources page result as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<LoadTestResourceInner> list(Context context);

    /**
     * Lists loadtest resources in a 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 list of resources page result as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<LoadTestResourceInner> listByResourceGroup(String resourceGroupName);

    /**
     * Lists loadtest resources in a 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 list of resources page result as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<LoadTestResourceInner> listByResourceGroup(String resourceGroupName, Context context);

    /**
     * Get a LoadTest resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param loadTestName Load Test 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 a LoadTest resource along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<LoadTestResourceInner> getByResourceGroupWithResponse(
        String resourceGroupName, String loadTestName, Context context);

    /**
     * Get a LoadTest resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param loadTestName Load Test 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 a LoadTest resource.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    LoadTestResourceInner getByResourceGroup(String resourceGroupName, String loadTestName);

    /**
     * Create or update LoadTest resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param loadTestName Load Test name.
     * @param loadTestResource LoadTest resource data.
     * @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 loadTest details.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<LoadTestResourceInner>, LoadTestResourceInner> beginCreateOrUpdate(
        String resourceGroupName, String loadTestName, LoadTestResourceInner loadTestResource);

    /**
     * Create or update LoadTest resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param loadTestName Load Test name.
     * @param loadTestResource LoadTest resource data.
     * @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 loadTest details.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<LoadTestResourceInner>, LoadTestResourceInner> beginCreateOrUpdate(
        String resourceGroupName, String loadTestName, LoadTestResourceInner loadTestResource, Context context);

    /**
     * Create or update LoadTest resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param loadTestName Load Test name.
     * @param loadTestResource LoadTest resource data.
     * @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 loadTest details.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    LoadTestResourceInner createOrUpdate(
        String resourceGroupName, String loadTestName, LoadTestResourceInner loadTestResource);

    /**
     * Create or update LoadTest resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param loadTestName Load Test name.
     * @param loadTestResource LoadTest resource data.
     * @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 loadTest details.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    LoadTestResourceInner createOrUpdate(
        String resourceGroupName, String loadTestName, LoadTestResourceInner loadTestResource, Context context);

    /**
     * Update a loadtest resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param loadTestName Load Test name.
     * @param loadTestResourcePatchRequestBody LoadTest resource update data.
     * @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 loadTest details.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<LoadTestResourceInner>, LoadTestResourceInner> beginUpdate(
        String resourceGroupName,
        String loadTestName,
        LoadTestResourcePatchRequestBody loadTestResourcePatchRequestBody);

    /**
     * Update a loadtest resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param loadTestName Load Test name.
     * @param loadTestResourcePatchRequestBody LoadTest resource update data.
     * @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 loadTest details.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<LoadTestResourceInner>, LoadTestResourceInner> beginUpdate(
        String resourceGroupName,
        String loadTestName,
        LoadTestResourcePatchRequestBody loadTestResourcePatchRequestBody,
        Context context);

    /**
     * Update a loadtest resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param loadTestName Load Test name.
     * @param loadTestResourcePatchRequestBody LoadTest resource update data.
     * @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 loadTest details.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    LoadTestResourceInner update(
        String resourceGroupName,
        String loadTestName,
        LoadTestResourcePatchRequestBody loadTestResourcePatchRequestBody);

    /**
     * Update a loadtest resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param loadTestName Load Test name.
     * @param loadTestResourcePatchRequestBody LoadTest resource update data.
     * @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 loadTest details.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    LoadTestResourceInner update(
        String resourceGroupName,
        String loadTestName,
        LoadTestResourcePatchRequestBody loadTestResourcePatchRequestBody,
        Context context);

    /**
     * Delete a LoadTest resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param loadTestName Load Test 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 loadTestName);

    /**
     * Delete a LoadTest resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param loadTestName Load Test 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 loadTestName, Context context);

    /**
     * Delete a LoadTest resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param loadTestName Load Test 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 loadTestName);

    /**
     * Delete a LoadTest resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param loadTestName Load Test 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 loadTestName, Context context);

    /**
     * Lists the endpoints that agents may call as part of load testing.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param loadTestName Load Test 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 values returned by the List operation as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<OutboundEnvironmentEndpointInner> listOutboundNetworkDependenciesEndpoints(
        String resourceGroupName, String loadTestName);

    /**
     * Lists the endpoints that agents may call as part of load testing.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param loadTestName Load Test 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 values returned by the List operation as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<OutboundEnvironmentEndpointInner> listOutboundNetworkDependenciesEndpoints(
        String resourceGroupName, String loadTestName, Context context);
}
