/*
 * 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 VirtualNetworkGatewayConnections operations. */
export class VirtualNetworkGatewayConnectionsImpl {
    client;
    /**
     * Initialize a new instance of the class VirtualNetworkGatewayConnections class.
     * @param client Reference to the service client
     */
    constructor(client) {
        this.client = client;
    }
    /**
     * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways
     * connections created.
     * @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;
        }
    }
    /**
     * Creates or updates a virtual network gateway connection in the specified resource group.
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param parameters Parameters supplied to the create or update virtual network gateway connection
     *                   operation.
     * @param options The options parameters.
     */
    async beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, 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,
                virtualNetworkGatewayConnectionName,
                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 a virtual network gateway connection in the specified resource group.
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param parameters Parameters supplied to the create or update virtual network gateway connection
     *                   operation.
     * @param options The options parameters.
     */
    async beginCreateOrUpdateAndWait(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) {
        const poller = await this.beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options);
        return poller.pollUntilDone();
    }
    /**
     * Gets the specified virtual network gateway connection by resource group.
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param options The options parameters.
     */
    get(resourceGroupName, virtualNetworkGatewayConnectionName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, virtualNetworkGatewayConnectionName, options }, getOperationSpec);
    }
    /**
     * Deletes the specified virtual network Gateway connection.
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param options The options parameters.
     */
    async beginDelete(resourceGroupName, virtualNetworkGatewayConnectionName, 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, virtualNetworkGatewayConnectionName, options },
            spec: deleteOperationSpec,
        });
        const poller = await createHttpPoller(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
            resourceLocationConfig: "location",
        });
        await poller.poll();
        return poller;
    }
    /**
     * Deletes the specified virtual network Gateway connection.
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param options The options parameters.
     */
    async beginDeleteAndWait(resourceGroupName, virtualNetworkGatewayConnectionName, options) {
        const poller = await this.beginDelete(resourceGroupName, virtualNetworkGatewayConnectionName, options);
        return poller.pollUntilDone();
    }
    /**
     * Updates a virtual network gateway connection tags.
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param parameters Parameters supplied to update virtual network gateway connection tags.
     * @param options The options parameters.
     */
    async beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, 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,
                virtualNetworkGatewayConnectionName,
                parameters,
                options,
            },
            spec: updateTagsOperationSpec,
        });
        const poller = await createHttpPoller(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
            resourceLocationConfig: "azure-async-operation",
        });
        await poller.poll();
        return poller;
    }
    /**
     * Updates a virtual network gateway connection tags.
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param parameters Parameters supplied to update virtual network gateway connection tags.
     * @param options The options parameters.
     */
    async beginUpdateTagsAndWait(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) {
        const poller = await this.beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options);
        return poller.pollUntilDone();
    }
    /**
     * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway
     * connection shared key for passed virtual network gateway connection in the specified resource group
     * through Network resource provider.
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name.
     * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key
     *                   operation throughNetwork resource provider.
     * @param options The options parameters.
     */
    async beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, 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,
                virtualNetworkGatewayConnectionName,
                parameters,
                options,
            },
            spec: setSharedKeyOperationSpec,
        });
        const poller = await createHttpPoller(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
            resourceLocationConfig: "azure-async-operation",
        });
        await poller.poll();
        return poller;
    }
    /**
     * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway
     * connection shared key for passed virtual network gateway connection in the specified resource group
     * through Network resource provider.
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name.
     * @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key
     *                   operation throughNetwork resource provider.
     * @param options The options parameters.
     */
    async beginSetSharedKeyAndWait(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) {
        const poller = await this.beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options);
        return poller.pollUntilDone();
    }
    /**
     * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified
     * virtual network gateway connection shared key through Network resource provider.
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection shared key name.
     * @param options The options parameters.
     */
    getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, virtualNetworkGatewayConnectionName, options }, getSharedKeyOperationSpec);
    }
    /**
     * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways
     * connections created.
     * @param resourceGroupName The name of the resource group.
     * @param options The options parameters.
     */
    _list(resourceGroupName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, options }, listOperationSpec);
    }
    /**
     * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway
     * connection shared key for passed virtual network gateway connection in the specified resource group
     * through Network resource provider.
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key
     *                                            Name.
     * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared
     *                   key operation through network resource provider.
     * @param options The options parameters.
     */
    async beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, 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,
                virtualNetworkGatewayConnectionName,
                parameters,
                options,
            },
            spec: resetSharedKeyOperationSpec,
        });
        const poller = await createHttpPoller(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
            resourceLocationConfig: "location",
        });
        await poller.poll();
        return poller;
    }
    /**
     * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway
     * connection shared key for passed virtual network gateway connection in the specified resource group
     * through Network resource provider.
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key
     *                                            Name.
     * @param parameters Parameters supplied to the begin reset virtual network gateway connection shared
     *                   key operation through network resource provider.
     * @param options The options parameters.
     */
    async beginResetSharedKeyAndWait(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) {
        const poller = await this.beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options);
        return poller.pollUntilDone();
    }
    /**
     * Starts packet capture on virtual network gateway connection in the specified resource group.
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param options The options parameters.
     */
    async beginStartPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, 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, virtualNetworkGatewayConnectionName, options },
            spec: startPacketCaptureOperationSpec,
        });
        const poller = await createHttpPoller(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
            resourceLocationConfig: "location",
        });
        await poller.poll();
        return poller;
    }
    /**
     * Starts packet capture on virtual network gateway connection in the specified resource group.
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection.
     * @param options The options parameters.
     */
    async beginStartPacketCaptureAndWait(resourceGroupName, virtualNetworkGatewayConnectionName, options) {
        const poller = await this.beginStartPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, options);
        return poller.pollUntilDone();
    }
    /**
     * Stops packet capture on virtual network gateway connection in the specified resource group.
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection.
     * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture
     *                   on gateway connection.
     * @param options The options parameters.
     */
    async beginStopPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, 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,
                virtualNetworkGatewayConnectionName,
                parameters,
                options,
            },
            spec: stopPacketCaptureOperationSpec,
        });
        const poller = await createHttpPoller(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
            resourceLocationConfig: "location",
        });
        await poller.poll();
        return poller;
    }
    /**
     * Stops packet capture on virtual network gateway connection in the specified resource group.
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection.
     * @param parameters Virtual network gateway packet capture parameters supplied to stop packet capture
     *                   on gateway connection.
     * @param options The options parameters.
     */
    async beginStopPacketCaptureAndWait(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) {
        const poller = await this.beginStopPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options);
        return poller.pollUntilDone();
    }
    /**
     * Lists IKE Security Associations for the virtual network gateway connection in the specified resource
     * group.
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection.
     * @param options The options parameters.
     */
    async beginGetIkeSas(resourceGroupName, virtualNetworkGatewayConnectionName, 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, virtualNetworkGatewayConnectionName, options },
            spec: getIkeSasOperationSpec,
        });
        const poller = await createHttpPoller(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
            resourceLocationConfig: "location",
        });
        await poller.poll();
        return poller;
    }
    /**
     * Lists IKE Security Associations for the virtual network gateway connection in the specified resource
     * group.
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection.
     * @param options The options parameters.
     */
    async beginGetIkeSasAndWait(resourceGroupName, virtualNetworkGatewayConnectionName, options) {
        const poller = await this.beginGetIkeSas(resourceGroupName, virtualNetworkGatewayConnectionName, options);
        return poller.pollUntilDone();
    }
    /**
     * Resets the virtual network gateway connection specified.
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection.
     * @param options The options parameters.
     */
    async beginResetConnection(resourceGroupName, virtualNetworkGatewayConnectionName, 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, virtualNetworkGatewayConnectionName, options },
            spec: resetConnectionOperationSpec,
        });
        const poller = await createHttpPoller(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
            resourceLocationConfig: "location",
        });
        await poller.poll();
        return poller;
    }
    /**
     * Resets the virtual network gateway connection specified.
     * @param resourceGroupName The name of the resource group.
     * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway Connection.
     * @param options The options parameters.
     */
    async beginResetConnectionAndWait(resourceGroupName, virtualNetworkGatewayConnectionName, options) {
        const poller = await this.beginResetConnection(resourceGroupName, virtualNetworkGatewayConnectionName, options);
        return poller.pollUntilDone();
    }
    /**
     * 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);
    }
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const createOrUpdateOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}",
    httpMethod: "PUT",
    responses: {
        200: {
            bodyMapper: Mappers.VirtualNetworkGatewayConnection,
        },
        201: {
            bodyMapper: Mappers.VirtualNetworkGatewayConnection,
        },
        202: {
            bodyMapper: Mappers.VirtualNetworkGatewayConnection,
        },
        204: {
            bodyMapper: Mappers.VirtualNetworkGatewayConnection,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    requestBody: Parameters.parameters86,
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.virtualNetworkGatewayConnectionName,
    ],
    headerParameters: [Parameters.accept, Parameters.contentType],
    mediaType: "json",
    serializer,
};
const getOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.VirtualNetworkGatewayConnection,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.virtualNetworkGatewayConnectionName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const deleteOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}",
    httpMethod: "DELETE",
    responses: {
        200: {},
        201: {},
        202: {},
        204: {},
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.virtualNetworkGatewayConnectionName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const updateTagsOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}",
    httpMethod: "PATCH",
    responses: {
        200: {
            bodyMapper: Mappers.VirtualNetworkGatewayConnection,
        },
        201: {
            bodyMapper: Mappers.VirtualNetworkGatewayConnection,
        },
        202: {
            bodyMapper: Mappers.VirtualNetworkGatewayConnection,
        },
        204: {
            bodyMapper: Mappers.VirtualNetworkGatewayConnection,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    requestBody: Parameters.parameters1,
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.virtualNetworkGatewayConnectionName,
    ],
    headerParameters: [Parameters.accept, Parameters.contentType],
    mediaType: "json",
    serializer,
};
const setSharedKeyOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey",
    httpMethod: "PUT",
    responses: {
        200: {
            bodyMapper: Mappers.ConnectionSharedKey,
        },
        201: {
            bodyMapper: Mappers.ConnectionSharedKey,
        },
        202: {
            bodyMapper: Mappers.ConnectionSharedKey,
        },
        204: {
            bodyMapper: Mappers.ConnectionSharedKey,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    requestBody: Parameters.parameters87,
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.virtualNetworkGatewayConnectionName,
    ],
    headerParameters: [Parameters.accept, Parameters.contentType],
    mediaType: "json",
    serializer,
};
const getSharedKeyOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.ConnectionSharedKey,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.virtualNetworkGatewayConnectionName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.VirtualNetworkGatewayConnectionListResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const resetSharedKeyOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset",
    httpMethod: "POST",
    responses: {
        200: {
            bodyMapper: Mappers.ConnectionResetSharedKey,
        },
        201: {
            bodyMapper: Mappers.ConnectionResetSharedKey,
        },
        202: {
            bodyMapper: Mappers.ConnectionResetSharedKey,
        },
        204: {
            bodyMapper: Mappers.ConnectionResetSharedKey,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    requestBody: Parameters.parameters88,
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.virtualNetworkGatewayConnectionName,
    ],
    headerParameters: [Parameters.accept, Parameters.contentType],
    mediaType: "json",
    serializer,
};
const startPacketCaptureOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/startPacketCapture",
    httpMethod: "POST",
    responses: {
        200: {
            bodyMapper: { type: { name: "String" } },
        },
        201: {
            bodyMapper: { type: { name: "String" } },
        },
        202: {
            bodyMapper: { type: { name: "String" } },
        },
        204: {
            bodyMapper: { type: { name: "String" } },
        },
        default: {
            bodyMapper: Mappers.ErrorModel,
        },
    },
    requestBody: Parameters.parameters84,
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.virtualNetworkGatewayConnectionName,
    ],
    headerParameters: [Parameters.accept, Parameters.contentType],
    mediaType: "json",
    serializer,
};
const stopPacketCaptureOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/stopPacketCapture",
    httpMethod: "POST",
    responses: {
        200: {
            bodyMapper: { type: { name: "String" } },
        },
        201: {
            bodyMapper: { type: { name: "String" } },
        },
        202: {
            bodyMapper: { type: { name: "String" } },
        },
        204: {
            bodyMapper: { type: { name: "String" } },
        },
        default: {
            bodyMapper: Mappers.ErrorModel,
        },
    },
    requestBody: Parameters.parameters85,
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.virtualNetworkGatewayConnectionName,
    ],
    headerParameters: [Parameters.accept, Parameters.contentType],
    mediaType: "json",
    serializer,
};
const getIkeSasOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/getikesas",
    httpMethod: "POST",
    responses: {
        200: {
            bodyMapper: { type: { name: "String" } },
        },
        201: {
            bodyMapper: { type: { name: "String" } },
        },
        202: {
            bodyMapper: { type: { name: "String" } },
        },
        204: {
            bodyMapper: { type: { name: "String" } },
        },
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.virtualNetworkGatewayConnectionName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const resetConnectionOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/resetconnection",
    httpMethod: "POST",
    responses: {
        200: {},
        201: {},
        202: {},
        204: {},
        default: {
            bodyMapper: Mappers.ErrorResponse,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.virtualNetworkGatewayConnectionName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.VirtualNetworkGatewayConnectionListResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.nextLink,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
//# sourceMappingURL=virtualNetworkGatewayConnections.js.map