< Summary

Class:Azure.ResourceManager.Network.ExpressRouteCircuitsRestOperations
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\ExpressRouteCircuitsRestOperations.cs
Covered lines:0
Uncovered lines:559
Coverable lines:559
Total lines:1216
Line coverage:0% (0 of 559)
Covered branches:0
Total branches:232
Branch coverage:0% (0 of 232)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
CreateDeleteRequest(...)-0%100%
DeleteAsync()-0%0%
Delete(...)-0%0%
CreateGetRequest(...)-0%100%
GetAsync()-0%0%
Get(...)-0%0%
CreateCreateOrUpdateRequest(...)-0%100%
CreateOrUpdateAsync()-0%0%
CreateOrUpdate(...)-0%0%
CreateUpdateTagsRequest(...)-0%100%
UpdateTagsAsync()-0%0%
UpdateTags(...)-0%0%
CreateListArpTableRequest(...)-0%100%
ListArpTableAsync()-0%0%
ListArpTable(...)-0%0%
CreateListRoutesTableRequest(...)-0%100%
ListRoutesTableAsync()-0%0%
ListRoutesTable(...)-0%0%
CreateListRoutesTableSummaryRequest(...)-0%100%
ListRoutesTableSummaryAsync()-0%0%
ListRoutesTableSummary(...)-0%0%
CreateGetStatsRequest(...)-0%100%
GetStatsAsync()-0%0%
GetStats(...)-0%0%
CreateGetPeeringStatsRequest(...)-0%100%
GetPeeringStatsAsync()-0%0%
GetPeeringStats(...)-0%0%
CreateListRequest(...)-0%100%
ListAsync()-0%0%
List(...)-0%0%
CreateListAllRequest()-0%100%
ListAllAsync()-0%0%
ListAll(...)-0%0%
CreateListNextPageRequest(...)-0%100%
ListNextPageAsync()-0%0%
ListNextPage(...)-0%0%
CreateListAllNextPageRequest(...)-0%100%
ListAllNextPageAsync()-0%0%
ListAllNextPage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\ExpressRouteCircuitsRestOperations.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 ExpressRouteCircuitsRestOperations
 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 ExpressRouteCircuitsRestOperations. </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
 032        public ExpressRouteCircuitsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string sub
 33        {
 034            if (subscriptionId == null)
 35            {
 036                throw new ArgumentNullException(nameof(subscriptionId));
 37            }
 038            endpoint ??= new Uri("https://management.azure.com");
 39
 040            this.subscriptionId = subscriptionId;
 041            this.endpoint = endpoint;
 042            _clientDiagnostics = clientDiagnostics;
 043            _pipeline = pipeline;
 044        }
 45
 46        internal HttpMessage CreateDeleteRequest(string resourceGroupName, string circuitName)
 47        {
 048            var message = _pipeline.CreateMessage();
 049            var request = message.Request;
 050            request.Method = RequestMethod.Delete;
 051            var uri = new RawRequestUriBuilder();
 052            uri.Reset(endpoint);
 053            uri.AppendPath("/subscriptions/", false);
 054            uri.AppendPath(subscriptionId, true);
 055            uri.AppendPath("/resourceGroups/", false);
 056            uri.AppendPath(resourceGroupName, true);
 057            uri.AppendPath("/providers/Microsoft.Network/expressRouteCircuits/", false);
 058            uri.AppendPath(circuitName, true);
 059            uri.AppendQuery("api-version", "2020-04-01", true);
 060            request.Uri = uri;
 061            return message;
 62        }
 63
 64        /// <summary> Deletes the specified express route circuit. </summary>
 65        /// <param name="resourceGroupName"> The name of the resource group. </param>
 66        /// <param name="circuitName"> The name of the express route circuit. </param>
 67        /// <param name="cancellationToken"> The cancellation token to use. </param>
 68        public async Task<Response> DeleteAsync(string resourceGroupName, string circuitName, CancellationToken cancella
 69        {
 070            if (resourceGroupName == null)
 71            {
 072                throw new ArgumentNullException(nameof(resourceGroupName));
 73            }
 074            if (circuitName == null)
 75            {
 076                throw new ArgumentNullException(nameof(circuitName));
 77            }
 78
 079            using var message = CreateDeleteRequest(resourceGroupName, circuitName);
 080            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 081            switch (message.Response.Status)
 82            {
 83                case 200:
 84                case 202:
 85                case 204:
 086                    return message.Response;
 87                default:
 088                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 89            }
 090        }
 91
 92        /// <summary> Deletes the specified express route circuit. </summary>
 93        /// <param name="resourceGroupName"> The name of the resource group. </param>
 94        /// <param name="circuitName"> The name of the express route circuit. </param>
 95        /// <param name="cancellationToken"> The cancellation token to use. </param>
 96        public Response Delete(string resourceGroupName, string circuitName, CancellationToken cancellationToken = defau
 97        {
 098            if (resourceGroupName == null)
 99            {
 0100                throw new ArgumentNullException(nameof(resourceGroupName));
 101            }
 0102            if (circuitName == null)
 103            {
 0104                throw new ArgumentNullException(nameof(circuitName));
 105            }
 106
 0107            using var message = CreateDeleteRequest(resourceGroupName, circuitName);
 0108            _pipeline.Send(message, cancellationToken);
 0109            switch (message.Response.Status)
 110            {
 111                case 200:
 112                case 202:
 113                case 204:
 0114                    return message.Response;
 115                default:
 0116                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 117            }
 0118        }
 119
 120        internal HttpMessage CreateGetRequest(string resourceGroupName, string circuitName)
 121        {
 0122            var message = _pipeline.CreateMessage();
 0123            var request = message.Request;
 0124            request.Method = RequestMethod.Get;
 0125            var uri = new RawRequestUriBuilder();
 0126            uri.Reset(endpoint);
 0127            uri.AppendPath("/subscriptions/", false);
 0128            uri.AppendPath(subscriptionId, true);
 0129            uri.AppendPath("/resourceGroups/", false);
 0130            uri.AppendPath(resourceGroupName, true);
 0131            uri.AppendPath("/providers/Microsoft.Network/expressRouteCircuits/", false);
 0132            uri.AppendPath(circuitName, true);
 0133            uri.AppendQuery("api-version", "2020-04-01", true);
 0134            request.Uri = uri;
 0135            return message;
 136        }
 137
 138        /// <summary> Gets information about the specified express route circuit. </summary>
 139        /// <param name="resourceGroupName"> The name of the resource group. </param>
 140        /// <param name="circuitName"> The name of express route circuit. </param>
 141        /// <param name="cancellationToken"> The cancellation token to use. </param>
 142        public async Task<Response<ExpressRouteCircuit>> GetAsync(string resourceGroupName, string circuitName, Cancella
 143        {
 0144            if (resourceGroupName == null)
 145            {
 0146                throw new ArgumentNullException(nameof(resourceGroupName));
 147            }
 0148            if (circuitName == null)
 149            {
 0150                throw new ArgumentNullException(nameof(circuitName));
 151            }
 152
 0153            using var message = CreateGetRequest(resourceGroupName, circuitName);
 0154            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0155            switch (message.Response.Status)
 156            {
 157                case 200:
 158                    {
 0159                        ExpressRouteCircuit value = default;
 0160                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0161                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 162                        {
 0163                            value = null;
 164                        }
 165                        else
 166                        {
 0167                            value = ExpressRouteCircuit.DeserializeExpressRouteCircuit(document.RootElement);
 168                        }
 0169                        return Response.FromValue(value, message.Response);
 170                    }
 171                default:
 0172                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 173            }
 0174        }
 175
 176        /// <summary> Gets information about the specified express route circuit. </summary>
 177        /// <param name="resourceGroupName"> The name of the resource group. </param>
 178        /// <param name="circuitName"> The name of express route circuit. </param>
 179        /// <param name="cancellationToken"> The cancellation token to use. </param>
 180        public Response<ExpressRouteCircuit> Get(string resourceGroupName, string circuitName, CancellationToken cancell
 181        {
 0182            if (resourceGroupName == null)
 183            {
 0184                throw new ArgumentNullException(nameof(resourceGroupName));
 185            }
 0186            if (circuitName == null)
 187            {
 0188                throw new ArgumentNullException(nameof(circuitName));
 189            }
 190
 0191            using var message = CreateGetRequest(resourceGroupName, circuitName);
 0192            _pipeline.Send(message, cancellationToken);
 0193            switch (message.Response.Status)
 194            {
 195                case 200:
 196                    {
 0197                        ExpressRouteCircuit value = default;
 0198                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0199                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 200                        {
 0201                            value = null;
 202                        }
 203                        else
 204                        {
 0205                            value = ExpressRouteCircuit.DeserializeExpressRouteCircuit(document.RootElement);
 206                        }
 0207                        return Response.FromValue(value, message.Response);
 208                    }
 209                default:
 0210                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 211            }
 0212        }
 213
 214        internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string circuitName, ExpressRouteCircu
 215        {
 0216            var message = _pipeline.CreateMessage();
 0217            var request = message.Request;
 0218            request.Method = RequestMethod.Put;
 0219            var uri = new RawRequestUriBuilder();
 0220            uri.Reset(endpoint);
 0221            uri.AppendPath("/subscriptions/", false);
 0222            uri.AppendPath(subscriptionId, true);
 0223            uri.AppendPath("/resourceGroups/", false);
 0224            uri.AppendPath(resourceGroupName, true);
 0225            uri.AppendPath("/providers/Microsoft.Network/expressRouteCircuits/", false);
 0226            uri.AppendPath(circuitName, true);
 0227            uri.AppendQuery("api-version", "2020-04-01", true);
 0228            request.Uri = uri;
 0229            request.Headers.Add("Content-Type", "application/json");
 0230            var content = new Utf8JsonRequestContent();
 0231            content.JsonWriter.WriteObjectValue(parameters);
 0232            request.Content = content;
 0233            return message;
 234        }
 235
 236        /// <summary> Creates or updates an express route circuit. </summary>
 237        /// <param name="resourceGroupName"> The name of the resource group. </param>
 238        /// <param name="circuitName"> The name of the circuit. </param>
 239        /// <param name="parameters"> Parameters supplied to the create or update express route circuit operation. </par
 240        /// <param name="cancellationToken"> The cancellation token to use. </param>
 241        public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string circuitName, ExpressRouteCircui
 242        {
 0243            if (resourceGroupName == null)
 244            {
 0245                throw new ArgumentNullException(nameof(resourceGroupName));
 246            }
 0247            if (circuitName == null)
 248            {
 0249                throw new ArgumentNullException(nameof(circuitName));
 250            }
 0251            if (parameters == null)
 252            {
 0253                throw new ArgumentNullException(nameof(parameters));
 254            }
 255
 0256            using var message = CreateCreateOrUpdateRequest(resourceGroupName, circuitName, parameters);
 0257            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0258            switch (message.Response.Status)
 259            {
 260                case 200:
 261                case 201:
 0262                    return message.Response;
 263                default:
 0264                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 265            }
 0266        }
 267
 268        /// <summary> Creates or updates an express route circuit. </summary>
 269        /// <param name="resourceGroupName"> The name of the resource group. </param>
 270        /// <param name="circuitName"> The name of the circuit. </param>
 271        /// <param name="parameters"> Parameters supplied to the create or update express route circuit operation. </par
 272        /// <param name="cancellationToken"> The cancellation token to use. </param>
 273        public Response CreateOrUpdate(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Can
 274        {
 0275            if (resourceGroupName == null)
 276            {
 0277                throw new ArgumentNullException(nameof(resourceGroupName));
 278            }
 0279            if (circuitName == null)
 280            {
 0281                throw new ArgumentNullException(nameof(circuitName));
 282            }
 0283            if (parameters == null)
 284            {
 0285                throw new ArgumentNullException(nameof(parameters));
 286            }
 287
 0288            using var message = CreateCreateOrUpdateRequest(resourceGroupName, circuitName, parameters);
 0289            _pipeline.Send(message, cancellationToken);
 0290            switch (message.Response.Status)
 291            {
 292                case 200:
 293                case 201:
 0294                    return message.Response;
 295                default:
 0296                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 297            }
 0298        }
 299
 300        internal HttpMessage CreateUpdateTagsRequest(string resourceGroupName, string circuitName, TagsObject parameters
 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/expressRouteCircuits/", false);
 0312            uri.AppendPath(circuitName, 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 an express route circuit tags. </summary>
 323        /// <param name="resourceGroupName"> The name of the resource group. </param>
 324        /// <param name="circuitName"> The name of the circuit. </param>
 325        /// <param name="parameters"> Parameters supplied to update express route circuit tags. </param>
 326        /// <param name="cancellationToken"> The cancellation token to use. </param>
 327        public async Task<Response<ExpressRouteCircuit>> UpdateTagsAsync(string resourceGroupName, string circuitName, T
 328        {
 0329            if (resourceGroupName == null)
 330            {
 0331                throw new ArgumentNullException(nameof(resourceGroupName));
 332            }
 0333            if (circuitName == null)
 334            {
 0335                throw new ArgumentNullException(nameof(circuitName));
 336            }
 0337            if (parameters == null)
 338            {
 0339                throw new ArgumentNullException(nameof(parameters));
 340            }
 341
 0342            using var message = CreateUpdateTagsRequest(resourceGroupName, circuitName, parameters);
 0343            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0344            switch (message.Response.Status)
 345            {
 346                case 200:
 347                    {
 0348                        ExpressRouteCircuit 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 = ExpressRouteCircuit.DeserializeExpressRouteCircuit(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 an express route circuit tags. </summary>
 366        /// <param name="resourceGroupName"> The name of the resource group. </param>
 367        /// <param name="circuitName"> The name of the circuit. </param>
 368        /// <param name="parameters"> Parameters supplied to update express route circuit tags. </param>
 369        /// <param name="cancellationToken"> The cancellation token to use. </param>
 370        public Response<ExpressRouteCircuit> UpdateTags(string resourceGroupName, string circuitName, TagsObject paramet
 371        {
 0372            if (resourceGroupName == null)
 373            {
 0374                throw new ArgumentNullException(nameof(resourceGroupName));
 375            }
 0376            if (circuitName == null)
 377            {
 0378                throw new ArgumentNullException(nameof(circuitName));
 379            }
 0380            if (parameters == null)
 381            {
 0382                throw new ArgumentNullException(nameof(parameters));
 383            }
 384
 0385            using var message = CreateUpdateTagsRequest(resourceGroupName, circuitName, parameters);
 0386            _pipeline.Send(message, cancellationToken);
 0387            switch (message.Response.Status)
 388            {
 389                case 200:
 390                    {
 0391                        ExpressRouteCircuit 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 = ExpressRouteCircuit.DeserializeExpressRouteCircuit(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 CreateListArpTableRequest(string resourceGroupName, string circuitName, string peeringName,
 409        {
 0410            var message = _pipeline.CreateMessage();
 0411            var request = message.Request;
 0412            request.Method = RequestMethod.Post;
 0413            var uri = new RawRequestUriBuilder();
 0414            uri.Reset(endpoint);
 0415            uri.AppendPath("/subscriptions/", false);
 0416            uri.AppendPath(subscriptionId, true);
 0417            uri.AppendPath("/resourceGroups/", false);
 0418            uri.AppendPath(resourceGroupName, true);
 0419            uri.AppendPath("/providers/Microsoft.Network/expressRouteCircuits/", false);
 0420            uri.AppendPath(circuitName, true);
 0421            uri.AppendPath("/peerings/", false);
 0422            uri.AppendPath(peeringName, true);
 0423            uri.AppendPath("/arpTables/", false);
 0424            uri.AppendPath(devicePath, true);
 0425            uri.AppendQuery("api-version", "2020-04-01", true);
 0426            request.Uri = uri;
 0427            return message;
 428        }
 429
 430        /// <summary> Gets the currently advertised ARP table associated with the express route circuit in a resource gr
 431        /// <param name="resourceGroupName"> The name of the resource group. </param>
 432        /// <param name="circuitName"> The name of the express route circuit. </param>
 433        /// <param name="peeringName"> The name of the peering. </param>
 434        /// <param name="devicePath"> The path of the device. </param>
 435        /// <param name="cancellationToken"> The cancellation token to use. </param>
 436        public async Task<Response> ListArpTableAsync(string resourceGroupName, string circuitName, string peeringName, 
 437        {
 0438            if (resourceGroupName == null)
 439            {
 0440                throw new ArgumentNullException(nameof(resourceGroupName));
 441            }
 0442            if (circuitName == null)
 443            {
 0444                throw new ArgumentNullException(nameof(circuitName));
 445            }
 0446            if (peeringName == null)
 447            {
 0448                throw new ArgumentNullException(nameof(peeringName));
 449            }
 0450            if (devicePath == null)
 451            {
 0452                throw new ArgumentNullException(nameof(devicePath));
 453            }
 454
 0455            using var message = CreateListArpTableRequest(resourceGroupName, circuitName, peeringName, devicePath);
 0456            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0457            switch (message.Response.Status)
 458            {
 459                case 200:
 460                case 202:
 0461                    return message.Response;
 462                default:
 0463                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 464            }
 0465        }
 466
 467        /// <summary> Gets the currently advertised ARP table associated with the express route circuit in a resource gr
 468        /// <param name="resourceGroupName"> The name of the resource group. </param>
 469        /// <param name="circuitName"> The name of the express route circuit. </param>
 470        /// <param name="peeringName"> The name of the peering. </param>
 471        /// <param name="devicePath"> The path of the device. </param>
 472        /// <param name="cancellationToken"> The cancellation token to use. </param>
 473        public Response ListArpTable(string resourceGroupName, string circuitName, string peeringName, string devicePath
 474        {
 0475            if (resourceGroupName == null)
 476            {
 0477                throw new ArgumentNullException(nameof(resourceGroupName));
 478            }
 0479            if (circuitName == null)
 480            {
 0481                throw new ArgumentNullException(nameof(circuitName));
 482            }
 0483            if (peeringName == null)
 484            {
 0485                throw new ArgumentNullException(nameof(peeringName));
 486            }
 0487            if (devicePath == null)
 488            {
 0489                throw new ArgumentNullException(nameof(devicePath));
 490            }
 491
 0492            using var message = CreateListArpTableRequest(resourceGroupName, circuitName, peeringName, devicePath);
 0493            _pipeline.Send(message, cancellationToken);
 0494            switch (message.Response.Status)
 495            {
 496                case 200:
 497                case 202:
 0498                    return message.Response;
 499                default:
 0500                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 501            }
 0502        }
 503
 504        internal HttpMessage CreateListRoutesTableRequest(string resourceGroupName, string circuitName, string peeringNa
 505        {
 0506            var message = _pipeline.CreateMessage();
 0507            var request = message.Request;
 0508            request.Method = RequestMethod.Post;
 0509            var uri = new RawRequestUriBuilder();
 0510            uri.Reset(endpoint);
 0511            uri.AppendPath("/subscriptions/", false);
 0512            uri.AppendPath(subscriptionId, true);
 0513            uri.AppendPath("/resourceGroups/", false);
 0514            uri.AppendPath(resourceGroupName, true);
 0515            uri.AppendPath("/providers/Microsoft.Network/expressRouteCircuits/", false);
 0516            uri.AppendPath(circuitName, true);
 0517            uri.AppendPath("/peerings/", false);
 0518            uri.AppendPath(peeringName, true);
 0519            uri.AppendPath("/routeTables/", false);
 0520            uri.AppendPath(devicePath, true);
 0521            uri.AppendQuery("api-version", "2020-04-01", true);
 0522            request.Uri = uri;
 0523            return message;
 524        }
 525
 526        /// <summary> Gets the currently advertised routes table associated with the express route circuit in a resource
 527        /// <param name="resourceGroupName"> The name of the resource group. </param>
 528        /// <param name="circuitName"> The name of the express route circuit. </param>
 529        /// <param name="peeringName"> The name of the peering. </param>
 530        /// <param name="devicePath"> The path of the device. </param>
 531        /// <param name="cancellationToken"> The cancellation token to use. </param>
 532        public async Task<Response> ListRoutesTableAsync(string resourceGroupName, string circuitName, string peeringNam
 533        {
 0534            if (resourceGroupName == null)
 535            {
 0536                throw new ArgumentNullException(nameof(resourceGroupName));
 537            }
 0538            if (circuitName == null)
 539            {
 0540                throw new ArgumentNullException(nameof(circuitName));
 541            }
 0542            if (peeringName == null)
 543            {
 0544                throw new ArgumentNullException(nameof(peeringName));
 545            }
 0546            if (devicePath == null)
 547            {
 0548                throw new ArgumentNullException(nameof(devicePath));
 549            }
 550
 0551            using var message = CreateListRoutesTableRequest(resourceGroupName, circuitName, peeringName, devicePath);
 0552            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0553            switch (message.Response.Status)
 554            {
 555                case 200:
 556                case 202:
 0557                    return message.Response;
 558                default:
 0559                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 560            }
 0561        }
 562
 563        /// <summary> Gets the currently advertised routes table associated with the express route circuit in a resource
 564        /// <param name="resourceGroupName"> The name of the resource group. </param>
 565        /// <param name="circuitName"> The name of the express route circuit. </param>
 566        /// <param name="peeringName"> The name of the peering. </param>
 567        /// <param name="devicePath"> The path of the device. </param>
 568        /// <param name="cancellationToken"> The cancellation token to use. </param>
 569        public Response ListRoutesTable(string resourceGroupName, string circuitName, string peeringName, string deviceP
 570        {
 0571            if (resourceGroupName == null)
 572            {
 0573                throw new ArgumentNullException(nameof(resourceGroupName));
 574            }
 0575            if (circuitName == null)
 576            {
 0577                throw new ArgumentNullException(nameof(circuitName));
 578            }
 0579            if (peeringName == null)
 580            {
 0581                throw new ArgumentNullException(nameof(peeringName));
 582            }
 0583            if (devicePath == null)
 584            {
 0585                throw new ArgumentNullException(nameof(devicePath));
 586            }
 587
 0588            using var message = CreateListRoutesTableRequest(resourceGroupName, circuitName, peeringName, devicePath);
 0589            _pipeline.Send(message, cancellationToken);
 0590            switch (message.Response.Status)
 591            {
 592                case 200:
 593                case 202:
 0594                    return message.Response;
 595                default:
 0596                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 597            }
 0598        }
 599
 600        internal HttpMessage CreateListRoutesTableSummaryRequest(string resourceGroupName, string circuitName, string pe
 601        {
 0602            var message = _pipeline.CreateMessage();
 0603            var request = message.Request;
 0604            request.Method = RequestMethod.Post;
 0605            var uri = new RawRequestUriBuilder();
 0606            uri.Reset(endpoint);
 0607            uri.AppendPath("/subscriptions/", false);
 0608            uri.AppendPath(subscriptionId, true);
 0609            uri.AppendPath("/resourceGroups/", false);
 0610            uri.AppendPath(resourceGroupName, true);
 0611            uri.AppendPath("/providers/Microsoft.Network/expressRouteCircuits/", false);
 0612            uri.AppendPath(circuitName, true);
 0613            uri.AppendPath("/peerings/", false);
 0614            uri.AppendPath(peeringName, true);
 0615            uri.AppendPath("/routeTablesSummary/", false);
 0616            uri.AppendPath(devicePath, true);
 0617            uri.AppendQuery("api-version", "2020-04-01", true);
 0618            request.Uri = uri;
 0619            return message;
 620        }
 621
 622        /// <summary> Gets the currently advertised routes table summary associated with the express route circuit in a 
 623        /// <param name="resourceGroupName"> The name of the resource group. </param>
 624        /// <param name="circuitName"> The name of the express route circuit. </param>
 625        /// <param name="peeringName"> The name of the peering. </param>
 626        /// <param name="devicePath"> The path of the device. </param>
 627        /// <param name="cancellationToken"> The cancellation token to use. </param>
 628        public async Task<Response> ListRoutesTableSummaryAsync(string resourceGroupName, string circuitName, string pee
 629        {
 0630            if (resourceGroupName == null)
 631            {
 0632                throw new ArgumentNullException(nameof(resourceGroupName));
 633            }
 0634            if (circuitName == null)
 635            {
 0636                throw new ArgumentNullException(nameof(circuitName));
 637            }
 0638            if (peeringName == null)
 639            {
 0640                throw new ArgumentNullException(nameof(peeringName));
 641            }
 0642            if (devicePath == null)
 643            {
 0644                throw new ArgumentNullException(nameof(devicePath));
 645            }
 646
 0647            using var message = CreateListRoutesTableSummaryRequest(resourceGroupName, circuitName, peeringName, deviceP
 0648            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0649            switch (message.Response.Status)
 650            {
 651                case 200:
 652                case 202:
 0653                    return message.Response;
 654                default:
 0655                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 656            }
 0657        }
 658
 659        /// <summary> Gets the currently advertised routes table summary associated with the express route circuit in a 
 660        /// <param name="resourceGroupName"> The name of the resource group. </param>
 661        /// <param name="circuitName"> The name of the express route circuit. </param>
 662        /// <param name="peeringName"> The name of the peering. </param>
 663        /// <param name="devicePath"> The path of the device. </param>
 664        /// <param name="cancellationToken"> The cancellation token to use. </param>
 665        public Response ListRoutesTableSummary(string resourceGroupName, string circuitName, string peeringName, string 
 666        {
 0667            if (resourceGroupName == null)
 668            {
 0669                throw new ArgumentNullException(nameof(resourceGroupName));
 670            }
 0671            if (circuitName == null)
 672            {
 0673                throw new ArgumentNullException(nameof(circuitName));
 674            }
 0675            if (peeringName == null)
 676            {
 0677                throw new ArgumentNullException(nameof(peeringName));
 678            }
 0679            if (devicePath == null)
 680            {
 0681                throw new ArgumentNullException(nameof(devicePath));
 682            }
 683
 0684            using var message = CreateListRoutesTableSummaryRequest(resourceGroupName, circuitName, peeringName, deviceP
 0685            _pipeline.Send(message, cancellationToken);
 0686            switch (message.Response.Status)
 687            {
 688                case 200:
 689                case 202:
 0690                    return message.Response;
 691                default:
 0692                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 693            }
 0694        }
 695
 696        internal HttpMessage CreateGetStatsRequest(string resourceGroupName, string circuitName)
 697        {
 0698            var message = _pipeline.CreateMessage();
 0699            var request = message.Request;
 0700            request.Method = RequestMethod.Get;
 0701            var uri = new RawRequestUriBuilder();
 0702            uri.Reset(endpoint);
 0703            uri.AppendPath("/subscriptions/", false);
 0704            uri.AppendPath(subscriptionId, true);
 0705            uri.AppendPath("/resourceGroups/", false);
 0706            uri.AppendPath(resourceGroupName, true);
 0707            uri.AppendPath("/providers/Microsoft.Network/expressRouteCircuits/", false);
 0708            uri.AppendPath(circuitName, true);
 0709            uri.AppendPath("/stats", false);
 0710            uri.AppendQuery("api-version", "2020-04-01", true);
 0711            request.Uri = uri;
 0712            return message;
 713        }
 714
 715        /// <summary> Gets all the stats from an express route circuit in a resource group. </summary>
 716        /// <param name="resourceGroupName"> The name of the resource group. </param>
 717        /// <param name="circuitName"> The name of the express route circuit. </param>
 718        /// <param name="cancellationToken"> The cancellation token to use. </param>
 719        public async Task<Response<ExpressRouteCircuitStats>> GetStatsAsync(string resourceGroupName, string circuitName
 720        {
 0721            if (resourceGroupName == null)
 722            {
 0723                throw new ArgumentNullException(nameof(resourceGroupName));
 724            }
 0725            if (circuitName == null)
 726            {
 0727                throw new ArgumentNullException(nameof(circuitName));
 728            }
 729
 0730            using var message = CreateGetStatsRequest(resourceGroupName, circuitName);
 0731            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0732            switch (message.Response.Status)
 733            {
 734                case 200:
 735                    {
 0736                        ExpressRouteCircuitStats value = default;
 0737                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0738                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 739                        {
 0740                            value = null;
 741                        }
 742                        else
 743                        {
 0744                            value = ExpressRouteCircuitStats.DeserializeExpressRouteCircuitStats(document.RootElement);
 745                        }
 0746                        return Response.FromValue(value, message.Response);
 747                    }
 748                default:
 0749                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 750            }
 0751        }
 752
 753        /// <summary> Gets all the stats from an express route circuit in a resource group. </summary>
 754        /// <param name="resourceGroupName"> The name of the resource group. </param>
 755        /// <param name="circuitName"> The name of the express route circuit. </param>
 756        /// <param name="cancellationToken"> The cancellation token to use. </param>
 757        public Response<ExpressRouteCircuitStats> GetStats(string resourceGroupName, string circuitName, CancellationTok
 758        {
 0759            if (resourceGroupName == null)
 760            {
 0761                throw new ArgumentNullException(nameof(resourceGroupName));
 762            }
 0763            if (circuitName == null)
 764            {
 0765                throw new ArgumentNullException(nameof(circuitName));
 766            }
 767
 0768            using var message = CreateGetStatsRequest(resourceGroupName, circuitName);
 0769            _pipeline.Send(message, cancellationToken);
 0770            switch (message.Response.Status)
 771            {
 772                case 200:
 773                    {
 0774                        ExpressRouteCircuitStats value = default;
 0775                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0776                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 777                        {
 0778                            value = null;
 779                        }
 780                        else
 781                        {
 0782                            value = ExpressRouteCircuitStats.DeserializeExpressRouteCircuitStats(document.RootElement);
 783                        }
 0784                        return Response.FromValue(value, message.Response);
 785                    }
 786                default:
 0787                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 788            }
 0789        }
 790
 791        internal HttpMessage CreateGetPeeringStatsRequest(string resourceGroupName, string circuitName, string peeringNa
 792        {
 0793            var message = _pipeline.CreateMessage();
 0794            var request = message.Request;
 0795            request.Method = RequestMethod.Get;
 0796            var uri = new RawRequestUriBuilder();
 0797            uri.Reset(endpoint);
 0798            uri.AppendPath("/subscriptions/", false);
 0799            uri.AppendPath(subscriptionId, true);
 0800            uri.AppendPath("/resourceGroups/", false);
 0801            uri.AppendPath(resourceGroupName, true);
 0802            uri.AppendPath("/providers/Microsoft.Network/expressRouteCircuits/", false);
 0803            uri.AppendPath(circuitName, true);
 0804            uri.AppendPath("/peerings/", false);
 0805            uri.AppendPath(peeringName, true);
 0806            uri.AppendPath("/stats", false);
 0807            uri.AppendQuery("api-version", "2020-04-01", true);
 0808            request.Uri = uri;
 0809            return message;
 810        }
 811
 812        /// <summary> Gets all stats from an express route circuit in a resource group. </summary>
 813        /// <param name="resourceGroupName"> The name of the resource group. </param>
 814        /// <param name="circuitName"> The name of the express route circuit. </param>
 815        /// <param name="peeringName"> The name of the peering. </param>
 816        /// <param name="cancellationToken"> The cancellation token to use. </param>
 817        public async Task<Response<ExpressRouteCircuitStats>> GetPeeringStatsAsync(string resourceGroupName, string circ
 818        {
 0819            if (resourceGroupName == null)
 820            {
 0821                throw new ArgumentNullException(nameof(resourceGroupName));
 822            }
 0823            if (circuitName == null)
 824            {
 0825                throw new ArgumentNullException(nameof(circuitName));
 826            }
 0827            if (peeringName == null)
 828            {
 0829                throw new ArgumentNullException(nameof(peeringName));
 830            }
 831
 0832            using var message = CreateGetPeeringStatsRequest(resourceGroupName, circuitName, peeringName);
 0833            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0834            switch (message.Response.Status)
 835            {
 836                case 200:
 837                    {
 0838                        ExpressRouteCircuitStats value = default;
 0839                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0840                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 841                        {
 0842                            value = null;
 843                        }
 844                        else
 845                        {
 0846                            value = ExpressRouteCircuitStats.DeserializeExpressRouteCircuitStats(document.RootElement);
 847                        }
 0848                        return Response.FromValue(value, message.Response);
 849                    }
 850                default:
 0851                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 852            }
 0853        }
 854
 855        /// <summary> Gets all stats from an express route circuit in a resource group. </summary>
 856        /// <param name="resourceGroupName"> The name of the resource group. </param>
 857        /// <param name="circuitName"> The name of the express route circuit. </param>
 858        /// <param name="peeringName"> The name of the peering. </param>
 859        /// <param name="cancellationToken"> The cancellation token to use. </param>
 860        public Response<ExpressRouteCircuitStats> GetPeeringStats(string resourceGroupName, string circuitName, string p
 861        {
 0862            if (resourceGroupName == null)
 863            {
 0864                throw new ArgumentNullException(nameof(resourceGroupName));
 865            }
 0866            if (circuitName == null)
 867            {
 0868                throw new ArgumentNullException(nameof(circuitName));
 869            }
 0870            if (peeringName == null)
 871            {
 0872                throw new ArgumentNullException(nameof(peeringName));
 873            }
 874
 0875            using var message = CreateGetPeeringStatsRequest(resourceGroupName, circuitName, peeringName);
 0876            _pipeline.Send(message, cancellationToken);
 0877            switch (message.Response.Status)
 878            {
 879                case 200:
 880                    {
 0881                        ExpressRouteCircuitStats value = default;
 0882                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0883                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 884                        {
 0885                            value = null;
 886                        }
 887                        else
 888                        {
 0889                            value = ExpressRouteCircuitStats.DeserializeExpressRouteCircuitStats(document.RootElement);
 890                        }
 0891                        return Response.FromValue(value, message.Response);
 892                    }
 893                default:
 0894                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 895            }
 0896        }
 897
 898        internal HttpMessage CreateListRequest(string resourceGroupName)
 899        {
 0900            var message = _pipeline.CreateMessage();
 0901            var request = message.Request;
 0902            request.Method = RequestMethod.Get;
 0903            var uri = new RawRequestUriBuilder();
 0904            uri.Reset(endpoint);
 0905            uri.AppendPath("/subscriptions/", false);
 0906            uri.AppendPath(subscriptionId, true);
 0907            uri.AppendPath("/resourceGroups/", false);
 0908            uri.AppendPath(resourceGroupName, true);
 0909            uri.AppendPath("/providers/Microsoft.Network/expressRouteCircuits", false);
 0910            uri.AppendQuery("api-version", "2020-04-01", true);
 0911            request.Uri = uri;
 0912            return message;
 913        }
 914
 915        /// <summary> Gets all the express route circuits in a resource group. </summary>
 916        /// <param name="resourceGroupName"> The name of the resource group. </param>
 917        /// <param name="cancellationToken"> The cancellation token to use. </param>
 918        public async Task<Response<ExpressRouteCircuitListResult>> ListAsync(string resourceGroupName, CancellationToken
 919        {
 0920            if (resourceGroupName == null)
 921            {
 0922                throw new ArgumentNullException(nameof(resourceGroupName));
 923            }
 924
 0925            using var message = CreateListRequest(resourceGroupName);
 0926            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0927            switch (message.Response.Status)
 928            {
 929                case 200:
 930                    {
 0931                        ExpressRouteCircuitListResult value = default;
 0932                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0933                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 934                        {
 0935                            value = null;
 936                        }
 937                        else
 938                        {
 0939                            value = ExpressRouteCircuitListResult.DeserializeExpressRouteCircuitListResult(document.Root
 940                        }
 0941                        return Response.FromValue(value, message.Response);
 942                    }
 943                default:
 0944                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 945            }
 0946        }
 947
 948        /// <summary> Gets all the express route circuits in a resource group. </summary>
 949        /// <param name="resourceGroupName"> The name of the resource group. </param>
 950        /// <param name="cancellationToken"> The cancellation token to use. </param>
 951        public Response<ExpressRouteCircuitListResult> List(string resourceGroupName, CancellationToken cancellationToke
 952        {
 0953            if (resourceGroupName == null)
 954            {
 0955                throw new ArgumentNullException(nameof(resourceGroupName));
 956            }
 957
 0958            using var message = CreateListRequest(resourceGroupName);
 0959            _pipeline.Send(message, cancellationToken);
 0960            switch (message.Response.Status)
 961            {
 962                case 200:
 963                    {
 0964                        ExpressRouteCircuitListResult value = default;
 0965                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0966                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 967                        {
 0968                            value = null;
 969                        }
 970                        else
 971                        {
 0972                            value = ExpressRouteCircuitListResult.DeserializeExpressRouteCircuitListResult(document.Root
 973                        }
 0974                        return Response.FromValue(value, message.Response);
 975                    }
 976                default:
 0977                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 978            }
 0979        }
 980
 981        internal HttpMessage CreateListAllRequest()
 982        {
 0983            var message = _pipeline.CreateMessage();
 0984            var request = message.Request;
 0985            request.Method = RequestMethod.Get;
 0986            var uri = new RawRequestUriBuilder();
 0987            uri.Reset(endpoint);
 0988            uri.AppendPath("/subscriptions/", false);
 0989            uri.AppendPath(subscriptionId, true);
 0990            uri.AppendPath("/providers/Microsoft.Network/expressRouteCircuits", false);
 0991            uri.AppendQuery("api-version", "2020-04-01", true);
 0992            request.Uri = uri;
 0993            return message;
 994        }
 995
 996        /// <summary> Gets all the express route circuits in a subscription. </summary>
 997        /// <param name="cancellationToken"> The cancellation token to use. </param>
 998        public async Task<Response<ExpressRouteCircuitListResult>> ListAllAsync(CancellationToken cancellationToken = de
 999        {
 01000            using var message = CreateListAllRequest();
 01001            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01002            switch (message.Response.Status)
 1003            {
 1004                case 200:
 1005                    {
 01006                        ExpressRouteCircuitListResult value = default;
 01007                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 01008                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1009                        {
 01010                            value = null;
 1011                        }
 1012                        else
 1013                        {
 01014                            value = ExpressRouteCircuitListResult.DeserializeExpressRouteCircuitListResult(document.Root
 1015                        }
 01016                        return Response.FromValue(value, message.Response);
 1017                    }
 1018                default:
 01019                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1020            }
 01021        }
 1022
 1023        /// <summary> Gets all the express route circuits in a subscription. </summary>
 1024        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1025        public Response<ExpressRouteCircuitListResult> ListAll(CancellationToken cancellationToken = default)
 1026        {
 01027            using var message = CreateListAllRequest();
 01028            _pipeline.Send(message, cancellationToken);
 01029            switch (message.Response.Status)
 1030            {
 1031                case 200:
 1032                    {
 01033                        ExpressRouteCircuitListResult value = default;
 01034                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01035                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1036                        {
 01037                            value = null;
 1038                        }
 1039                        else
 1040                        {
 01041                            value = ExpressRouteCircuitListResult.DeserializeExpressRouteCircuitListResult(document.Root
 1042                        }
 01043                        return Response.FromValue(value, message.Response);
 1044                    }
 1045                default:
 01046                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1047            }
 01048        }
 1049
 1050        internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName)
 1051        {
 01052            var message = _pipeline.CreateMessage();
 01053            var request = message.Request;
 01054            request.Method = RequestMethod.Get;
 01055            var uri = new RawRequestUriBuilder();
 01056            uri.Reset(endpoint);
 01057            uri.AppendRawNextLink(nextLink, false);
 01058            request.Uri = uri;
 01059            return message;
 1060        }
 1061
 1062        /// <summary> Gets all the express route circuits in a resource group. </summary>
 1063        /// <param name="nextLink"> The URL to the next page of results. </param>
 1064        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1065        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1066        public async Task<Response<ExpressRouteCircuitListResult>> ListNextPageAsync(string nextLink, string resourceGro
 1067        {
 01068            if (nextLink == null)
 1069            {
 01070                throw new ArgumentNullException(nameof(nextLink));
 1071            }
 01072            if (resourceGroupName == null)
 1073            {
 01074                throw new ArgumentNullException(nameof(resourceGroupName));
 1075            }
 1076
 01077            using var message = CreateListNextPageRequest(nextLink, resourceGroupName);
 01078            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01079            switch (message.Response.Status)
 1080            {
 1081                case 200:
 1082                    {
 01083                        ExpressRouteCircuitListResult value = default;
 01084                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 01085                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1086                        {
 01087                            value = null;
 1088                        }
 1089                        else
 1090                        {
 01091                            value = ExpressRouteCircuitListResult.DeserializeExpressRouteCircuitListResult(document.Root
 1092                        }
 01093                        return Response.FromValue(value, message.Response);
 1094                    }
 1095                default:
 01096                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1097            }
 01098        }
 1099
 1100        /// <summary> Gets all the express route circuits in a resource group. </summary>
 1101        /// <param name="nextLink"> The URL to the next page of results. </param>
 1102        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1103        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1104        public Response<ExpressRouteCircuitListResult> ListNextPage(string nextLink, string resourceGroupName, Cancellat
 1105        {
 01106            if (nextLink == null)
 1107            {
 01108                throw new ArgumentNullException(nameof(nextLink));
 1109            }
 01110            if (resourceGroupName == null)
 1111            {
 01112                throw new ArgumentNullException(nameof(resourceGroupName));
 1113            }
 1114
 01115            using var message = CreateListNextPageRequest(nextLink, resourceGroupName);
 01116            _pipeline.Send(message, cancellationToken);
 01117            switch (message.Response.Status)
 1118            {
 1119                case 200:
 1120                    {
 01121                        ExpressRouteCircuitListResult value = default;
 01122                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01123                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1124                        {
 01125                            value = null;
 1126                        }
 1127                        else
 1128                        {
 01129                            value = ExpressRouteCircuitListResult.DeserializeExpressRouteCircuitListResult(document.Root
 1130                        }
 01131                        return Response.FromValue(value, message.Response);
 1132                    }
 1133                default:
 01134                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1135            }
 01136        }
 1137
 1138        internal HttpMessage CreateListAllNextPageRequest(string nextLink)
 1139        {
 01140            var message = _pipeline.CreateMessage();
 01141            var request = message.Request;
 01142            request.Method = RequestMethod.Get;
 01143            var uri = new RawRequestUriBuilder();
 01144            uri.Reset(endpoint);
 01145            uri.AppendRawNextLink(nextLink, false);
 01146            request.Uri = uri;
 01147            return message;
 1148        }
 1149
 1150        /// <summary> Gets all the express route circuits in a subscription. </summary>
 1151        /// <param name="nextLink"> The URL to the next page of results. </param>
 1152        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1153        public async Task<Response<ExpressRouteCircuitListResult>> ListAllNextPageAsync(string nextLink, CancellationTok
 1154        {
 01155            if (nextLink == null)
 1156            {
 01157                throw new ArgumentNullException(nameof(nextLink));
 1158            }
 1159
 01160            using var message = CreateListAllNextPageRequest(nextLink);
 01161            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01162            switch (message.Response.Status)
 1163            {
 1164                case 200:
 1165                    {
 01166                        ExpressRouteCircuitListResult value = default;
 01167                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 01168                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1169                        {
 01170                            value = null;
 1171                        }
 1172                        else
 1173                        {
 01174                            value = ExpressRouteCircuitListResult.DeserializeExpressRouteCircuitListResult(document.Root
 1175                        }
 01176                        return Response.FromValue(value, message.Response);
 1177                    }
 1178                default:
 01179                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1180            }
 01181        }
 1182
 1183        /// <summary> Gets all the express route circuits in a subscription. </summary>
 1184        /// <param name="nextLink"> The URL to the next page of results. </param>
 1185        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1186        public Response<ExpressRouteCircuitListResult> ListAllNextPage(string nextLink, CancellationToken cancellationTo
 1187        {
 01188            if (nextLink == null)
 1189            {
 01190                throw new ArgumentNullException(nameof(nextLink));
 1191            }
 1192
 01193            using var message = CreateListAllNextPageRequest(nextLink);
 01194            _pipeline.Send(message, cancellationToken);
 01195            switch (message.Response.Status)
 1196            {
 1197                case 200:
 1198                    {
 01199                        ExpressRouteCircuitListResult value = default;
 01200                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01201                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1202                        {
 01203                            value = null;
 1204                        }
 1205                        else
 1206                        {
 01207                            value = ExpressRouteCircuitListResult.DeserializeExpressRouteCircuitListResult(document.Root
 1208                        }
 01209                        return Response.FromValue(value, message.Response);
 1210                    }
 1211                default:
 01212                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1213            }
 01214        }
 1215    }
 1216}