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

package com.azure.resourcemanager.devhub.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 Workflows. */
public interface Workflows {
    /**
     * Gets a list of workflows associated with the specified 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 workflows associated with the specified subscription as paginated response with {@link
     *     PagedIterable}.
     */
    PagedIterable<Workflow> list();

    /**
     * Gets a list of workflows associated with the specified 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 a list of workflows associated with the specified subscription as paginated response with {@link
     *     PagedIterable}.
     */
    PagedIterable<Workflow> list(Context context);

    /**
     * Gets a list of workflows within 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 a list of workflows within a resource group as paginated response with {@link PagedIterable}.
     */
    PagedIterable<Workflow> listByResourceGroup(String resourceGroupName);

    /**
     * Gets a list of workflows within a resource group.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param managedClusterResource The ManagedCluster resource associated with the workflows.
     * @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 workflows within a resource group as paginated response with {@link PagedIterable}.
     */
    PagedIterable<Workflow> listByResourceGroup(
        String resourceGroupName, String managedClusterResource, Context context);

    /**
     * Gets a workflow.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param workflowName The name of the workflow 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 a workflow along with {@link Response}.
     */
    Response<Workflow> getByResourceGroupWithResponse(String resourceGroupName, String workflowName, Context context);

    /**
     * Gets a workflow.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param workflowName The name of the workflow 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 a workflow.
     */
    Workflow getByResourceGroup(String resourceGroupName, String workflowName);

    /**
     * Deletes a workflow.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param workflowName The name of the workflow 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 delete response if content must be provided on delete operation along with {@link Response}.
     */
    Response<DeleteWorkflowResponse> deleteByResourceGroupWithResponse(
        String resourceGroupName, String workflowName, Context context);

    /**
     * Deletes a workflow.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param workflowName The name of the workflow 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 delete response if content must be provided on delete operation.
     */
    DeleteWorkflowResponse deleteByResourceGroup(String resourceGroupName, String workflowName);

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

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

    /**
     * Deletes a workflow.
     *
     * @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 delete response if content must be provided on delete operation along with {@link Response}.
     */
    DeleteWorkflowResponse deleteById(String id);

    /**
     * Deletes a workflow.
     *
     * @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 delete response if content must be provided on delete operation along with {@link Response}.
     */
    Response<DeleteWorkflowResponse> deleteByIdWithResponse(String id, Context context);

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