// 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 EventSources. */
public interface EventSources {
    /**
     * Create or update an event source under the specified environment.
     *
     * @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 eventSourceName Name of the event source.
     * @param parameters Parameters for creating an event source 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 receives data from one or more event sources along with {@link Response}.
     */
    Response<EventSourceResource> createOrUpdateWithResponse(
        String resourceGroupName,
        String environmentName,
        String eventSourceName,
        EventSourceCreateOrUpdateParameters parameters,
        Context context);

    /**
     * Create or update an event source under the specified environment.
     *
     * @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 eventSourceName Name of the event source.
     * @param parameters Parameters for creating an event source 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 receives data from one or more event sources.
     */
    EventSourceResource createOrUpdate(
        String resourceGroupName,
        String environmentName,
        String eventSourceName,
        EventSourceCreateOrUpdateParameters parameters);

    /**
     * Gets the event source with the specified name in the specified environment.
     *
     * @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 eventSourceName The name of the Time Series Insights event source associated with the specified
     *     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 the event source with the specified name in the specified environment along with {@link Response}.
     */
    Response<EventSourceResource> getWithResponse(
        String resourceGroupName, String environmentName, String eventSourceName, Context context);

    /**
     * Gets the event source with the specified name in the specified environment.
     *
     * @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 eventSourceName The name of the Time Series Insights event source associated with the specified
     *     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 the event source with the specified name in the specified environment.
     */
    EventSourceResource get(String resourceGroupName, String environmentName, String eventSourceName);

    /**
     * Updates the event source with the specified name in the specified subscription, resource group, and environment.
     *
     * @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 eventSourceName The name of the Time Series Insights event source associated with the specified
     *     environment.
     * @param eventSourceUpdateParameters Request object that contains the updated information for the event source.
     * @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 receives data from one or more event sources along with {@link Response}.
     */
    Response<EventSourceResource> updateWithResponse(
        String resourceGroupName,
        String environmentName,
        String eventSourceName,
        EventSourceUpdateParameters eventSourceUpdateParameters,
        Context context);

    /**
     * Updates the event source with the specified name in the specified subscription, resource group, and environment.
     *
     * @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 eventSourceName The name of the Time Series Insights event source associated with the specified
     *     environment.
     * @param eventSourceUpdateParameters Request object that contains the updated information for the event source.
     * @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 receives data from one or more event sources.
     */
    EventSourceResource update(
        String resourceGroupName,
        String environmentName,
        String eventSourceName,
        EventSourceUpdateParameters eventSourceUpdateParameters);

    /**
     * Deletes the event source with the specified name in the specified subscription, resource group, and environment.
     *
     * @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 eventSourceName The name of the Time Series Insights event source associated with the specified
     *     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 the {@link Response}.
     */
    Response<Void> deleteWithResponse(
        String resourceGroupName, String environmentName, String eventSourceName, Context context);

    /**
     * Deletes the event source with the specified name in the specified subscription, resource group, and environment.
     *
     * @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 eventSourceName The name of the Time Series Insights event source associated with the specified
     *     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.
     */
    void delete(String resourceGroupName, String environmentName, String eventSourceName);

    /**
     * Lists all the available event sources associated with the subscription and within the specified resource group
     * and environment.
     *
     * @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 response of the List EventSources operation along with {@link Response}.
     */
    Response<EventSourceListResponse> listByEnvironmentWithResponse(
        String resourceGroupName, String environmentName, Context context);

    /**
     * Lists all the available event sources associated with the subscription and within the specified resource group
     * and environment.
     *
     * @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 response of the List EventSources operation.
     */
    EventSourceListResponse listByEnvironment(String resourceGroupName, String environmentName);
}
