"use strict";
/*
 * Copyright (c) Microsoft Corporation.
 * Licensed under the MIT License.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 * Changes may cause incorrect behavior and will be lost if the code is regenerated.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.PrivateLinkServicesImpl = void 0;
const tslib_1 = require("tslib");
const pagingHelper_js_1 = require("../pagingHelper.js");
const coreClient = tslib_1.__importStar(require("@azure/core-client"));
const Mappers = tslib_1.__importStar(require("../models/mappers.js"));
const Parameters = tslib_1.__importStar(require("../models/parameters.js"));
const core_lro_1 = require("@azure/core-lro");
const lroImpl_js_1 = require("../lroImpl.js");
/// <reference lib="esnext.asynciterable" />
/** Class containing PrivateLinkServices operations. */
class PrivateLinkServicesImpl {
    client;
    /**
     * Initialize a new instance of the class PrivateLinkServices class.
     * @param client Reference to the service client
     */
    constructor(client) {
        this.client = client;
    }
    /**
     * Gets all private link services 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;
            (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listNext(resourceGroupName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
            yield page;
        }
    }
    async *listPagingAll(resourceGroupName, options) {
        for await (const page of this.listPagingPage(resourceGroupName, options)) {
            yield* page;
        }
    }
    /**
     * Gets all private link service in a subscription.
     * @param options The options parameters.
     */
    listBySubscription(options) {
        const iter = this.listBySubscriptionPagingAll(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.listBySubscriptionPagingPage(options, settings);
            },
        };
    }
    async *listBySubscriptionPagingPage(options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listBySubscription(options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listBySubscriptionNext(continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
            yield page;
        }
    }
    async *listBySubscriptionPagingAll(options) {
        for await (const page of this.listBySubscriptionPagingPage(options)) {
            yield* page;
        }
    }
    /**
     * Gets all private end point connections for a specific private link service.
     * @param resourceGroupName The name of the resource group.
     * @param serviceName The name of the private link service.
     * @param options The options parameters.
     */
    listPrivateEndpointConnections(resourceGroupName, serviceName, options) {
        const iter = this.listPrivateEndpointConnectionsPagingAll(resourceGroupName, serviceName, 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.listPrivateEndpointConnectionsPagingPage(resourceGroupName, serviceName, options, settings);
            },
        };
    }
    async *listPrivateEndpointConnectionsPagingPage(resourceGroupName, serviceName, options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listPrivateEndpointConnections(resourceGroupName, serviceName, options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listPrivateEndpointConnectionsNext(resourceGroupName, serviceName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
            yield page;
        }
    }
    async *listPrivateEndpointConnectionsPagingAll(resourceGroupName, serviceName, options) {
        for await (const page of this.listPrivateEndpointConnectionsPagingPage(resourceGroupName, serviceName, options)) {
            yield* page;
        }
    }
    /**
     * Returns all of the private link service ids that can be linked to a Private Endpoint with auto
     * approved in this subscription in this region.
     * @param location The location of the domain name.
     * @param options The options parameters.
     */
    listAutoApprovedPrivateLinkServices(location, options) {
        const iter = this.listAutoApprovedPrivateLinkServicesPagingAll(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.listAutoApprovedPrivateLinkServicesPagingPage(location, options, settings);
            },
        };
    }
    async *listAutoApprovedPrivateLinkServicesPagingPage(location, options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listAutoApprovedPrivateLinkServices(location, options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listAutoApprovedPrivateLinkServicesNext(location, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
            yield page;
        }
    }
    async *listAutoApprovedPrivateLinkServicesPagingAll(location, options) {
        for await (const page of this.listAutoApprovedPrivateLinkServicesPagingPage(location, options)) {
            yield* page;
        }
    }
    /**
     * Returns all of the private link service ids that can be linked to a Private Endpoint with auto
     * approved in this subscription in this region.
     * @param location The location of the domain name.
     * @param resourceGroupName The name of the resource group.
     * @param options The options parameters.
     */
    listAutoApprovedPrivateLinkServicesByResourceGroup(location, resourceGroupName, options) {
        const iter = this.listAutoApprovedPrivateLinkServicesByResourceGroupPagingAll(location, 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.listAutoApprovedPrivateLinkServicesByResourceGroupPagingPage(location, resourceGroupName, options, settings);
            },
        };
    }
    async *listAutoApprovedPrivateLinkServicesByResourceGroupPagingPage(location, resourceGroupName, options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listAutoApprovedPrivateLinkServicesByResourceGroup(location, resourceGroupName, options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result =
                await this._listAutoApprovedPrivateLinkServicesByResourceGroupNext(location, resourceGroupName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
            yield page;
        }
    }
    async *listAutoApprovedPrivateLinkServicesByResourceGroupPagingAll(location, resourceGroupName, options) {
        for await (const page of this.listAutoApprovedPrivateLinkServicesByResourceGroupPagingPage(location, resourceGroupName, options)) {
            yield* page;
        }
    }
    /**
     * Deletes the specified private link service.
     * @param resourceGroupName The name of the resource group.
     * @param serviceName The name of the private link service.
     * @param options The options parameters.
     */
    async beginDelete(resourceGroupName, serviceName, options) {
        const directSendOperation = async (args, spec) => {
            return this.client.sendOperationRequest(args, spec);
        };
        const sendOperationFn = async (args, spec) => {
            let currentRawResponse = undefined;
            const providedCallback = args.options?.onResponse;
            const callback = (rawResponse, flatResponse) => {
                currentRawResponse = rawResponse;
                providedCallback?.(rawResponse, flatResponse);
            };
            const updatedArgs = {
                ...args,
                options: {
                    ...args.options,
                    onResponse: callback,
                },
            };
            const flatResponse = await directSendOperation(updatedArgs, spec);
            return {
                flatResponse,
                rawResponse: {
                    statusCode: currentRawResponse.status,
                    body: currentRawResponse.parsedBody,
                    headers: currentRawResponse.headers.toJSON(),
                },
            };
        };
        const lro = (0, lroImpl_js_1.createLroSpec)({
            sendOperationFn,
            args: { resourceGroupName, serviceName, options },
            spec: deleteOperationSpec,
        });
        const poller = await (0, core_lro_1.createHttpPoller)(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
            resourceLocationConfig: "location",
        });
        await poller.poll();
        return poller;
    }
    /**
     * Deletes the specified private link service.
     * @param resourceGroupName The name of the resource group.
     * @param serviceName The name of the private link service.
     * @param options The options parameters.
     */
    async beginDeleteAndWait(resourceGroupName, serviceName, options) {
        const poller = await this.beginDelete(resourceGroupName, serviceName, options);
        return poller.pollUntilDone();
    }
    /**
     * Gets the specified private link service by resource group.
     * @param resourceGroupName The name of the resource group.
     * @param serviceName The name of the private link service.
     * @param options The options parameters.
     */
    get(resourceGroupName, serviceName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, options }, getOperationSpec);
    }
    /**
     * Creates or updates an private link service in the specified resource group.
     * @param resourceGroupName The name of the resource group.
     * @param serviceName The name of the private link service.
     * @param parameters Parameters supplied to the create or update private link service operation.
     * @param options The options parameters.
     */
    async beginCreateOrUpdate(resourceGroupName, serviceName, parameters, options) {
        const directSendOperation = async (args, spec) => {
            return this.client.sendOperationRequest(args, spec);
        };
        const sendOperationFn = async (args, spec) => {
            let currentRawResponse = undefined;
            const providedCallback = args.options?.onResponse;
            const callback = (rawResponse, flatResponse) => {
                currentRawResponse = rawResponse;
                providedCallback?.(rawResponse, flatResponse);
            };
            const updatedArgs = {
                ...args,
                options: {
                    ...args.options,
                    onResponse: callback,
                },
            };
            const flatResponse = await directSendOperation(updatedArgs, spec);
            return {
                flatResponse,
                rawResponse: {
                    statusCode: currentRawResponse.status,
                    body: currentRawResponse.parsedBody,
                    headers: currentRawResponse.headers.toJSON(),
                },
            };
        };
        const lro = (0, lroImpl_js_1.createLroSpec)({
            sendOperationFn,
            args: { resourceGroupName, serviceName, parameters, options },
            spec: createOrUpdateOperationSpec,
        });
        const poller = await (0, core_lro_1.createHttpPoller)(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
            resourceLocationConfig: "azure-async-operation",
        });
        await poller.poll();
        return poller;
    }
    /**
     * Creates or updates an private link service in the specified resource group.
     * @param resourceGroupName The name of the resource group.
     * @param serviceName The name of the private link service.
     * @param parameters Parameters supplied to the create or update private link service operation.
     * @param options The options parameters.
     */
    async beginCreateOrUpdateAndWait(resourceGroupName, serviceName, parameters, options) {
        const poller = await this.beginCreateOrUpdate(resourceGroupName, serviceName, parameters, options);
        return poller.pollUntilDone();
    }
    /**
     * Gets all private link services 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 private link service in a subscription.
     * @param options The options parameters.
     */
    _listBySubscription(options) {
        return this.client.sendOperationRequest({ options }, listBySubscriptionOperationSpec);
    }
    /**
     * Get the specific private end point connection by specific private link service in the resource
     * group.
     * @param resourceGroupName The name of the resource group.
     * @param serviceName The name of the private link service.
     * @param peConnectionName The name of the private end point connection.
     * @param options The options parameters.
     */
    getPrivateEndpointConnection(resourceGroupName, serviceName, peConnectionName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, peConnectionName, options }, getPrivateEndpointConnectionOperationSpec);
    }
    /**
     * Approve or reject private end point connection for a private link service in a subscription.
     * @param resourceGroupName The name of the resource group.
     * @param serviceName The name of the private link service.
     * @param peConnectionName The name of the private end point connection.
     * @param parameters Parameters supplied to approve or reject the private end point connection.
     * @param options The options parameters.
     */
    updatePrivateEndpointConnection(resourceGroupName, serviceName, peConnectionName, parameters, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, peConnectionName, parameters, options }, updatePrivateEndpointConnectionOperationSpec);
    }
    /**
     * Delete private end point connection for a private link service in a subscription.
     * @param resourceGroupName The name of the resource group.
     * @param serviceName The name of the private link service.
     * @param peConnectionName The name of the private end point connection.
     * @param options The options parameters.
     */
    async beginDeletePrivateEndpointConnection(resourceGroupName, serviceName, peConnectionName, options) {
        const directSendOperation = async (args, spec) => {
            return this.client.sendOperationRequest(args, spec);
        };
        const sendOperationFn = async (args, spec) => {
            let currentRawResponse = undefined;
            const providedCallback = args.options?.onResponse;
            const callback = (rawResponse, flatResponse) => {
                currentRawResponse = rawResponse;
                providedCallback?.(rawResponse, flatResponse);
            };
            const updatedArgs = {
                ...args,
                options: {
                    ...args.options,
                    onResponse: callback,
                },
            };
            const flatResponse = await directSendOperation(updatedArgs, spec);
            return {
                flatResponse,
                rawResponse: {
                    statusCode: currentRawResponse.status,
                    body: currentRawResponse.parsedBody,
                    headers: currentRawResponse.headers.toJSON(),
                },
            };
        };
        const lro = (0, lroImpl_js_1.createLroSpec)({
            sendOperationFn,
            args: { resourceGroupName, serviceName, peConnectionName, options },
            spec: deletePrivateEndpointConnectionOperationSpec,
        });
        const poller = await (0, core_lro_1.createHttpPoller)(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
            resourceLocationConfig: "location",
        });
        await poller.poll();
        return poller;
    }
    /**
     * Delete private end point connection for a private link service in a subscription.
     * @param resourceGroupName The name of the resource group.
     * @param serviceName The name of the private link service.
     * @param peConnectionName The name of the private end point connection.
     * @param options The options parameters.
     */
    async beginDeletePrivateEndpointConnectionAndWait(resourceGroupName, serviceName, peConnectionName, options) {
        const poller = await this.beginDeletePrivateEndpointConnection(resourceGroupName, serviceName, peConnectionName, options);
        return poller.pollUntilDone();
    }
    /**
     * Gets all private end point connections for a specific private link service.
     * @param resourceGroupName The name of the resource group.
     * @param serviceName The name of the private link service.
     * @param options The options parameters.
     */
    _listPrivateEndpointConnections(resourceGroupName, serviceName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, options }, listPrivateEndpointConnectionsOperationSpec);
    }
    /**
     * Checks whether the subscription is visible to private link service.
     * @param location The location of the domain name.
     * @param parameters The request body of CheckPrivateLinkService API call.
     * @param options The options parameters.
     */
    async beginCheckPrivateLinkServiceVisibility(location, parameters, options) {
        const directSendOperation = async (args, spec) => {
            return this.client.sendOperationRequest(args, spec);
        };
        const sendOperationFn = async (args, spec) => {
            let currentRawResponse = undefined;
            const providedCallback = args.options?.onResponse;
            const callback = (rawResponse, flatResponse) => {
                currentRawResponse = rawResponse;
                providedCallback?.(rawResponse, flatResponse);
            };
            const updatedArgs = {
                ...args,
                options: {
                    ...args.options,
                    onResponse: callback,
                },
            };
            const flatResponse = await directSendOperation(updatedArgs, spec);
            return {
                flatResponse,
                rawResponse: {
                    statusCode: currentRawResponse.status,
                    body: currentRawResponse.parsedBody,
                    headers: currentRawResponse.headers.toJSON(),
                },
            };
        };
        const lro = (0, lroImpl_js_1.createLroSpec)({
            sendOperationFn,
            args: { location, parameters, options },
            spec: checkPrivateLinkServiceVisibilityOperationSpec,
        });
        const poller = await (0, core_lro_1.createHttpPoller)(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
            resourceLocationConfig: "location",
        });
        await poller.poll();
        return poller;
    }
    /**
     * Checks whether the subscription is visible to private link service.
     * @param location The location of the domain name.
     * @param parameters The request body of CheckPrivateLinkService API call.
     * @param options The options parameters.
     */
    async beginCheckPrivateLinkServiceVisibilityAndWait(location, parameters, options) {
        const poller = await this.beginCheckPrivateLinkServiceVisibility(location, parameters, options);
        return poller.pollUntilDone();
    }
    /**
     * Checks whether the subscription is visible to private link service in the specified resource group.
     * @param location The location of the domain name.
     * @param resourceGroupName The name of the resource group.
     * @param parameters The request body of CheckPrivateLinkService API call.
     * @param options The options parameters.
     */
    async beginCheckPrivateLinkServiceVisibilityByResourceGroup(location, resourceGroupName, parameters, options) {
        const directSendOperation = async (args, spec) => {
            return this.client.sendOperationRequest(args, spec);
        };
        const sendOperationFn = async (args, spec) => {
            let currentRawResponse = undefined;
            const providedCallback = args.options?.onResponse;
            const callback = (rawResponse, flatResponse) => {
                currentRawResponse = rawResponse;
                providedCallback?.(rawResponse, flatResponse);
            };
            const updatedArgs = {
                ...args,
                options: {
                    ...args.options,
                    onResponse: callback,
                },
            };
            const flatResponse = await directSendOperation(updatedArgs, spec);
            return {
                flatResponse,
                rawResponse: {
                    statusCode: currentRawResponse.status,
                    body: currentRawResponse.parsedBody,
                    headers: currentRawResponse.headers.toJSON(),
                },
            };
        };
        const lro = (0, lroImpl_js_1.createLroSpec)({
            sendOperationFn,
            args: { location, resourceGroupName, parameters, options },
            spec: checkPrivateLinkServiceVisibilityByResourceGroupOperationSpec,
        });
        const poller = await (0, core_lro_1.createHttpPoller)(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
            resourceLocationConfig: "location",
        });
        await poller.poll();
        return poller;
    }
    /**
     * Checks whether the subscription is visible to private link service in the specified resource group.
     * @param location The location of the domain name.
     * @param resourceGroupName The name of the resource group.
     * @param parameters The request body of CheckPrivateLinkService API call.
     * @param options The options parameters.
     */
    async beginCheckPrivateLinkServiceVisibilityByResourceGroupAndWait(location, resourceGroupName, parameters, options) {
        const poller = await this.beginCheckPrivateLinkServiceVisibilityByResourceGroup(location, resourceGroupName, parameters, options);
        return poller.pollUntilDone();
    }
    /**
     * Returns all of the private link service ids that can be linked to a Private Endpoint with auto
     * approved in this subscription in this region.
     * @param location The location of the domain name.
     * @param options The options parameters.
     */
    _listAutoApprovedPrivateLinkServices(location, options) {
        return this.client.sendOperationRequest({ location, options }, listAutoApprovedPrivateLinkServicesOperationSpec);
    }
    /**
     * Returns all of the private link service ids that can be linked to a Private Endpoint with auto
     * approved in this subscription in this region.
     * @param location The location of the domain name.
     * @param resourceGroupName The name of the resource group.
     * @param options The options parameters.
     */
    _listAutoApprovedPrivateLinkServicesByResourceGroup(location, resourceGroupName, options) {
        return this.client.sendOperationRequest({ location, resourceGroupName, options }, listAutoApprovedPrivateLinkServicesByResourceGroupOperationSpec);
    }
    /**
     * 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);
    }
    /**
     * ListBySubscriptionNext
     * @param nextLink The nextLink from the previous successful call to the ListBySubscription method.
     * @param options The options parameters.
     */
    _listBySubscriptionNext(nextLink, options) {
        return this.client.sendOperationRequest({ nextLink, options }, listBySubscriptionNextOperationSpec);
    }
    /**
     * ListPrivateEndpointConnectionsNext
     * @param resourceGroupName The name of the resource group.
     * @param serviceName The name of the private link service.
     * @param nextLink The nextLink from the previous successful call to the ListPrivateEndpointConnections
     *                 method.
     * @param options The options parameters.
     */
    _listPrivateEndpointConnectionsNext(resourceGroupName, serviceName, nextLink, options) {
        return this.client.sendOperationRequest({ resourceGroupName, serviceName, nextLink, options }, listPrivateEndpointConnectionsNextOperationSpec);
    }
    /**
     * ListAutoApprovedPrivateLinkServicesNext
     * @param location The location of the domain name.
     * @param nextLink The nextLink from the previous successful call to the
     *                 ListAutoApprovedPrivateLinkServices method.
     * @param options The options parameters.
     */
    _listAutoApprovedPrivateLinkServicesNext(location, nextLink, options) {
        return this.client.sendOperationRequest({ location, nextLink, options }, listAutoApprovedPrivateLinkServicesNextOperationSpec);
    }
    /**
     * ListAutoApprovedPrivateLinkServicesByResourceGroupNext
     * @param location The location of the domain name.
     * @param resourceGroupName The name of the resource group.
     * @param nextLink The nextLink from the previous successful call to the
     *                 ListAutoApprovedPrivateLinkServicesByResourceGroup method.
     * @param options The options parameters.
     */
    _listAutoApprovedPrivateLinkServicesByResourceGroupNext(location, resourceGroupName, nextLink, options) {
        return this.client.sendOperationRequest({ location, resourceGroupName, nextLink, options }, listAutoApprovedPrivateLinkServicesByResourceGroupNextOperationSpec);
    }
}
exports.PrivateLinkServicesImpl = PrivateLinkServicesImpl;
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const deleteOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}",
    httpMethod: "DELETE",
    responses: {
        200: {},
        201: {},
        202: {},
        204: {},
        default: {
            bodyMapper: Mappers.ErrorModel,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const getOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PrivateLinkService,
        },
        default: {
            bodyMapper: Mappers.ErrorModel,
        },
    },
    queryParameters: [Parameters.apiVersion, Parameters.expand],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const createOrUpdateOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}",
    httpMethod: "PUT",
    responses: {
        200: {
            bodyMapper: Mappers.PrivateLinkService,
        },
        201: {
            bodyMapper: Mappers.PrivateLinkService,
        },
        202: {
            bodyMapper: Mappers.PrivateLinkService,
        },
        204: {
            bodyMapper: Mappers.PrivateLinkService,
        },
        default: {
            bodyMapper: Mappers.ErrorModel,
        },
    },
    requestBody: Parameters.parameters73,
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
    ],
    headerParameters: [Parameters.accept, Parameters.contentType],
    mediaType: "json",
    serializer,
};
const listOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PrivateLinkServiceListResult,
        },
        default: {
            bodyMapper: Mappers.ErrorModel,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listBySubscriptionOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateLinkServices",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PrivateLinkServiceListResult,
        },
        default: {
            bodyMapper: Mappers.ErrorModel,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [Parameters.$host, Parameters.subscriptionId],
    headerParameters: [Parameters.accept],
    serializer,
};
const getPrivateEndpointConnectionOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PrivateEndpointConnection,
        },
        default: {
            bodyMapper: Mappers.ErrorModel,
        },
    },
    queryParameters: [Parameters.apiVersion, Parameters.expand],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.peConnectionName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const updatePrivateEndpointConnectionOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}",
    httpMethod: "PUT",
    responses: {
        200: {
            bodyMapper: Mappers.PrivateEndpointConnection,
        },
        default: {
            bodyMapper: Mappers.ErrorModel,
        },
    },
    requestBody: Parameters.parameters74,
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.peConnectionName,
    ],
    headerParameters: [Parameters.accept, Parameters.contentType],
    mediaType: "json",
    serializer,
};
const deletePrivateEndpointConnectionOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}",
    httpMethod: "DELETE",
    responses: {
        200: {},
        201: {},
        202: {},
        204: {},
        default: {
            bodyMapper: Mappers.ErrorModel,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
        Parameters.peConnectionName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listPrivateEndpointConnectionsOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PrivateEndpointConnectionListResult,
        },
        default: {
            bodyMapper: Mappers.ErrorModel,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.serviceName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const checkPrivateLinkServiceVisibilityOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility",
    httpMethod: "POST",
    responses: {
        200: {
            bodyMapper: Mappers.PrivateLinkServiceVisibility,
        },
        201: {
            bodyMapper: Mappers.PrivateLinkServiceVisibility,
        },
        202: {
            bodyMapper: Mappers.PrivateLinkServiceVisibility,
        },
        204: {
            bodyMapper: Mappers.PrivateLinkServiceVisibility,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    requestBody: Parameters.parameters75,
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.location,
    ],
    headerParameters: [Parameters.accept, Parameters.contentType],
    mediaType: "json",
    serializer,
};
const checkPrivateLinkServiceVisibilityByResourceGroupOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility",
    httpMethod: "POST",
    responses: {
        200: {
            bodyMapper: Mappers.PrivateLinkServiceVisibility,
        },
        201: {
            bodyMapper: Mappers.PrivateLinkServiceVisibility,
        },
        202: {
            bodyMapper: Mappers.PrivateLinkServiceVisibility,
        },
        204: {
            bodyMapper: Mappers.PrivateLinkServiceVisibility,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    requestBody: Parameters.parameters75,
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.location,
    ],
    headerParameters: [Parameters.accept, Parameters.contentType],
    mediaType: "json",
    serializer,
};
const listAutoApprovedPrivateLinkServicesOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.AutoApprovedPrivateLinkServicesResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.location,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listAutoApprovedPrivateLinkServicesByResourceGroupOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.AutoApprovedPrivateLinkServicesResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.location,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PrivateLinkServiceListResult,
        },
        default: {
            bodyMapper: Mappers.ErrorModel,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.nextLink,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listBySubscriptionNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PrivateLinkServiceListResult,
        },
        default: {
            bodyMapper: Mappers.ErrorModel,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.nextLink,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listPrivateEndpointConnectionsNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PrivateEndpointConnectionListResult,
        },
        default: {
            bodyMapper: Mappers.ErrorModel,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.nextLink,
        Parameters.serviceName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listAutoApprovedPrivateLinkServicesNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.AutoApprovedPrivateLinkServicesResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.nextLink,
        Parameters.location,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listAutoApprovedPrivateLinkServicesByResourceGroupNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.AutoApprovedPrivateLinkServicesResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.nextLink,
        Parameters.location,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
//# sourceMappingURL=privateLinkServices.js.map