// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { setContinuationToken } from "../pagingHelper.js";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers.js";
import * as Parameters from "../models/parameters.js";
import { createHttpPoller } from "@azure/core-lro";
import { createLroSpec } from "../lroImpl.js";
/// <reference lib="esnext.asynciterable" />
/** Class containing LongTermRetentionManagedInstanceBackups operations. */
export class LongTermRetentionManagedInstanceBackupsImpl {
    client;
    /**
     * Initialize a new instance of the class LongTermRetentionManagedInstanceBackups class.
     * @param client Reference to the service client
     */
    constructor(client) {
        this.client = client;
    }
    /**
     * Lists all long term retention backups for a managed database.
     * @param locationName The location of the database.
     * @param managedInstanceName The name of the managed instance.
     * @param databaseName The name of the managed database.
     * @param options The options parameters.
     */
    listByDatabase(locationName, managedInstanceName, databaseName, options) {
        const iter = this.listByDatabasePagingAll(locationName, managedInstanceName, databaseName, options);
        return {
            next() {
                return iter.next();
            },
            [Symbol.asyncIterator]() {
                return this;
            },
            byPage: (settings) => {
                if (settings?.maxPageSize) {
                    throw new Error("maxPageSize is not supported by this operation.");
                }
                return this.listByDatabasePagingPage(locationName, managedInstanceName, databaseName, options, settings);
            },
        };
    }
    async *listByDatabasePagingPage(locationName, managedInstanceName, databaseName, options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listByDatabase(locationName, managedInstanceName, databaseName, options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            setContinuationToken(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listByDatabaseNext(locationName, managedInstanceName, databaseName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            setContinuationToken(page, continuationToken);
            yield page;
        }
    }
    async *listByDatabasePagingAll(locationName, managedInstanceName, databaseName, options) {
        for await (const page of this.listByDatabasePagingPage(locationName, managedInstanceName, databaseName, options)) {
            yield* page;
        }
    }
    /**
     * Lists the long term retention backups for a given managed instance.
     * @param locationName The location of the database
     * @param managedInstanceName The name of the managed instance.
     * @param options The options parameters.
     */
    listByInstance(locationName, managedInstanceName, options) {
        const iter = this.listByInstancePagingAll(locationName, managedInstanceName, options);
        return {
            next() {
                return iter.next();
            },
            [Symbol.asyncIterator]() {
                return this;
            },
            byPage: (settings) => {
                if (settings?.maxPageSize) {
                    throw new Error("maxPageSize is not supported by this operation.");
                }
                return this.listByInstancePagingPage(locationName, managedInstanceName, options, settings);
            },
        };
    }
    async *listByInstancePagingPage(locationName, managedInstanceName, options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listByInstance(locationName, managedInstanceName, options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            setContinuationToken(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listByInstanceNext(locationName, managedInstanceName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            setContinuationToken(page, continuationToken);
            yield page;
        }
    }
    async *listByInstancePagingAll(locationName, managedInstanceName, options) {
        for await (const page of this.listByInstancePagingPage(locationName, managedInstanceName, options)) {
            yield* page;
        }
    }
    /**
     * Lists the long term retention backups for managed databases in a given location.
     * @param locationName The location of the database.
     * @param options The options parameters.
     */
    listByLocation(locationName, options) {
        const iter = this.listByLocationPagingAll(locationName, options);
        return {
            next() {
                return iter.next();
            },
            [Symbol.asyncIterator]() {
                return this;
            },
            byPage: (settings) => {
                if (settings?.maxPageSize) {
                    throw new Error("maxPageSize is not supported by this operation.");
                }
                return this.listByLocationPagingPage(locationName, options, settings);
            },
        };
    }
    async *listByLocationPagingPage(locationName, options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listByLocation(locationName, options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            setContinuationToken(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listByLocationNext(locationName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            setContinuationToken(page, continuationToken);
            yield page;
        }
    }
    async *listByLocationPagingAll(locationName, options) {
        for await (const page of this.listByLocationPagingPage(locationName, options)) {
            yield* page;
        }
    }
    /**
     * Lists all long term retention backups for a managed database.
     * @param resourceGroupName The name of the resource group that contains the resource. You can obtain
     *                          this value from the Azure Resource Manager API or the portal.
     * @param locationName The location of the database
     * @param managedInstanceName The name of the managed instance.
     * @param databaseName The name of the managed database.
     * @param options The options parameters.
     */
    listByResourceGroupDatabase(resourceGroupName, locationName, managedInstanceName, databaseName, options) {
        const iter = this.listByResourceGroupDatabasePagingAll(resourceGroupName, locationName, managedInstanceName, databaseName, options);
        return {
            next() {
                return iter.next();
            },
            [Symbol.asyncIterator]() {
                return this;
            },
            byPage: (settings) => {
                if (settings?.maxPageSize) {
                    throw new Error("maxPageSize is not supported by this operation.");
                }
                return this.listByResourceGroupDatabasePagingPage(resourceGroupName, locationName, managedInstanceName, databaseName, options, settings);
            },
        };
    }
    async *listByResourceGroupDatabasePagingPage(resourceGroupName, locationName, managedInstanceName, databaseName, options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listByResourceGroupDatabase(resourceGroupName, locationName, managedInstanceName, databaseName, options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            setContinuationToken(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listByResourceGroupDatabaseNext(resourceGroupName, locationName, managedInstanceName, databaseName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            setContinuationToken(page, continuationToken);
            yield page;
        }
    }
    async *listByResourceGroupDatabasePagingAll(resourceGroupName, locationName, managedInstanceName, databaseName, options) {
        for await (const page of this.listByResourceGroupDatabasePagingPage(resourceGroupName, locationName, managedInstanceName, databaseName, options)) {
            yield* page;
        }
    }
    /**
     * Lists the long term retention backups for a given managed instance.
     * @param resourceGroupName The name of the resource group that contains the resource. You can obtain
     *                          this value from the Azure Resource Manager API or the portal.
     * @param locationName The location of the database.
     * @param managedInstanceName The name of the managed instance.
     * @param options The options parameters.
     */
    listByResourceGroupInstance(resourceGroupName, locationName, managedInstanceName, options) {
        const iter = this.listByResourceGroupInstancePagingAll(resourceGroupName, locationName, managedInstanceName, options);
        return {
            next() {
                return iter.next();
            },
            [Symbol.asyncIterator]() {
                return this;
            },
            byPage: (settings) => {
                if (settings?.maxPageSize) {
                    throw new Error("maxPageSize is not supported by this operation.");
                }
                return this.listByResourceGroupInstancePagingPage(resourceGroupName, locationName, managedInstanceName, options, settings);
            },
        };
    }
    async *listByResourceGroupInstancePagingPage(resourceGroupName, locationName, managedInstanceName, options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listByResourceGroupInstance(resourceGroupName, locationName, managedInstanceName, options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            setContinuationToken(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listByResourceGroupInstanceNext(resourceGroupName, locationName, managedInstanceName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            setContinuationToken(page, continuationToken);
            yield page;
        }
    }
    async *listByResourceGroupInstancePagingAll(resourceGroupName, locationName, managedInstanceName, options) {
        for await (const page of this.listByResourceGroupInstancePagingPage(resourceGroupName, locationName, managedInstanceName, options)) {
            yield* page;
        }
    }
    /**
     * Lists the long term retention backups for managed databases in a given location.
     * @param resourceGroupName The name of the resource group that contains the resource. You can obtain
     *                          this value from the Azure Resource Manager API or the portal.
     * @param locationName The location of the database.
     * @param options The options parameters.
     */
    listByResourceGroupLocation(resourceGroupName, locationName, options) {
        const iter = this.listByResourceGroupLocationPagingAll(resourceGroupName, locationName, options);
        return {
            next() {
                return iter.next();
            },
            [Symbol.asyncIterator]() {
                return this;
            },
            byPage: (settings) => {
                if (settings?.maxPageSize) {
                    throw new Error("maxPageSize is not supported by this operation.");
                }
                return this.listByResourceGroupLocationPagingPage(resourceGroupName, locationName, options, settings);
            },
        };
    }
    async *listByResourceGroupLocationPagingPage(resourceGroupName, locationName, options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listByResourceGroupLocation(resourceGroupName, locationName, options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            setContinuationToken(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listByResourceGroupLocationNext(resourceGroupName, locationName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            setContinuationToken(page, continuationToken);
            yield page;
        }
    }
    async *listByResourceGroupLocationPagingAll(resourceGroupName, locationName, options) {
        for await (const page of this.listByResourceGroupLocationPagingPage(resourceGroupName, locationName, options)) {
            yield* page;
        }
    }
    /**
     * Gets a long term retention backup for a managed database.
     * @param locationName The location of the database.
     * @param managedInstanceName The name of the managed instance.
     * @param databaseName The name of the managed database.
     * @param backupName The backup name.
     * @param options The options parameters.
     */
    get(locationName, managedInstanceName, databaseName, backupName, options) {
        return this.client.sendOperationRequest({ locationName, managedInstanceName, databaseName, backupName, options }, getOperationSpec);
    }
    /**
     * Deletes a long term retention backup.
     * @param locationName The location of the database.
     * @param managedInstanceName The name of the managed instance.
     * @param databaseName The name of the managed database.
     * @param backupName The backup name.
     * @param options The options parameters.
     */
    async beginDelete(locationName, managedInstanceName, databaseName, backupName, options) {
        const directSendOperation = async (args, spec) => {
            return this.client.sendOperationRequest(args, spec);
        };
        const sendOperationFn = async (args, spec) => {
            let currentRawResponse = undefined;
            const providedCallback = args.options?.onResponse;
            const callback = (rawResponse, flatResponse) => {
                currentRawResponse = rawResponse;
                providedCallback?.(rawResponse, flatResponse);
            };
            const updatedArgs = {
                ...args,
                options: {
                    ...args.options,
                    onResponse: callback,
                },
            };
            const flatResponse = await directSendOperation(updatedArgs, spec);
            return {
                flatResponse,
                rawResponse: {
                    statusCode: currentRawResponse.status,
                    body: currentRawResponse.parsedBody,
                    headers: currentRawResponse.headers.toJSON(),
                },
            };
        };
        const lro = createLroSpec({
            sendOperationFn,
            args: {
                locationName,
                managedInstanceName,
                databaseName,
                backupName,
                options,
            },
            spec: deleteOperationSpec,
        });
        const poller = await createHttpPoller(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
        });
        await poller.poll();
        return poller;
    }
    /**
     * Deletes a long term retention backup.
     * @param locationName The location of the database.
     * @param managedInstanceName The name of the managed instance.
     * @param databaseName The name of the managed database.
     * @param backupName The backup name.
     * @param options The options parameters.
     */
    async beginDeleteAndWait(locationName, managedInstanceName, databaseName, backupName, options) {
        const poller = await this.beginDelete(locationName, managedInstanceName, databaseName, backupName, options);
        return poller.pollUntilDone();
    }
    /**
     * Lists all long term retention backups for a managed database.
     * @param locationName The location of the database.
     * @param managedInstanceName The name of the managed instance.
     * @param databaseName The name of the managed database.
     * @param options The options parameters.
     */
    _listByDatabase(locationName, managedInstanceName, databaseName, options) {
        return this.client.sendOperationRequest({ locationName, managedInstanceName, databaseName, options }, listByDatabaseOperationSpec);
    }
    /**
     * Lists the long term retention backups for a given managed instance.
     * @param locationName The location of the database
     * @param managedInstanceName The name of the managed instance.
     * @param options The options parameters.
     */
    _listByInstance(locationName, managedInstanceName, options) {
        return this.client.sendOperationRequest({ locationName, managedInstanceName, options }, listByInstanceOperationSpec);
    }
    /**
     * Lists the long term retention backups for managed databases in a given location.
     * @param locationName The location of the database.
     * @param options The options parameters.
     */
    _listByLocation(locationName, options) {
        return this.client.sendOperationRequest({ locationName, options }, listByLocationOperationSpec);
    }
    /**
     * Gets a long term retention backup for a managed database.
     * @param resourceGroupName The name of the resource group that contains the resource. You can obtain
     *                          this value from the Azure Resource Manager API or the portal.
     * @param locationName The location of the database.
     * @param managedInstanceName The name of the managed instance.
     * @param databaseName The name of the managed database.
     * @param backupName The backup name.
     * @param options The options parameters.
     */
    getByResourceGroup(resourceGroupName, locationName, managedInstanceName, databaseName, backupName, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            locationName,
            managedInstanceName,
            databaseName,
            backupName,
            options,
        }, getByResourceGroupOperationSpec);
    }
    /**
     * Deletes a long term retention backup.
     * @param resourceGroupName The name of the resource group that contains the resource. You can obtain
     *                          this value from the Azure Resource Manager API or the portal.
     * @param locationName The location of the database
     * @param managedInstanceName The name of the managed instance.
     * @param databaseName The name of the managed database.
     * @param backupName The backup name.
     * @param options The options parameters.
     */
    async beginDeleteByResourceGroup(resourceGroupName, locationName, managedInstanceName, databaseName, backupName, options) {
        const directSendOperation = async (args, spec) => {
            return this.client.sendOperationRequest(args, spec);
        };
        const sendOperationFn = async (args, spec) => {
            let currentRawResponse = undefined;
            const providedCallback = args.options?.onResponse;
            const callback = (rawResponse, flatResponse) => {
                currentRawResponse = rawResponse;
                providedCallback?.(rawResponse, flatResponse);
            };
            const updatedArgs = {
                ...args,
                options: {
                    ...args.options,
                    onResponse: callback,
                },
            };
            const flatResponse = await directSendOperation(updatedArgs, spec);
            return {
                flatResponse,
                rawResponse: {
                    statusCode: currentRawResponse.status,
                    body: currentRawResponse.parsedBody,
                    headers: currentRawResponse.headers.toJSON(),
                },
            };
        };
        const lro = createLroSpec({
            sendOperationFn,
            args: {
                resourceGroupName,
                locationName,
                managedInstanceName,
                databaseName,
                backupName,
                options,
            },
            spec: deleteByResourceGroupOperationSpec,
        });
        const poller = await createHttpPoller(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
        });
        await poller.poll();
        return poller;
    }
    /**
     * Deletes a long term retention backup.
     * @param resourceGroupName The name of the resource group that contains the resource. You can obtain
     *                          this value from the Azure Resource Manager API or the portal.
     * @param locationName The location of the database
     * @param managedInstanceName The name of the managed instance.
     * @param databaseName The name of the managed database.
     * @param backupName The backup name.
     * @param options The options parameters.
     */
    async beginDeleteByResourceGroupAndWait(resourceGroupName, locationName, managedInstanceName, databaseName, backupName, options) {
        const poller = await this.beginDeleteByResourceGroup(resourceGroupName, locationName, managedInstanceName, databaseName, backupName, options);
        return poller.pollUntilDone();
    }
    /**
     * Lists all long term retention backups for a managed database.
     * @param resourceGroupName The name of the resource group that contains the resource. You can obtain
     *                          this value from the Azure Resource Manager API or the portal.
     * @param locationName The location of the database
     * @param managedInstanceName The name of the managed instance.
     * @param databaseName The name of the managed database.
     * @param options The options parameters.
     */
    _listByResourceGroupDatabase(resourceGroupName, locationName, managedInstanceName, databaseName, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            locationName,
            managedInstanceName,
            databaseName,
            options,
        }, listByResourceGroupDatabaseOperationSpec);
    }
    /**
     * Lists the long term retention backups for a given managed instance.
     * @param resourceGroupName The name of the resource group that contains the resource. You can obtain
     *                          this value from the Azure Resource Manager API or the portal.
     * @param locationName The location of the database.
     * @param managedInstanceName The name of the managed instance.
     * @param options The options parameters.
     */
    _listByResourceGroupInstance(resourceGroupName, locationName, managedInstanceName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, locationName, managedInstanceName, options }, listByResourceGroupInstanceOperationSpec);
    }
    /**
     * Lists the long term retention backups for managed databases in a given location.
     * @param resourceGroupName The name of the resource group that contains the resource. You can obtain
     *                          this value from the Azure Resource Manager API or the portal.
     * @param locationName The location of the database.
     * @param options The options parameters.
     */
    _listByResourceGroupLocation(resourceGroupName, locationName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, locationName, options }, listByResourceGroupLocationOperationSpec);
    }
    /**
     * ListByDatabaseNext
     * @param locationName The location of the database.
     * @param managedInstanceName The name of the managed instance.
     * @param databaseName The name of the managed database.
     * @param nextLink The nextLink from the previous successful call to the ListByDatabase method.
     * @param options The options parameters.
     */
    _listByDatabaseNext(locationName, managedInstanceName, databaseName, nextLink, options) {
        return this.client.sendOperationRequest({ locationName, managedInstanceName, databaseName, nextLink, options }, listByDatabaseNextOperationSpec);
    }
    /**
     * ListByInstanceNext
     * @param locationName The location of the database
     * @param managedInstanceName The name of the managed instance.
     * @param nextLink The nextLink from the previous successful call to the ListByInstance method.
     * @param options The options parameters.
     */
    _listByInstanceNext(locationName, managedInstanceName, nextLink, options) {
        return this.client.sendOperationRequest({ locationName, managedInstanceName, nextLink, options }, listByInstanceNextOperationSpec);
    }
    /**
     * ListByLocationNext
     * @param locationName The location of the database.
     * @param nextLink The nextLink from the previous successful call to the ListByLocation method.
     * @param options The options parameters.
     */
    _listByLocationNext(locationName, nextLink, options) {
        return this.client.sendOperationRequest({ locationName, nextLink, options }, listByLocationNextOperationSpec);
    }
    /**
     * ListByResourceGroupDatabaseNext
     * @param resourceGroupName The name of the resource group that contains the resource. You can obtain
     *                          this value from the Azure Resource Manager API or the portal.
     * @param locationName The location of the database
     * @param managedInstanceName The name of the managed instance.
     * @param databaseName The name of the managed database.
     * @param nextLink The nextLink from the previous successful call to the ListByResourceGroupDatabase
     *                 method.
     * @param options The options parameters.
     */
    _listByResourceGroupDatabaseNext(resourceGroupName, locationName, managedInstanceName, databaseName, nextLink, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            locationName,
            managedInstanceName,
            databaseName,
            nextLink,
            options,
        }, listByResourceGroupDatabaseNextOperationSpec);
    }
    /**
     * ListByResourceGroupInstanceNext
     * @param resourceGroupName The name of the resource group that contains the resource. You can obtain
     *                          this value from the Azure Resource Manager API or the portal.
     * @param locationName The location of the database.
     * @param managedInstanceName The name of the managed instance.
     * @param nextLink The nextLink from the previous successful call to the ListByResourceGroupInstance
     *                 method.
     * @param options The options parameters.
     */
    _listByResourceGroupInstanceNext(resourceGroupName, locationName, managedInstanceName, nextLink, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            locationName,
            managedInstanceName,
            nextLink,
            options,
        }, listByResourceGroupInstanceNextOperationSpec);
    }
    /**
     * ListByResourceGroupLocationNext
     * @param resourceGroupName The name of the resource group that contains the resource. You can obtain
     *                          this value from the Azure Resource Manager API or the portal.
     * @param locationName The location of the database.
     * @param nextLink The nextLink from the previous successful call to the ListByResourceGroupLocation
     *                 method.
     * @param options The options parameters.
     */
    _listByResourceGroupLocationNext(resourceGroupName, locationName, nextLink, options) {
        return this.client.sendOperationRequest({ resourceGroupName, locationName, nextLink, options }, listByResourceGroupLocationNextOperationSpec);
    }
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const getOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ManagedInstanceLongTermRetentionBackup,
        },
        default: {},
    },
    queryParameters: [Parameters.apiVersion7],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.databaseName,
        Parameters.locationName,
        Parameters.managedInstanceName,
        Parameters.backupName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const deleteOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}",
    httpMethod: "DELETE",
    responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} },
    queryParameters: [Parameters.apiVersion7],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.databaseName,
        Parameters.locationName,
        Parameters.managedInstanceName,
        Parameters.backupName,
    ],
    serializer,
};
const listByDatabaseOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ManagedInstanceLongTermRetentionBackupListResult,
        },
        default: {},
    },
    queryParameters: [
        Parameters.apiVersion7,
        Parameters.onlyLatestPerDatabase,
        Parameters.databaseState,
    ],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.databaseName,
        Parameters.locationName,
        Parameters.managedInstanceName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByInstanceOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ManagedInstanceLongTermRetentionBackupListResult,
        },
        default: {},
    },
    queryParameters: [
        Parameters.apiVersion7,
        Parameters.onlyLatestPerDatabase,
        Parameters.databaseState,
    ],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.locationName,
        Parameters.managedInstanceName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByLocationOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ManagedInstanceLongTermRetentionBackupListResult,
        },
        default: {},
    },
    queryParameters: [
        Parameters.apiVersion7,
        Parameters.onlyLatestPerDatabase,
        Parameters.databaseState,
    ],
    urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.locationName],
    headerParameters: [Parameters.accept],
    serializer,
};
const getByResourceGroupOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ManagedInstanceLongTermRetentionBackup,
        },
        default: {},
    },
    queryParameters: [Parameters.apiVersion7],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.databaseName,
        Parameters.locationName,
        Parameters.managedInstanceName,
        Parameters.backupName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const deleteByResourceGroupOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}",
    httpMethod: "DELETE",
    responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} },
    queryParameters: [Parameters.apiVersion7],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.databaseName,
        Parameters.locationName,
        Parameters.managedInstanceName,
        Parameters.backupName,
    ],
    serializer,
};
const listByResourceGroupDatabaseOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ManagedInstanceLongTermRetentionBackupListResult,
        },
        default: {},
    },
    queryParameters: [
        Parameters.apiVersion7,
        Parameters.onlyLatestPerDatabase,
        Parameters.databaseState,
    ],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.databaseName,
        Parameters.locationName,
        Parameters.managedInstanceName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByResourceGroupInstanceOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ManagedInstanceLongTermRetentionBackupListResult,
        },
        default: {},
    },
    queryParameters: [
        Parameters.apiVersion7,
        Parameters.onlyLatestPerDatabase,
        Parameters.databaseState,
    ],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.locationName,
        Parameters.managedInstanceName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByResourceGroupLocationOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ManagedInstanceLongTermRetentionBackupListResult,
        },
        default: {},
    },
    queryParameters: [
        Parameters.apiVersion7,
        Parameters.onlyLatestPerDatabase,
        Parameters.databaseState,
    ],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.locationName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByDatabaseNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ManagedInstanceLongTermRetentionBackupListResult,
        },
        default: {},
    },
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.databaseName,
        Parameters.nextLink,
        Parameters.locationName,
        Parameters.managedInstanceName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByInstanceNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ManagedInstanceLongTermRetentionBackupListResult,
        },
        default: {},
    },
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.nextLink,
        Parameters.locationName,
        Parameters.managedInstanceName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByLocationNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ManagedInstanceLongTermRetentionBackupListResult,
        },
        default: {},
    },
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.nextLink,
        Parameters.locationName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByResourceGroupDatabaseNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ManagedInstanceLongTermRetentionBackupListResult,
        },
        default: {},
    },
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.databaseName,
        Parameters.nextLink,
        Parameters.locationName,
        Parameters.managedInstanceName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByResourceGroupInstanceNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ManagedInstanceLongTermRetentionBackupListResult,
        },
        default: {},
    },
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.nextLink,
        Parameters.locationName,
        Parameters.managedInstanceName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByResourceGroupLocationNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ManagedInstanceLongTermRetentionBackupListResult,
        },
        default: {},
    },
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.nextLink,
        Parameters.locationName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
//# sourceMappingURL=longTermRetentionManagedInstanceBackups.js.map