"use strict";
/*
 * Copyright (c) Microsoft Corporation.
 * Licensed under the MIT License.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 * Changes may cause incorrect behavior and will be lost if the code is regenerated.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.LongTermRetentionBackupsImpl = void 0;
const tslib_1 = require("tslib");
const pagingHelper_js_1 = require("../pagingHelper.js");
const coreClient = tslib_1.__importStar(require("@azure/core-client"));
const Mappers = tslib_1.__importStar(require("../models/mappers.js"));
const Parameters = tslib_1.__importStar(require("../models/parameters.js"));
const core_lro_1 = require("@azure/core-lro");
const lroImpl_js_1 = require("../lroImpl.js");
/// <reference lib="esnext.asynciterable" />
/** Class containing LongTermRetentionBackups operations. */
class LongTermRetentionBackupsImpl {
    client;
    /**
     * Initialize a new instance of the class LongTermRetentionBackups class.
     * @param client Reference to the service client
     */
    constructor(client) {
        this.client = client;
    }
    /**
     * Lists the long term retention backups for 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;
            (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listByLocationNext(locationName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
            yield page;
        }
    }
    async *listByLocationPagingAll(locationName, options) {
        for await (const page of this.listByLocationPagingPage(locationName, options)) {
            yield* page;
        }
    }
    /**
     * Lists the long term retention backups for a given server.
     * @param locationName The location of the database
     * @param longTermRetentionServerName The name of the server
     * @param options The options parameters.
     */
    listByServer(locationName, longTermRetentionServerName, options) {
        const iter = this.listByServerPagingAll(locationName, longTermRetentionServerName, 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.listByServerPagingPage(locationName, longTermRetentionServerName, options, settings);
            },
        };
    }
    async *listByServerPagingPage(locationName, longTermRetentionServerName, options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listByServer(locationName, longTermRetentionServerName, options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listByServerNext(locationName, longTermRetentionServerName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
            yield page;
        }
    }
    async *listByServerPagingAll(locationName, longTermRetentionServerName, options) {
        for await (const page of this.listByServerPagingPage(locationName, longTermRetentionServerName, options)) {
            yield* page;
        }
    }
    /**
     * Lists all long term retention backups for a database.
     * @param locationName The location of the database
     * @param longTermRetentionServerName The name of the server
     * @param longTermRetentionDatabaseName The name of the database
     * @param options The options parameters.
     */
    listByDatabase(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options) {
        const iter = this.listByDatabasePagingAll(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, 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, longTermRetentionServerName, longTermRetentionDatabaseName, options, settings);
            },
        };
    }
    async *listByDatabasePagingPage(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listByDatabase(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listByDatabaseNext(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
            yield page;
        }
    }
    async *listByDatabasePagingAll(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options) {
        for await (const page of this.listByDatabasePagingPage(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options)) {
            yield* page;
        }
    }
    /**
     * Lists the long term retention backups for a given location based on resource group.
     * @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;
            (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listByResourceGroupLocationNext(resourceGroupName, locationName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
            yield page;
        }
    }
    async *listByResourceGroupLocationPagingAll(resourceGroupName, locationName, options) {
        for await (const page of this.listByResourceGroupLocationPagingPage(resourceGroupName, locationName, options)) {
            yield* page;
        }
    }
    /**
     * Lists the long term retention backups for a given server based on resource groups.
     * @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 longTermRetentionServerName The name of the server
     * @param options The options parameters.
     */
    listByResourceGroupServer(resourceGroupName, locationName, longTermRetentionServerName, options) {
        const iter = this.listByResourceGroupServerPagingAll(resourceGroupName, locationName, longTermRetentionServerName, 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.listByResourceGroupServerPagingPage(resourceGroupName, locationName, longTermRetentionServerName, options, settings);
            },
        };
    }
    async *listByResourceGroupServerPagingPage(resourceGroupName, locationName, longTermRetentionServerName, options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listByResourceGroupServer(resourceGroupName, locationName, longTermRetentionServerName, options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listByResourceGroupServerNext(resourceGroupName, locationName, longTermRetentionServerName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
            yield page;
        }
    }
    async *listByResourceGroupServerPagingAll(resourceGroupName, locationName, longTermRetentionServerName, options) {
        for await (const page of this.listByResourceGroupServerPagingPage(resourceGroupName, locationName, longTermRetentionServerName, options)) {
            yield* page;
        }
    }
    /**
     * Lists all long term retention backups for a database based on a particular resource group.
     * @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 longTermRetentionServerName The name of the server
     * @param longTermRetentionDatabaseName The name of the database
     * @param options The options parameters.
     */
    listByResourceGroupDatabase(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options) {
        const iter = this.listByResourceGroupDatabasePagingAll(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, 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, longTermRetentionServerName, longTermRetentionDatabaseName, options, settings);
            },
        };
    }
    async *listByResourceGroupDatabasePagingPage(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listByResourceGroupDatabase(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listByResourceGroupDatabaseNext(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
            yield page;
        }
    }
    async *listByResourceGroupDatabasePagingAll(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options) {
        for await (const page of this.listByResourceGroupDatabasePagingPage(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options)) {
            yield* page;
        }
    }
    /**
     * Lists the long term retention backups for 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);
    }
    /**
     * Lists the long term retention backups for a given server.
     * @param locationName The location of the database
     * @param longTermRetentionServerName The name of the server
     * @param options The options parameters.
     */
    _listByServer(locationName, longTermRetentionServerName, options) {
        return this.client.sendOperationRequest({ locationName, longTermRetentionServerName, options }, listByServerOperationSpec);
    }
    /**
     * Lists all long term retention backups for a database.
     * @param locationName The location of the database
     * @param longTermRetentionServerName The name of the server
     * @param longTermRetentionDatabaseName The name of the database
     * @param options The options parameters.
     */
    _listByDatabase(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options) {
        return this.client.sendOperationRequest({
            locationName,
            longTermRetentionServerName,
            longTermRetentionDatabaseName,
            options,
        }, listByDatabaseOperationSpec);
    }
    /**
     * Gets a long term retention backup.
     * @param locationName The location of the database.
     * @param longTermRetentionServerName The name of the server
     * @param longTermRetentionDatabaseName The name of the database
     * @param backupName The backup name.
     * @param options The options parameters.
     */
    get(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options) {
        return this.client.sendOperationRequest({
            locationName,
            longTermRetentionServerName,
            longTermRetentionDatabaseName,
            backupName,
            options,
        }, getOperationSpec);
    }
    /**
     * Deletes a long term retention backup.
     * @param locationName The location of the database
     * @param longTermRetentionServerName The name of the server
     * @param longTermRetentionDatabaseName The name of the database
     * @param backupName The backup name.
     * @param options The options parameters.
     */
    async beginDelete(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, 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 = (0, lroImpl_js_1.createLroSpec)({
            sendOperationFn,
            args: {
                locationName,
                longTermRetentionServerName,
                longTermRetentionDatabaseName,
                backupName,
                options,
            },
            spec: deleteOperationSpec,
        });
        const poller = await (0, core_lro_1.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 longTermRetentionServerName The name of the server
     * @param longTermRetentionDatabaseName The name of the database
     * @param backupName The backup name.
     * @param options The options parameters.
     */
    async beginDeleteAndWait(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options) {
        const poller = await this.beginDelete(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options);
        return poller.pollUntilDone();
    }
    /**
     * Change a long term retention backup access tier.
     * @param locationName
     * @param longTermRetentionServerName
     * @param longTermRetentionDatabaseName
     * @param backupName
     * @param parameters Contains the information necessary to change long term retention backup access
     *                   tier and related operation mode.
     * @param options The options parameters.
     */
    async beginChangeAccessTier(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, 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 = (0, lroImpl_js_1.createLroSpec)({
            sendOperationFn,
            args: {
                locationName,
                longTermRetentionServerName,
                longTermRetentionDatabaseName,
                backupName,
                parameters,
                options,
            },
            spec: changeAccessTierOperationSpec,
        });
        const poller = await (0, core_lro_1.createHttpPoller)(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
        });
        await poller.poll();
        return poller;
    }
    /**
     * Change a long term retention backup access tier.
     * @param locationName
     * @param longTermRetentionServerName
     * @param longTermRetentionDatabaseName
     * @param backupName
     * @param parameters Contains the information necessary to change long term retention backup access
     *                   tier and related operation mode.
     * @param options The options parameters.
     */
    async beginChangeAccessTierAndWait(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options) {
        const poller = await this.beginChangeAccessTier(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options);
        return poller.pollUntilDone();
    }
    /**
     * Copy an existing long term retention backup.
     * @param locationName The location of the database.
     * @param longTermRetentionServerName The name of the server
     * @param longTermRetentionDatabaseName The name of the database
     * @param backupName The backup name.
     * @param parameters The parameters needed for long term retention copy request
     * @param options The options parameters.
     */
    async beginCopy(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, 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 = (0, lroImpl_js_1.createLroSpec)({
            sendOperationFn,
            args: {
                locationName,
                longTermRetentionServerName,
                longTermRetentionDatabaseName,
                backupName,
                parameters,
                options,
            },
            spec: copyOperationSpec,
        });
        const poller = await (0, core_lro_1.createHttpPoller)(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
        });
        await poller.poll();
        return poller;
    }
    /**
     * Copy an existing long term retention backup.
     * @param locationName The location of the database.
     * @param longTermRetentionServerName The name of the server
     * @param longTermRetentionDatabaseName The name of the database
     * @param backupName The backup name.
     * @param parameters The parameters needed for long term retention copy request
     * @param options The options parameters.
     */
    async beginCopyAndWait(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options) {
        const poller = await this.beginCopy(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options);
        return poller.pollUntilDone();
    }
    /**
     * Updates an existing long term retention backup.
     * @param locationName The location of the database.
     * @param longTermRetentionServerName The name of the server
     * @param longTermRetentionDatabaseName The name of the database
     * @param backupName The backup name.
     * @param parameters The requested backup resource state
     * @param options The options parameters.
     */
    async beginUpdate(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, 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 = (0, lroImpl_js_1.createLroSpec)({
            sendOperationFn,
            args: {
                locationName,
                longTermRetentionServerName,
                longTermRetentionDatabaseName,
                backupName,
                parameters,
                options,
            },
            spec: updateOperationSpec,
        });
        const poller = await (0, core_lro_1.createHttpPoller)(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
        });
        await poller.poll();
        return poller;
    }
    /**
     * Updates an existing long term retention backup.
     * @param locationName The location of the database.
     * @param longTermRetentionServerName The name of the server
     * @param longTermRetentionDatabaseName The name of the database
     * @param backupName The backup name.
     * @param parameters The requested backup resource state
     * @param options The options parameters.
     */
    async beginUpdateAndWait(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options) {
        const poller = await this.beginUpdate(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options);
        return poller.pollUntilDone();
    }
    /**
     * Lists the long term retention backups for a given location based on resource group.
     * @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);
    }
    /**
     * Lists the long term retention backups for a given server based on resource groups.
     * @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 longTermRetentionServerName The name of the server
     * @param options The options parameters.
     */
    _listByResourceGroupServer(resourceGroupName, locationName, longTermRetentionServerName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, locationName, longTermRetentionServerName, options }, listByResourceGroupServerOperationSpec);
    }
    /**
     * Lists all long term retention backups for a database based on a particular resource group.
     * @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 longTermRetentionServerName The name of the server
     * @param longTermRetentionDatabaseName The name of the database
     * @param options The options parameters.
     */
    _listByResourceGroupDatabase(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            locationName,
            longTermRetentionServerName,
            longTermRetentionDatabaseName,
            options,
        }, listByResourceGroupDatabaseOperationSpec);
    }
    /**
     * Gets 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 longTermRetentionServerName The name of the server
     * @param longTermRetentionDatabaseName The name of the database
     * @param backupName The backup name.
     * @param options The options parameters.
     */
    getByResourceGroup(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            locationName,
            longTermRetentionServerName,
            longTermRetentionDatabaseName,
            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 longTermRetentionServerName The name of the server
     * @param longTermRetentionDatabaseName The name of the database
     * @param backupName The backup name.
     * @param options The options parameters.
     */
    async beginDeleteByResourceGroup(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, 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 = (0, lroImpl_js_1.createLroSpec)({
            sendOperationFn,
            args: {
                resourceGroupName,
                locationName,
                longTermRetentionServerName,
                longTermRetentionDatabaseName,
                backupName,
                options,
            },
            spec: deleteByResourceGroupOperationSpec,
        });
        const poller = await (0, core_lro_1.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 longTermRetentionServerName The name of the server
     * @param longTermRetentionDatabaseName The name of the database
     * @param backupName The backup name.
     * @param options The options parameters.
     */
    async beginDeleteByResourceGroupAndWait(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options) {
        const poller = await this.beginDeleteByResourceGroup(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options);
        return poller.pollUntilDone();
    }
    /**
     * Change a long term retention backup access tier.
     * @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
     * @param longTermRetentionServerName
     * @param longTermRetentionDatabaseName
     * @param backupName
     * @param parameters Contains the information necessary to change long term retention backup access
     *                   tier and related operation mode.
     * @param options The options parameters.
     */
    async beginChangeAccessTierByResourceGroup(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, 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 = (0, lroImpl_js_1.createLroSpec)({
            sendOperationFn,
            args: {
                resourceGroupName,
                locationName,
                longTermRetentionServerName,
                longTermRetentionDatabaseName,
                backupName,
                parameters,
                options,
            },
            spec: changeAccessTierByResourceGroupOperationSpec,
        });
        const poller = await (0, core_lro_1.createHttpPoller)(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
        });
        await poller.poll();
        return poller;
    }
    /**
     * Change a long term retention backup access tier.
     * @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
     * @param longTermRetentionServerName
     * @param longTermRetentionDatabaseName
     * @param backupName
     * @param parameters Contains the information necessary to change long term retention backup access
     *                   tier and related operation mode.
     * @param options The options parameters.
     */
    async beginChangeAccessTierByResourceGroupAndWait(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options) {
        const poller = await this.beginChangeAccessTierByResourceGroup(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options);
        return poller.pollUntilDone();
    }
    /**
     * Copy an existing long term retention backup to a different server.
     * @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 longTermRetentionServerName The name of the server
     * @param longTermRetentionDatabaseName The name of the database
     * @param backupName The backup name.
     * @param parameters The parameters needed for long term retention copy request
     * @param options The options parameters.
     */
    async beginCopyByResourceGroup(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, 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 = (0, lroImpl_js_1.createLroSpec)({
            sendOperationFn,
            args: {
                resourceGroupName,
                locationName,
                longTermRetentionServerName,
                longTermRetentionDatabaseName,
                backupName,
                parameters,
                options,
            },
            spec: copyByResourceGroupOperationSpec,
        });
        const poller = await (0, core_lro_1.createHttpPoller)(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
        });
        await poller.poll();
        return poller;
    }
    /**
     * Copy an existing long term retention backup to a different server.
     * @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 longTermRetentionServerName The name of the server
     * @param longTermRetentionDatabaseName The name of the database
     * @param backupName The backup name.
     * @param parameters The parameters needed for long term retention copy request
     * @param options The options parameters.
     */
    async beginCopyByResourceGroupAndWait(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options) {
        const poller = await this.beginCopyByResourceGroup(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options);
        return poller.pollUntilDone();
    }
    /**
     * Updates an existing 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 longTermRetentionServerName The name of the server
     * @param longTermRetentionDatabaseName The name of the database
     * @param backupName The backup name.
     * @param parameters The requested backup resource state
     * @param options The options parameters.
     */
    async beginUpdateByResourceGroup(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, 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 = (0, lroImpl_js_1.createLroSpec)({
            sendOperationFn,
            args: {
                resourceGroupName,
                locationName,
                longTermRetentionServerName,
                longTermRetentionDatabaseName,
                backupName,
                parameters,
                options,
            },
            spec: updateByResourceGroupOperationSpec,
        });
        const poller = await (0, core_lro_1.createHttpPoller)(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
        });
        await poller.poll();
        return poller;
    }
    /**
     * Updates an existing 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 longTermRetentionServerName The name of the server
     * @param longTermRetentionDatabaseName The name of the database
     * @param backupName The backup name.
     * @param parameters The requested backup resource state
     * @param options The options parameters.
     */
    async beginUpdateByResourceGroupAndWait(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options) {
        const poller = await this.beginUpdateByResourceGroup(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options);
        return poller.pollUntilDone();
    }
    /**
     * 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);
    }
    /**
     * ListByServerNext
     * @param locationName The location of the database
     * @param longTermRetentionServerName The name of the server
     * @param nextLink The nextLink from the previous successful call to the ListByServer method.
     * @param options The options parameters.
     */
    _listByServerNext(locationName, longTermRetentionServerName, nextLink, options) {
        return this.client.sendOperationRequest({ locationName, longTermRetentionServerName, nextLink, options }, listByServerNextOperationSpec);
    }
    /**
     * ListByDatabaseNext
     * @param locationName The location of the database
     * @param longTermRetentionServerName The name of the server
     * @param longTermRetentionDatabaseName The name of the database
     * @param nextLink The nextLink from the previous successful call to the ListByDatabase method.
     * @param options The options parameters.
     */
    _listByDatabaseNext(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, nextLink, options) {
        return this.client.sendOperationRequest({
            locationName,
            longTermRetentionServerName,
            longTermRetentionDatabaseName,
            nextLink,
            options,
        }, listByDatabaseNextOperationSpec);
    }
    /**
     * 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);
    }
    /**
     * ListByResourceGroupServerNext
     * @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 longTermRetentionServerName The name of the server
     * @param nextLink The nextLink from the previous successful call to the ListByResourceGroupServer
     *                 method.
     * @param options The options parameters.
     */
    _listByResourceGroupServerNext(resourceGroupName, locationName, longTermRetentionServerName, nextLink, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            locationName,
            longTermRetentionServerName,
            nextLink,
            options,
        }, listByResourceGroupServerNextOperationSpec);
    }
    /**
     * 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 longTermRetentionServerName The name of the server
     * @param longTermRetentionDatabaseName The name of the database
     * @param nextLink The nextLink from the previous successful call to the ListByResourceGroupDatabase
     *                 method.
     * @param options The options parameters.
     */
    _listByResourceGroupDatabaseNext(resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, nextLink, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            locationName,
            longTermRetentionServerName,
            longTermRetentionDatabaseName,
            nextLink,
            options,
        }, listByResourceGroupDatabaseNextOperationSpec);
    }
}
exports.LongTermRetentionBackupsImpl = LongTermRetentionBackupsImpl;
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listByLocationOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.LongTermRetentionBackupListResult,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [
        Parameters.apiVersion4,
        Parameters.onlyLatestPerDatabase,
        Parameters.databaseState,
    ],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.locationName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByServerOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.LongTermRetentionBackupListResult,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [
        Parameters.apiVersion4,
        Parameters.onlyLatestPerDatabase,
        Parameters.databaseState,
    ],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.locationName,
        Parameters.longTermRetentionServerName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByDatabaseOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.LongTermRetentionBackupListResult,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [
        Parameters.apiVersion4,
        Parameters.onlyLatestPerDatabase,
        Parameters.databaseState,
    ],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.locationName,
        Parameters.longTermRetentionServerName,
        Parameters.longTermRetentionDatabaseName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const getOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.LongTermRetentionBackup,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion4],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.locationName,
        Parameters.backupName,
        Parameters.longTermRetentionServerName,
        Parameters.longTermRetentionDatabaseName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const deleteOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}",
    httpMethod: "DELETE",
    responses: {
        200: {},
        201: {},
        202: {},
        204: {},
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion4],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.locationName,
        Parameters.backupName,
        Parameters.longTermRetentionServerName,
        Parameters.longTermRetentionDatabaseName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const changeAccessTierOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/changeAccessTier",
    httpMethod: "POST",
    responses: {
        200: {
            bodyMapper: Mappers.LongTermRetentionBackup,
        },
        201: {
            bodyMapper: Mappers.LongTermRetentionBackup,
        },
        202: {
            bodyMapper: Mappers.LongTermRetentionBackup,
        },
        204: {
            bodyMapper: Mappers.LongTermRetentionBackup,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    requestBody: Parameters.parameters98,
    queryParameters: [Parameters.apiVersion4],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.locationName,
        Parameters.backupName,
        Parameters.longTermRetentionServerName,
        Parameters.longTermRetentionDatabaseName,
    ],
    headerParameters: [Parameters.contentType, Parameters.accept],
    mediaType: "json",
    serializer,
};
const copyOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy",
    httpMethod: "POST",
    responses: {
        200: {
            bodyMapper: Mappers.LongTermRetentionBackupOperationResult,
        },
        201: {
            bodyMapper: Mappers.LongTermRetentionBackupOperationResult,
        },
        202: {
            bodyMapper: Mappers.LongTermRetentionBackupOperationResult,
        },
        204: {
            bodyMapper: Mappers.LongTermRetentionBackupOperationResult,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    requestBody: Parameters.parameters99,
    queryParameters: [Parameters.apiVersion4],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.locationName,
        Parameters.backupName,
        Parameters.longTermRetentionServerName,
        Parameters.longTermRetentionDatabaseName,
    ],
    headerParameters: [Parameters.contentType, Parameters.accept],
    mediaType: "json",
    serializer,
};
const updateOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update",
    httpMethod: "POST",
    responses: {
        200: {
            bodyMapper: Mappers.LongTermRetentionBackupOperationResult,
        },
        201: {
            bodyMapper: Mappers.LongTermRetentionBackupOperationResult,
        },
        202: {
            bodyMapper: Mappers.LongTermRetentionBackupOperationResult,
        },
        204: {
            bodyMapper: Mappers.LongTermRetentionBackupOperationResult,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    requestBody: Parameters.parameters100,
    queryParameters: [Parameters.apiVersion4],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.locationName,
        Parameters.backupName,
        Parameters.longTermRetentionServerName,
        Parameters.longTermRetentionDatabaseName,
    ],
    headerParameters: [Parameters.contentType, Parameters.accept],
    mediaType: "json",
    serializer,
};
const listByResourceGroupLocationOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.LongTermRetentionBackupListResult,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [
        Parameters.apiVersion4,
        Parameters.onlyLatestPerDatabase,
        Parameters.databaseState,
    ],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.locationName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByResourceGroupServerOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.LongTermRetentionBackupListResult,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [
        Parameters.apiVersion4,
        Parameters.onlyLatestPerDatabase,
        Parameters.databaseState,
    ],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.locationName,
        Parameters.longTermRetentionServerName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByResourceGroupDatabaseOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.LongTermRetentionBackupListResult,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [
        Parameters.apiVersion4,
        Parameters.onlyLatestPerDatabase,
        Parameters.databaseState,
    ],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.locationName,
        Parameters.longTermRetentionServerName,
        Parameters.longTermRetentionDatabaseName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const getByResourceGroupOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.LongTermRetentionBackup,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion4],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.locationName,
        Parameters.backupName,
        Parameters.longTermRetentionServerName,
        Parameters.longTermRetentionDatabaseName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const deleteByResourceGroupOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}",
    httpMethod: "DELETE",
    responses: {
        200: {},
        201: {},
        202: {},
        204: {},
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion4],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.locationName,
        Parameters.backupName,
        Parameters.longTermRetentionServerName,
        Parameters.longTermRetentionDatabaseName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const changeAccessTierByResourceGroupOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/changeAccessTier",
    httpMethod: "POST",
    responses: {
        200: {
            bodyMapper: Mappers.LongTermRetentionBackup,
        },
        201: {
            bodyMapper: Mappers.LongTermRetentionBackup,
        },
        202: {
            bodyMapper: Mappers.LongTermRetentionBackup,
        },
        204: {
            bodyMapper: Mappers.LongTermRetentionBackup,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    requestBody: Parameters.parameters98,
    queryParameters: [Parameters.apiVersion4],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.locationName,
        Parameters.backupName,
        Parameters.longTermRetentionServerName,
        Parameters.longTermRetentionDatabaseName,
    ],
    headerParameters: [Parameters.contentType, Parameters.accept],
    mediaType: "json",
    serializer,
};
const copyByResourceGroupOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy",
    httpMethod: "POST",
    responses: {
        200: {
            bodyMapper: Mappers.LongTermRetentionBackupOperationResult,
        },
        201: {
            bodyMapper: Mappers.LongTermRetentionBackupOperationResult,
        },
        202: {
            bodyMapper: Mappers.LongTermRetentionBackupOperationResult,
        },
        204: {
            bodyMapper: Mappers.LongTermRetentionBackupOperationResult,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    requestBody: Parameters.parameters99,
    queryParameters: [Parameters.apiVersion4],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.locationName,
        Parameters.backupName,
        Parameters.longTermRetentionServerName,
        Parameters.longTermRetentionDatabaseName,
    ],
    headerParameters: [Parameters.contentType, Parameters.accept],
    mediaType: "json",
    serializer,
};
const updateByResourceGroupOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update",
    httpMethod: "POST",
    responses: {
        200: {
            bodyMapper: Mappers.LongTermRetentionBackupOperationResult,
        },
        201: {
            bodyMapper: Mappers.LongTermRetentionBackupOperationResult,
        },
        202: {
            bodyMapper: Mappers.LongTermRetentionBackupOperationResult,
        },
        204: {
            bodyMapper: Mappers.LongTermRetentionBackupOperationResult,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    requestBody: Parameters.parameters100,
    queryParameters: [Parameters.apiVersion4],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.locationName,
        Parameters.backupName,
        Parameters.longTermRetentionServerName,
        Parameters.longTermRetentionDatabaseName,
    ],
    headerParameters: [Parameters.contentType, Parameters.accept],
    mediaType: "json",
    serializer,
};
const listByLocationNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.LongTermRetentionBackupListResult,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.nextLink,
        Parameters.locationName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByServerNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.LongTermRetentionBackupListResult,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.nextLink,
        Parameters.locationName,
        Parameters.longTermRetentionServerName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByDatabaseNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.LongTermRetentionBackupListResult,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.nextLink,
        Parameters.locationName,
        Parameters.longTermRetentionServerName,
        Parameters.longTermRetentionDatabaseName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByResourceGroupLocationNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.LongTermRetentionBackupListResult,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.nextLink,
        Parameters.locationName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByResourceGroupServerNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.LongTermRetentionBackupListResult,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.nextLink,
        Parameters.locationName,
        Parameters.longTermRetentionServerName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listByResourceGroupDatabaseNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.LongTermRetentionBackupListResult,
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.resourceGroupName,
        Parameters.nextLink,
        Parameters.locationName,
        Parameters.longTermRetentionServerName,
        Parameters.longTermRetentionDatabaseName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
//# sourceMappingURL=longTermRetentionBackups.js.map