/*
 * 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 { setContinuationToken } from "../pagingHelper.js";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers.js";
import * as Parameters from "../models/parameters.js";
import { createHttpPoller, } from "@azure/core-lro";
import { createLroSpec } from "../lroImpl.js";
/// <reference lib="esnext.asynciterable" />
/** Class containing ApplicationGateways operations. */
export class ApplicationGatewaysImpl {
    client;
    /**
     * Initialize a new instance of the class ApplicationGateways class.
     * @param client Reference to the service client
     */
    constructor(client) {
        this.client = client;
    }
    /**
     * Lists all application gateways in a resource group.
     * @param resourceGroupName The name of the resource group.
     * @param options The options parameters.
     */
    list(resourceGroupName, options) {
        const iter = this.listPagingAll(resourceGroupName, 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.listPagingPage(resourceGroupName, options, settings);
            },
        };
    }
    async *listPagingPage(resourceGroupName, options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._list(resourceGroupName, options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            setContinuationToken(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listNext(resourceGroupName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            setContinuationToken(page, continuationToken);
            yield page;
        }
    }
    async *listPagingAll(resourceGroupName, options) {
        for await (const page of this.listPagingPage(resourceGroupName, options)) {
            yield* page;
        }
    }
    /**
     * Gets all the application gateways in a subscription.
     * @param options The options parameters.
     */
    listAll(options) {
        const iter = this.listAllPagingAll(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.listAllPagingPage(options, settings);
            },
        };
    }
    async *listAllPagingPage(options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listAll(options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            setContinuationToken(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listAllNext(continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            setContinuationToken(page, continuationToken);
            yield page;
        }
    }
    async *listAllPagingAll(options) {
        for await (const page of this.listAllPagingPage(options)) {
            yield* page;
        }
    }
    /**
     * Lists all SSL predefined policies for configuring Ssl policy.
     * @param options The options parameters.
     */
    listAvailableSslPredefinedPolicies(options) {
        const iter = this.listAvailableSslPredefinedPoliciesPagingAll(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.listAvailableSslPredefinedPoliciesPagingPage(options, settings);
            },
        };
    }
    async *listAvailableSslPredefinedPoliciesPagingPage(options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listAvailableSslPredefinedPolicies(options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            setContinuationToken(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listAvailableSslPredefinedPoliciesNext(continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            setContinuationToken(page, continuationToken);
            yield page;
        }
    }
    async *listAvailableSslPredefinedPoliciesPagingAll(options) {
        for await (const page of this.listAvailableSslPredefinedPoliciesPagingPage(options)) {
            yield* page;
        }
    }
    /**
     * Deletes the specified application gateway.
     * @param resourceGroupName The name of the resource group.
     * @param applicationGatewayName The name of the application gateway.
     * @param options The options parameters.
     */
    async beginDelete(resourceGroupName, applicationGatewayName, options) {
        const directSendOperation = async (args, spec) => {
            return this.client.sendOperationRequest(args, spec);
        };
        const sendOperationFn = async (args, spec) => {
            let currentRawResponse = undefined;
            const providedCallback = args.options?.onResponse;
            const callback = (rawResponse, flatResponse) => {
                currentRawResponse = rawResponse;
                providedCallback?.(rawResponse, flatResponse);
            };
            const updatedArgs = {
                ...args,
                options: {
                    ...args.options,
                    onResponse: callback,
                },
            };
            const flatResponse = await directSendOperation(updatedArgs, spec);
            return {
                flatResponse,
                rawResponse: {
                    statusCode: currentRawResponse.status,
                    body: currentRawResponse.parsedBody,
                    headers: currentRawResponse.headers.toJSON(),
                },
            };
        };
        const lro = createLroSpec({
            sendOperationFn,
            args: { resourceGroupName, applicationGatewayName, options },
            spec: deleteOperationSpec,
        });
        const poller = await createHttpPoller(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
            resourceLocationConfig: "location",
        });
        await poller.poll();
        return poller;
    }
    /**
     * Deletes the specified application gateway.
     * @param resourceGroupName The name of the resource group.
     * @param applicationGatewayName The name of the application gateway.
     * @param options The options parameters.
     */
    async beginDeleteAndWait(resourceGroupName, applicationGatewayName, options) {
        const poller = await this.beginDelete(resourceGroupName, applicationGatewayName, options);
        return poller.pollUntilDone();
    }
    /**
     * Gets the specified application gateway.
     * @param resourceGroupName The name of the resource group.
     * @param applicationGatewayName The name of the application gateway.
     * @param options The options parameters.
     */
    get(resourceGroupName, applicationGatewayName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, applicationGatewayName, options }, getOperationSpec);
    }
    /**
     * Creates or updates the specified application gateway.
     * @param resourceGroupName The name of the resource group.
     * @param applicationGatewayName The name of the application gateway.
     * @param parameters Parameters supplied to the create or update application gateway operation.
     * @param options The options parameters.
     */
    async beginCreateOrUpdate(resourceGroupName, applicationGatewayName, 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 = createLroSpec({
            sendOperationFn,
            args: { resourceGroupName, applicationGatewayName, parameters, options },
            spec: createOrUpdateOperationSpec,
        });
        const poller = await createHttpPoller(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
            resourceLocationConfig: "azure-async-operation",
        });
        await poller.poll();
        return poller;
    }
    /**
     * Creates or updates the specified application gateway.
     * @param resourceGroupName The name of the resource group.
     * @param applicationGatewayName The name of the application gateway.
     * @param parameters Parameters supplied to the create or update application gateway operation.
     * @param options The options parameters.
     */
    async beginCreateOrUpdateAndWait(resourceGroupName, applicationGatewayName, parameters, options) {
        const poller = await this.beginCreateOrUpdate(resourceGroupName, applicationGatewayName, parameters, options);
        return poller.pollUntilDone();
    }
    /**
     * Updates the specified application gateway tags.
     * @param resourceGroupName The name of the resource group.
     * @param applicationGatewayName The name of the application gateway.
     * @param parameters Parameters supplied to update application gateway tags.
     * @param options The options parameters.
     */
    updateTags(resourceGroupName, applicationGatewayName, parameters, options) {
        return this.client.sendOperationRequest({ resourceGroupName, applicationGatewayName, parameters, options }, updateTagsOperationSpec);
    }
    /**
     * Lists all application gateways in a resource group.
     * @param resourceGroupName The name of the resource group.
     * @param options The options parameters.
     */
    _list(resourceGroupName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, options }, listOperationSpec);
    }
    /**
     * Gets all the application gateways in a subscription.
     * @param options The options parameters.
     */
    _listAll(options) {
        return this.client.sendOperationRequest({ options }, listAllOperationSpec);
    }
    /**
     * Starts the specified application gateway.
     * @param resourceGroupName The name of the resource group.
     * @param applicationGatewayName The name of the application gateway.
     * @param options The options parameters.
     */
    async beginStart(resourceGroupName, applicationGatewayName, options) {
        const directSendOperation = async (args, spec) => {
            return this.client.sendOperationRequest(args, spec);
        };
        const sendOperationFn = async (args, spec) => {
            let currentRawResponse = undefined;
            const providedCallback = args.options?.onResponse;
            const callback = (rawResponse, flatResponse) => {
                currentRawResponse = rawResponse;
                providedCallback?.(rawResponse, flatResponse);
            };
            const updatedArgs = {
                ...args,
                options: {
                    ...args.options,
                    onResponse: callback,
                },
            };
            const flatResponse = await directSendOperation(updatedArgs, spec);
            return {
                flatResponse,
                rawResponse: {
                    statusCode: currentRawResponse.status,
                    body: currentRawResponse.parsedBody,
                    headers: currentRawResponse.headers.toJSON(),
                },
            };
        };
        const lro = createLroSpec({
            sendOperationFn,
            args: { resourceGroupName, applicationGatewayName, options },
            spec: startOperationSpec,
        });
        const poller = await createHttpPoller(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
            resourceLocationConfig: "location",
        });
        await poller.poll();
        return poller;
    }
    /**
     * Starts the specified application gateway.
     * @param resourceGroupName The name of the resource group.
     * @param applicationGatewayName The name of the application gateway.
     * @param options The options parameters.
     */
    async beginStartAndWait(resourceGroupName, applicationGatewayName, options) {
        const poller = await this.beginStart(resourceGroupName, applicationGatewayName, options);
        return poller.pollUntilDone();
    }
    /**
     * Stops the specified application gateway in a resource group.
     * @param resourceGroupName The name of the resource group.
     * @param applicationGatewayName The name of the application gateway.
     * @param options The options parameters.
     */
    async beginStop(resourceGroupName, applicationGatewayName, options) {
        const directSendOperation = async (args, spec) => {
            return this.client.sendOperationRequest(args, spec);
        };
        const sendOperationFn = async (args, spec) => {
            let currentRawResponse = undefined;
            const providedCallback = args.options?.onResponse;
            const callback = (rawResponse, flatResponse) => {
                currentRawResponse = rawResponse;
                providedCallback?.(rawResponse, flatResponse);
            };
            const updatedArgs = {
                ...args,
                options: {
                    ...args.options,
                    onResponse: callback,
                },
            };
            const flatResponse = await directSendOperation(updatedArgs, spec);
            return {
                flatResponse,
                rawResponse: {
                    statusCode: currentRawResponse.status,
                    body: currentRawResponse.parsedBody,
                    headers: currentRawResponse.headers.toJSON(),
                },
            };
        };
        const lro = createLroSpec({
            sendOperationFn,
            args: { resourceGroupName, applicationGatewayName, options },
            spec: stopOperationSpec,
        });
        const poller = await createHttpPoller(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
            resourceLocationConfig: "location",
        });
        await poller.poll();
        return poller;
    }
    /**
     * Stops the specified application gateway in a resource group.
     * @param resourceGroupName The name of the resource group.
     * @param applicationGatewayName The name of the application gateway.
     * @param options The options parameters.
     */
    async beginStopAndWait(resourceGroupName, applicationGatewayName, options) {
        const poller = await this.beginStop(resourceGroupName, applicationGatewayName, options);
        return poller.pollUntilDone();
    }
    /**
     * Gets the backend health of the specified application gateway in a resource group.
     * @param resourceGroupName The name of the resource group.
     * @param applicationGatewayName The name of the application gateway.
     * @param options The options parameters.
     */
    async beginBackendHealth(resourceGroupName, applicationGatewayName, options) {
        const directSendOperation = async (args, spec) => {
            return this.client.sendOperationRequest(args, spec);
        };
        const sendOperationFn = async (args, spec) => {
            let currentRawResponse = undefined;
            const providedCallback = args.options?.onResponse;
            const callback = (rawResponse, flatResponse) => {
                currentRawResponse = rawResponse;
                providedCallback?.(rawResponse, flatResponse);
            };
            const updatedArgs = {
                ...args,
                options: {
                    ...args.options,
                    onResponse: callback,
                },
            };
            const flatResponse = await directSendOperation(updatedArgs, spec);
            return {
                flatResponse,
                rawResponse: {
                    statusCode: currentRawResponse.status,
                    body: currentRawResponse.parsedBody,
                    headers: currentRawResponse.headers.toJSON(),
                },
            };
        };
        const lro = createLroSpec({
            sendOperationFn,
            args: { resourceGroupName, applicationGatewayName, options },
            spec: backendHealthOperationSpec,
        });
        const poller = await createHttpPoller(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
            resourceLocationConfig: "location",
        });
        await poller.poll();
        return poller;
    }
    /**
     * Gets the backend health of the specified application gateway in a resource group.
     * @param resourceGroupName The name of the resource group.
     * @param applicationGatewayName The name of the application gateway.
     * @param options The options parameters.
     */
    async beginBackendHealthAndWait(resourceGroupName, applicationGatewayName, options) {
        const poller = await this.beginBackendHealth(resourceGroupName, applicationGatewayName, options);
        return poller.pollUntilDone();
    }
    /**
     * Gets the backend health for given combination of backend pool and http setting of the specified
     * application gateway in a resource group.
     * @param resourceGroupName The name of the resource group.
     * @param applicationGatewayName The name of the application gateway.
     * @param probeRequest Request body for on-demand test probe operation.
     * @param options The options parameters.
     */
    async beginBackendHealthOnDemand(resourceGroupName, applicationGatewayName, probeRequest, options) {
        const directSendOperation = async (args, spec) => {
            return this.client.sendOperationRequest(args, spec);
        };
        const sendOperationFn = async (args, spec) => {
            let currentRawResponse = undefined;
            const providedCallback = args.options?.onResponse;
            const callback = (rawResponse, flatResponse) => {
                currentRawResponse = rawResponse;
                providedCallback?.(rawResponse, flatResponse);
            };
            const updatedArgs = {
                ...args,
                options: {
                    ...args.options,
                    onResponse: callback,
                },
            };
            const flatResponse = await directSendOperation(updatedArgs, spec);
            return {
                flatResponse,
                rawResponse: {
                    statusCode: currentRawResponse.status,
                    body: currentRawResponse.parsedBody,
                    headers: currentRawResponse.headers.toJSON(),
                },
            };
        };
        const lro = createLroSpec({
            sendOperationFn,
            args: {
                resourceGroupName,
                applicationGatewayName,
                probeRequest,
                options,
            },
            spec: backendHealthOnDemandOperationSpec,
        });
        const poller = await createHttpPoller(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
            resourceLocationConfig: "location",
        });
        await poller.poll();
        return poller;
    }
    /**
     * Gets the backend health for given combination of backend pool and http setting of the specified
     * application gateway in a resource group.
     * @param resourceGroupName The name of the resource group.
     * @param applicationGatewayName The name of the application gateway.
     * @param probeRequest Request body for on-demand test probe operation.
     * @param options The options parameters.
     */
    async beginBackendHealthOnDemandAndWait(resourceGroupName, applicationGatewayName, probeRequest, options) {
        const poller = await this.beginBackendHealthOnDemand(resourceGroupName, applicationGatewayName, probeRequest, options);
        return poller.pollUntilDone();
    }
    /**
     * Lists all available server variables.
     * @param options The options parameters.
     */
    listAvailableServerVariables(options) {
        return this.client.sendOperationRequest({ options }, listAvailableServerVariablesOperationSpec);
    }
    /**
     * Lists all available request headers.
     * @param options The options parameters.
     */
    listAvailableRequestHeaders(options) {
        return this.client.sendOperationRequest({ options }, listAvailableRequestHeadersOperationSpec);
    }
    /**
     * Lists all available response headers.
     * @param options The options parameters.
     */
    listAvailableResponseHeaders(options) {
        return this.client.sendOperationRequest({ options }, listAvailableResponseHeadersOperationSpec);
    }
    /**
     * Lists all available web application firewall rule sets.
     * @param options The options parameters.
     */
    listAvailableWafRuleSets(options) {
        return this.client.sendOperationRequest({ options }, listAvailableWafRuleSetsOperationSpec);
    }
    /**
     * Lists available Ssl options for configuring Ssl policy.
     * @param options The options parameters.
     */
    listAvailableSslOptions(options) {
        return this.client.sendOperationRequest({ options }, listAvailableSslOptionsOperationSpec);
    }
    /**
     * Lists all SSL predefined policies for configuring Ssl policy.
     * @param options The options parameters.
     */
    _listAvailableSslPredefinedPolicies(options) {
        return this.client.sendOperationRequest({ options }, listAvailableSslPredefinedPoliciesOperationSpec);
    }
    /**
     * Gets Ssl predefined policy with the specified policy name.
     * @param predefinedPolicyName Name of Ssl predefined policy.
     * @param options The options parameters.
     */
    getSslPredefinedPolicy(predefinedPolicyName, options) {
        return this.client.sendOperationRequest({ predefinedPolicyName, options }, getSslPredefinedPolicyOperationSpec);
    }
    /**
     * ListNext
     * @param resourceGroupName The name of the resource group.
     * @param nextLink The nextLink from the previous successful call to the List method.
     * @param options The options parameters.
     */
    _listNext(resourceGroupName, nextLink, options) {
        return this.client.sendOperationRequest({ resourceGroupName, nextLink, options }, listNextOperationSpec);
    }
    /**
     * ListAllNext
     * @param nextLink The nextLink from the previous successful call to the ListAll method.
     * @param options The options parameters.
     */
    _listAllNext(nextLink, options) {
        return this.client.sendOperationRequest({ nextLink, options }, listAllNextOperationSpec);
    }
    /**
     * ListAvailableSslPredefinedPoliciesNext
     * @param nextLink The nextLink from the previous successful call to the
     *                 ListAvailableSslPredefinedPolicies method.
     * @param options The options parameters.
     */
    _listAvailableSslPredefinedPoliciesNext(nextLink, options) {
        return this.client.sendOperationRequest({ nextLink, options }, listAvailableSslPredefinedPoliciesNextOperationSpec);
    }
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const deleteOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}",
    httpMethod: "DELETE",
    responses: {
        200: {},
        201: {},
        202: {},
        204: {},
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.applicationGatewayName,
        Parameters.subscriptionId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const getOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ApplicationGateway,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.applicationGatewayName,
        Parameters.subscriptionId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const createOrUpdateOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}",
    httpMethod: "PUT",
    responses: {
        200: {
            bodyMapper: Mappers.ApplicationGateway,
        },
        201: {
            bodyMapper: Mappers.ApplicationGateway,
        },
        202: {
            bodyMapper: Mappers.ApplicationGateway,
        },
        204: {
            bodyMapper: Mappers.ApplicationGateway,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    requestBody: Parameters.parameters,
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.applicationGatewayName,
        Parameters.subscriptionId,
    ],
    headerParameters: [Parameters.accept, Parameters.contentType],
    mediaType: "json",
    serializer,
};
const updateTagsOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}",
    httpMethod: "PATCH",
    responses: {
        200: {
            bodyMapper: Mappers.ApplicationGateway,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    requestBody: Parameters.parameters1,
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.applicationGatewayName,
        Parameters.subscriptionId,
    ],
    headerParameters: [Parameters.accept, Parameters.contentType],
    mediaType: "json",
    serializer,
};
const listOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ApplicationGatewayListResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listAllOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ApplicationGatewayListResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [Parameters.$host, Parameters.subscriptionId],
    headerParameters: [Parameters.accept],
    serializer,
};
const startOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start",
    httpMethod: "POST",
    responses: {
        200: {},
        201: {},
        202: {},
        204: {},
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.applicationGatewayName,
        Parameters.subscriptionId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const stopOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop",
    httpMethod: "POST",
    responses: {
        200: {},
        201: {},
        202: {},
        204: {},
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.applicationGatewayName,
        Parameters.subscriptionId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const backendHealthOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth",
    httpMethod: "POST",
    responses: {
        200: {
            bodyMapper: Mappers.ApplicationGatewayBackendHealth,
        },
        201: {
            bodyMapper: Mappers.ApplicationGatewayBackendHealth,
        },
        202: {
            bodyMapper: Mappers.ApplicationGatewayBackendHealth,
        },
        204: {
            bodyMapper: Mappers.ApplicationGatewayBackendHealth,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion, Parameters.expand],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.applicationGatewayName,
        Parameters.subscriptionId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const backendHealthOnDemandOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/getBackendHealthOnDemand",
    httpMethod: "POST",
    responses: {
        200: {
            bodyMapper: Mappers.ApplicationGatewayBackendHealthOnDemand,
        },
        201: {
            bodyMapper: Mappers.ApplicationGatewayBackendHealthOnDemand,
        },
        202: {
            bodyMapper: Mappers.ApplicationGatewayBackendHealthOnDemand,
        },
        204: {
            bodyMapper: Mappers.ApplicationGatewayBackendHealthOnDemand,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    requestBody: Parameters.probeRequest,
    queryParameters: [Parameters.apiVersion, Parameters.expand],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.applicationGatewayName,
        Parameters.subscriptionId,
    ],
    headerParameters: [Parameters.accept, Parameters.contentType],
    mediaType: "json",
    serializer,
};
const listAvailableServerVariablesOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableServerVariables",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: {
                type: { name: "Sequence", element: { type: { name: "String" } } },
            },
        },
        default: {
            bodyMapper: Mappers.ErrorModel,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [Parameters.$host, Parameters.subscriptionId],
    headerParameters: [Parameters.accept],
    serializer,
};
const listAvailableRequestHeadersOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableRequestHeaders",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: {
                type: { name: "Sequence", element: { type: { name: "String" } } },
            },
        },
        default: {
            bodyMapper: Mappers.ErrorModel,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [Parameters.$host, Parameters.subscriptionId],
    headerParameters: [Parameters.accept],
    serializer,
};
const listAvailableResponseHeadersOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableResponseHeaders",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: {
                type: { name: "Sequence", element: { type: { name: "String" } } },
            },
        },
        default: {
            bodyMapper: Mappers.ErrorModel,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [Parameters.$host, Parameters.subscriptionId],
    headerParameters: [Parameters.accept],
    serializer,
};
const listAvailableWafRuleSetsOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ApplicationGatewayAvailableWafRuleSetsResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [Parameters.$host, Parameters.subscriptionId],
    headerParameters: [Parameters.accept],
    serializer,
};
const listAvailableSslOptionsOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ApplicationGatewayAvailableSslOptions,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [Parameters.$host, Parameters.subscriptionId],
    headerParameters: [Parameters.accept],
    serializer,
};
const listAvailableSslPredefinedPoliciesOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ApplicationGatewayAvailableSslPredefinedPolicies,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [Parameters.$host, Parameters.subscriptionId],
    headerParameters: [Parameters.accept],
    serializer,
};
const getSslPredefinedPolicyOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ApplicationGatewaySslPredefinedPolicy,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.predefinedPolicyName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ApplicationGatewayListResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.nextLink,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listAllNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ApplicationGatewayListResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.nextLink,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listAvailableSslPredefinedPoliciesNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ApplicationGatewayAvailableSslPredefinedPolicies,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.nextLink,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
//# sourceMappingURL=applicationGateways.js.map