< Summary

Class:Azure.ResourceManager.Network.RouteTablesRestOperations
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\RouteTablesRestOperations.cs
Covered lines:140
Uncovered lines:187
Coverable lines:327
Total lines:732
Line coverage:42.8% (140 of 327)
Covered branches:35
Total branches:126
Branch coverage:27.7% (35 of 126)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-88.89%50%
CreateDeleteRequest(...)-100%100%
DeleteAsync()-70%50%
Delete(...)-70%50%
CreateGetRequest(...)-93.75%50%
GetAsync()-73.33%50%
Get(...)-73.33%50%
CreateCreateOrUpdateRequest(...)-100%100%
CreateOrUpdateAsync()-66.67%50%
CreateOrUpdate(...)-66.67%50%
CreateUpdateTagsRequest(...)-0%100%
UpdateTagsAsync()-0%0%
UpdateTags(...)-0%0%
CreateListRequest(...)-100%100%
ListAsync()-76.92%50%
List(...)-76.92%50%
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\RouteTablesRestOperations.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 RouteTablesRestOperations
 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 RouteTablesRestOperations. </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
 10832        public RouteTablesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscription
 33        {
 10834            if (subscriptionId == null)
 35            {
 036                throw new ArgumentNullException(nameof(subscriptionId));
 37            }
 10838            endpoint ??= new Uri("https://management.azure.com");
 39
 10840            this.subscriptionId = subscriptionId;
 10841            this.endpoint = endpoint;
 10842            _clientDiagnostics = clientDiagnostics;
 10843            _pipeline = pipeline;
 10844        }
 45
 46        internal HttpMessage CreateDeleteRequest(string resourceGroupName, string routeTableName)
 47        {
 3248            var message = _pipeline.CreateMessage();
 3249            var request = message.Request;
 3250            request.Method = RequestMethod.Delete;
 3251            var uri = new RawRequestUriBuilder();
 3252            uri.Reset(endpoint);
 3253            uri.AppendPath("/subscriptions/", false);
 3254            uri.AppendPath(subscriptionId, true);
 3255            uri.AppendPath("/resourceGroups/", false);
 3256            uri.AppendPath(resourceGroupName, true);
 3257            uri.AppendPath("/providers/Microsoft.Network/routeTables/", false);
 3258            uri.AppendPath(routeTableName, true);
 3259            uri.AppendQuery("api-version", "2020-04-01", true);
 3260            request.Uri = uri;
 3261            return message;
 62        }
 63
 64        /// <summary> Deletes the specified route table. </summary>
 65        /// <param name="resourceGroupName"> The name of the resource group. </param>
 66        /// <param name="routeTableName"> The name of the route table. </param>
 67        /// <param name="cancellationToken"> The cancellation token to use. </param>
 68        public async Task<Response> DeleteAsync(string resourceGroupName, string routeTableName, CancellationToken cance
 69        {
 870            if (resourceGroupName == null)
 71            {
 072                throw new ArgumentNullException(nameof(resourceGroupName));
 73            }
 874            if (routeTableName == null)
 75            {
 076                throw new ArgumentNullException(nameof(routeTableName));
 77            }
 78
 879            using var message = CreateDeleteRequest(resourceGroupName, routeTableName);
 880            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 881            switch (message.Response.Status)
 82            {
 83                case 200:
 84                case 202:
 85                case 204:
 886                    return message.Response;
 87                default:
 088                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 89            }
 890        }
 91
 92        /// <summary> Deletes the specified route table. </summary>
 93        /// <param name="resourceGroupName"> The name of the resource group. </param>
 94        /// <param name="routeTableName"> The name of the route table. </param>
 95        /// <param name="cancellationToken"> The cancellation token to use. </param>
 96        public Response Delete(string resourceGroupName, string routeTableName, CancellationToken cancellationToken = de
 97        {
 898            if (resourceGroupName == null)
 99            {
 0100                throw new ArgumentNullException(nameof(resourceGroupName));
 101            }
 8102            if (routeTableName == null)
 103            {
 0104                throw new ArgumentNullException(nameof(routeTableName));
 105            }
 106
 8107            using var message = CreateDeleteRequest(resourceGroupName, routeTableName);
 8108            _pipeline.Send(message, cancellationToken);
 8109            switch (message.Response.Status)
 110            {
 111                case 200:
 112                case 202:
 113                case 204:
 8114                    return message.Response;
 115                default:
 0116                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 117            }
 8118        }
 119
 120        internal HttpMessage CreateGetRequest(string resourceGroupName, string routeTableName, string expand)
 121        {
 44122            var message = _pipeline.CreateMessage();
 44123            var request = message.Request;
 44124            request.Method = RequestMethod.Get;
 44125            var uri = new RawRequestUriBuilder();
 44126            uri.Reset(endpoint);
 44127            uri.AppendPath("/subscriptions/", false);
 44128            uri.AppendPath(subscriptionId, true);
 44129            uri.AppendPath("/resourceGroups/", false);
 44130            uri.AppendPath(resourceGroupName, true);
 44131            uri.AppendPath("/providers/Microsoft.Network/routeTables/", false);
 44132            uri.AppendPath(routeTableName, true);
 44133            uri.AppendQuery("api-version", "2020-04-01", true);
 44134            if (expand != null)
 135            {
 0136                uri.AppendQuery("$expand", expand, true);
 137            }
 44138            request.Uri = uri;
 44139            return message;
 140        }
 141
 142        /// <summary> Gets the specified route table. </summary>
 143        /// <param name="resourceGroupName"> The name of the resource group. </param>
 144        /// <param name="routeTableName"> The name of the route table. </param>
 145        /// <param name="expand"> Expands referenced resources. </param>
 146        /// <param name="cancellationToken"> The cancellation token to use. </param>
 147        public async Task<Response<RouteTable>> GetAsync(string resourceGroupName, string routeTableName, string expand 
 148        {
 22149            if (resourceGroupName == null)
 150            {
 0151                throw new ArgumentNullException(nameof(resourceGroupName));
 152            }
 22153            if (routeTableName == null)
 154            {
 0155                throw new ArgumentNullException(nameof(routeTableName));
 156            }
 157
 22158            using var message = CreateGetRequest(resourceGroupName, routeTableName, expand);
 22159            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 22160            switch (message.Response.Status)
 161            {
 162                case 200:
 163                    {
 22164                        RouteTable value = default;
 22165                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 22166                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 167                        {
 0168                            value = null;
 169                        }
 170                        else
 171                        {
 22172                            value = RouteTable.DeserializeRouteTable(document.RootElement);
 173                        }
 22174                        return Response.FromValue(value, message.Response);
 175                    }
 176                default:
 0177                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 178            }
 22179        }
 180
 181        /// <summary> Gets the specified route table. </summary>
 182        /// <param name="resourceGroupName"> The name of the resource group. </param>
 183        /// <param name="routeTableName"> The name of the route table. </param>
 184        /// <param name="expand"> Expands referenced resources. </param>
 185        /// <param name="cancellationToken"> The cancellation token to use. </param>
 186        public Response<RouteTable> Get(string resourceGroupName, string routeTableName, string expand = null, Cancellat
 187        {
 22188            if (resourceGroupName == null)
 189            {
 0190                throw new ArgumentNullException(nameof(resourceGroupName));
 191            }
 22192            if (routeTableName == null)
 193            {
 0194                throw new ArgumentNullException(nameof(routeTableName));
 195            }
 196
 22197            using var message = CreateGetRequest(resourceGroupName, routeTableName, expand);
 22198            _pipeline.Send(message, cancellationToken);
 22199            switch (message.Response.Status)
 200            {
 201                case 200:
 202                    {
 22203                        RouteTable value = default;
 22204                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 22205                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 206                        {
 0207                            value = null;
 208                        }
 209                        else
 210                        {
 22211                            value = RouteTable.DeserializeRouteTable(document.RootElement);
 212                        }
 22213                        return Response.FromValue(value, message.Response);
 214                    }
 215                default:
 0216                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 217            }
 22218        }
 219
 220        internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string routeTableName, RouteTable par
 221        {
 56222            var message = _pipeline.CreateMessage();
 56223            var request = message.Request;
 56224            request.Method = RequestMethod.Put;
 56225            var uri = new RawRequestUriBuilder();
 56226            uri.Reset(endpoint);
 56227            uri.AppendPath("/subscriptions/", false);
 56228            uri.AppendPath(subscriptionId, true);
 56229            uri.AppendPath("/resourceGroups/", false);
 56230            uri.AppendPath(resourceGroupName, true);
 56231            uri.AppendPath("/providers/Microsoft.Network/routeTables/", false);
 56232            uri.AppendPath(routeTableName, true);
 56233            uri.AppendQuery("api-version", "2020-04-01", true);
 56234            request.Uri = uri;
 56235            request.Headers.Add("Content-Type", "application/json");
 56236            var content = new Utf8JsonRequestContent();
 56237            content.JsonWriter.WriteObjectValue(parameters);
 56238            request.Content = content;
 56239            return message;
 240        }
 241
 242        /// <summary> Create or updates a route table in a specified resource group. </summary>
 243        /// <param name="resourceGroupName"> The name of the resource group. </param>
 244        /// <param name="routeTableName"> The name of the route table. </param>
 245        /// <param name="parameters"> Parameters supplied to the create or update route table operation. </param>
 246        /// <param name="cancellationToken"> The cancellation token to use. </param>
 247        public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string routeTableName, RouteTable para
 248        {
 14249            if (resourceGroupName == null)
 250            {
 0251                throw new ArgumentNullException(nameof(resourceGroupName));
 252            }
 14253            if (routeTableName == null)
 254            {
 0255                throw new ArgumentNullException(nameof(routeTableName));
 256            }
 14257            if (parameters == null)
 258            {
 0259                throw new ArgumentNullException(nameof(parameters));
 260            }
 261
 14262            using var message = CreateCreateOrUpdateRequest(resourceGroupName, routeTableName, parameters);
 14263            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 14264            switch (message.Response.Status)
 265            {
 266                case 200:
 267                case 201:
 14268                    return message.Response;
 269                default:
 0270                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 271            }
 14272        }
 273
 274        /// <summary> Create or updates a route table in a specified resource group. </summary>
 275        /// <param name="resourceGroupName"> The name of the resource group. </param>
 276        /// <param name="routeTableName"> The name of the route table. </param>
 277        /// <param name="parameters"> Parameters supplied to the create or update route table operation. </param>
 278        /// <param name="cancellationToken"> The cancellation token to use. </param>
 279        public Response CreateOrUpdate(string resourceGroupName, string routeTableName, RouteTable parameters, Cancellat
 280        {
 14281            if (resourceGroupName == null)
 282            {
 0283                throw new ArgumentNullException(nameof(resourceGroupName));
 284            }
 14285            if (routeTableName == null)
 286            {
 0287                throw new ArgumentNullException(nameof(routeTableName));
 288            }
 14289            if (parameters == null)
 290            {
 0291                throw new ArgumentNullException(nameof(parameters));
 292            }
 293
 14294            using var message = CreateCreateOrUpdateRequest(resourceGroupName, routeTableName, parameters);
 14295            _pipeline.Send(message, cancellationToken);
 14296            switch (message.Response.Status)
 297            {
 298                case 200:
 299                case 201:
 14300                    return message.Response;
 301                default:
 0302                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 303            }
 14304        }
 305
 306        internal HttpMessage CreateUpdateTagsRequest(string resourceGroupName, string routeTableName, TagsObject paramet
 307        {
 0308            var message = _pipeline.CreateMessage();
 0309            var request = message.Request;
 0310            request.Method = RequestMethod.Patch;
 0311            var uri = new RawRequestUriBuilder();
 0312            uri.Reset(endpoint);
 0313            uri.AppendPath("/subscriptions/", false);
 0314            uri.AppendPath(subscriptionId, true);
 0315            uri.AppendPath("/resourceGroups/", false);
 0316            uri.AppendPath(resourceGroupName, true);
 0317            uri.AppendPath("/providers/Microsoft.Network/routeTables/", false);
 0318            uri.AppendPath(routeTableName, true);
 0319            uri.AppendQuery("api-version", "2020-04-01", true);
 0320            request.Uri = uri;
 0321            request.Headers.Add("Content-Type", "application/json");
 0322            var content = new Utf8JsonRequestContent();
 0323            content.JsonWriter.WriteObjectValue(parameters);
 0324            request.Content = content;
 0325            return message;
 326        }
 327
 328        /// <summary> Updates a route table tags. </summary>
 329        /// <param name="resourceGroupName"> The name of the resource group. </param>
 330        /// <param name="routeTableName"> The name of the route table. </param>
 331        /// <param name="parameters"> Parameters supplied to update route table tags. </param>
 332        /// <param name="cancellationToken"> The cancellation token to use. </param>
 333        public async Task<Response<RouteTable>> UpdateTagsAsync(string resourceGroupName, string routeTableName, TagsObj
 334        {
 0335            if (resourceGroupName == null)
 336            {
 0337                throw new ArgumentNullException(nameof(resourceGroupName));
 338            }
 0339            if (routeTableName == null)
 340            {
 0341                throw new ArgumentNullException(nameof(routeTableName));
 342            }
 0343            if (parameters == null)
 344            {
 0345                throw new ArgumentNullException(nameof(parameters));
 346            }
 347
 0348            using var message = CreateUpdateTagsRequest(resourceGroupName, routeTableName, parameters);
 0349            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0350            switch (message.Response.Status)
 351            {
 352                case 200:
 353                    {
 0354                        RouteTable value = default;
 0355                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0356                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 357                        {
 0358                            value = null;
 359                        }
 360                        else
 361                        {
 0362                            value = RouteTable.DeserializeRouteTable(document.RootElement);
 363                        }
 0364                        return Response.FromValue(value, message.Response);
 365                    }
 366                default:
 0367                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 368            }
 0369        }
 370
 371        /// <summary> Updates a route table tags. </summary>
 372        /// <param name="resourceGroupName"> The name of the resource group. </param>
 373        /// <param name="routeTableName"> The name of the route table. </param>
 374        /// <param name="parameters"> Parameters supplied to update route table tags. </param>
 375        /// <param name="cancellationToken"> The cancellation token to use. </param>
 376        public Response<RouteTable> UpdateTags(string resourceGroupName, string routeTableName, TagsObject parameters, C
 377        {
 0378            if (resourceGroupName == null)
 379            {
 0380                throw new ArgumentNullException(nameof(resourceGroupName));
 381            }
 0382            if (routeTableName == null)
 383            {
 0384                throw new ArgumentNullException(nameof(routeTableName));
 385            }
 0386            if (parameters == null)
 387            {
 0388                throw new ArgumentNullException(nameof(parameters));
 389            }
 390
 0391            using var message = CreateUpdateTagsRequest(resourceGroupName, routeTableName, parameters);
 0392            _pipeline.Send(message, cancellationToken);
 0393            switch (message.Response.Status)
 394            {
 395                case 200:
 396                    {
 0397                        RouteTable value = default;
 0398                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0399                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 400                        {
 0401                            value = null;
 402                        }
 403                        else
 404                        {
 0405                            value = RouteTable.DeserializeRouteTable(document.RootElement);
 406                        }
 0407                        return Response.FromValue(value, message.Response);
 408                    }
 409                default:
 0410                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 411            }
 0412        }
 413
 414        internal HttpMessage CreateListRequest(string resourceGroupName)
 415        {
 20416            var message = _pipeline.CreateMessage();
 20417            var request = message.Request;
 20418            request.Method = RequestMethod.Get;
 20419            var uri = new RawRequestUriBuilder();
 20420            uri.Reset(endpoint);
 20421            uri.AppendPath("/subscriptions/", false);
 20422            uri.AppendPath(subscriptionId, true);
 20423            uri.AppendPath("/resourceGroups/", false);
 20424            uri.AppendPath(resourceGroupName, true);
 20425            uri.AppendPath("/providers/Microsoft.Network/routeTables", false);
 20426            uri.AppendQuery("api-version", "2020-04-01", true);
 20427            request.Uri = uri;
 20428            return message;
 429        }
 430
 431        /// <summary> Gets all route tables in a resource group. </summary>
 432        /// <param name="resourceGroupName"> The name of the resource group. </param>
 433        /// <param name="cancellationToken"> The cancellation token to use. </param>
 434        public async Task<Response<RouteTableListResult>> ListAsync(string resourceGroupName, CancellationToken cancella
 435        {
 10436            if (resourceGroupName == null)
 437            {
 0438                throw new ArgumentNullException(nameof(resourceGroupName));
 439            }
 440
 10441            using var message = CreateListRequest(resourceGroupName);
 10442            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 10443            switch (message.Response.Status)
 444            {
 445                case 200:
 446                    {
 10447                        RouteTableListResult value = default;
 10448                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 10449                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 450                        {
 0451                            value = null;
 452                        }
 453                        else
 454                        {
 10455                            value = RouteTableListResult.DeserializeRouteTableListResult(document.RootElement);
 456                        }
 10457                        return Response.FromValue(value, message.Response);
 458                    }
 459                default:
 0460                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 461            }
 10462        }
 463
 464        /// <summary> Gets all route tables in a resource group. </summary>
 465        /// <param name="resourceGroupName"> The name of the resource group. </param>
 466        /// <param name="cancellationToken"> The cancellation token to use. </param>
 467        public Response<RouteTableListResult> List(string resourceGroupName, CancellationToken cancellationToken = defau
 468        {
 10469            if (resourceGroupName == null)
 470            {
 0471                throw new ArgumentNullException(nameof(resourceGroupName));
 472            }
 473
 10474            using var message = CreateListRequest(resourceGroupName);
 10475            _pipeline.Send(message, cancellationToken);
 10476            switch (message.Response.Status)
 477            {
 478                case 200:
 479                    {
 10480                        RouteTableListResult value = default;
 10481                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 10482                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 483                        {
 0484                            value = null;
 485                        }
 486                        else
 487                        {
 10488                            value = RouteTableListResult.DeserializeRouteTableListResult(document.RootElement);
 489                        }
 10490                        return Response.FromValue(value, message.Response);
 491                    }
 492                default:
 0493                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 494            }
 10495        }
 496
 497        internal HttpMessage CreateListAllRequest()
 498        {
 0499            var message = _pipeline.CreateMessage();
 0500            var request = message.Request;
 0501            request.Method = RequestMethod.Get;
 0502            var uri = new RawRequestUriBuilder();
 0503            uri.Reset(endpoint);
 0504            uri.AppendPath("/subscriptions/", false);
 0505            uri.AppendPath(subscriptionId, true);
 0506            uri.AppendPath("/providers/Microsoft.Network/routeTables", false);
 0507            uri.AppendQuery("api-version", "2020-04-01", true);
 0508            request.Uri = uri;
 0509            return message;
 510        }
 511
 512        /// <summary> Gets all route tables in a subscription. </summary>
 513        /// <param name="cancellationToken"> The cancellation token to use. </param>
 514        public async Task<Response<RouteTableListResult>> ListAllAsync(CancellationToken cancellationToken = default)
 515        {
 0516            using var message = CreateListAllRequest();
 0517            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0518            switch (message.Response.Status)
 519            {
 520                case 200:
 521                    {
 0522                        RouteTableListResult value = default;
 0523                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0524                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 525                        {
 0526                            value = null;
 527                        }
 528                        else
 529                        {
 0530                            value = RouteTableListResult.DeserializeRouteTableListResult(document.RootElement);
 531                        }
 0532                        return Response.FromValue(value, message.Response);
 533                    }
 534                default:
 0535                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 536            }
 0537        }
 538
 539        /// <summary> Gets all route tables in a subscription. </summary>
 540        /// <param name="cancellationToken"> The cancellation token to use. </param>
 541        public Response<RouteTableListResult> ListAll(CancellationToken cancellationToken = default)
 542        {
 0543            using var message = CreateListAllRequest();
 0544            _pipeline.Send(message, cancellationToken);
 0545            switch (message.Response.Status)
 546            {
 547                case 200:
 548                    {
 0549                        RouteTableListResult value = default;
 0550                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0551                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 552                        {
 0553                            value = null;
 554                        }
 555                        else
 556                        {
 0557                            value = RouteTableListResult.DeserializeRouteTableListResult(document.RootElement);
 558                        }
 0559                        return Response.FromValue(value, message.Response);
 560                    }
 561                default:
 0562                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 563            }
 0564        }
 565
 566        internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName)
 567        {
 0568            var message = _pipeline.CreateMessage();
 0569            var request = message.Request;
 0570            request.Method = RequestMethod.Get;
 0571            var uri = new RawRequestUriBuilder();
 0572            uri.Reset(endpoint);
 0573            uri.AppendRawNextLink(nextLink, false);
 0574            request.Uri = uri;
 0575            return message;
 576        }
 577
 578        /// <summary> Gets all route tables in a resource group. </summary>
 579        /// <param name="nextLink"> The URL to the next page of results. </param>
 580        /// <param name="resourceGroupName"> The name of the resource group. </param>
 581        /// <param name="cancellationToken"> The cancellation token to use. </param>
 582        public async Task<Response<RouteTableListResult>> ListNextPageAsync(string nextLink, string resourceGroupName, C
 583        {
 0584            if (nextLink == null)
 585            {
 0586                throw new ArgumentNullException(nameof(nextLink));
 587            }
 0588            if (resourceGroupName == null)
 589            {
 0590                throw new ArgumentNullException(nameof(resourceGroupName));
 591            }
 592
 0593            using var message = CreateListNextPageRequest(nextLink, resourceGroupName);
 0594            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0595            switch (message.Response.Status)
 596            {
 597                case 200:
 598                    {
 0599                        RouteTableListResult value = default;
 0600                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0601                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 602                        {
 0603                            value = null;
 604                        }
 605                        else
 606                        {
 0607                            value = RouteTableListResult.DeserializeRouteTableListResult(document.RootElement);
 608                        }
 0609                        return Response.FromValue(value, message.Response);
 610                    }
 611                default:
 0612                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 613            }
 0614        }
 615
 616        /// <summary> Gets all route tables in a resource group. </summary>
 617        /// <param name="nextLink"> The URL to the next page of results. </param>
 618        /// <param name="resourceGroupName"> The name of the resource group. </param>
 619        /// <param name="cancellationToken"> The cancellation token to use. </param>
 620        public Response<RouteTableListResult> ListNextPage(string nextLink, string resourceGroupName, CancellationToken 
 621        {
 0622            if (nextLink == null)
 623            {
 0624                throw new ArgumentNullException(nameof(nextLink));
 625            }
 0626            if (resourceGroupName == null)
 627            {
 0628                throw new ArgumentNullException(nameof(resourceGroupName));
 629            }
 630
 0631            using var message = CreateListNextPageRequest(nextLink, resourceGroupName);
 0632            _pipeline.Send(message, cancellationToken);
 0633            switch (message.Response.Status)
 634            {
 635                case 200:
 636                    {
 0637                        RouteTableListResult value = default;
 0638                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0639                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 640                        {
 0641                            value = null;
 642                        }
 643                        else
 644                        {
 0645                            value = RouteTableListResult.DeserializeRouteTableListResult(document.RootElement);
 646                        }
 0647                        return Response.FromValue(value, message.Response);
 648                    }
 649                default:
 0650                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 651            }
 0652        }
 653
 654        internal HttpMessage CreateListAllNextPageRequest(string nextLink)
 655        {
 0656            var message = _pipeline.CreateMessage();
 0657            var request = message.Request;
 0658            request.Method = RequestMethod.Get;
 0659            var uri = new RawRequestUriBuilder();
 0660            uri.Reset(endpoint);
 0661            uri.AppendRawNextLink(nextLink, false);
 0662            request.Uri = uri;
 0663            return message;
 664        }
 665
 666        /// <summary> Gets all route tables in a subscription. </summary>
 667        /// <param name="nextLink"> The URL to the next page of results. </param>
 668        /// <param name="cancellationToken"> The cancellation token to use. </param>
 669        public async Task<Response<RouteTableListResult>> ListAllNextPageAsync(string nextLink, CancellationToken cancel
 670        {
 0671            if (nextLink == null)
 672            {
 0673                throw new ArgumentNullException(nameof(nextLink));
 674            }
 675
 0676            using var message = CreateListAllNextPageRequest(nextLink);
 0677            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0678            switch (message.Response.Status)
 679            {
 680                case 200:
 681                    {
 0682                        RouteTableListResult value = default;
 0683                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0684                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 685                        {
 0686                            value = null;
 687                        }
 688                        else
 689                        {
 0690                            value = RouteTableListResult.DeserializeRouteTableListResult(document.RootElement);
 691                        }
 0692                        return Response.FromValue(value, message.Response);
 693                    }
 694                default:
 0695                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 696            }
 0697        }
 698
 699        /// <summary> Gets all route tables in a subscription. </summary>
 700        /// <param name="nextLink"> The URL to the next page of results. </param>
 701        /// <param name="cancellationToken"> The cancellation token to use. </param>
 702        public Response<RouteTableListResult> ListAllNextPage(string nextLink, CancellationToken cancellationToken = def
 703        {
 0704            if (nextLink == null)
 705            {
 0706                throw new ArgumentNullException(nameof(nextLink));
 707            }
 708
 0709            using var message = CreateListAllNextPageRequest(nextLink);
 0710            _pipeline.Send(message, cancellationToken);
 0711            switch (message.Response.Status)
 712            {
 713                case 200:
 714                    {
 0715                        RouteTableListResult value = default;
 0716                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0717                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 718                        {
 0719                            value = null;
 720                        }
 721                        else
 722                        {
 0723                            value = RouteTableListResult.DeserializeRouteTableListResult(document.RootElement);
 724                        }
 0725                        return Response.FromValue(value, message.Response);
 726                    }
 727                default:
 0728                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 729            }
 0730        }
 731    }
 732}