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

package com.azure.resourcemanager.deviceupdate.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 Instances. */
public interface Instances {
    /**
     * Returns instances for the given account name.
     *
     * @param resourceGroupName The resource group name.
     * @param accountName Account 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 list of Instances as paginated response with {@link PagedIterable}.
     */
    PagedIterable<Instance> listByAccount(String resourceGroupName, String accountName);

    /**
     * Returns instances for the given account name.
     *
     * @param resourceGroupName The resource group name.
     * @param accountName Account 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 list of Instances as paginated response with {@link PagedIterable}.
     */
    PagedIterable<Instance> listByAccount(String resourceGroupName, String accountName, Context context);

    /**
     * Returns instance details for the given instance and account name.
     *
     * @param resourceGroupName The resource group name.
     * @param accountName Account name.
     * @param instanceName Instance 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 device Update instance details.
     */
    Instance get(String resourceGroupName, String accountName, String instanceName);

    /**
     * Returns instance details for the given instance and account name.
     *
     * @param resourceGroupName The resource group name.
     * @param accountName Account name.
     * @param instanceName Instance 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 device Update instance details along with {@link Response}.
     */
    Response<Instance> getWithResponse(
        String resourceGroupName, String accountName, String instanceName, Context context);

    /**
     * Checks whether instance exists.
     *
     * @param resourceGroupName The resource group name.
     * @param accountName Account name.
     * @param instanceName Instance 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 head(String resourceGroupName, String accountName, String instanceName);

    /**
     * Checks whether instance exists.
     *
     * @param resourceGroupName The resource group name.
     * @param accountName Account name.
     * @param instanceName Instance 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> headWithResponse(String resourceGroupName, String accountName, String instanceName, Context context);

    /**
     * Deletes instance.
     *
     * @param resourceGroupName The resource group name.
     * @param accountName Account name.
     * @param instanceName Instance 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 delete(String resourceGroupName, String accountName, String instanceName);

    /**
     * Deletes instance.
     *
     * @param resourceGroupName The resource group name.
     * @param accountName Account name.
     * @param instanceName Instance 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.
     */
    void delete(String resourceGroupName, String accountName, String instanceName, Context context);

    /**
     * Returns instance details for the given instance and account name.
     *
     * @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 device Update instance details along with {@link Response}.
     */
    Instance getById(String id);

    /**
     * Returns instance details for the given instance and account name.
     *
     * @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 device Update instance details along with {@link Response}.
     */
    Response<Instance> getByIdWithResponse(String id, Context context);

    /**
     * Deletes instance.
     *
     * @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 instance.
     *
     * @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 Instance resource.
     *
     * @param name resource name.
     * @return the first stage of the new Instance definition.
     */
    Instance.DefinitionStages.Blank define(String name);
}
