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

package com.azure.resourcemanager.devcenter.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 NetworkConnections. */
public interface NetworkConnections {
    /**
     * Lists network connections 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 result of the network connection list operation as paginated response with {@link PagedIterable}.
     */
    PagedIterable<NetworkConnection> list();

    /**
     * Lists network connections in a subscription.
     *
     * @param top The maximum number of resources to return from the operation. Example: '$top=10'.
     * @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 result of the network connection list operation as paginated response with {@link PagedIterable}.
     */
    PagedIterable<NetworkConnection> list(Integer top, Context context);

    /**
     * Lists network connections 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 result of the network connection list operation as paginated response with {@link PagedIterable}.
     */
    PagedIterable<NetworkConnection> listByResourceGroup(String resourceGroupName);

    /**
     * Lists network connections in a resource group.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param top The maximum number of resources to return from the operation. Example: '$top=10'.
     * @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 result of the network connection list operation as paginated response with {@link PagedIterable}.
     */
    PagedIterable<NetworkConnection> listByResourceGroup(String resourceGroupName, Integer top, Context context);

    /**
     * Gets a network connection resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param networkConnectionName Name of the Network Connection that can be applied to a Pool.
     * @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 network connection resource along with {@link Response}.
     */
    Response<NetworkConnection> getByResourceGroupWithResponse(
        String resourceGroupName, String networkConnectionName, Context context);

    /**
     * Gets a network connection resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param networkConnectionName Name of the Network Connection that can be applied to a Pool.
     * @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 network connection resource.
     */
    NetworkConnection getByResourceGroup(String resourceGroupName, String networkConnectionName);

    /**
     * Deletes a Network Connections resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param networkConnectionName Name of the Network Connection that can be applied to a Pool.
     * @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 networkConnectionName);

    /**
     * Deletes a Network Connections resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param networkConnectionName Name of the Network Connection that can be applied to a Pool.
     * @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.
     */
    void delete(String resourceGroupName, String networkConnectionName, Context context);

    /**
     * Lists health check status details.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param networkConnectionName Name of the Network Connection that can be applied to a Pool.
     * @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 result of the network health check list operation as paginated response with {@link PagedIterable}.
     */
    PagedIterable<HealthCheckStatusDetails> listHealthDetails(String resourceGroupName, String networkConnectionName);

    /**
     * Lists health check status details.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param networkConnectionName Name of the Network Connection that can be applied to a Pool.
     * @param top The maximum number of resources to return from the operation. Example: '$top=10'.
     * @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 result of the network health check list operation as paginated response with {@link PagedIterable}.
     */
    PagedIterable<HealthCheckStatusDetails> listHealthDetails(
        String resourceGroupName, String networkConnectionName, Integer top, Context context);

    /**
     * Gets health check status details.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param networkConnectionName Name of the Network Connection that can be applied to a Pool.
     * @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 health check status details along with {@link Response}.
     */
    Response<HealthCheckStatusDetails> getHealthDetailsWithResponse(
        String resourceGroupName, String networkConnectionName, Context context);

    /**
     * Gets health check status details.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param networkConnectionName Name of the Network Connection that can be applied to a Pool.
     * @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 health check status details.
     */
    HealthCheckStatusDetails getHealthDetails(String resourceGroupName, String networkConnectionName);

    /**
     * Triggers a new health check run. The execution and health check result can be tracked via the network Connection
     * health check details.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param networkConnectionName Name of the Network Connection that can be applied to a Pool.
     * @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 runHealthChecks(String resourceGroupName, String networkConnectionName);

    /**
     * Triggers a new health check run. The execution and health check result can be tracked via the network Connection
     * health check details.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param networkConnectionName Name of the Network Connection that can be applied to a Pool.
     * @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.
     */
    void runHealthChecks(String resourceGroupName, String networkConnectionName, Context context);

    /**
     * Lists the endpoints that agents may call as part of Dev Box service administration. These FQDNs should be allowed
     * for outbound access in order for the Dev Box service to function.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param networkConnectionName Name of the Network Connection that can be applied to a Pool.
     * @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}.
     */
    PagedIterable<OutboundEnvironmentEndpoint> listOutboundNetworkDependenciesEndpoints(
        String resourceGroupName, String networkConnectionName);

    /**
     * Lists the endpoints that agents may call as part of Dev Box service administration. These FQDNs should be allowed
     * for outbound access in order for the Dev Box service to function.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param networkConnectionName Name of the Network Connection that can be applied to a Pool.
     * @param top The maximum number of resources to return from the operation. Example: '$top=10'.
     * @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}.
     */
    PagedIterable<OutboundEnvironmentEndpoint> listOutboundNetworkDependenciesEndpoints(
        String resourceGroupName, String networkConnectionName, Integer top, Context context);

    /**
     * Gets a network connection resource.
     *
     * @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 a network connection resource along with {@link Response}.
     */
    NetworkConnection getById(String id);

    /**
     * Gets a network connection resource.
     *
     * @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 a network connection resource along with {@link Response}.
     */
    Response<NetworkConnection> getByIdWithResponse(String id, Context context);

    /**
     * Deletes a Network Connections resource.
     *
     * @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 a Network Connections resource.
     *
     * @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.
     */
    void deleteByIdWithResponse(String id, Context context);

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