/*
 * 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 PublicIPAddresses operations. */
export class PublicIPAddressesImpl {
    client;
    /**
     * Initialize a new instance of the class PublicIPAddresses class.
     * @param client Reference to the service client
     */
    constructor(client) {
        this.client = client;
    }
    /**
     * Gets information about all public IP addresses on a cloud service level.
     * @param resourceGroupName The name of the resource group.
     * @param cloudServiceName The name of the cloud service.
     * @param options The options parameters.
     */
    listCloudServicePublicIPAddresses(resourceGroupName, cloudServiceName, options) {
        const iter = this.listCloudServicePublicIPAddressesPagingAll(resourceGroupName, cloudServiceName, 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.listCloudServicePublicIPAddressesPagingPage(resourceGroupName, cloudServiceName, options, settings);
            },
        };
    }
    async *listCloudServicePublicIPAddressesPagingPage(resourceGroupName, cloudServiceName, options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listCloudServicePublicIPAddresses(resourceGroupName, cloudServiceName, options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            setContinuationToken(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listCloudServicePublicIPAddressesNext(resourceGroupName, cloudServiceName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            setContinuationToken(page, continuationToken);
            yield page;
        }
    }
    async *listCloudServicePublicIPAddressesPagingAll(resourceGroupName, cloudServiceName, options) {
        for await (const page of this.listCloudServicePublicIPAddressesPagingPage(resourceGroupName, cloudServiceName, options)) {
            yield* page;
        }
    }
    /**
     * Gets information about all public IP addresses in a role instance IP configuration in a cloud
     * service.
     * @param resourceGroupName The name of the resource group.
     * @param cloudServiceName The name of the cloud service.
     * @param roleInstanceName The name of role instance.
     * @param networkInterfaceName The network interface name.
     * @param ipConfigurationName The IP configuration name.
     * @param options The options parameters.
     */
    listCloudServiceRoleInstancePublicIPAddresses(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName, options) {
        const iter = this.listCloudServiceRoleInstancePublicIPAddressesPagingAll(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName, 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.listCloudServiceRoleInstancePublicIPAddressesPagingPage(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName, options, settings);
            },
        };
    }
    async *listCloudServiceRoleInstancePublicIPAddressesPagingPage(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName, options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listCloudServiceRoleInstancePublicIPAddresses(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName, options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            setContinuationToken(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listCloudServiceRoleInstancePublicIPAddressesNext(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            setContinuationToken(page, continuationToken);
            yield page;
        }
    }
    async *listCloudServiceRoleInstancePublicIPAddressesPagingAll(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName, options) {
        for await (const page of this.listCloudServiceRoleInstancePublicIPAddressesPagingPage(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName, options)) {
            yield* page;
        }
    }
    /**
     * Gets all the public IP addresses 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;
        }
    }
    /**
     * Gets all public IP addresses 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 information about all public IP addresses on a virtual machine scale set level.
     * @param resourceGroupName The name of the resource group.
     * @param virtualMachineScaleSetName The name of the virtual machine scale set.
     * @param options The options parameters.
     */
    listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, options) {
        const iter = this.listVirtualMachineScaleSetPublicIPAddressesPagingAll(resourceGroupName, virtualMachineScaleSetName, 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.listVirtualMachineScaleSetPublicIPAddressesPagingPage(resourceGroupName, virtualMachineScaleSetName, options, settings);
            },
        };
    }
    async *listVirtualMachineScaleSetPublicIPAddressesPagingPage(resourceGroupName, virtualMachineScaleSetName, options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            setContinuationToken(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listVirtualMachineScaleSetPublicIPAddressesNext(resourceGroupName, virtualMachineScaleSetName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            setContinuationToken(page, continuationToken);
            yield page;
        }
    }
    async *listVirtualMachineScaleSetPublicIPAddressesPagingAll(resourceGroupName, virtualMachineScaleSetName, options) {
        for await (const page of this.listVirtualMachineScaleSetPublicIPAddressesPagingPage(resourceGroupName, virtualMachineScaleSetName, options)) {
            yield* page;
        }
    }
    /**
     * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual
     * machine scale set.
     * @param resourceGroupName The name of the resource group.
     * @param virtualMachineScaleSetName The name of the virtual machine scale set.
     * @param virtualmachineIndex The virtual machine index.
     * @param networkInterfaceName The network interface name.
     * @param ipConfigurationName The IP configuration name.
     * @param options The options parameters.
     */
    listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options) {
        const iter = this.listVirtualMachineScaleSetVMPublicIPAddressesPagingAll(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, 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.listVirtualMachineScaleSetVMPublicIPAddressesPagingPage(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options, settings);
            },
        };
    }
    async *listVirtualMachineScaleSetVMPublicIPAddressesPagingPage(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options, settings) {
        let result;
        let continuationToken = settings?.continuationToken;
        if (!continuationToken) {
            result = await this._listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options);
            let page = result.value || [];
            continuationToken = result.nextLink;
            setContinuationToken(page, continuationToken);
            yield page;
        }
        while (continuationToken) {
            result = await this._listVirtualMachineScaleSetVMPublicIPAddressesNext(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, continuationToken, options);
            continuationToken = result.nextLink;
            let page = result.value || [];
            setContinuationToken(page, continuationToken);
            yield page;
        }
    }
    async *listVirtualMachineScaleSetVMPublicIPAddressesPagingAll(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options) {
        for await (const page of this.listVirtualMachineScaleSetVMPublicIPAddressesPagingPage(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options)) {
            yield* page;
        }
    }
    /**
     * Gets information about all public IP addresses on a cloud service level.
     * @param resourceGroupName The name of the resource group.
     * @param cloudServiceName The name of the cloud service.
     * @param options The options parameters.
     */
    _listCloudServicePublicIPAddresses(resourceGroupName, cloudServiceName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, cloudServiceName, options }, listCloudServicePublicIPAddressesOperationSpec);
    }
    /**
     * Gets information about all public IP addresses in a role instance IP configuration in a cloud
     * service.
     * @param resourceGroupName The name of the resource group.
     * @param cloudServiceName The name of the cloud service.
     * @param roleInstanceName The name of role instance.
     * @param networkInterfaceName The network interface name.
     * @param ipConfigurationName The IP configuration name.
     * @param options The options parameters.
     */
    _listCloudServiceRoleInstancePublicIPAddresses(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            cloudServiceName,
            roleInstanceName,
            networkInterfaceName,
            ipConfigurationName,
            options,
        }, listCloudServiceRoleInstancePublicIPAddressesOperationSpec);
    }
    /**
     * Get the specified public IP address in a cloud service.
     * @param resourceGroupName The name of the resource group.
     * @param cloudServiceName The name of the cloud service.
     * @param roleInstanceName The role instance name.
     * @param networkInterfaceName The name of the network interface.
     * @param ipConfigurationName The name of the IP configuration.
     * @param publicIpAddressName The name of the public IP Address.
     * @param options The options parameters.
     */
    getCloudServicePublicIPAddress(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName, publicIpAddressName, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            cloudServiceName,
            roleInstanceName,
            networkInterfaceName,
            ipConfigurationName,
            publicIpAddressName,
            options,
        }, getCloudServicePublicIPAddressOperationSpec);
    }
    /**
     * Deletes the specified public IP address.
     * @param resourceGroupName The name of the resource group.
     * @param publicIpAddressName The name of the public IP address.
     * @param options The options parameters.
     */
    async beginDelete(resourceGroupName, publicIpAddressName, 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, publicIpAddressName, options },
            spec: deleteOperationSpec,
        });
        const poller = await createHttpPoller(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
            resourceLocationConfig: "location",
        });
        await poller.poll();
        return poller;
    }
    /**
     * Deletes the specified public IP address.
     * @param resourceGroupName The name of the resource group.
     * @param publicIpAddressName The name of the public IP address.
     * @param options The options parameters.
     */
    async beginDeleteAndWait(resourceGroupName, publicIpAddressName, options) {
        const poller = await this.beginDelete(resourceGroupName, publicIpAddressName, options);
        return poller.pollUntilDone();
    }
    /**
     * Gets the specified public IP address in a specified resource group.
     * @param resourceGroupName The name of the resource group.
     * @param publicIpAddressName The name of the public IP address.
     * @param options The options parameters.
     */
    get(resourceGroupName, publicIpAddressName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, publicIpAddressName, options }, getOperationSpec);
    }
    /**
     * Creates or updates a static or dynamic public IP address.
     * @param resourceGroupName The name of the resource group.
     * @param publicIpAddressName The name of the public IP address.
     * @param parameters Parameters supplied to the create or update public IP address operation.
     * @param options The options parameters.
     */
    async beginCreateOrUpdate(resourceGroupName, publicIpAddressName, 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, publicIpAddressName, 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 static or dynamic public IP address.
     * @param resourceGroupName The name of the resource group.
     * @param publicIpAddressName The name of the public IP address.
     * @param parameters Parameters supplied to the create or update public IP address operation.
     * @param options The options parameters.
     */
    async beginCreateOrUpdateAndWait(resourceGroupName, publicIpAddressName, parameters, options) {
        const poller = await this.beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters, options);
        return poller.pollUntilDone();
    }
    /**
     * Updates public IP address tags.
     * @param resourceGroupName The name of the resource group.
     * @param publicIpAddressName The name of the public IP address.
     * @param parameters Parameters supplied to update public IP address tags.
     * @param options The options parameters.
     */
    updateTags(resourceGroupName, publicIpAddressName, parameters, options) {
        return this.client.sendOperationRequest({ resourceGroupName, publicIpAddressName, parameters, options }, updateTagsOperationSpec);
    }
    /**
     * Gets all the public IP addresses in a subscription.
     * @param options The options parameters.
     */
    _listAll(options) {
        return this.client.sendOperationRequest({ options }, listAllOperationSpec);
    }
    /**
     * Gets all public IP addresses 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 the Ddos Protection Status of a Public IP Address
     * @param resourceGroupName The name of the resource group.
     * @param publicIpAddressName The name of the public IP address.
     * @param options The options parameters.
     */
    async beginDdosProtectionStatus(resourceGroupName, publicIpAddressName, 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, publicIpAddressName, options },
            spec: ddosProtectionStatusOperationSpec,
        });
        const poller = await createHttpPoller(lro, {
            restoreFrom: options?.resumeFrom,
            intervalInMs: options?.updateIntervalInMs,
            resourceLocationConfig: "location",
        });
        await poller.poll();
        return poller;
    }
    /**
     * Gets the Ddos Protection Status of a Public IP Address
     * @param resourceGroupName The name of the resource group.
     * @param publicIpAddressName The name of the public IP address.
     * @param options The options parameters.
     */
    async beginDdosProtectionStatusAndWait(resourceGroupName, publicIpAddressName, options) {
        const poller = await this.beginDdosProtectionStatus(resourceGroupName, publicIpAddressName, options);
        return poller.pollUntilDone();
    }
    /**
     * Gets information about all public IP addresses on a virtual machine scale set level.
     * @param resourceGroupName The name of the resource group.
     * @param virtualMachineScaleSetName The name of the virtual machine scale set.
     * @param options The options parameters.
     */
    _listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, options) {
        return this.client.sendOperationRequest({ resourceGroupName, virtualMachineScaleSetName, options }, listVirtualMachineScaleSetPublicIPAddressesOperationSpec);
    }
    /**
     * Gets information about all public IP addresses in a virtual machine IP configuration in a virtual
     * machine scale set.
     * @param resourceGroupName The name of the resource group.
     * @param virtualMachineScaleSetName The name of the virtual machine scale set.
     * @param virtualmachineIndex The virtual machine index.
     * @param networkInterfaceName The network interface name.
     * @param ipConfigurationName The IP configuration name.
     * @param options The options parameters.
     */
    _listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            virtualMachineScaleSetName,
            virtualmachineIndex,
            networkInterfaceName,
            ipConfigurationName,
            options,
        }, listVirtualMachineScaleSetVMPublicIPAddressesOperationSpec);
    }
    /**
     * Get the specified public IP address in a virtual machine scale set.
     * @param resourceGroupName The name of the resource group.
     * @param virtualMachineScaleSetName The name of the virtual machine scale set.
     * @param virtualmachineIndex The virtual machine index.
     * @param networkInterfaceName The name of the network interface.
     * @param ipConfigurationName The name of the IP configuration.
     * @param publicIpAddressName The name of the public IP Address.
     * @param options The options parameters.
     */
    getVirtualMachineScaleSetPublicIPAddress(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            virtualMachineScaleSetName,
            virtualmachineIndex,
            networkInterfaceName,
            ipConfigurationName,
            publicIpAddressName,
            options,
        }, getVirtualMachineScaleSetPublicIPAddressOperationSpec);
    }
    /**
     * ListCloudServicePublicIPAddressesNext
     * @param resourceGroupName The name of the resource group.
     * @param cloudServiceName The name of the cloud service.
     * @param nextLink The nextLink from the previous successful call to the
     *                 ListCloudServicePublicIPAddresses method.
     * @param options The options parameters.
     */
    _listCloudServicePublicIPAddressesNext(resourceGroupName, cloudServiceName, nextLink, options) {
        return this.client.sendOperationRequest({ resourceGroupName, cloudServiceName, nextLink, options }, listCloudServicePublicIPAddressesNextOperationSpec);
    }
    /**
     * ListCloudServiceRoleInstancePublicIPAddressesNext
     * @param resourceGroupName The name of the resource group.
     * @param cloudServiceName The name of the cloud service.
     * @param roleInstanceName The name of role instance.
     * @param networkInterfaceName The network interface name.
     * @param ipConfigurationName The IP configuration name.
     * @param nextLink The nextLink from the previous successful call to the
     *                 ListCloudServiceRoleInstancePublicIPAddresses method.
     * @param options The options parameters.
     */
    _listCloudServiceRoleInstancePublicIPAddressesNext(resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, ipConfigurationName, nextLink, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            cloudServiceName,
            roleInstanceName,
            networkInterfaceName,
            ipConfigurationName,
            nextLink,
            options,
        }, listCloudServiceRoleInstancePublicIPAddressesNextOperationSpec);
    }
    /**
     * 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);
    }
    /**
     * 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);
    }
    /**
     * ListVirtualMachineScaleSetPublicIPAddressesNext
     * @param resourceGroupName The name of the resource group.
     * @param virtualMachineScaleSetName The name of the virtual machine scale set.
     * @param nextLink The nextLink from the previous successful call to the
     *                 ListVirtualMachineScaleSetPublicIPAddresses method.
     * @param options The options parameters.
     */
    _listVirtualMachineScaleSetPublicIPAddressesNext(resourceGroupName, virtualMachineScaleSetName, nextLink, options) {
        return this.client.sendOperationRequest({ resourceGroupName, virtualMachineScaleSetName, nextLink, options }, listVirtualMachineScaleSetPublicIPAddressesNextOperationSpec);
    }
    /**
     * ListVirtualMachineScaleSetVMPublicIPAddressesNext
     * @param resourceGroupName The name of the resource group.
     * @param virtualMachineScaleSetName The name of the virtual machine scale set.
     * @param virtualmachineIndex The virtual machine index.
     * @param networkInterfaceName The network interface name.
     * @param ipConfigurationName The IP configuration name.
     * @param nextLink The nextLink from the previous successful call to the
     *                 ListVirtualMachineScaleSetVMPublicIPAddresses method.
     * @param options The options parameters.
     */
    _listVirtualMachineScaleSetVMPublicIPAddressesNext(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, nextLink, options) {
        return this.client.sendOperationRequest({
            resourceGroupName,
            virtualMachineScaleSetName,
            virtualmachineIndex,
            networkInterfaceName,
            ipConfigurationName,
            nextLink,
            options,
        }, listVirtualMachineScaleSetVMPublicIPAddressesNextOperationSpec);
    }
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listCloudServicePublicIPAddressesOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/publicipaddresses",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PublicIPAddressListResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.cloudServiceName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listCloudServiceRoleInstancePublicIPAddressesOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PublicIPAddressListResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.cloudServiceName,
        Parameters.roleInstanceName,
        Parameters.networkInterfaceName,
        Parameters.ipConfigurationName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const getCloudServicePublicIPAddressOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PublicIPAddress,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion, Parameters.expand],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.cloudServiceName,
        Parameters.roleInstanceName,
        Parameters.networkInterfaceName,
        Parameters.ipConfigurationName,
        Parameters.publicIpAddressName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const deleteOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}",
    httpMethod: "DELETE",
    responses: {
        200: {},
        201: {},
        202: {},
        204: {},
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.publicIpAddressName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const getOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PublicIPAddress,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion, Parameters.expand],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.publicIpAddressName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const createOrUpdateOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}",
    httpMethod: "PUT",
    responses: {
        200: {
            bodyMapper: Mappers.PublicIPAddress,
        },
        201: {
            bodyMapper: Mappers.PublicIPAddress,
        },
        202: {
            bodyMapper: Mappers.PublicIPAddress,
        },
        204: {
            bodyMapper: Mappers.PublicIPAddress,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    requestBody: Parameters.parameters10,
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.publicIpAddressName,
    ],
    headerParameters: [Parameters.accept, Parameters.contentType],
    mediaType: "json",
    serializer,
};
const updateTagsOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}",
    httpMethod: "PATCH",
    responses: {
        200: {
            bodyMapper: Mappers.PublicIPAddress,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    requestBody: Parameters.parameters1,
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.publicIpAddressName,
    ],
    headerParameters: [Parameters.accept, Parameters.contentType],
    mediaType: "json",
    serializer,
};
const listAllOperationSpec = {
    path: "/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PublicIPAddressListResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [Parameters.$host, Parameters.subscriptionId],
    headerParameters: [Parameters.accept],
    serializer,
};
const listOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PublicIPAddressListResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const ddosProtectionStatusOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}/ddosProtectionStatus",
    httpMethod: "POST",
    responses: {
        200: {
            bodyMapper: Mappers.PublicIpDdosProtectionStatusResult,
        },
        201: {
            bodyMapper: Mappers.PublicIpDdosProtectionStatusResult,
        },
        202: {
            bodyMapper: Mappers.PublicIpDdosProtectionStatusResult,
        },
        204: {
            bodyMapper: Mappers.PublicIpDdosProtectionStatusResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.publicIpAddressName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listVirtualMachineScaleSetPublicIPAddressesOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PublicIPAddressListResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion1],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.virtualMachineScaleSetName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listVirtualMachineScaleSetVMPublicIPAddressesOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PublicIPAddressListResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.apiVersion1],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.networkInterfaceName,
        Parameters.virtualMachineScaleSetName,
        Parameters.virtualmachineIndex,
        Parameters.ipConfigurationName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const getVirtualMachineScaleSetPublicIPAddressOperationSpec = {
    path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PublicIPAddress,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    queryParameters: [Parameters.expand, Parameters.apiVersion1],
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.networkInterfaceName,
        Parameters.virtualMachineScaleSetName,
        Parameters.virtualmachineIndex,
        Parameters.ipConfigurationName,
        Parameters.publicIpAddressName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listCloudServicePublicIPAddressesNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PublicIPAddressListResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.nextLink,
        Parameters.cloudServiceName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listCloudServiceRoleInstancePublicIPAddressesNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PublicIPAddressListResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.nextLink,
        Parameters.cloudServiceName,
        Parameters.roleInstanceName,
        Parameters.networkInterfaceName,
        Parameters.ipConfigurationName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listAllNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PublicIPAddressListResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.subscriptionId,
        Parameters.nextLink,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PublicIPAddressListResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.nextLink,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listVirtualMachineScaleSetPublicIPAddressesNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PublicIPAddressListResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.nextLink,
        Parameters.virtualMachineScaleSetName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
const listVirtualMachineScaleSetVMPublicIPAddressesNextOperationSpec = {
    path: "{nextLink}",
    httpMethod: "GET",
    responses: {
        200: {
            bodyMapper: Mappers.PublicIPAddressListResult,
        },
        default: {
            bodyMapper: Mappers.CloudError,
        },
    },
    urlParameters: [
        Parameters.$host,
        Parameters.resourceGroupName,
        Parameters.subscriptionId,
        Parameters.nextLink,
        Parameters.networkInterfaceName,
        Parameters.virtualMachineScaleSetName,
        Parameters.virtualmachineIndex,
        Parameters.ipConfigurationName,
    ],
    headerParameters: [Parameters.accept],
    serializer,
};
//# sourceMappingURL=publicIPAddresses.js.map