/*
* 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.
*/
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
import { setContinuationToken } from "../pagingHelper";
import { LongTermRetentionBackups } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { SqlManagementClient } from "../sqlManagementClient";
import {
SimplePollerLike,
OperationState,
createHttpPoller
} from "@azure/core-lro";
import { createLroSpec } from "../lroImpl";
import {
LongTermRetentionBackup,
LongTermRetentionBackupsListByDatabaseNextOptionalParams,
LongTermRetentionBackupsListByDatabaseOptionalParams,
LongTermRetentionBackupsListByDatabaseResponse,
LongTermRetentionBackupsListByLocationNextOptionalParams,
LongTermRetentionBackupsListByLocationOptionalParams,
LongTermRetentionBackupsListByLocationResponse,
LongTermRetentionBackupsListByServerNextOptionalParams,
LongTermRetentionBackupsListByServerOptionalParams,
LongTermRetentionBackupsListByServerResponse,
LongTermRetentionBackupsListByResourceGroupDatabaseNextOptionalParams,
LongTermRetentionBackupsListByResourceGroupDatabaseOptionalParams,
LongTermRetentionBackupsListByResourceGroupDatabaseResponse,
LongTermRetentionBackupsListByResourceGroupLocationNextOptionalParams,
LongTermRetentionBackupsListByResourceGroupLocationOptionalParams,
LongTermRetentionBackupsListByResourceGroupLocationResponse,
LongTermRetentionBackupsListByResourceGroupServerNextOptionalParams,
LongTermRetentionBackupsListByResourceGroupServerOptionalParams,
LongTermRetentionBackupsListByResourceGroupServerResponse,
CopyLongTermRetentionBackupParameters,
LongTermRetentionBackupsCopyOptionalParams,
LongTermRetentionBackupsCopyResponse,
UpdateLongTermRetentionBackupParameters,
LongTermRetentionBackupsUpdateOptionalParams,
LongTermRetentionBackupsUpdateResponse,
LongTermRetentionBackupsGetOptionalParams,
LongTermRetentionBackupsGetResponse,
LongTermRetentionBackupsDeleteOptionalParams,
LongTermRetentionBackupsCopyByResourceGroupOptionalParams,
LongTermRetentionBackupsCopyByResourceGroupResponse,
LongTermRetentionBackupsUpdateByResourceGroupOptionalParams,
LongTermRetentionBackupsUpdateByResourceGroupResponse,
LongTermRetentionBackupsGetByResourceGroupOptionalParams,
LongTermRetentionBackupsGetByResourceGroupResponse,
LongTermRetentionBackupsDeleteByResourceGroupOptionalParams,
LongTermRetentionBackupsListByDatabaseNextResponse,
LongTermRetentionBackupsListByLocationNextResponse,
LongTermRetentionBackupsListByServerNextResponse,
LongTermRetentionBackupsListByResourceGroupDatabaseNextResponse,
LongTermRetentionBackupsListByResourceGroupLocationNextResponse,
LongTermRetentionBackupsListByResourceGroupServerNextResponse
} from "../models";
///
/** Class containing LongTermRetentionBackups operations. */
export class LongTermRetentionBackupsImpl implements LongTermRetentionBackups {
private readonly client: SqlManagementClient;
/**
* Initialize a new instance of the class LongTermRetentionBackups class.
* @param client Reference to the service client
*/
constructor(client: SqlManagementClient) {
this.client = client;
}
/**
* 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.
*/
public listByDatabase(
locationName: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
options?: LongTermRetentionBackupsListByDatabaseOptionalParams
): PagedAsyncIterableIterator {
const iter = this.listByDatabasePagingAll(
locationName,
longTermRetentionServerName,
longTermRetentionDatabaseName,
options
);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: (settings?: PageSettings) => {
if (settings?.maxPageSize) {
throw new Error("maxPageSize is not supported by this operation.");
}
return this.listByDatabasePagingPage(
locationName,
longTermRetentionServerName,
longTermRetentionDatabaseName,
options,
settings
);
}
};
}
private async *listByDatabasePagingPage(
locationName: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
options?: LongTermRetentionBackupsListByDatabaseOptionalParams,
settings?: PageSettings
): AsyncIterableIterator {
let result: LongTermRetentionBackupsListByDatabaseResponse;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._listByDatabase(
locationName,
longTermRetentionServerName,
longTermRetentionDatabaseName,
options
);
let page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._listByDatabaseNext(
locationName,
longTermRetentionServerName,
longTermRetentionDatabaseName,
continuationToken,
options
);
continuationToken = result.nextLink;
let page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
private async *listByDatabasePagingAll(
locationName: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
options?: LongTermRetentionBackupsListByDatabaseOptionalParams
): AsyncIterableIterator {
for await (const page of this.listByDatabasePagingPage(
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.
*/
public listByLocation(
locationName: string,
options?: LongTermRetentionBackupsListByLocationOptionalParams
): PagedAsyncIterableIterator {
const iter = this.listByLocationPagingAll(locationName, options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: (settings?: PageSettings) => {
if (settings?.maxPageSize) {
throw new Error("maxPageSize is not supported by this operation.");
}
return this.listByLocationPagingPage(locationName, options, settings);
}
};
}
private async *listByLocationPagingPage(
locationName: string,
options?: LongTermRetentionBackupsListByLocationOptionalParams,
settings?: PageSettings
): AsyncIterableIterator {
let result: LongTermRetentionBackupsListByLocationResponse;
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;
}
}
private async *listByLocationPagingAll(
locationName: string,
options?: LongTermRetentionBackupsListByLocationOptionalParams
): AsyncIterableIterator {
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.
*/
public listByServer(
locationName: string,
longTermRetentionServerName: string,
options?: LongTermRetentionBackupsListByServerOptionalParams
): PagedAsyncIterableIterator {
const iter = this.listByServerPagingAll(
locationName,
longTermRetentionServerName,
options
);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: (settings?: PageSettings) => {
if (settings?.maxPageSize) {
throw new Error("maxPageSize is not supported by this operation.");
}
return this.listByServerPagingPage(
locationName,
longTermRetentionServerName,
options,
settings
);
}
};
}
private async *listByServerPagingPage(
locationName: string,
longTermRetentionServerName: string,
options?: LongTermRetentionBackupsListByServerOptionalParams,
settings?: PageSettings
): AsyncIterableIterator {
let result: LongTermRetentionBackupsListByServerResponse;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._listByServer(
locationName,
longTermRetentionServerName,
options
);
let page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._listByServerNext(
locationName,
longTermRetentionServerName,
continuationToken,
options
);
continuationToken = result.nextLink;
let page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
private async *listByServerPagingAll(
locationName: string,
longTermRetentionServerName: string,
options?: LongTermRetentionBackupsListByServerOptionalParams
): AsyncIterableIterator {
for await (const page of this.listByServerPagingPage(
locationName,
longTermRetentionServerName,
options
)) {
yield* page;
}
}
/**
* Lists all long term retention backups for a 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 longTermRetentionServerName The name of the server
* @param longTermRetentionDatabaseName The name of the database
* @param options The options parameters.
*/
public listByResourceGroupDatabase(
resourceGroupName: string,
locationName: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
options?: LongTermRetentionBackupsListByResourceGroupDatabaseOptionalParams
): PagedAsyncIterableIterator {
const iter = this.listByResourceGroupDatabasePagingAll(
resourceGroupName,
locationName,
longTermRetentionServerName,
longTermRetentionDatabaseName,
options
);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: (settings?: PageSettings) => {
if (settings?.maxPageSize) {
throw new Error("maxPageSize is not supported by this operation.");
}
return this.listByResourceGroupDatabasePagingPage(
resourceGroupName,
locationName,
longTermRetentionServerName,
longTermRetentionDatabaseName,
options,
settings
);
}
};
}
private async *listByResourceGroupDatabasePagingPage(
resourceGroupName: string,
locationName: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
options?: LongTermRetentionBackupsListByResourceGroupDatabaseOptionalParams,
settings?: PageSettings
): AsyncIterableIterator {
let result: LongTermRetentionBackupsListByResourceGroupDatabaseResponse;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._listByResourceGroupDatabase(
resourceGroupName,
locationName,
longTermRetentionServerName,
longTermRetentionDatabaseName,
options
);
let page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._listByResourceGroupDatabaseNext(
resourceGroupName,
locationName,
longTermRetentionServerName,
longTermRetentionDatabaseName,
continuationToken,
options
);
continuationToken = result.nextLink;
let page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
private async *listByResourceGroupDatabasePagingAll(
resourceGroupName: string,
locationName: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
options?: LongTermRetentionBackupsListByResourceGroupDatabaseOptionalParams
): AsyncIterableIterator {
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 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.
*/
public listByResourceGroupLocation(
resourceGroupName: string,
locationName: string,
options?: LongTermRetentionBackupsListByResourceGroupLocationOptionalParams
): PagedAsyncIterableIterator {
const iter = this.listByResourceGroupLocationPagingAll(
resourceGroupName,
locationName,
options
);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: (settings?: PageSettings) => {
if (settings?.maxPageSize) {
throw new Error("maxPageSize is not supported by this operation.");
}
return this.listByResourceGroupLocationPagingPage(
resourceGroupName,
locationName,
options,
settings
);
}
};
}
private async *listByResourceGroupLocationPagingPage(
resourceGroupName: string,
locationName: string,
options?: LongTermRetentionBackupsListByResourceGroupLocationOptionalParams,
settings?: PageSettings
): AsyncIterableIterator {
let result: LongTermRetentionBackupsListByResourceGroupLocationResponse;
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;
}
}
private async *listByResourceGroupLocationPagingAll(
resourceGroupName: string,
locationName: string,
options?: LongTermRetentionBackupsListByResourceGroupLocationOptionalParams
): AsyncIterableIterator {
for await (const page of this.listByResourceGroupLocationPagingPage(
resourceGroupName,
locationName,
options
)) {
yield* page;
}
}
/**
* Lists the long term retention backups for a given 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 options The options parameters.
*/
public listByResourceGroupServer(
resourceGroupName: string,
locationName: string,
longTermRetentionServerName: string,
options?: LongTermRetentionBackupsListByResourceGroupServerOptionalParams
): PagedAsyncIterableIterator {
const iter = this.listByResourceGroupServerPagingAll(
resourceGroupName,
locationName,
longTermRetentionServerName,
options
);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: (settings?: PageSettings) => {
if (settings?.maxPageSize) {
throw new Error("maxPageSize is not supported by this operation.");
}
return this.listByResourceGroupServerPagingPage(
resourceGroupName,
locationName,
longTermRetentionServerName,
options,
settings
);
}
};
}
private async *listByResourceGroupServerPagingPage(
resourceGroupName: string,
locationName: string,
longTermRetentionServerName: string,
options?: LongTermRetentionBackupsListByResourceGroupServerOptionalParams,
settings?: PageSettings
): AsyncIterableIterator {
let result: LongTermRetentionBackupsListByResourceGroupServerResponse;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._listByResourceGroupServer(
resourceGroupName,
locationName,
longTermRetentionServerName,
options
);
let page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._listByResourceGroupServerNext(
resourceGroupName,
locationName,
longTermRetentionServerName,
continuationToken,
options
);
continuationToken = result.nextLink;
let page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
private async *listByResourceGroupServerPagingAll(
resourceGroupName: string,
locationName: string,
longTermRetentionServerName: string,
options?: LongTermRetentionBackupsListByResourceGroupServerOptionalParams
): AsyncIterableIterator {
for await (const page of this.listByResourceGroupServerPagingPage(
resourceGroupName,
locationName,
longTermRetentionServerName,
options
)) {
yield* page;
}
}
/**
* 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: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
backupName: string,
parameters: CopyLongTermRetentionBackupParameters,
options?: LongTermRetentionBackupsCopyOptionalParams
): Promise<
SimplePollerLike<
OperationState,
LongTermRetentionBackupsCopyResponse
>
> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
): Promise => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperationFn = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
) => {
let currentRawResponse:
| coreClient.FullOperationResponse
| undefined = undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown
) => {
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,
longTermRetentionServerName,
longTermRetentionDatabaseName,
backupName,
parameters,
options
},
spec: copyOperationSpec
});
const poller = await createHttpPoller<
LongTermRetentionBackupsCopyResponse,
OperationState
>(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: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
backupName: string,
parameters: CopyLongTermRetentionBackupParameters,
options?: LongTermRetentionBackupsCopyOptionalParams
): Promise {
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: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
backupName: string,
parameters: UpdateLongTermRetentionBackupParameters,
options?: LongTermRetentionBackupsUpdateOptionalParams
): Promise<
SimplePollerLike<
OperationState,
LongTermRetentionBackupsUpdateResponse
>
> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
): Promise => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperationFn = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
) => {
let currentRawResponse:
| coreClient.FullOperationResponse
| undefined = undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown
) => {
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,
longTermRetentionServerName,
longTermRetentionDatabaseName,
backupName,
parameters,
options
},
spec: updateOperationSpec
});
const poller = await createHttpPoller<
LongTermRetentionBackupsUpdateResponse,
OperationState
>(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: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
backupName: string,
parameters: UpdateLongTermRetentionBackupParameters,
options?: LongTermRetentionBackupsUpdateOptionalParams
): Promise {
const poller = await this.beginUpdate(
locationName,
longTermRetentionServerName,
longTermRetentionDatabaseName,
backupName,
parameters,
options
);
return poller.pollUntilDone();
}
/**
* 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: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
backupName: string,
options?: LongTermRetentionBackupsGetOptionalParams
): Promise {
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: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
backupName: string,
options?: LongTermRetentionBackupsDeleteOptionalParams
): Promise, void>> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
): Promise => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperationFn = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
) => {
let currentRawResponse:
| coreClient.FullOperationResponse
| undefined = undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown
) => {
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,
longTermRetentionServerName,
longTermRetentionDatabaseName,
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 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: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
backupName: string,
options?: LongTermRetentionBackupsDeleteOptionalParams
): Promise {
const poller = await this.beginDelete(
locationName,
longTermRetentionServerName,
longTermRetentionDatabaseName,
backupName,
options
);
return poller.pollUntilDone();
}
/**
* 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.
*/
private _listByDatabase(
locationName: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
options?: LongTermRetentionBackupsListByDatabaseOptionalParams
): Promise {
return this.client.sendOperationRequest(
{
locationName,
longTermRetentionServerName,
longTermRetentionDatabaseName,
options
},
listByDatabaseOperationSpec
);
}
/**
* Lists the long term retention backups for a given location.
* @param locationName The location of the database
* @param options The options parameters.
*/
private _listByLocation(
locationName: string,
options?: LongTermRetentionBackupsListByLocationOptionalParams
): Promise {
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.
*/
private _listByServer(
locationName: string,
longTermRetentionServerName: string,
options?: LongTermRetentionBackupsListByServerOptionalParams
): Promise {
return this.client.sendOperationRequest(
{ locationName, longTermRetentionServerName, options },
listByServerOperationSpec
);
}
/**
* 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: string,
locationName: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
backupName: string,
parameters: CopyLongTermRetentionBackupParameters,
options?: LongTermRetentionBackupsCopyByResourceGroupOptionalParams
): Promise<
SimplePollerLike<
OperationState,
LongTermRetentionBackupsCopyByResourceGroupResponse
>
> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
): Promise => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperationFn = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
) => {
let currentRawResponse:
| coreClient.FullOperationResponse
| undefined = undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown
) => {
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,
longTermRetentionServerName,
longTermRetentionDatabaseName,
backupName,
parameters,
options
},
spec: copyByResourceGroupOperationSpec
});
const poller = await createHttpPoller<
LongTermRetentionBackupsCopyByResourceGroupResponse,
OperationState
>(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: string,
locationName: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
backupName: string,
parameters: CopyLongTermRetentionBackupParameters,
options?: LongTermRetentionBackupsCopyByResourceGroupOptionalParams
): Promise {
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: string,
locationName: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
backupName: string,
parameters: UpdateLongTermRetentionBackupParameters,
options?: LongTermRetentionBackupsUpdateByResourceGroupOptionalParams
): Promise<
SimplePollerLike<
OperationState,
LongTermRetentionBackupsUpdateByResourceGroupResponse
>
> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
): Promise => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperationFn = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
) => {
let currentRawResponse:
| coreClient.FullOperationResponse
| undefined = undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown
) => {
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,
longTermRetentionServerName,
longTermRetentionDatabaseName,
backupName,
parameters,
options
},
spec: updateByResourceGroupOperationSpec
});
const poller = await createHttpPoller<
LongTermRetentionBackupsUpdateByResourceGroupResponse,
OperationState
>(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: string,
locationName: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
backupName: string,
parameters: UpdateLongTermRetentionBackupParameters,
options?: LongTermRetentionBackupsUpdateByResourceGroupOptionalParams
): Promise {
const poller = await this.beginUpdateByResourceGroup(
resourceGroupName,
locationName,
longTermRetentionServerName,
longTermRetentionDatabaseName,
backupName,
parameters,
options
);
return poller.pollUntilDone();
}
/**
* 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: string,
locationName: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
backupName: string,
options?: LongTermRetentionBackupsGetByResourceGroupOptionalParams
): Promise {
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: string,
locationName: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
backupName: string,
options?: LongTermRetentionBackupsDeleteByResourceGroupOptionalParams
): Promise, void>> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
): Promise => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperationFn = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
) => {
let currentRawResponse:
| coreClient.FullOperationResponse
| undefined = undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown
) => {
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,
longTermRetentionServerName,
longTermRetentionDatabaseName,
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 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: string,
locationName: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
backupName: string,
options?: LongTermRetentionBackupsDeleteByResourceGroupOptionalParams
): Promise {
const poller = await this.beginDeleteByResourceGroup(
resourceGroupName,
locationName,
longTermRetentionServerName,
longTermRetentionDatabaseName,
backupName,
options
);
return poller.pollUntilDone();
}
/**
* Lists all long term retention backups for a 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 longTermRetentionServerName The name of the server
* @param longTermRetentionDatabaseName The name of the database
* @param options The options parameters.
*/
private _listByResourceGroupDatabase(
resourceGroupName: string,
locationName: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
options?: LongTermRetentionBackupsListByResourceGroupDatabaseOptionalParams
): Promise {
return this.client.sendOperationRequest(
{
resourceGroupName,
locationName,
longTermRetentionServerName,
longTermRetentionDatabaseName,
options
},
listByResourceGroupDatabaseOperationSpec
);
}
/**
* Lists the long term retention backups for 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.
*/
private _listByResourceGroupLocation(
resourceGroupName: string,
locationName: string,
options?: LongTermRetentionBackupsListByResourceGroupLocationOptionalParams
): Promise {
return this.client.sendOperationRequest(
{ resourceGroupName, locationName, options },
listByResourceGroupLocationOperationSpec
);
}
/**
* Lists the long term retention backups for a given 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 options The options parameters.
*/
private _listByResourceGroupServer(
resourceGroupName: string,
locationName: string,
longTermRetentionServerName: string,
options?: LongTermRetentionBackupsListByResourceGroupServerOptionalParams
): Promise {
return this.client.sendOperationRequest(
{ resourceGroupName, locationName, longTermRetentionServerName, options },
listByResourceGroupServerOperationSpec
);
}
/**
* 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.
*/
private _listByDatabaseNext(
locationName: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
nextLink: string,
options?: LongTermRetentionBackupsListByDatabaseNextOptionalParams
): Promise {
return this.client.sendOperationRequest(
{
locationName,
longTermRetentionServerName,
longTermRetentionDatabaseName,
nextLink,
options
},
listByDatabaseNextOperationSpec
);
}
/**
* 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.
*/
private _listByLocationNext(
locationName: string,
nextLink: string,
options?: LongTermRetentionBackupsListByLocationNextOptionalParams
): Promise {
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.
*/
private _listByServerNext(
locationName: string,
longTermRetentionServerName: string,
nextLink: string,
options?: LongTermRetentionBackupsListByServerNextOptionalParams
): Promise {
return this.client.sendOperationRequest(
{ locationName, longTermRetentionServerName, nextLink, options },
listByServerNextOperationSpec
);
}
/**
* 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.
*/
private _listByResourceGroupDatabaseNext(
resourceGroupName: string,
locationName: string,
longTermRetentionServerName: string,
longTermRetentionDatabaseName: string,
nextLink: string,
options?: LongTermRetentionBackupsListByResourceGroupDatabaseNextOptionalParams
): Promise {
return this.client.sendOperationRequest(
{
resourceGroupName,
locationName,
longTermRetentionServerName,
longTermRetentionDatabaseName,
nextLink,
options
},
listByResourceGroupDatabaseNextOperationSpec
);
}
/**
* 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.
*/
private _listByResourceGroupLocationNext(
resourceGroupName: string,
locationName: string,
nextLink: string,
options?: LongTermRetentionBackupsListByResourceGroupLocationNextOptionalParams
): Promise {
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.
*/
private _listByResourceGroupServerNext(
resourceGroupName: string,
locationName: string,
longTermRetentionServerName: string,
nextLink: string,
options?: LongTermRetentionBackupsListByResourceGroupServerNextOptionalParams
): Promise {
return this.client.sendOperationRequest(
{
resourceGroupName,
locationName,
longTermRetentionServerName,
nextLink,
options
},
listByResourceGroupServerNextOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const copyOperationSpec: coreClient.OperationSpec = {
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: {}
},
requestBody: Parameters.parameters66,
queryParameters: [Parameters.apiVersion6],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.locationName,
Parameters.longTermRetentionServerName,
Parameters.longTermRetentionDatabaseName,
Parameters.backupName
],
headerParameters: [Parameters.contentType, Parameters.accept],
mediaType: "json",
serializer
};
const updateOperationSpec: coreClient.OperationSpec = {
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: {}
},
requestBody: Parameters.parameters67,
queryParameters: [Parameters.apiVersion6],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.locationName,
Parameters.longTermRetentionServerName,
Parameters.longTermRetentionDatabaseName,
Parameters.backupName
],
headerParameters: [Parameters.contentType, Parameters.accept],
mediaType: "json",
serializer
};
const getOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.LongTermRetentionBackup
},
default: {}
},
queryParameters: [Parameters.apiVersion6],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.locationName,
Parameters.longTermRetentionServerName,
Parameters.longTermRetentionDatabaseName,
Parameters.backupName
],
headerParameters: [Parameters.accept],
serializer
};
const deleteOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}",
httpMethod: "DELETE",
responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} },
queryParameters: [Parameters.apiVersion6],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.locationName,
Parameters.longTermRetentionServerName,
Parameters.longTermRetentionDatabaseName,
Parameters.backupName
],
serializer
};
const listByDatabaseOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.LongTermRetentionBackupListResult
},
default: {}
},
queryParameters: [
Parameters.apiVersion6,
Parameters.onlyLatestPerDatabase,
Parameters.databaseState
],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.locationName,
Parameters.longTermRetentionServerName,
Parameters.longTermRetentionDatabaseName
],
headerParameters: [Parameters.accept],
serializer
};
const listByLocationOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.LongTermRetentionBackupListResult
},
default: {}
},
queryParameters: [
Parameters.apiVersion6,
Parameters.onlyLatestPerDatabase,
Parameters.databaseState
],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.locationName
],
headerParameters: [Parameters.accept],
serializer
};
const listByServerOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.LongTermRetentionBackupListResult
},
default: {}
},
queryParameters: [
Parameters.apiVersion6,
Parameters.onlyLatestPerDatabase,
Parameters.databaseState
],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.locationName,
Parameters.longTermRetentionServerName
],
headerParameters: [Parameters.accept],
serializer
};
const copyByResourceGroupOperationSpec: coreClient.OperationSpec = {
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: {}
},
requestBody: Parameters.parameters66,
queryParameters: [Parameters.apiVersion6],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.locationName,
Parameters.longTermRetentionServerName,
Parameters.longTermRetentionDatabaseName,
Parameters.backupName
],
headerParameters: [Parameters.contentType, Parameters.accept],
mediaType: "json",
serializer
};
const updateByResourceGroupOperationSpec: coreClient.OperationSpec = {
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: {}
},
requestBody: Parameters.parameters67,
queryParameters: [Parameters.apiVersion6],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.locationName,
Parameters.longTermRetentionServerName,
Parameters.longTermRetentionDatabaseName,
Parameters.backupName
],
headerParameters: [Parameters.contentType, Parameters.accept],
mediaType: "json",
serializer
};
const getByResourceGroupOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.LongTermRetentionBackup
},
default: {}
},
queryParameters: [Parameters.apiVersion6],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.locationName,
Parameters.longTermRetentionServerName,
Parameters.longTermRetentionDatabaseName,
Parameters.backupName
],
headerParameters: [Parameters.accept],
serializer
};
const deleteByResourceGroupOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}",
httpMethod: "DELETE",
responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: {} },
queryParameters: [Parameters.apiVersion6],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.locationName,
Parameters.longTermRetentionServerName,
Parameters.longTermRetentionDatabaseName,
Parameters.backupName
],
serializer
};
const listByResourceGroupDatabaseOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.LongTermRetentionBackupListResult
},
default: {}
},
queryParameters: [
Parameters.apiVersion6,
Parameters.onlyLatestPerDatabase,
Parameters.databaseState
],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.locationName,
Parameters.longTermRetentionServerName,
Parameters.longTermRetentionDatabaseName
],
headerParameters: [Parameters.accept],
serializer
};
const listByResourceGroupLocationOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.LongTermRetentionBackupListResult
},
default: {}
},
queryParameters: [
Parameters.apiVersion6,
Parameters.onlyLatestPerDatabase,
Parameters.databaseState
],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.locationName
],
headerParameters: [Parameters.accept],
serializer
};
const listByResourceGroupServerOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.LongTermRetentionBackupListResult
},
default: {}
},
queryParameters: [
Parameters.apiVersion6,
Parameters.onlyLatestPerDatabase,
Parameters.databaseState
],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.locationName,
Parameters.longTermRetentionServerName
],
headerParameters: [Parameters.accept],
serializer
};
const listByDatabaseNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.LongTermRetentionBackupListResult
},
default: {}
},
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.nextLink,
Parameters.locationName,
Parameters.longTermRetentionServerName,
Parameters.longTermRetentionDatabaseName
],
headerParameters: [Parameters.accept],
serializer
};
const listByLocationNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.LongTermRetentionBackupListResult
},
default: {}
},
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.nextLink,
Parameters.locationName
],
headerParameters: [Parameters.accept],
serializer
};
const listByServerNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.LongTermRetentionBackupListResult
},
default: {}
},
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.nextLink,
Parameters.locationName,
Parameters.longTermRetentionServerName
],
headerParameters: [Parameters.accept],
serializer
};
const listByResourceGroupDatabaseNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.LongTermRetentionBackupListResult
},
default: {}
},
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.nextLink,
Parameters.locationName,
Parameters.longTermRetentionServerName,
Parameters.longTermRetentionDatabaseName
],
headerParameters: [Parameters.accept],
serializer
};
const listByResourceGroupLocationNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.LongTermRetentionBackupListResult
},
default: {}
},
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.nextLink,
Parameters.locationName
],
headerParameters: [Parameters.accept],
serializer
};
const listByResourceGroupServerNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.LongTermRetentionBackupListResult
},
default: {}
},
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.nextLink,
Parameters.locationName,
Parameters.longTermRetentionServerName
],
headerParameters: [Parameters.accept],
serializer
};