@azure/arm-appservice
Version:
A generated SDK for WebSiteManagementClient.
662 lines • 24.1 kB
JavaScript
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { setContinuationToken } from "../pagingHelper.js";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers.js";
import * as Parameters from "../models/parameters.js";
/// <reference lib="esnext.asynciterable" />
/** Class containing Provider operations. */
export class ProviderImpl {
client;
/**
* Initialize a new instance of the class Provider class.
* @param client Reference to the service client
*/
constructor(client) {
this.client = client;
}
/**
* Description for Get available application frameworks and their versions
* @param options The options parameters.
*/
listAvailableStacks(options) {
const iter = this.getAvailableStacksPagingAll(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.getAvailableStacksPagingPage(options, settings);
},
};
}
async *getAvailableStacksPagingPage(options, settings) {
let result;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._getAvailableStacks(options);
const page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._getAvailableStacksNext(continuationToken, options);
continuationToken = result.nextLink;
const page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
async *getAvailableStacksPagingAll(options) {
for await (const page of this.getAvailableStacksPagingPage(options)) {
yield* page;
}
}
/**
* Description for Get available Function app frameworks and their versions
* @param options The options parameters.
*/
listFunctionAppStacks(options) {
const iter = this.getFunctionAppStacksPagingAll(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.getFunctionAppStacksPagingPage(options, settings);
},
};
}
async *getFunctionAppStacksPagingPage(options, settings) {
let result;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._getFunctionAppStacks(options);
const page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._getFunctionAppStacksNext(continuationToken, options);
continuationToken = result.nextLink;
const page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
async *getFunctionAppStacksPagingAll(options) {
for await (const page of this.getFunctionAppStacksPagingPage(options)) {
yield* page;
}
}
/**
* Description for Get available Function app frameworks and their versions for location
* @param location Function App stack location.
* @param options The options parameters.
*/
listFunctionAppStacksForLocation(location, options) {
const iter = this.getFunctionAppStacksForLocationPagingAll(location, 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.getFunctionAppStacksForLocationPagingPage(location, options, settings);
},
};
}
async *getFunctionAppStacksForLocationPagingPage(location, options, settings) {
let result;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._getFunctionAppStacksForLocation(location, options);
const page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._getFunctionAppStacksForLocationNext(location, continuationToken, options);
continuationToken = result.nextLink;
const page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
async *getFunctionAppStacksForLocationPagingAll(location, options) {
for await (const page of this.getFunctionAppStacksForLocationPagingPage(location, options)) {
yield* page;
}
}
/**
* Description for Get available Web app frameworks and their versions for location
* @param location Web App stack location.
* @param options The options parameters.
*/
listWebAppStacksForLocation(location, options) {
const iter = this.getWebAppStacksForLocationPagingAll(location, 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.getWebAppStacksForLocationPagingPage(location, options, settings);
},
};
}
async *getWebAppStacksForLocationPagingPage(location, options, settings) {
let result;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._getWebAppStacksForLocation(location, options);
const page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._getWebAppStacksForLocationNext(location, continuationToken, options);
continuationToken = result.nextLink;
const page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
async *getWebAppStacksForLocationPagingAll(location, options) {
for await (const page of this.getWebAppStacksForLocationPagingPage(location, options)) {
yield* page;
}
}
/**
* Description for Gets all available operations for the Microsoft.Web resource provider. Also exposes
* resource metric definitions
* @param options The options parameters.
*/
listOperations(options) {
const iter = this.listOperationsPagingAll(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.listOperationsPagingPage(options, settings);
},
};
}
async *listOperationsPagingPage(options, settings) {
let result;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._listOperations(options);
const page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._listOperationsNext(continuationToken, options);
continuationToken = result.nextLink;
const page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
async *listOperationsPagingAll(options) {
for await (const page of this.listOperationsPagingPage(options)) {
yield* page;
}
}
/**
* Description for Get available Web app frameworks and their versions
* @param options The options parameters.
*/
listWebAppStacks(options) {
const iter = this.getWebAppStacksPagingAll(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.getWebAppStacksPagingPage(options, settings);
},
};
}
async *getWebAppStacksPagingPage(options, settings) {
let result;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._getWebAppStacks(options);
const page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._getWebAppStacksNext(continuationToken, options);
continuationToken = result.nextLink;
const page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
async *getWebAppStacksPagingAll(options) {
for await (const page of this.getWebAppStacksPagingPage(options)) {
yield* page;
}
}
/**
* Description for Get available application frameworks and their versions
* @param options The options parameters.
*/
listAvailableStacksOnPrem(options) {
const iter = this.getAvailableStacksOnPremPagingAll(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.getAvailableStacksOnPremPagingPage(options, settings);
},
};
}
async *getAvailableStacksOnPremPagingPage(options, settings) {
let result;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._getAvailableStacksOnPrem(options);
const page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._getAvailableStacksOnPremNext(continuationToken, options);
continuationToken = result.nextLink;
const page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
async *getAvailableStacksOnPremPagingAll(options) {
for await (const page of this.getAvailableStacksOnPremPagingPage(options)) {
yield* page;
}
}
/**
* Description for Get available application frameworks and their versions
* @param options The options parameters.
*/
_getAvailableStacks(options) {
return this.client.sendOperationRequest({ options }, getAvailableStacksOperationSpec);
}
/**
* Description for Get available Function app frameworks and their versions
* @param options The options parameters.
*/
_getFunctionAppStacks(options) {
return this.client.sendOperationRequest({ options }, getFunctionAppStacksOperationSpec);
}
/**
* Description for Get available Function app frameworks and their versions for location
* @param location Function App stack location.
* @param options The options parameters.
*/
_getFunctionAppStacksForLocation(location, options) {
return this.client.sendOperationRequest({ location, options }, getFunctionAppStacksForLocationOperationSpec);
}
/**
* Description for Get available Web app frameworks and their versions for location
* @param location Web App stack location.
* @param options The options parameters.
*/
_getWebAppStacksForLocation(location, options) {
return this.client.sendOperationRequest({ location, options }, getWebAppStacksForLocationOperationSpec);
}
/**
* Description for Gets all available operations for the Microsoft.Web resource provider. Also exposes
* resource metric definitions
* @param options The options parameters.
*/
_listOperations(options) {
return this.client.sendOperationRequest({ options }, listOperationsOperationSpec);
}
/**
* Description for Get available Web app frameworks and their versions
* @param options The options parameters.
*/
_getWebAppStacks(options) {
return this.client.sendOperationRequest({ options }, getWebAppStacksOperationSpec);
}
/**
* Description for Get available application frameworks and their versions
* @param options The options parameters.
*/
_getAvailableStacksOnPrem(options) {
return this.client.sendOperationRequest({ options }, getAvailableStacksOnPremOperationSpec);
}
/**
* GetAvailableStacksNext
* @param nextLink The nextLink from the previous successful call to the GetAvailableStacks method.
* @param options The options parameters.
*/
_getAvailableStacksNext(nextLink, options) {
return this.client.sendOperationRequest({ nextLink, options }, getAvailableStacksNextOperationSpec);
}
/**
* GetFunctionAppStacksNext
* @param nextLink The nextLink from the previous successful call to the GetFunctionAppStacks method.
* @param options The options parameters.
*/
_getFunctionAppStacksNext(nextLink, options) {
return this.client.sendOperationRequest({ nextLink, options }, getFunctionAppStacksNextOperationSpec);
}
/**
* GetFunctionAppStacksForLocationNext
* @param location Function App stack location.
* @param nextLink The nextLink from the previous successful call to the
* GetFunctionAppStacksForLocation method.
* @param options The options parameters.
*/
_getFunctionAppStacksForLocationNext(location, nextLink, options) {
return this.client.sendOperationRequest({ location, nextLink, options }, getFunctionAppStacksForLocationNextOperationSpec);
}
/**
* GetWebAppStacksForLocationNext
* @param location Web App stack location.
* @param nextLink The nextLink from the previous successful call to the GetWebAppStacksForLocation
* method.
* @param options The options parameters.
*/
_getWebAppStacksForLocationNext(location, nextLink, options) {
return this.client.sendOperationRequest({ location, nextLink, options }, getWebAppStacksForLocationNextOperationSpec);
}
/**
* ListOperationsNext
* @param nextLink The nextLink from the previous successful call to the ListOperations method.
* @param options The options parameters.
*/
_listOperationsNext(nextLink, options) {
return this.client.sendOperationRequest({ nextLink, options }, listOperationsNextOperationSpec);
}
/**
* GetWebAppStacksNext
* @param nextLink The nextLink from the previous successful call to the GetWebAppStacks method.
* @param options The options parameters.
*/
_getWebAppStacksNext(nextLink, options) {
return this.client.sendOperationRequest({ nextLink, options }, getWebAppStacksNextOperationSpec);
}
/**
* GetAvailableStacksOnPremNext
* @param nextLink The nextLink from the previous successful call to the GetAvailableStacksOnPrem
* method.
* @param options The options parameters.
*/
_getAvailableStacksOnPremNext(nextLink, options) {
return this.client.sendOperationRequest({ nextLink, options }, getAvailableStacksOnPremNextOperationSpec);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const getAvailableStacksOperationSpec = {
path: "/providers/Microsoft.Web/availableStacks",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ApplicationStackCollection,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion, Parameters.osTypeSelected],
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer,
};
const getFunctionAppStacksOperationSpec = {
path: "/providers/Microsoft.Web/functionAppStacks",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.FunctionAppStackCollection,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion, Parameters.stackOsType],
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer,
};
const getFunctionAppStacksForLocationOperationSpec = {
path: "/providers/Microsoft.Web/locations/{location}/functionAppStacks",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.FunctionAppStackCollection,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion, Parameters.stackOsType],
urlParameters: [Parameters.$host, Parameters.location],
headerParameters: [Parameters.accept],
serializer,
};
const getWebAppStacksForLocationOperationSpec = {
path: "/providers/Microsoft.Web/locations/{location}/webAppStacks",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.WebAppStackCollection,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion, Parameters.stackOsType],
urlParameters: [Parameters.$host, Parameters.location],
headerParameters: [Parameters.accept],
serializer,
};
const listOperationsOperationSpec = {
path: "/providers/Microsoft.Web/operations",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.CsmOperationCollection,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer,
};
const getWebAppStacksOperationSpec = {
path: "/providers/Microsoft.Web/webAppStacks",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.WebAppStackCollection,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion, Parameters.stackOsType],
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer,
};
const getAvailableStacksOnPremOperationSpec = {
path: "/subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ApplicationStackCollection,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
queryParameters: [Parameters.apiVersion, Parameters.osTypeSelected],
urlParameters: [Parameters.$host, Parameters.subscriptionId],
headerParameters: [Parameters.accept],
serializer,
};
const getAvailableStacksNextOperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ApplicationStackCollection,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
urlParameters: [Parameters.$host, Parameters.nextLink],
headerParameters: [Parameters.accept],
serializer,
};
const getFunctionAppStacksNextOperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.FunctionAppStackCollection,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
urlParameters: [Parameters.$host, Parameters.nextLink],
headerParameters: [Parameters.accept],
serializer,
};
const getFunctionAppStacksForLocationNextOperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.FunctionAppStackCollection,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.location],
headerParameters: [Parameters.accept],
serializer,
};
const getWebAppStacksForLocationNextOperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.WebAppStackCollection,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.location],
headerParameters: [Parameters.accept],
serializer,
};
const listOperationsNextOperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.CsmOperationCollection,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
urlParameters: [Parameters.$host, Parameters.nextLink],
headerParameters: [Parameters.accept],
serializer,
};
const getWebAppStacksNextOperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.WebAppStackCollection,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
urlParameters: [Parameters.$host, Parameters.nextLink],
headerParameters: [Parameters.accept],
serializer,
};
const getAvailableStacksOnPremNextOperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ApplicationStackCollection,
},
default: {
bodyMapper: Mappers.DefaultErrorResponse,
},
},
urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.nextLink],
headerParameters: [Parameters.accept],
serializer,
};
//# sourceMappingURL=provider.js.map