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

package com.azure.resourcemanager.timeseriesinsights.models;

import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;

/** Resource collection API of Environments. */
public interface Environments {
    /**
     * Create or update an environment in the specified subscription and resource group.
     *
     * @param resourceGroupName Name of an Azure Resource group.
     * @param environmentName Name of the environment.
     * @param parameters Parameters for creating an environment 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 an environment is a set of time-series data available for query, and is the top level Azure Time Series
     *     Insights resource.
     */
    EnvironmentResource createOrUpdate(
        String resourceGroupName, String environmentName, EnvironmentCreateOrUpdateParameters parameters);

    /**
     * Create or update an environment in the specified subscription and resource group.
     *
     * @param resourceGroupName Name of an Azure Resource group.
     * @param environmentName Name of the environment.
     * @param parameters Parameters for creating an environment 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 an environment is a set of time-series data available for query, and is the top level Azure Time Series
     *     Insights resource.
     */
    EnvironmentResource createOrUpdate(
        String resourceGroupName,
        String environmentName,
        EnvironmentCreateOrUpdateParameters parameters,
        Context context);

    /**
     * Gets the environment with the specified name in the specified subscription and resource group.
     *
     * @param resourceGroupName Name of an Azure Resource group.
     * @param environmentName The name of the Time Series Insights environment associated with the specified resource
     *     group.
     * @param expand Setting $expand=status will include the status of the internal services of the environment in the
     *     Time Series Insights service.
     * @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 environment with the specified name in the specified subscription and resource group along with
     *     {@link Response}.
     */
    Response<EnvironmentResource> getByResourceGroupWithResponse(
        String resourceGroupName, String environmentName, String expand, Context context);

    /**
     * Gets the environment with the specified name in the specified subscription and resource group.
     *
     * @param resourceGroupName Name of an Azure Resource group.
     * @param environmentName The name of the Time Series Insights environment associated with the specified 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 the environment with the specified name in the specified subscription and resource group.
     */
    EnvironmentResource getByResourceGroup(String resourceGroupName, String environmentName);

    /**
     * Updates the environment with the specified name in the specified subscription and resource group.
     *
     * @param resourceGroupName Name of an Azure Resource group.
     * @param environmentName The name of the Time Series Insights environment associated with the specified resource
     *     group.
     * @param environmentUpdateParameters Request object that contains the updated information for the environment.
     * @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 an environment is a set of time-series data available for query, and is the top level Azure Time Series
     *     Insights resource.
     */
    EnvironmentResource update(
        String resourceGroupName, String environmentName, EnvironmentUpdateParameters environmentUpdateParameters);

    /**
     * Updates the environment with the specified name in the specified subscription and resource group.
     *
     * @param resourceGroupName Name of an Azure Resource group.
     * @param environmentName The name of the Time Series Insights environment associated with the specified resource
     *     group.
     * @param environmentUpdateParameters Request object that contains the updated information for the environment.
     * @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 an environment is a set of time-series data available for query, and is the top level Azure Time Series
     *     Insights resource.
     */
    EnvironmentResource update(
        String resourceGroupName,
        String environmentName,
        EnvironmentUpdateParameters environmentUpdateParameters,
        Context context);

    /**
     * Deletes the environment with the specified name in the specified subscription and resource group.
     *
     * @param resourceGroupName Name of an Azure Resource group.
     * @param environmentName The name of the Time Series Insights environment associated with the specified resource
     *     group.
     * @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 Response}.
     */
    Response<Void> deleteByResourceGroupWithResponse(String resourceGroupName, String environmentName, Context context);

    /**
     * Deletes the environment with the specified name in the specified subscription and resource group.
     *
     * @param resourceGroupName Name of an Azure Resource group.
     * @param environmentName The name of the Time Series Insights environment associated with the specified 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.
     */
    void deleteByResourceGroup(String resourceGroupName, String environmentName);

    /**
     * Lists all the available environments associated with the subscription and within the specified resource group.
     *
     * @param resourceGroupName Name of an Azure Resource group.
     * @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 response of the List Environments operation along with {@link Response}.
     */
    Response<EnvironmentListResponse> listByResourceGroupWithResponse(String resourceGroupName, Context context);

    /**
     * Lists all the available environments associated with the subscription and within the specified resource group.
     *
     * @param resourceGroupName Name of an Azure 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 the response of the List Environments operation.
     */
    EnvironmentListResponse listByResourceGroup(String resourceGroupName);

    /**
     * Lists all the available environments within a subscription, irrespective of the resource groups.
     *
     * @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 response of the List Environments operation along with {@link Response}.
     */
    Response<EnvironmentListResponse> listBySubscriptionWithResponse(Context context);

    /**
     * Lists all the available environments within a subscription, irrespective of the resource groups.
     *
     * @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 response of the List Environments operation.
     */
    EnvironmentListResponse listBySubscription();
}
