< Summary

Class:Azure.ResourceManager.Network.PublicIPAddressesRestOperations
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\PublicIPAddressesRestOperations.cs
Covered lines:309
Uncovered lines:292
Coverable lines:601
Total lines:1332
Line coverage:51.4% (309 of 601)
Covered branches:79
Total branches:256
Branch coverage:30.8% (79 of 256)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-88.89%50%
CreateDeleteRequest(...)-100%100%
DeleteAsync()-70%50%
Delete(...)-70%50%
CreateGetRequest(...)-100%100%
GetAsync()-73.33%50%
Get(...)-73.33%50%
CreateCreateOrUpdateRequest(...)-100%100%
CreateOrUpdateAsync()-66.67%50%
CreateOrUpdate(...)-66.67%50%
CreateUpdateTagsRequest(...)-0%100%
UpdateTagsAsync()-0%0%
UpdateTags(...)-0%0%
CreateListAllRequest()-100%100%
ListAllAsync()-81.82%50%
ListAll(...)-81.82%50%
CreateListRequest(...)-100%100%
ListAsync()-76.92%50%
List(...)-76.92%50%
CreateListVirtualMachineScaleSetPublicIPAddressesRequest(...)-100%100%
ListVirtualMachineScaleSetPublicIPAddressesAsync()-73.33%50%
ListVirtualMachineScaleSetPublicIPAddresses(...)-73.33%50%
CreateListVirtualMachineScaleSetVMPublicIPAddressesRequest(...)-100%100%
ListVirtualMachineScaleSetVMPublicIPAddressesAsync()-66.67%50%
ListVirtualMachineScaleSetVMPublicIPAddresses(...)-66.67%50%
CreateGetVirtualMachineScaleSetPublicIPAddressRequest(...)-95.83%50%
GetVirtualMachineScaleSetPublicIPAddressAsync()-65.22%50%
GetVirtualMachineScaleSetPublicIPAddress(...)-65.22%50%
CreateListAllNextPageRequest(...)-0%100%
ListAllNextPageAsync()-0%0%
ListAllNextPage(...)-0%0%
CreateListNextPageRequest(...)-0%100%
ListNextPageAsync()-0%0%
ListNextPage(...)-0%0%
CreateListVirtualMachineScaleSetPublicIPAddressesNextPageRequest(...)-0%100%
ListVirtualMachineScaleSetPublicIPAddressesNextPageAsync()-0%0%
ListVirtualMachineScaleSetPublicIPAddressesNextPage(...)-0%0%
CreateListVirtualMachineScaleSetVMPublicIPAddressesNextPageRequest(...)-0%100%
ListVirtualMachineScaleSetVMPublicIPAddressesNextPageAsync()-0%0%
ListVirtualMachineScaleSetVMPublicIPAddressesNextPage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\PublicIPAddressesRestOperations.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9using System.Text.Json;
 10using System.Threading;
 11using System.Threading.Tasks;
 12using Azure;
 13using Azure.Core;
 14using Azure.Core.Pipeline;
 15using Azure.ResourceManager.Network.Models;
 16
 17namespace Azure.ResourceManager.Network
 18{
 19    internal partial class PublicIPAddressesRestOperations
 20    {
 21        private string subscriptionId;
 22        private Uri endpoint;
 23        private ClientDiagnostics _clientDiagnostics;
 24        private HttpPipeline _pipeline;
 25
 26        /// <summary> Initializes a new instance of PublicIPAddressesRestOperations. </summary>
 27        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
 28        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
 29        /// <param name="subscriptionId"> The subscription credentials which uniquely identify the Microsoft Azure subsc
 30        /// <param name="endpoint"> server parameter. </param>
 31        /// <exception cref="ArgumentNullException"> This occurs when one of the required arguments is null. </exception
 22032        public PublicIPAddressesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscr
 33        {
 22034            if (subscriptionId == null)
 35            {
 036                throw new ArgumentNullException(nameof(subscriptionId));
 37            }
 22038            endpoint ??= new Uri("https://management.azure.com");
 39
 22040            this.subscriptionId = subscriptionId;
 22041            this.endpoint = endpoint;
 22042            _clientDiagnostics = clientDiagnostics;
 22043            _pipeline = pipeline;
 22044        }
 45
 46        internal HttpMessage CreateDeleteRequest(string resourceGroupName, string publicIpAddressName)
 47        {
 8848            var message = _pipeline.CreateMessage();
 8849            var request = message.Request;
 8850            request.Method = RequestMethod.Delete;
 8851            var uri = new RawRequestUriBuilder();
 8852            uri.Reset(endpoint);
 8853            uri.AppendPath("/subscriptions/", false);
 8854            uri.AppendPath(subscriptionId, true);
 8855            uri.AppendPath("/resourceGroups/", false);
 8856            uri.AppendPath(resourceGroupName, true);
 8857            uri.AppendPath("/providers/Microsoft.Network/publicIPAddresses/", false);
 8858            uri.AppendPath(publicIpAddressName, true);
 8859            uri.AppendQuery("api-version", "2020-04-01", true);
 8860            request.Uri = uri;
 8861            return message;
 62        }
 63
 64        /// <summary> Deletes the specified public IP address. </summary>
 65        /// <param name="resourceGroupName"> The name of the resource group. </param>
 66        /// <param name="publicIpAddressName"> The name of the subnet. </param>
 67        /// <param name="cancellationToken"> The cancellation token to use. </param>
 68        public async Task<Response> DeleteAsync(string resourceGroupName, string publicIpAddressName, CancellationToken 
 69        {
 2270            if (resourceGroupName == null)
 71            {
 072                throw new ArgumentNullException(nameof(resourceGroupName));
 73            }
 2274            if (publicIpAddressName == null)
 75            {
 076                throw new ArgumentNullException(nameof(publicIpAddressName));
 77            }
 78
 2279            using var message = CreateDeleteRequest(resourceGroupName, publicIpAddressName);
 2280            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 2281            switch (message.Response.Status)
 82            {
 83                case 200:
 84                case 202:
 85                case 204:
 2286                    return message.Response;
 87                default:
 088                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 89            }
 2290        }
 91
 92        /// <summary> Deletes the specified public IP address. </summary>
 93        /// <param name="resourceGroupName"> The name of the resource group. </param>
 94        /// <param name="publicIpAddressName"> The name of the subnet. </param>
 95        /// <param name="cancellationToken"> The cancellation token to use. </param>
 96        public Response Delete(string resourceGroupName, string publicIpAddressName, CancellationToken cancellationToken
 97        {
 2298            if (resourceGroupName == null)
 99            {
 0100                throw new ArgumentNullException(nameof(resourceGroupName));
 101            }
 22102            if (publicIpAddressName == null)
 103            {
 0104                throw new ArgumentNullException(nameof(publicIpAddressName));
 105            }
 106
 22107            using var message = CreateDeleteRequest(resourceGroupName, publicIpAddressName);
 22108            _pipeline.Send(message, cancellationToken);
 22109            switch (message.Response.Status)
 110            {
 111                case 200:
 112                case 202:
 113                case 204:
 22114                    return message.Response;
 115                default:
 0116                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 117            }
 22118        }
 119
 120        internal HttpMessage CreateGetRequest(string resourceGroupName, string publicIpAddressName, string expand)
 121        {
 64122            var message = _pipeline.CreateMessage();
 64123            var request = message.Request;
 64124            request.Method = RequestMethod.Get;
 64125            var uri = new RawRequestUriBuilder();
 64126            uri.Reset(endpoint);
 64127            uri.AppendPath("/subscriptions/", false);
 64128            uri.AppendPath(subscriptionId, true);
 64129            uri.AppendPath("/resourceGroups/", false);
 64130            uri.AppendPath(resourceGroupName, true);
 64131            uri.AppendPath("/providers/Microsoft.Network/publicIPAddresses/", false);
 64132            uri.AppendPath(publicIpAddressName, true);
 64133            uri.AppendQuery("api-version", "2020-04-01", true);
 64134            if (expand != null)
 135            {
 4136                uri.AppendQuery("$expand", expand, true);
 137            }
 64138            request.Uri = uri;
 64139            return message;
 140        }
 141
 142        /// <summary> Gets the specified public IP address in a specified resource group. </summary>
 143        /// <param name="resourceGroupName"> The name of the resource group. </param>
 144        /// <param name="publicIpAddressName"> The name of the subnet. </param>
 145        /// <param name="expand"> Expands referenced resources. </param>
 146        /// <param name="cancellationToken"> The cancellation token to use. </param>
 147        public async Task<Response<PublicIPAddress>> GetAsync(string resourceGroupName, string publicIpAddressName, stri
 148        {
 32149            if (resourceGroupName == null)
 150            {
 0151                throw new ArgumentNullException(nameof(resourceGroupName));
 152            }
 32153            if (publicIpAddressName == null)
 154            {
 0155                throw new ArgumentNullException(nameof(publicIpAddressName));
 156            }
 157
 32158            using var message = CreateGetRequest(resourceGroupName, publicIpAddressName, expand);
 32159            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 32160            switch (message.Response.Status)
 161            {
 162                case 200:
 163                    {
 32164                        PublicIPAddress value = default;
 32165                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 32166                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 167                        {
 0168                            value = null;
 169                        }
 170                        else
 171                        {
 32172                            value = PublicIPAddress.DeserializePublicIPAddress(document.RootElement);
 173                        }
 32174                        return Response.FromValue(value, message.Response);
 175                    }
 176                default:
 0177                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 178            }
 32179        }
 180
 181        /// <summary> Gets the specified public IP address in a specified resource group. </summary>
 182        /// <param name="resourceGroupName"> The name of the resource group. </param>
 183        /// <param name="publicIpAddressName"> The name of the subnet. </param>
 184        /// <param name="expand"> Expands referenced resources. </param>
 185        /// <param name="cancellationToken"> The cancellation token to use. </param>
 186        public Response<PublicIPAddress> Get(string resourceGroupName, string publicIpAddressName, string expand = null,
 187        {
 32188            if (resourceGroupName == null)
 189            {
 0190                throw new ArgumentNullException(nameof(resourceGroupName));
 191            }
 32192            if (publicIpAddressName == null)
 193            {
 0194                throw new ArgumentNullException(nameof(publicIpAddressName));
 195            }
 196
 32197            using var message = CreateGetRequest(resourceGroupName, publicIpAddressName, expand);
 32198            _pipeline.Send(message, cancellationToken);
 32199            switch (message.Response.Status)
 200            {
 201                case 200:
 202                    {
 32203                        PublicIPAddress value = default;
 32204                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 32205                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 206                        {
 0207                            value = null;
 208                        }
 209                        else
 210                        {
 32211                            value = PublicIPAddress.DeserializePublicIPAddress(document.RootElement);
 212                        }
 32213                        return Response.FromValue(value, message.Response);
 214                    }
 215                default:
 0216                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 217            }
 32218        }
 219
 220        internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string publicIpAddressName, PublicIPA
 221        {
 120222            var message = _pipeline.CreateMessage();
 120223            var request = message.Request;
 120224            request.Method = RequestMethod.Put;
 120225            var uri = new RawRequestUriBuilder();
 120226            uri.Reset(endpoint);
 120227            uri.AppendPath("/subscriptions/", false);
 120228            uri.AppendPath(subscriptionId, true);
 120229            uri.AppendPath("/resourceGroups/", false);
 120230            uri.AppendPath(resourceGroupName, true);
 120231            uri.AppendPath("/providers/Microsoft.Network/publicIPAddresses/", false);
 120232            uri.AppendPath(publicIpAddressName, true);
 120233            uri.AppendQuery("api-version", "2020-04-01", true);
 120234            request.Uri = uri;
 120235            request.Headers.Add("Content-Type", "application/json");
 120236            var content = new Utf8JsonRequestContent();
 120237            content.JsonWriter.WriteObjectValue(parameters);
 120238            request.Content = content;
 120239            return message;
 240        }
 241
 242        /// <summary> Creates or updates a static or dynamic public IP address. </summary>
 243        /// <param name="resourceGroupName"> The name of the resource group. </param>
 244        /// <param name="publicIpAddressName"> The name of the public IP address. </param>
 245        /// <param name="parameters"> Parameters supplied to the create or update public IP address operation. </param>
 246        /// <param name="cancellationToken"> The cancellation token to use. </param>
 247        public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string publicIpAddressName, PublicIPAd
 248        {
 30249            if (resourceGroupName == null)
 250            {
 0251                throw new ArgumentNullException(nameof(resourceGroupName));
 252            }
 30253            if (publicIpAddressName == null)
 254            {
 0255                throw new ArgumentNullException(nameof(publicIpAddressName));
 256            }
 30257            if (parameters == null)
 258            {
 0259                throw new ArgumentNullException(nameof(parameters));
 260            }
 261
 30262            using var message = CreateCreateOrUpdateRequest(resourceGroupName, publicIpAddressName, parameters);
 30263            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 30264            switch (message.Response.Status)
 265            {
 266                case 200:
 267                case 201:
 30268                    return message.Response;
 269                default:
 0270                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 271            }
 30272        }
 273
 274        /// <summary> Creates or updates a static or dynamic public IP address. </summary>
 275        /// <param name="resourceGroupName"> The name of the resource group. </param>
 276        /// <param name="publicIpAddressName"> The name of the public IP address. </param>
 277        /// <param name="parameters"> Parameters supplied to the create or update public IP address operation. </param>
 278        /// <param name="cancellationToken"> The cancellation token to use. </param>
 279        public Response CreateOrUpdate(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters,
 280        {
 30281            if (resourceGroupName == null)
 282            {
 0283                throw new ArgumentNullException(nameof(resourceGroupName));
 284            }
 30285            if (publicIpAddressName == null)
 286            {
 0287                throw new ArgumentNullException(nameof(publicIpAddressName));
 288            }
 30289            if (parameters == null)
 290            {
 0291                throw new ArgumentNullException(nameof(parameters));
 292            }
 293
 30294            using var message = CreateCreateOrUpdateRequest(resourceGroupName, publicIpAddressName, parameters);
 30295            _pipeline.Send(message, cancellationToken);
 30296            switch (message.Response.Status)
 297            {
 298                case 200:
 299                case 201:
 30300                    return message.Response;
 301                default:
 0302                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 303            }
 30304        }
 305
 306        internal HttpMessage CreateUpdateTagsRequest(string resourceGroupName, string publicIpAddressName, TagsObject pa
 307        {
 0308            var message = _pipeline.CreateMessage();
 0309            var request = message.Request;
 0310            request.Method = RequestMethod.Patch;
 0311            var uri = new RawRequestUriBuilder();
 0312            uri.Reset(endpoint);
 0313            uri.AppendPath("/subscriptions/", false);
 0314            uri.AppendPath(subscriptionId, true);
 0315            uri.AppendPath("/resourceGroups/", false);
 0316            uri.AppendPath(resourceGroupName, true);
 0317            uri.AppendPath("/providers/Microsoft.Network/publicIPAddresses/", false);
 0318            uri.AppendPath(publicIpAddressName, true);
 0319            uri.AppendQuery("api-version", "2020-04-01", true);
 0320            request.Uri = uri;
 0321            request.Headers.Add("Content-Type", "application/json");
 0322            var content = new Utf8JsonRequestContent();
 0323            content.JsonWriter.WriteObjectValue(parameters);
 0324            request.Content = content;
 0325            return message;
 326        }
 327
 328        /// <summary> Updates public IP address tags. </summary>
 329        /// <param name="resourceGroupName"> The name of the resource group. </param>
 330        /// <param name="publicIpAddressName"> The name of the public IP address. </param>
 331        /// <param name="parameters"> Parameters supplied to update public IP address tags. </param>
 332        /// <param name="cancellationToken"> The cancellation token to use. </param>
 333        public async Task<Response<PublicIPAddress>> UpdateTagsAsync(string resourceGroupName, string publicIpAddressNam
 334        {
 0335            if (resourceGroupName == null)
 336            {
 0337                throw new ArgumentNullException(nameof(resourceGroupName));
 338            }
 0339            if (publicIpAddressName == null)
 340            {
 0341                throw new ArgumentNullException(nameof(publicIpAddressName));
 342            }
 0343            if (parameters == null)
 344            {
 0345                throw new ArgumentNullException(nameof(parameters));
 346            }
 347
 0348            using var message = CreateUpdateTagsRequest(resourceGroupName, publicIpAddressName, parameters);
 0349            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0350            switch (message.Response.Status)
 351            {
 352                case 200:
 353                    {
 0354                        PublicIPAddress value = default;
 0355                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0356                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 357                        {
 0358                            value = null;
 359                        }
 360                        else
 361                        {
 0362                            value = PublicIPAddress.DeserializePublicIPAddress(document.RootElement);
 363                        }
 0364                        return Response.FromValue(value, message.Response);
 365                    }
 366                default:
 0367                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 368            }
 0369        }
 370
 371        /// <summary> Updates public IP address tags. </summary>
 372        /// <param name="resourceGroupName"> The name of the resource group. </param>
 373        /// <param name="publicIpAddressName"> The name of the public IP address. </param>
 374        /// <param name="parameters"> Parameters supplied to update public IP address tags. </param>
 375        /// <param name="cancellationToken"> The cancellation token to use. </param>
 376        public Response<PublicIPAddress> UpdateTags(string resourceGroupName, string publicIpAddressName, TagsObject par
 377        {
 0378            if (resourceGroupName == null)
 379            {
 0380                throw new ArgumentNullException(nameof(resourceGroupName));
 381            }
 0382            if (publicIpAddressName == null)
 383            {
 0384                throw new ArgumentNullException(nameof(publicIpAddressName));
 385            }
 0386            if (parameters == null)
 387            {
 0388                throw new ArgumentNullException(nameof(parameters));
 389            }
 390
 0391            using var message = CreateUpdateTagsRequest(resourceGroupName, publicIpAddressName, parameters);
 0392            _pipeline.Send(message, cancellationToken);
 0393            switch (message.Response.Status)
 394            {
 395                case 200:
 396                    {
 0397                        PublicIPAddress value = default;
 0398                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0399                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 400                        {
 0401                            value = null;
 402                        }
 403                        else
 404                        {
 0405                            value = PublicIPAddress.DeserializePublicIPAddress(document.RootElement);
 406                        }
 0407                        return Response.FromValue(value, message.Response);
 408                    }
 409                default:
 0410                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 411            }
 0412        }
 413
 414        internal HttpMessage CreateListAllRequest()
 415        {
 12416            var message = _pipeline.CreateMessage();
 12417            var request = message.Request;
 12418            request.Method = RequestMethod.Get;
 12419            var uri = new RawRequestUriBuilder();
 12420            uri.Reset(endpoint);
 12421            uri.AppendPath("/subscriptions/", false);
 12422            uri.AppendPath(subscriptionId, true);
 12423            uri.AppendPath("/providers/Microsoft.Network/publicIPAddresses", false);
 12424            uri.AppendQuery("api-version", "2020-04-01", true);
 12425            request.Uri = uri;
 12426            return message;
 427        }
 428
 429        /// <summary> Gets all the public IP addresses in a subscription. </summary>
 430        /// <param name="cancellationToken"> The cancellation token to use. </param>
 431        public async Task<Response<PublicIPAddressListResult>> ListAllAsync(CancellationToken cancellationToken = defaul
 432        {
 6433            using var message = CreateListAllRequest();
 6434            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 6435            switch (message.Response.Status)
 436            {
 437                case 200:
 438                    {
 6439                        PublicIPAddressListResult value = default;
 6440                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 6441                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 442                        {
 0443                            value = null;
 444                        }
 445                        else
 446                        {
 6447                            value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement)
 448                        }
 6449                        return Response.FromValue(value, message.Response);
 450                    }
 451                default:
 0452                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 453            }
 6454        }
 455
 456        /// <summary> Gets all the public IP addresses in a subscription. </summary>
 457        /// <param name="cancellationToken"> The cancellation token to use. </param>
 458        public Response<PublicIPAddressListResult> ListAll(CancellationToken cancellationToken = default)
 459        {
 6460            using var message = CreateListAllRequest();
 6461            _pipeline.Send(message, cancellationToken);
 6462            switch (message.Response.Status)
 463            {
 464                case 200:
 465                    {
 6466                        PublicIPAddressListResult value = default;
 6467                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 6468                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 469                        {
 0470                            value = null;
 471                        }
 472                        else
 473                        {
 6474                            value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement)
 475                        }
 6476                        return Response.FromValue(value, message.Response);
 477                    }
 478                default:
 0479                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 480            }
 6481        }
 482
 483        internal HttpMessage CreateListRequest(string resourceGroupName)
 484        {
 24485            var message = _pipeline.CreateMessage();
 24486            var request = message.Request;
 24487            request.Method = RequestMethod.Get;
 24488            var uri = new RawRequestUriBuilder();
 24489            uri.Reset(endpoint);
 24490            uri.AppendPath("/subscriptions/", false);
 24491            uri.AppendPath(subscriptionId, true);
 24492            uri.AppendPath("/resourceGroups/", false);
 24493            uri.AppendPath(resourceGroupName, true);
 24494            uri.AppendPath("/providers/Microsoft.Network/publicIPAddresses", false);
 24495            uri.AppendQuery("api-version", "2020-04-01", true);
 24496            request.Uri = uri;
 24497            return message;
 498        }
 499
 500        /// <summary> Gets all public IP addresses in a resource group. </summary>
 501        /// <param name="resourceGroupName"> The name of the resource group. </param>
 502        /// <param name="cancellationToken"> The cancellation token to use. </param>
 503        public async Task<Response<PublicIPAddressListResult>> ListAsync(string resourceGroupName, CancellationToken can
 504        {
 12505            if (resourceGroupName == null)
 506            {
 0507                throw new ArgumentNullException(nameof(resourceGroupName));
 508            }
 509
 12510            using var message = CreateListRequest(resourceGroupName);
 12511            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 12512            switch (message.Response.Status)
 513            {
 514                case 200:
 515                    {
 12516                        PublicIPAddressListResult value = default;
 12517                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 12518                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 519                        {
 0520                            value = null;
 521                        }
 522                        else
 523                        {
 12524                            value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement)
 525                        }
 12526                        return Response.FromValue(value, message.Response);
 527                    }
 528                default:
 0529                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 530            }
 12531        }
 532
 533        /// <summary> Gets all public IP addresses in a resource group. </summary>
 534        /// <param name="resourceGroupName"> The name of the resource group. </param>
 535        /// <param name="cancellationToken"> The cancellation token to use. </param>
 536        public Response<PublicIPAddressListResult> List(string resourceGroupName, CancellationToken cancellationToken = 
 537        {
 12538            if (resourceGroupName == null)
 539            {
 0540                throw new ArgumentNullException(nameof(resourceGroupName));
 541            }
 542
 12543            using var message = CreateListRequest(resourceGroupName);
 12544            _pipeline.Send(message, cancellationToken);
 12545            switch (message.Response.Status)
 546            {
 547                case 200:
 548                    {
 12549                        PublicIPAddressListResult value = default;
 12550                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 12551                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 552                        {
 0553                            value = null;
 554                        }
 555                        else
 556                        {
 12557                            value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement)
 558                        }
 12559                        return Response.FromValue(value, message.Response);
 560                    }
 561                default:
 0562                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 563            }
 12564        }
 565
 566        internal HttpMessage CreateListVirtualMachineScaleSetPublicIPAddressesRequest(string resourceGroupName, string v
 567        {
 8568            var message = _pipeline.CreateMessage();
 8569            var request = message.Request;
 8570            request.Method = RequestMethod.Get;
 8571            var uri = new RawRequestUriBuilder();
 8572            uri.Reset(endpoint);
 8573            uri.AppendPath("/subscriptions/", false);
 8574            uri.AppendPath(subscriptionId, true);
 8575            uri.AppendPath("/resourceGroups/", false);
 8576            uri.AppendPath(resourceGroupName, true);
 8577            uri.AppendPath("/providers/Microsoft.Compute/virtualMachineScaleSets/", false);
 8578            uri.AppendPath(virtualMachineScaleSetName, true);
 8579            uri.AppendPath("/publicipaddresses", false);
 8580            uri.AppendQuery("api-version", "2018-10-01", true);
 8581            request.Uri = uri;
 8582            return message;
 583        }
 584
 585        /// <summary> Gets information about all public IP addresses on a virtual machine scale set level. </summary>
 586        /// <param name="resourceGroupName"> The name of the resource group. </param>
 587        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 588        /// <param name="cancellationToken"> The cancellation token to use. </param>
 589        public async Task<Response<PublicIPAddressListResult>> ListVirtualMachineScaleSetPublicIPAddressesAsync(string r
 590        {
 4591            if (resourceGroupName == null)
 592            {
 0593                throw new ArgumentNullException(nameof(resourceGroupName));
 594            }
 4595            if (virtualMachineScaleSetName == null)
 596            {
 0597                throw new ArgumentNullException(nameof(virtualMachineScaleSetName));
 598            }
 599
 4600            using var message = CreateListVirtualMachineScaleSetPublicIPAddressesRequest(resourceGroupName, virtualMachi
 4601            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 4602            switch (message.Response.Status)
 603            {
 604                case 200:
 605                    {
 4606                        PublicIPAddressListResult value = default;
 4607                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 4608                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 609                        {
 0610                            value = null;
 611                        }
 612                        else
 613                        {
 4614                            value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement)
 615                        }
 4616                        return Response.FromValue(value, message.Response);
 617                    }
 618                default:
 0619                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 620            }
 4621        }
 622
 623        /// <summary> Gets information about all public IP addresses on a virtual machine scale set level. </summary>
 624        /// <param name="resourceGroupName"> The name of the resource group. </param>
 625        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 626        /// <param name="cancellationToken"> The cancellation token to use. </param>
 627        public Response<PublicIPAddressListResult> ListVirtualMachineScaleSetPublicIPAddresses(string resourceGroupName,
 628        {
 4629            if (resourceGroupName == null)
 630            {
 0631                throw new ArgumentNullException(nameof(resourceGroupName));
 632            }
 4633            if (virtualMachineScaleSetName == null)
 634            {
 0635                throw new ArgumentNullException(nameof(virtualMachineScaleSetName));
 636            }
 637
 4638            using var message = CreateListVirtualMachineScaleSetPublicIPAddressesRequest(resourceGroupName, virtualMachi
 4639            _pipeline.Send(message, cancellationToken);
 4640            switch (message.Response.Status)
 641            {
 642                case 200:
 643                    {
 4644                        PublicIPAddressListResult value = default;
 4645                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 4646                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 647                        {
 0648                            value = null;
 649                        }
 650                        else
 651                        {
 4652                            value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement)
 653                        }
 4654                        return Response.FromValue(value, message.Response);
 655                    }
 656                default:
 0657                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 658            }
 4659        }
 660
 661        internal HttpMessage CreateListVirtualMachineScaleSetVMPublicIPAddressesRequest(string resourceGroupName, string
 662        {
 4663            var message = _pipeline.CreateMessage();
 4664            var request = message.Request;
 4665            request.Method = RequestMethod.Get;
 4666            var uri = new RawRequestUriBuilder();
 4667            uri.Reset(endpoint);
 4668            uri.AppendPath("/subscriptions/", false);
 4669            uri.AppendPath(subscriptionId, true);
 4670            uri.AppendPath("/resourceGroups/", false);
 4671            uri.AppendPath(resourceGroupName, true);
 4672            uri.AppendPath("/providers/Microsoft.Compute/virtualMachineScaleSets/", false);
 4673            uri.AppendPath(virtualMachineScaleSetName, true);
 4674            uri.AppendPath("/virtualMachines/", false);
 4675            uri.AppendPath(virtualmachineIndex, true);
 4676            uri.AppendPath("/networkInterfaces/", false);
 4677            uri.AppendPath(networkInterfaceName, true);
 4678            uri.AppendPath("/ipconfigurations/", false);
 4679            uri.AppendPath(ipConfigurationName, true);
 4680            uri.AppendPath("/publicipaddresses", false);
 4681            uri.AppendQuery("api-version", "2018-10-01", true);
 4682            request.Uri = uri;
 4683            return message;
 684        }
 685
 686        /// <summary> Gets information about all public IP addresses in a virtual machine IP configuration in a virtual 
 687        /// <param name="resourceGroupName"> The name of the resource group. </param>
 688        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 689        /// <param name="virtualmachineIndex"> The virtual machine index. </param>
 690        /// <param name="networkInterfaceName"> The network interface name. </param>
 691        /// <param name="ipConfigurationName"> The IP configuration name. </param>
 692        /// <param name="cancellationToken"> The cancellation token to use. </param>
 693        public async Task<Response<PublicIPAddressListResult>> ListVirtualMachineScaleSetVMPublicIPAddressesAsync(string
 694        {
 2695            if (resourceGroupName == null)
 696            {
 0697                throw new ArgumentNullException(nameof(resourceGroupName));
 698            }
 2699            if (virtualMachineScaleSetName == null)
 700            {
 0701                throw new ArgumentNullException(nameof(virtualMachineScaleSetName));
 702            }
 2703            if (virtualmachineIndex == null)
 704            {
 0705                throw new ArgumentNullException(nameof(virtualmachineIndex));
 706            }
 2707            if (networkInterfaceName == null)
 708            {
 0709                throw new ArgumentNullException(nameof(networkInterfaceName));
 710            }
 2711            if (ipConfigurationName == null)
 712            {
 0713                throw new ArgumentNullException(nameof(ipConfigurationName));
 714            }
 715
 2716            using var message = CreateListVirtualMachineScaleSetVMPublicIPAddressesRequest(resourceGroupName, virtualMac
 2717            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 2718            switch (message.Response.Status)
 719            {
 720                case 200:
 721                    {
 2722                        PublicIPAddressListResult value = default;
 2723                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 2724                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 725                        {
 0726                            value = null;
 727                        }
 728                        else
 729                        {
 2730                            value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement)
 731                        }
 2732                        return Response.FromValue(value, message.Response);
 733                    }
 734                default:
 0735                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 736            }
 2737        }
 738
 739        /// <summary> Gets information about all public IP addresses in a virtual machine IP configuration in a virtual 
 740        /// <param name="resourceGroupName"> The name of the resource group. </param>
 741        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 742        /// <param name="virtualmachineIndex"> The virtual machine index. </param>
 743        /// <param name="networkInterfaceName"> The network interface name. </param>
 744        /// <param name="ipConfigurationName"> The IP configuration name. </param>
 745        /// <param name="cancellationToken"> The cancellation token to use. </param>
 746        public Response<PublicIPAddressListResult> ListVirtualMachineScaleSetVMPublicIPAddresses(string resourceGroupNam
 747        {
 2748            if (resourceGroupName == null)
 749            {
 0750                throw new ArgumentNullException(nameof(resourceGroupName));
 751            }
 2752            if (virtualMachineScaleSetName == null)
 753            {
 0754                throw new ArgumentNullException(nameof(virtualMachineScaleSetName));
 755            }
 2756            if (virtualmachineIndex == null)
 757            {
 0758                throw new ArgumentNullException(nameof(virtualmachineIndex));
 759            }
 2760            if (networkInterfaceName == null)
 761            {
 0762                throw new ArgumentNullException(nameof(networkInterfaceName));
 763            }
 2764            if (ipConfigurationName == null)
 765            {
 0766                throw new ArgumentNullException(nameof(ipConfigurationName));
 767            }
 768
 2769            using var message = CreateListVirtualMachineScaleSetVMPublicIPAddressesRequest(resourceGroupName, virtualMac
 2770            _pipeline.Send(message, cancellationToken);
 2771            switch (message.Response.Status)
 772            {
 773                case 200:
 774                    {
 2775                        PublicIPAddressListResult value = default;
 2776                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 2777                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 778                        {
 0779                            value = null;
 780                        }
 781                        else
 782                        {
 2783                            value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement)
 784                        }
 2785                        return Response.FromValue(value, message.Response);
 786                    }
 787                default:
 0788                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 789            }
 2790        }
 791
 792        internal HttpMessage CreateGetVirtualMachineScaleSetPublicIPAddressRequest(string resourceGroupName, string virt
 793        {
 4794            var message = _pipeline.CreateMessage();
 4795            var request = message.Request;
 4796            request.Method = RequestMethod.Get;
 4797            var uri = new RawRequestUriBuilder();
 4798            uri.Reset(endpoint);
 4799            uri.AppendPath("/subscriptions/", false);
 4800            uri.AppendPath(subscriptionId, true);
 4801            uri.AppendPath("/resourceGroups/", false);
 4802            uri.AppendPath(resourceGroupName, true);
 4803            uri.AppendPath("/providers/Microsoft.Compute/virtualMachineScaleSets/", false);
 4804            uri.AppendPath(virtualMachineScaleSetName, true);
 4805            uri.AppendPath("/virtualMachines/", false);
 4806            uri.AppendPath(virtualmachineIndex, true);
 4807            uri.AppendPath("/networkInterfaces/", false);
 4808            uri.AppendPath(networkInterfaceName, true);
 4809            uri.AppendPath("/ipconfigurations/", false);
 4810            uri.AppendPath(ipConfigurationName, true);
 4811            uri.AppendPath("/publicipaddresses/", false);
 4812            uri.AppendPath(publicIpAddressName, true);
 4813            uri.AppendQuery("api-version", "2018-10-01", true);
 4814            if (expand != null)
 815            {
 0816                uri.AppendQuery("$expand", expand, true);
 817            }
 4818            request.Uri = uri;
 4819            return message;
 820        }
 821
 822        /// <summary> Get the specified public IP address in a virtual machine scale set. </summary>
 823        /// <param name="resourceGroupName"> The name of the resource group. </param>
 824        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 825        /// <param name="virtualmachineIndex"> The virtual machine index. </param>
 826        /// <param name="networkInterfaceName"> The name of the network interface. </param>
 827        /// <param name="ipConfigurationName"> The name of the IP configuration. </param>
 828        /// <param name="publicIpAddressName"> The name of the public IP Address. </param>
 829        /// <param name="expand"> Expands referenced resources. </param>
 830        /// <param name="cancellationToken"> The cancellation token to use. </param>
 831        public async Task<Response<PublicIPAddress>> GetVirtualMachineScaleSetPublicIPAddressAsync(string resourceGroupN
 832        {
 2833            if (resourceGroupName == null)
 834            {
 0835                throw new ArgumentNullException(nameof(resourceGroupName));
 836            }
 2837            if (virtualMachineScaleSetName == null)
 838            {
 0839                throw new ArgumentNullException(nameof(virtualMachineScaleSetName));
 840            }
 2841            if (virtualmachineIndex == null)
 842            {
 0843                throw new ArgumentNullException(nameof(virtualmachineIndex));
 844            }
 2845            if (networkInterfaceName == null)
 846            {
 0847                throw new ArgumentNullException(nameof(networkInterfaceName));
 848            }
 2849            if (ipConfigurationName == null)
 850            {
 0851                throw new ArgumentNullException(nameof(ipConfigurationName));
 852            }
 2853            if (publicIpAddressName == null)
 854            {
 0855                throw new ArgumentNullException(nameof(publicIpAddressName));
 856            }
 857
 2858            using var message = CreateGetVirtualMachineScaleSetPublicIPAddressRequest(resourceGroupName, virtualMachineS
 2859            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 2860            switch (message.Response.Status)
 861            {
 862                case 200:
 863                    {
 2864                        PublicIPAddress value = default;
 2865                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 2866                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 867                        {
 0868                            value = null;
 869                        }
 870                        else
 871                        {
 2872                            value = PublicIPAddress.DeserializePublicIPAddress(document.RootElement);
 873                        }
 2874                        return Response.FromValue(value, message.Response);
 875                    }
 876                default:
 0877                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 878            }
 2879        }
 880
 881        /// <summary> Get the specified public IP address in a virtual machine scale set. </summary>
 882        /// <param name="resourceGroupName"> The name of the resource group. </param>
 883        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 884        /// <param name="virtualmachineIndex"> The virtual machine index. </param>
 885        /// <param name="networkInterfaceName"> The name of the network interface. </param>
 886        /// <param name="ipConfigurationName"> The name of the IP configuration. </param>
 887        /// <param name="publicIpAddressName"> The name of the public IP Address. </param>
 888        /// <param name="expand"> Expands referenced resources. </param>
 889        /// <param name="cancellationToken"> The cancellation token to use. </param>
 890        public Response<PublicIPAddress> GetVirtualMachineScaleSetPublicIPAddress(string resourceGroupName, string virtu
 891        {
 2892            if (resourceGroupName == null)
 893            {
 0894                throw new ArgumentNullException(nameof(resourceGroupName));
 895            }
 2896            if (virtualMachineScaleSetName == null)
 897            {
 0898                throw new ArgumentNullException(nameof(virtualMachineScaleSetName));
 899            }
 2900            if (virtualmachineIndex == null)
 901            {
 0902                throw new ArgumentNullException(nameof(virtualmachineIndex));
 903            }
 2904            if (networkInterfaceName == null)
 905            {
 0906                throw new ArgumentNullException(nameof(networkInterfaceName));
 907            }
 2908            if (ipConfigurationName == null)
 909            {
 0910                throw new ArgumentNullException(nameof(ipConfigurationName));
 911            }
 2912            if (publicIpAddressName == null)
 913            {
 0914                throw new ArgumentNullException(nameof(publicIpAddressName));
 915            }
 916
 2917            using var message = CreateGetVirtualMachineScaleSetPublicIPAddressRequest(resourceGroupName, virtualMachineS
 2918            _pipeline.Send(message, cancellationToken);
 2919            switch (message.Response.Status)
 920            {
 921                case 200:
 922                    {
 2923                        PublicIPAddress value = default;
 2924                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 2925                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 926                        {
 0927                            value = null;
 928                        }
 929                        else
 930                        {
 2931                            value = PublicIPAddress.DeserializePublicIPAddress(document.RootElement);
 932                        }
 2933                        return Response.FromValue(value, message.Response);
 934                    }
 935                default:
 0936                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 937            }
 2938        }
 939
 940        internal HttpMessage CreateListAllNextPageRequest(string nextLink)
 941        {
 0942            var message = _pipeline.CreateMessage();
 0943            var request = message.Request;
 0944            request.Method = RequestMethod.Get;
 0945            var uri = new RawRequestUriBuilder();
 0946            uri.Reset(endpoint);
 0947            uri.AppendRawNextLink(nextLink, false);
 0948            request.Uri = uri;
 0949            return message;
 950        }
 951
 952        /// <summary> Gets all the public IP addresses in a subscription. </summary>
 953        /// <param name="nextLink"> The URL to the next page of results. </param>
 954        /// <param name="cancellationToken"> The cancellation token to use. </param>
 955        public async Task<Response<PublicIPAddressListResult>> ListAllNextPageAsync(string nextLink, CancellationToken c
 956        {
 0957            if (nextLink == null)
 958            {
 0959                throw new ArgumentNullException(nameof(nextLink));
 960            }
 961
 0962            using var message = CreateListAllNextPageRequest(nextLink);
 0963            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0964            switch (message.Response.Status)
 965            {
 966                case 200:
 967                    {
 0968                        PublicIPAddressListResult value = default;
 0969                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0970                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 971                        {
 0972                            value = null;
 973                        }
 974                        else
 975                        {
 0976                            value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement)
 977                        }
 0978                        return Response.FromValue(value, message.Response);
 979                    }
 980                default:
 0981                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 982            }
 0983        }
 984
 985        /// <summary> Gets all the public IP addresses in a subscription. </summary>
 986        /// <param name="nextLink"> The URL to the next page of results. </param>
 987        /// <param name="cancellationToken"> The cancellation token to use. </param>
 988        public Response<PublicIPAddressListResult> ListAllNextPage(string nextLink, CancellationToken cancellationToken 
 989        {
 0990            if (nextLink == null)
 991            {
 0992                throw new ArgumentNullException(nameof(nextLink));
 993            }
 994
 0995            using var message = CreateListAllNextPageRequest(nextLink);
 0996            _pipeline.Send(message, cancellationToken);
 0997            switch (message.Response.Status)
 998            {
 999                case 200:
 1000                    {
 01001                        PublicIPAddressListResult value = default;
 01002                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01003                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1004                        {
 01005                            value = null;
 1006                        }
 1007                        else
 1008                        {
 01009                            value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement)
 1010                        }
 01011                        return Response.FromValue(value, message.Response);
 1012                    }
 1013                default:
 01014                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1015            }
 01016        }
 1017
 1018        internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName)
 1019        {
 01020            var message = _pipeline.CreateMessage();
 01021            var request = message.Request;
 01022            request.Method = RequestMethod.Get;
 01023            var uri = new RawRequestUriBuilder();
 01024            uri.Reset(endpoint);
 01025            uri.AppendRawNextLink(nextLink, false);
 01026            request.Uri = uri;
 01027            return message;
 1028        }
 1029
 1030        /// <summary> Gets all public IP addresses in a resource group. </summary>
 1031        /// <param name="nextLink"> The URL to the next page of results. </param>
 1032        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1033        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1034        public async Task<Response<PublicIPAddressListResult>> ListNextPageAsync(string nextLink, string resourceGroupNa
 1035        {
 01036            if (nextLink == null)
 1037            {
 01038                throw new ArgumentNullException(nameof(nextLink));
 1039            }
 01040            if (resourceGroupName == null)
 1041            {
 01042                throw new ArgumentNullException(nameof(resourceGroupName));
 1043            }
 1044
 01045            using var message = CreateListNextPageRequest(nextLink, resourceGroupName);
 01046            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01047            switch (message.Response.Status)
 1048            {
 1049                case 200:
 1050                    {
 01051                        PublicIPAddressListResult value = default;
 01052                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 01053                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1054                        {
 01055                            value = null;
 1056                        }
 1057                        else
 1058                        {
 01059                            value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement)
 1060                        }
 01061                        return Response.FromValue(value, message.Response);
 1062                    }
 1063                default:
 01064                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1065            }
 01066        }
 1067
 1068        /// <summary> Gets all public IP addresses in a resource group. </summary>
 1069        /// <param name="nextLink"> The URL to the next page of results. </param>
 1070        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1071        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1072        public Response<PublicIPAddressListResult> ListNextPage(string nextLink, string resourceGroupName, CancellationT
 1073        {
 01074            if (nextLink == null)
 1075            {
 01076                throw new ArgumentNullException(nameof(nextLink));
 1077            }
 01078            if (resourceGroupName == null)
 1079            {
 01080                throw new ArgumentNullException(nameof(resourceGroupName));
 1081            }
 1082
 01083            using var message = CreateListNextPageRequest(nextLink, resourceGroupName);
 01084            _pipeline.Send(message, cancellationToken);
 01085            switch (message.Response.Status)
 1086            {
 1087                case 200:
 1088                    {
 01089                        PublicIPAddressListResult value = default;
 01090                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01091                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1092                        {
 01093                            value = null;
 1094                        }
 1095                        else
 1096                        {
 01097                            value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement)
 1098                        }
 01099                        return Response.FromValue(value, message.Response);
 1100                    }
 1101                default:
 01102                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1103            }
 01104        }
 1105
 1106        internal HttpMessage CreateListVirtualMachineScaleSetPublicIPAddressesNextPageRequest(string nextLink, string re
 1107        {
 01108            var message = _pipeline.CreateMessage();
 01109            var request = message.Request;
 01110            request.Method = RequestMethod.Get;
 01111            var uri = new RawRequestUriBuilder();
 01112            uri.Reset(endpoint);
 01113            uri.AppendRawNextLink(nextLink, false);
 01114            request.Uri = uri;
 01115            return message;
 1116        }
 1117
 1118        /// <summary> Gets information about all public IP addresses on a virtual machine scale set level. </summary>
 1119        /// <param name="nextLink"> The URL to the next page of results. </param>
 1120        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1121        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 1122        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1123        public async Task<Response<PublicIPAddressListResult>> ListVirtualMachineScaleSetPublicIPAddressesNextPageAsync(
 1124        {
 01125            if (nextLink == null)
 1126            {
 01127                throw new ArgumentNullException(nameof(nextLink));
 1128            }
 01129            if (resourceGroupName == null)
 1130            {
 01131                throw new ArgumentNullException(nameof(resourceGroupName));
 1132            }
 01133            if (virtualMachineScaleSetName == null)
 1134            {
 01135                throw new ArgumentNullException(nameof(virtualMachineScaleSetName));
 1136            }
 1137
 01138            using var message = CreateListVirtualMachineScaleSetPublicIPAddressesNextPageRequest(nextLink, resourceGroup
 01139            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01140            switch (message.Response.Status)
 1141            {
 1142                case 200:
 1143                    {
 01144                        PublicIPAddressListResult value = default;
 01145                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 01146                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1147                        {
 01148                            value = null;
 1149                        }
 1150                        else
 1151                        {
 01152                            value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement)
 1153                        }
 01154                        return Response.FromValue(value, message.Response);
 1155                    }
 1156                default:
 01157                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1158            }
 01159        }
 1160
 1161        /// <summary> Gets information about all public IP addresses on a virtual machine scale set level. </summary>
 1162        /// <param name="nextLink"> The URL to the next page of results. </param>
 1163        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1164        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 1165        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1166        public Response<PublicIPAddressListResult> ListVirtualMachineScaleSetPublicIPAddressesNextPage(string nextLink, 
 1167        {
 01168            if (nextLink == null)
 1169            {
 01170                throw new ArgumentNullException(nameof(nextLink));
 1171            }
 01172            if (resourceGroupName == null)
 1173            {
 01174                throw new ArgumentNullException(nameof(resourceGroupName));
 1175            }
 01176            if (virtualMachineScaleSetName == null)
 1177            {
 01178                throw new ArgumentNullException(nameof(virtualMachineScaleSetName));
 1179            }
 1180
 01181            using var message = CreateListVirtualMachineScaleSetPublicIPAddressesNextPageRequest(nextLink, resourceGroup
 01182            _pipeline.Send(message, cancellationToken);
 01183            switch (message.Response.Status)
 1184            {
 1185                case 200:
 1186                    {
 01187                        PublicIPAddressListResult value = default;
 01188                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01189                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1190                        {
 01191                            value = null;
 1192                        }
 1193                        else
 1194                        {
 01195                            value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement)
 1196                        }
 01197                        return Response.FromValue(value, message.Response);
 1198                    }
 1199                default:
 01200                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1201            }
 01202        }
 1203
 1204        internal HttpMessage CreateListVirtualMachineScaleSetVMPublicIPAddressesNextPageRequest(string nextLink, string 
 1205        {
 01206            var message = _pipeline.CreateMessage();
 01207            var request = message.Request;
 01208            request.Method = RequestMethod.Get;
 01209            var uri = new RawRequestUriBuilder();
 01210            uri.Reset(endpoint);
 01211            uri.AppendRawNextLink(nextLink, false);
 01212            request.Uri = uri;
 01213            return message;
 1214        }
 1215
 1216        /// <summary> Gets information about all public IP addresses in a virtual machine IP configuration in a virtual 
 1217        /// <param name="nextLink"> The URL to the next page of results. </param>
 1218        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1219        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 1220        /// <param name="virtualmachineIndex"> The virtual machine index. </param>
 1221        /// <param name="networkInterfaceName"> The network interface name. </param>
 1222        /// <param name="ipConfigurationName"> The IP configuration name. </param>
 1223        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1224        public async Task<Response<PublicIPAddressListResult>> ListVirtualMachineScaleSetVMPublicIPAddressesNextPageAsyn
 1225        {
 01226            if (nextLink == null)
 1227            {
 01228                throw new ArgumentNullException(nameof(nextLink));
 1229            }
 01230            if (resourceGroupName == null)
 1231            {
 01232                throw new ArgumentNullException(nameof(resourceGroupName));
 1233            }
 01234            if (virtualMachineScaleSetName == null)
 1235            {
 01236                throw new ArgumentNullException(nameof(virtualMachineScaleSetName));
 1237            }
 01238            if (virtualmachineIndex == null)
 1239            {
 01240                throw new ArgumentNullException(nameof(virtualmachineIndex));
 1241            }
 01242            if (networkInterfaceName == null)
 1243            {
 01244                throw new ArgumentNullException(nameof(networkInterfaceName));
 1245            }
 01246            if (ipConfigurationName == null)
 1247            {
 01248                throw new ArgumentNullException(nameof(ipConfigurationName));
 1249            }
 1250
 01251            using var message = CreateListVirtualMachineScaleSetVMPublicIPAddressesNextPageRequest(nextLink, resourceGro
 01252            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01253            switch (message.Response.Status)
 1254            {
 1255                case 200:
 1256                    {
 01257                        PublicIPAddressListResult value = default;
 01258                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 01259                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1260                        {
 01261                            value = null;
 1262                        }
 1263                        else
 1264                        {
 01265                            value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement)
 1266                        }
 01267                        return Response.FromValue(value, message.Response);
 1268                    }
 1269                default:
 01270                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1271            }
 01272        }
 1273
 1274        /// <summary> Gets information about all public IP addresses in a virtual machine IP configuration in a virtual 
 1275        /// <param name="nextLink"> The URL to the next page of results. </param>
 1276        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1277        /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param>
 1278        /// <param name="virtualmachineIndex"> The virtual machine index. </param>
 1279        /// <param name="networkInterfaceName"> The network interface name. </param>
 1280        /// <param name="ipConfigurationName"> The IP configuration name. </param>
 1281        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1282        public Response<PublicIPAddressListResult> ListVirtualMachineScaleSetVMPublicIPAddressesNextPage(string nextLink
 1283        {
 01284            if (nextLink == null)
 1285            {
 01286                throw new ArgumentNullException(nameof(nextLink));
 1287            }
 01288            if (resourceGroupName == null)
 1289            {
 01290                throw new ArgumentNullException(nameof(resourceGroupName));
 1291            }
 01292            if (virtualMachineScaleSetName == null)
 1293            {
 01294                throw new ArgumentNullException(nameof(virtualMachineScaleSetName));
 1295            }
 01296            if (virtualmachineIndex == null)
 1297            {
 01298                throw new ArgumentNullException(nameof(virtualmachineIndex));
 1299            }
 01300            if (networkInterfaceName == null)
 1301            {
 01302                throw new ArgumentNullException(nameof(networkInterfaceName));
 1303            }
 01304            if (ipConfigurationName == null)
 1305            {
 01306                throw new ArgumentNullException(nameof(ipConfigurationName));
 1307            }
 1308
 01309            using var message = CreateListVirtualMachineScaleSetVMPublicIPAddressesNextPageRequest(nextLink, resourceGro
 01310            _pipeline.Send(message, cancellationToken);
 01311            switch (message.Response.Status)
 1312            {
 1313                case 200:
 1314                    {
 01315                        PublicIPAddressListResult value = default;
 01316                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01317                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1318                        {
 01319                            value = null;
 1320                        }
 1321                        else
 1322                        {
 01323                            value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement)
 1324                        }
 01325                        return Response.FromValue(value, message.Response);
 1326                    }
 1327                default:
 01328                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1329            }
 01330        }
 1331    }
 1332}