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

package com.azure.resourcemanager.logic.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 IntegrationServiceEnvironments. */
public interface IntegrationServiceEnvironments {
    /**
     * Gets a list of integration service environments by 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 a list of integration service environments by subscription as paginated response with {@link
     *     PagedIterable}.
     */
    PagedIterable<IntegrationServiceEnvironment> list();

    /**
     * Gets a list of integration service environments by subscription.
     *
     * @param top The number of items to be included in the result.
     * @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 list of integration service environments by subscription as paginated response with {@link
     *     PagedIterable}.
     */
    PagedIterable<IntegrationServiceEnvironment> list(Integer top, Context context);

    /**
     * Gets a list of integration service environments by resource group.
     *
     * @param resourceGroup 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 a list of integration service environments by resource group as paginated response with {@link
     *     PagedIterable}.
     */
    PagedIterable<IntegrationServiceEnvironment> listByResourceGroup(String resourceGroup);

    /**
     * Gets a list of integration service environments by resource group.
     *
     * @param resourceGroup The resource group.
     * @param top The number of items to be included in the result.
     * @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 list of integration service environments by resource group as paginated response with {@link
     *     PagedIterable}.
     */
    PagedIterable<IntegrationServiceEnvironment> listByResourceGroup(
        String resourceGroup, Integer top, Context context);

    /**
     * Gets an integration service environment.
     *
     * @param resourceGroup The resource group.
     * @param integrationServiceEnvironmentName The integration service environment 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 an integration service environment along with {@link Response}.
     */
    Response<IntegrationServiceEnvironment> getByResourceGroupWithResponse(
        String resourceGroup, String integrationServiceEnvironmentName, Context context);

    /**
     * Gets an integration service environment.
     *
     * @param resourceGroup The resource group.
     * @param integrationServiceEnvironmentName The integration service environment 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 an integration service environment.
     */
    IntegrationServiceEnvironment getByResourceGroup(String resourceGroup, String integrationServiceEnvironmentName);

    /**
     * Deletes an integration service environment.
     *
     * @param resourceGroup The resource group.
     * @param integrationServiceEnvironmentName The integration service environment 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 Response}.
     */
    Response<Void> deleteByResourceGroupWithResponse(
        String resourceGroup, String integrationServiceEnvironmentName, Context context);

    /**
     * Deletes an integration service environment.
     *
     * @param resourceGroup The resource group.
     * @param integrationServiceEnvironmentName The integration service environment 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 deleteByResourceGroup(String resourceGroup, String integrationServiceEnvironmentName);

    /**
     * Restarts an integration service environment.
     *
     * @param resourceGroup The resource group.
     * @param integrationServiceEnvironmentName The integration service environment 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 Response}.
     */
    Response<Void> restartWithResponse(String resourceGroup, String integrationServiceEnvironmentName, Context context);

    /**
     * Restarts an integration service environment.
     *
     * @param resourceGroup The resource group.
     * @param integrationServiceEnvironmentName The integration service environment 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 restart(String resourceGroup, String integrationServiceEnvironmentName);

    /**
     * Gets an integration service environment.
     *
     * @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 an integration service environment along with {@link Response}.
     */
    IntegrationServiceEnvironment getById(String id);

    /**
     * Gets an integration service environment.
     *
     * @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 an integration service environment along with {@link Response}.
     */
    Response<IntegrationServiceEnvironment> getByIdWithResponse(String id, Context context);

    /**
     * Deletes an integration service environment.
     *
     * @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);

    /**
     * Deletes an integration service environment.
     *
     * @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 the {@link Response}.
     */
    Response<Void> deleteByIdWithResponse(String id, Context context);

    /**
     * Begins definition for a new IntegrationServiceEnvironment resource.
     *
     * @param name resource name.
     * @return the first stage of the new IntegrationServiceEnvironment definition.
     */
    IntegrationServiceEnvironment.DefinitionStages.Blank define(String name);
}
