< Summary

Class:Azure.ResourceManager.Network.LocalNetworkGatewaysRestOperations
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\LocalNetworkGatewaysRestOperations.cs
Covered lines:139
Uncovered lines:119
Coverable lines:258
Total lines:579
Line coverage:53.8% (139 of 258)
Covered branches:34
Total branches:104
Branch coverage:32.6% (34 of 104)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-88.89%50%
CreateCreateOrUpdateRequest(...)-100%100%
CreateOrUpdateAsync()-66.67%50%
CreateOrUpdate(...)-66.67%50%
CreateGetRequest(...)-100%100%
GetAsync()-73.33%50%
Get(...)-73.33%50%
CreateDeleteRequest(...)-100%100%
DeleteAsync()-70%50%
Delete(...)-70%50%
CreateUpdateTagsRequest(...)-0%100%
UpdateTagsAsync()-0%0%
UpdateTags(...)-0%0%
CreateListRequest(...)-100%100%
ListAsync()-76.92%50%
List(...)-76.92%50%
CreateListNextPageRequest(...)-0%100%
ListNextPageAsync()-0%0%
ListNextPage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\LocalNetworkGatewaysRestOperations.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 LocalNetworkGatewaysRestOperations
 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 LocalNetworkGatewaysRestOperations. </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
 5232        public LocalNetworkGatewaysRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string sub
 33        {
 5234            if (subscriptionId == null)
 35            {
 036                throw new ArgumentNullException(nameof(subscriptionId));
 37            }
 5238            endpoint ??= new Uri("https://management.azure.com");
 39
 5240            this.subscriptionId = subscriptionId;
 5241            this.endpoint = endpoint;
 5242            _clientDiagnostics = clientDiagnostics;
 5243            _pipeline = pipeline;
 5244        }
 45
 46        internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string localNetworkGatewayName, Local
 47        {
 4048            var message = _pipeline.CreateMessage();
 4049            var request = message.Request;
 4050            request.Method = RequestMethod.Put;
 4051            var uri = new RawRequestUriBuilder();
 4052            uri.Reset(endpoint);
 4053            uri.AppendPath("/subscriptions/", false);
 4054            uri.AppendPath(subscriptionId, true);
 4055            uri.AppendPath("/resourceGroups/", false);
 4056            uri.AppendPath(resourceGroupName, true);
 4057            uri.AppendPath("/providers/Microsoft.Network/localNetworkGateways/", false);
 4058            uri.AppendPath(localNetworkGatewayName, true);
 4059            uri.AppendQuery("api-version", "2020-04-01", true);
 4060            request.Uri = uri;
 4061            request.Headers.Add("Content-Type", "application/json");
 4062            var content = new Utf8JsonRequestContent();
 4063            content.JsonWriter.WriteObjectValue(parameters);
 4064            request.Content = content;
 4065            return message;
 66        }
 67
 68        /// <summary> Creates or updates a local network gateway in the specified resource group. </summary>
 69        /// <param name="resourceGroupName"> The name of the resource group. </param>
 70        /// <param name="localNetworkGatewayName"> The name of the local network gateway. </param>
 71        /// <param name="parameters"> Parameters supplied to the create or update local network gateway operation. </par
 72        /// <param name="cancellationToken"> The cancellation token to use. </param>
 73        public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string localNetworkGatewayName, LocalN
 74        {
 1075            if (resourceGroupName == null)
 76            {
 077                throw new ArgumentNullException(nameof(resourceGroupName));
 78            }
 1079            if (localNetworkGatewayName == null)
 80            {
 081                throw new ArgumentNullException(nameof(localNetworkGatewayName));
 82            }
 1083            if (parameters == null)
 84            {
 085                throw new ArgumentNullException(nameof(parameters));
 86            }
 87
 1088            using var message = CreateCreateOrUpdateRequest(resourceGroupName, localNetworkGatewayName, parameters);
 1089            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 1090            switch (message.Response.Status)
 91            {
 92                case 200:
 93                case 201:
 1094                    return message.Response;
 95                default:
 096                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 97            }
 1098        }
 99
 100        /// <summary> Creates or updates a local network gateway in the specified resource group. </summary>
 101        /// <param name="resourceGroupName"> The name of the resource group. </param>
 102        /// <param name="localNetworkGatewayName"> The name of the local network gateway. </param>
 103        /// <param name="parameters"> Parameters supplied to the create or update local network gateway operation. </par
 104        /// <param name="cancellationToken"> The cancellation token to use. </param>
 105        public Response CreateOrUpdate(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway par
 106        {
 10107            if (resourceGroupName == null)
 108            {
 0109                throw new ArgumentNullException(nameof(resourceGroupName));
 110            }
 10111            if (localNetworkGatewayName == null)
 112            {
 0113                throw new ArgumentNullException(nameof(localNetworkGatewayName));
 114            }
 10115            if (parameters == null)
 116            {
 0117                throw new ArgumentNullException(nameof(parameters));
 118            }
 119
 10120            using var message = CreateCreateOrUpdateRequest(resourceGroupName, localNetworkGatewayName, parameters);
 10121            _pipeline.Send(message, cancellationToken);
 10122            switch (message.Response.Status)
 123            {
 124                case 200:
 125                case 201:
 10126                    return message.Response;
 127                default:
 0128                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 129            }
 10130        }
 131
 132        internal HttpMessage CreateGetRequest(string resourceGroupName, string localNetworkGatewayName)
 133        {
 20134            var message = _pipeline.CreateMessage();
 20135            var request = message.Request;
 20136            request.Method = RequestMethod.Get;
 20137            var uri = new RawRequestUriBuilder();
 20138            uri.Reset(endpoint);
 20139            uri.AppendPath("/subscriptions/", false);
 20140            uri.AppendPath(subscriptionId, true);
 20141            uri.AppendPath("/resourceGroups/", false);
 20142            uri.AppendPath(resourceGroupName, true);
 20143            uri.AppendPath("/providers/Microsoft.Network/localNetworkGateways/", false);
 20144            uri.AppendPath(localNetworkGatewayName, true);
 20145            uri.AppendQuery("api-version", "2020-04-01", true);
 20146            request.Uri = uri;
 20147            return message;
 148        }
 149
 150        /// <summary> Gets the specified local network gateway in a resource group. </summary>
 151        /// <param name="resourceGroupName"> The name of the resource group. </param>
 152        /// <param name="localNetworkGatewayName"> The name of the local network gateway. </param>
 153        /// <param name="cancellationToken"> The cancellation token to use. </param>
 154        public async Task<Response<LocalNetworkGateway>> GetAsync(string resourceGroupName, string localNetworkGatewayNa
 155        {
 10156            if (resourceGroupName == null)
 157            {
 0158                throw new ArgumentNullException(nameof(resourceGroupName));
 159            }
 10160            if (localNetworkGatewayName == null)
 161            {
 0162                throw new ArgumentNullException(nameof(localNetworkGatewayName));
 163            }
 164
 10165            using var message = CreateGetRequest(resourceGroupName, localNetworkGatewayName);
 10166            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 10167            switch (message.Response.Status)
 168            {
 169                case 200:
 170                    {
 10171                        LocalNetworkGateway value = default;
 10172                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 10173                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 174                        {
 0175                            value = null;
 176                        }
 177                        else
 178                        {
 10179                            value = LocalNetworkGateway.DeserializeLocalNetworkGateway(document.RootElement);
 180                        }
 10181                        return Response.FromValue(value, message.Response);
 182                    }
 183                default:
 0184                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 185            }
 10186        }
 187
 188        /// <summary> Gets the specified local network gateway in a resource group. </summary>
 189        /// <param name="resourceGroupName"> The name of the resource group. </param>
 190        /// <param name="localNetworkGatewayName"> The name of the local network gateway. </param>
 191        /// <param name="cancellationToken"> The cancellation token to use. </param>
 192        public Response<LocalNetworkGateway> Get(string resourceGroupName, string localNetworkGatewayName, CancellationT
 193        {
 10194            if (resourceGroupName == null)
 195            {
 0196                throw new ArgumentNullException(nameof(resourceGroupName));
 197            }
 10198            if (localNetworkGatewayName == null)
 199            {
 0200                throw new ArgumentNullException(nameof(localNetworkGatewayName));
 201            }
 202
 10203            using var message = CreateGetRequest(resourceGroupName, localNetworkGatewayName);
 10204            _pipeline.Send(message, cancellationToken);
 10205            switch (message.Response.Status)
 206            {
 207                case 200:
 208                    {
 10209                        LocalNetworkGateway value = default;
 10210                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 10211                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 212                        {
 0213                            value = null;
 214                        }
 215                        else
 216                        {
 10217                            value = LocalNetworkGateway.DeserializeLocalNetworkGateway(document.RootElement);
 218                        }
 10219                        return Response.FromValue(value, message.Response);
 220                    }
 221                default:
 0222                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 223            }
 10224        }
 225
 226        internal HttpMessage CreateDeleteRequest(string resourceGroupName, string localNetworkGatewayName)
 227        {
 8228            var message = _pipeline.CreateMessage();
 8229            var request = message.Request;
 8230            request.Method = RequestMethod.Delete;
 8231            var uri = new RawRequestUriBuilder();
 8232            uri.Reset(endpoint);
 8233            uri.AppendPath("/subscriptions/", false);
 8234            uri.AppendPath(subscriptionId, true);
 8235            uri.AppendPath("/resourceGroups/", false);
 8236            uri.AppendPath(resourceGroupName, true);
 8237            uri.AppendPath("/providers/Microsoft.Network/localNetworkGateways/", false);
 8238            uri.AppendPath(localNetworkGatewayName, true);
 8239            uri.AppendQuery("api-version", "2020-04-01", true);
 8240            request.Uri = uri;
 8241            return message;
 242        }
 243
 244        /// <summary> Deletes the specified local network gateway. </summary>
 245        /// <param name="resourceGroupName"> The name of the resource group. </param>
 246        /// <param name="localNetworkGatewayName"> The name of the local network gateway. </param>
 247        /// <param name="cancellationToken"> The cancellation token to use. </param>
 248        public async Task<Response> DeleteAsync(string resourceGroupName, string localNetworkGatewayName, CancellationTo
 249        {
 2250            if (resourceGroupName == null)
 251            {
 0252                throw new ArgumentNullException(nameof(resourceGroupName));
 253            }
 2254            if (localNetworkGatewayName == null)
 255            {
 0256                throw new ArgumentNullException(nameof(localNetworkGatewayName));
 257            }
 258
 2259            using var message = CreateDeleteRequest(resourceGroupName, localNetworkGatewayName);
 2260            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 2261            switch (message.Response.Status)
 262            {
 263                case 200:
 264                case 202:
 265                case 204:
 2266                    return message.Response;
 267                default:
 0268                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 269            }
 2270        }
 271
 272        /// <summary> Deletes the specified local network gateway. </summary>
 273        /// <param name="resourceGroupName"> The name of the resource group. </param>
 274        /// <param name="localNetworkGatewayName"> The name of the local network gateway. </param>
 275        /// <param name="cancellationToken"> The cancellation token to use. </param>
 276        public Response Delete(string resourceGroupName, string localNetworkGatewayName, CancellationToken cancellationT
 277        {
 2278            if (resourceGroupName == null)
 279            {
 0280                throw new ArgumentNullException(nameof(resourceGroupName));
 281            }
 2282            if (localNetworkGatewayName == null)
 283            {
 0284                throw new ArgumentNullException(nameof(localNetworkGatewayName));
 285            }
 286
 2287            using var message = CreateDeleteRequest(resourceGroupName, localNetworkGatewayName);
 2288            _pipeline.Send(message, cancellationToken);
 2289            switch (message.Response.Status)
 290            {
 291                case 200:
 292                case 202:
 293                case 204:
 2294                    return message.Response;
 295                default:
 0296                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 297            }
 2298        }
 299
 300        internal HttpMessage CreateUpdateTagsRequest(string resourceGroupName, string localNetworkGatewayName, TagsObjec
 301        {
 0302            var message = _pipeline.CreateMessage();
 0303            var request = message.Request;
 0304            request.Method = RequestMethod.Patch;
 0305            var uri = new RawRequestUriBuilder();
 0306            uri.Reset(endpoint);
 0307            uri.AppendPath("/subscriptions/", false);
 0308            uri.AppendPath(subscriptionId, true);
 0309            uri.AppendPath("/resourceGroups/", false);
 0310            uri.AppendPath(resourceGroupName, true);
 0311            uri.AppendPath("/providers/Microsoft.Network/localNetworkGateways/", false);
 0312            uri.AppendPath(localNetworkGatewayName, true);
 0313            uri.AppendQuery("api-version", "2020-04-01", true);
 0314            request.Uri = uri;
 0315            request.Headers.Add("Content-Type", "application/json");
 0316            var content = new Utf8JsonRequestContent();
 0317            content.JsonWriter.WriteObjectValue(parameters);
 0318            request.Content = content;
 0319            return message;
 320        }
 321
 322        /// <summary> Updates a local network gateway tags. </summary>
 323        /// <param name="resourceGroupName"> The name of the resource group. </param>
 324        /// <param name="localNetworkGatewayName"> The name of the local network gateway. </param>
 325        /// <param name="parameters"> Parameters supplied to update local network gateway tags. </param>
 326        /// <param name="cancellationToken"> The cancellation token to use. </param>
 327        public async Task<Response<LocalNetworkGateway>> UpdateTagsAsync(string resourceGroupName, string localNetworkGa
 328        {
 0329            if (resourceGroupName == null)
 330            {
 0331                throw new ArgumentNullException(nameof(resourceGroupName));
 332            }
 0333            if (localNetworkGatewayName == null)
 334            {
 0335                throw new ArgumentNullException(nameof(localNetworkGatewayName));
 336            }
 0337            if (parameters == null)
 338            {
 0339                throw new ArgumentNullException(nameof(parameters));
 340            }
 341
 0342            using var message = CreateUpdateTagsRequest(resourceGroupName, localNetworkGatewayName, parameters);
 0343            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0344            switch (message.Response.Status)
 345            {
 346                case 200:
 347                    {
 0348                        LocalNetworkGateway value = default;
 0349                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0350                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 351                        {
 0352                            value = null;
 353                        }
 354                        else
 355                        {
 0356                            value = LocalNetworkGateway.DeserializeLocalNetworkGateway(document.RootElement);
 357                        }
 0358                        return Response.FromValue(value, message.Response);
 359                    }
 360                default:
 0361                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 362            }
 0363        }
 364
 365        /// <summary> Updates a local network gateway tags. </summary>
 366        /// <param name="resourceGroupName"> The name of the resource group. </param>
 367        /// <param name="localNetworkGatewayName"> The name of the local network gateway. </param>
 368        /// <param name="parameters"> Parameters supplied to update local network gateway tags. </param>
 369        /// <param name="cancellationToken"> The cancellation token to use. </param>
 370        public Response<LocalNetworkGateway> UpdateTags(string resourceGroupName, string localNetworkGatewayName, TagsOb
 371        {
 0372            if (resourceGroupName == null)
 373            {
 0374                throw new ArgumentNullException(nameof(resourceGroupName));
 375            }
 0376            if (localNetworkGatewayName == null)
 377            {
 0378                throw new ArgumentNullException(nameof(localNetworkGatewayName));
 379            }
 0380            if (parameters == null)
 381            {
 0382                throw new ArgumentNullException(nameof(parameters));
 383            }
 384
 0385            using var message = CreateUpdateTagsRequest(resourceGroupName, localNetworkGatewayName, parameters);
 0386            _pipeline.Send(message, cancellationToken);
 0387            switch (message.Response.Status)
 388            {
 389                case 200:
 390                    {
 0391                        LocalNetworkGateway value = default;
 0392                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0393                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 394                        {
 0395                            value = null;
 396                        }
 397                        else
 398                        {
 0399                            value = LocalNetworkGateway.DeserializeLocalNetworkGateway(document.RootElement);
 400                        }
 0401                        return Response.FromValue(value, message.Response);
 402                    }
 403                default:
 0404                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 405            }
 0406        }
 407
 408        internal HttpMessage CreateListRequest(string resourceGroupName)
 409        {
 8410            var message = _pipeline.CreateMessage();
 8411            var request = message.Request;
 8412            request.Method = RequestMethod.Get;
 8413            var uri = new RawRequestUriBuilder();
 8414            uri.Reset(endpoint);
 8415            uri.AppendPath("/subscriptions/", false);
 8416            uri.AppendPath(subscriptionId, true);
 8417            uri.AppendPath("/resourceGroups/", false);
 8418            uri.AppendPath(resourceGroupName, true);
 8419            uri.AppendPath("/providers/Microsoft.Network/localNetworkGateways", false);
 8420            uri.AppendQuery("api-version", "2020-04-01", true);
 8421            request.Uri = uri;
 8422            return message;
 423        }
 424
 425        /// <summary> Gets all the local network gateways in a resource group. </summary>
 426        /// <param name="resourceGroupName"> The name of the resource group. </param>
 427        /// <param name="cancellationToken"> The cancellation token to use. </param>
 428        public async Task<Response<LocalNetworkGatewayListResult>> ListAsync(string resourceGroupName, CancellationToken
 429        {
 4430            if (resourceGroupName == null)
 431            {
 0432                throw new ArgumentNullException(nameof(resourceGroupName));
 433            }
 434
 4435            using var message = CreateListRequest(resourceGroupName);
 4436            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 4437            switch (message.Response.Status)
 438            {
 439                case 200:
 440                    {
 4441                        LocalNetworkGatewayListResult value = default;
 4442                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 4443                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 444                        {
 0445                            value = null;
 446                        }
 447                        else
 448                        {
 4449                            value = LocalNetworkGatewayListResult.DeserializeLocalNetworkGatewayListResult(document.Root
 450                        }
 4451                        return Response.FromValue(value, message.Response);
 452                    }
 453                default:
 0454                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 455            }
 4456        }
 457
 458        /// <summary> Gets all the local network gateways in a resource group. </summary>
 459        /// <param name="resourceGroupName"> The name of the resource group. </param>
 460        /// <param name="cancellationToken"> The cancellation token to use. </param>
 461        public Response<LocalNetworkGatewayListResult> List(string resourceGroupName, CancellationToken cancellationToke
 462        {
 4463            if (resourceGroupName == null)
 464            {
 0465                throw new ArgumentNullException(nameof(resourceGroupName));
 466            }
 467
 4468            using var message = CreateListRequest(resourceGroupName);
 4469            _pipeline.Send(message, cancellationToken);
 4470            switch (message.Response.Status)
 471            {
 472                case 200:
 473                    {
 4474                        LocalNetworkGatewayListResult value = default;
 4475                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 4476                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 477                        {
 0478                            value = null;
 479                        }
 480                        else
 481                        {
 4482                            value = LocalNetworkGatewayListResult.DeserializeLocalNetworkGatewayListResult(document.Root
 483                        }
 4484                        return Response.FromValue(value, message.Response);
 485                    }
 486                default:
 0487                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 488            }
 4489        }
 490
 491        internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName)
 492        {
 0493            var message = _pipeline.CreateMessage();
 0494            var request = message.Request;
 0495            request.Method = RequestMethod.Get;
 0496            var uri = new RawRequestUriBuilder();
 0497            uri.Reset(endpoint);
 0498            uri.AppendRawNextLink(nextLink, false);
 0499            request.Uri = uri;
 0500            return message;
 501        }
 502
 503        /// <summary> Gets all the local network gateways in a resource group. </summary>
 504        /// <param name="nextLink"> The URL to the next page of results. </param>
 505        /// <param name="resourceGroupName"> The name of the resource group. </param>
 506        /// <param name="cancellationToken"> The cancellation token to use. </param>
 507        public async Task<Response<LocalNetworkGatewayListResult>> ListNextPageAsync(string nextLink, string resourceGro
 508        {
 0509            if (nextLink == null)
 510            {
 0511                throw new ArgumentNullException(nameof(nextLink));
 512            }
 0513            if (resourceGroupName == null)
 514            {
 0515                throw new ArgumentNullException(nameof(resourceGroupName));
 516            }
 517
 0518            using var message = CreateListNextPageRequest(nextLink, resourceGroupName);
 0519            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0520            switch (message.Response.Status)
 521            {
 522                case 200:
 523                    {
 0524                        LocalNetworkGatewayListResult value = default;
 0525                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0526                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 527                        {
 0528                            value = null;
 529                        }
 530                        else
 531                        {
 0532                            value = LocalNetworkGatewayListResult.DeserializeLocalNetworkGatewayListResult(document.Root
 533                        }
 0534                        return Response.FromValue(value, message.Response);
 535                    }
 536                default:
 0537                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 538            }
 0539        }
 540
 541        /// <summary> Gets all the local network gateways in a resource group. </summary>
 542        /// <param name="nextLink"> The URL to the next page of results. </param>
 543        /// <param name="resourceGroupName"> The name of the resource group. </param>
 544        /// <param name="cancellationToken"> The cancellation token to use. </param>
 545        public Response<LocalNetworkGatewayListResult> ListNextPage(string nextLink, string resourceGroupName, Cancellat
 546        {
 0547            if (nextLink == null)
 548            {
 0549                throw new ArgumentNullException(nameof(nextLink));
 550            }
 0551            if (resourceGroupName == null)
 552            {
 0553                throw new ArgumentNullException(nameof(resourceGroupName));
 554            }
 555
 0556            using var message = CreateListNextPageRequest(nextLink, resourceGroupName);
 0557            _pipeline.Send(message, cancellationToken);
 0558            switch (message.Response.Status)
 559            {
 560                case 200:
 561                    {
 0562                        LocalNetworkGatewayListResult value = default;
 0563                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0564                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 565                        {
 0566                            value = null;
 567                        }
 568                        else
 569                        {
 0570                            value = LocalNetworkGatewayListResult.DeserializeLocalNetworkGatewayListResult(document.Root
 571                        }
 0572                        return Response.FromValue(value, message.Response);
 573                    }
 574                default:
 0575                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 576            }
 0577        }
 578    }
 579}