< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
CreateListRequest()-0%100%
ListAsync()-0%0%
List(...)-0%0%
CreateListByResourceGroupRequest(...)-0%100%
ListByResourceGroupAsync()-0%0%
ListByResourceGroup(...)-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%
CreateListRoutesTableSummaryRequest(...)-0%100%
ListRoutesTableSummaryAsync()-0%0%
ListRoutesTableSummary(...)-0%0%
CreateListRoutesTableRequest(...)-0%100%
ListRoutesTableAsync()-0%0%
ListRoutesTable(...)-0%0%
CreateListNextPageRequest(...)-0%100%
ListNextPageAsync()-0%0%
ListNextPage(...)-0%0%
CreateListByResourceGroupNextPageRequest(...)-0%100%
ListByResourceGroupNextPageAsync()-0%0%
ListByResourceGroupNextPage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\ExpressRouteCrossConnectionsRestOperations.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 ExpressRouteCrossConnectionsRestOperations
 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 ExpressRouteCrossConnectionsRestOperations. </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 ExpressRouteCrossConnectionsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, st
 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 CreateListRequest()
 47        {
 048            var message = _pipeline.CreateMessage();
 049            var request = message.Request;
 050            request.Method = RequestMethod.Get;
 051            var uri = new RawRequestUriBuilder();
 052            uri.Reset(endpoint);
 053            uri.AppendPath("/subscriptions/", false);
 054            uri.AppendPath(subscriptionId, true);
 055            uri.AppendPath("/providers/Microsoft.Network/expressRouteCrossConnections", false);
 056            uri.AppendQuery("api-version", "2020-04-01", true);
 057            request.Uri = uri;
 058            return message;
 59        }
 60
 61        /// <summary> Retrieves all the ExpressRouteCrossConnections in a subscription. </summary>
 62        /// <param name="cancellationToken"> The cancellation token to use. </param>
 63        public async Task<Response<ExpressRouteCrossConnectionListResult>> ListAsync(CancellationToken cancellationToken
 64        {
 065            using var message = CreateListRequest();
 066            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 067            switch (message.Response.Status)
 68            {
 69                case 200:
 70                    {
 071                        ExpressRouteCrossConnectionListResult value = default;
 072                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 073                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 74                        {
 075                            value = null;
 76                        }
 77                        else
 78                        {
 079                            value = ExpressRouteCrossConnectionListResult.DeserializeExpressRouteCrossConnectionListResu
 80                        }
 081                        return Response.FromValue(value, message.Response);
 82                    }
 83                default:
 084                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 85            }
 086        }
 87
 88        /// <summary> Retrieves all the ExpressRouteCrossConnections in a subscription. </summary>
 89        /// <param name="cancellationToken"> The cancellation token to use. </param>
 90        public Response<ExpressRouteCrossConnectionListResult> List(CancellationToken cancellationToken = default)
 91        {
 092            using var message = CreateListRequest();
 093            _pipeline.Send(message, cancellationToken);
 094            switch (message.Response.Status)
 95            {
 96                case 200:
 97                    {
 098                        ExpressRouteCrossConnectionListResult value = default;
 099                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0100                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 101                        {
 0102                            value = null;
 103                        }
 104                        else
 105                        {
 0106                            value = ExpressRouteCrossConnectionListResult.DeserializeExpressRouteCrossConnectionListResu
 107                        }
 0108                        return Response.FromValue(value, message.Response);
 109                    }
 110                default:
 0111                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 112            }
 0113        }
 114
 115        internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName)
 116        {
 0117            var message = _pipeline.CreateMessage();
 0118            var request = message.Request;
 0119            request.Method = RequestMethod.Get;
 0120            var uri = new RawRequestUriBuilder();
 0121            uri.Reset(endpoint);
 0122            uri.AppendPath("/subscriptions/", false);
 0123            uri.AppendPath(subscriptionId, true);
 0124            uri.AppendPath("/resourceGroups/", false);
 0125            uri.AppendPath(resourceGroupName, true);
 0126            uri.AppendPath("/providers/Microsoft.Network/expressRouteCrossConnections", false);
 0127            uri.AppendQuery("api-version", "2020-04-01", true);
 0128            request.Uri = uri;
 0129            return message;
 130        }
 131
 132        /// <summary> Retrieves all the ExpressRouteCrossConnections in a resource group. </summary>
 133        /// <param name="resourceGroupName"> The name of the resource group. </param>
 134        /// <param name="cancellationToken"> The cancellation token to use. </param>
 135        public async Task<Response<ExpressRouteCrossConnectionListResult>> ListByResourceGroupAsync(string resourceGroup
 136        {
 0137            if (resourceGroupName == null)
 138            {
 0139                throw new ArgumentNullException(nameof(resourceGroupName));
 140            }
 141
 0142            using var message = CreateListByResourceGroupRequest(resourceGroupName);
 0143            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0144            switch (message.Response.Status)
 145            {
 146                case 200:
 147                    {
 0148                        ExpressRouteCrossConnectionListResult value = default;
 0149                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0150                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 151                        {
 0152                            value = null;
 153                        }
 154                        else
 155                        {
 0156                            value = ExpressRouteCrossConnectionListResult.DeserializeExpressRouteCrossConnectionListResu
 157                        }
 0158                        return Response.FromValue(value, message.Response);
 159                    }
 160                default:
 0161                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 162            }
 0163        }
 164
 165        /// <summary> Retrieves all the ExpressRouteCrossConnections in a resource group. </summary>
 166        /// <param name="resourceGroupName"> The name of the resource group. </param>
 167        /// <param name="cancellationToken"> The cancellation token to use. </param>
 168        public Response<ExpressRouteCrossConnectionListResult> ListByResourceGroup(string resourceGroupName, Cancellatio
 169        {
 0170            if (resourceGroupName == null)
 171            {
 0172                throw new ArgumentNullException(nameof(resourceGroupName));
 173            }
 174
 0175            using var message = CreateListByResourceGroupRequest(resourceGroupName);
 0176            _pipeline.Send(message, cancellationToken);
 0177            switch (message.Response.Status)
 178            {
 179                case 200:
 180                    {
 0181                        ExpressRouteCrossConnectionListResult value = default;
 0182                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0183                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 184                        {
 0185                            value = null;
 186                        }
 187                        else
 188                        {
 0189                            value = ExpressRouteCrossConnectionListResult.DeserializeExpressRouteCrossConnectionListResu
 190                        }
 0191                        return Response.FromValue(value, message.Response);
 192                    }
 193                default:
 0194                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 195            }
 0196        }
 197
 198        internal HttpMessage CreateGetRequest(string resourceGroupName, string crossConnectionName)
 199        {
 0200            var message = _pipeline.CreateMessage();
 0201            var request = message.Request;
 0202            request.Method = RequestMethod.Get;
 0203            var uri = new RawRequestUriBuilder();
 0204            uri.Reset(endpoint);
 0205            uri.AppendPath("/subscriptions/", false);
 0206            uri.AppendPath(subscriptionId, true);
 0207            uri.AppendPath("/resourceGroups/", false);
 0208            uri.AppendPath(resourceGroupName, true);
 0209            uri.AppendPath("/providers/Microsoft.Network/expressRouteCrossConnections/", false);
 0210            uri.AppendPath(crossConnectionName, true);
 0211            uri.AppendQuery("api-version", "2020-04-01", true);
 0212            request.Uri = uri;
 0213            return message;
 214        }
 215
 216        /// <summary> Gets details about the specified ExpressRouteCrossConnection. </summary>
 217        /// <param name="resourceGroupName"> The name of the resource group (peering location of the circuit). </param>
 218        /// <param name="crossConnectionName"> The name of the ExpressRouteCrossConnection (service key of the circuit).
 219        /// <param name="cancellationToken"> The cancellation token to use. </param>
 220        public async Task<Response<ExpressRouteCrossConnection>> GetAsync(string resourceGroupName, string crossConnecti
 221        {
 0222            if (resourceGroupName == null)
 223            {
 0224                throw new ArgumentNullException(nameof(resourceGroupName));
 225            }
 0226            if (crossConnectionName == null)
 227            {
 0228                throw new ArgumentNullException(nameof(crossConnectionName));
 229            }
 230
 0231            using var message = CreateGetRequest(resourceGroupName, crossConnectionName);
 0232            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0233            switch (message.Response.Status)
 234            {
 235                case 200:
 236                    {
 0237                        ExpressRouteCrossConnection value = default;
 0238                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0239                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 240                        {
 0241                            value = null;
 242                        }
 243                        else
 244                        {
 0245                            value = ExpressRouteCrossConnection.DeserializeExpressRouteCrossConnection(document.RootElem
 246                        }
 0247                        return Response.FromValue(value, message.Response);
 248                    }
 249                default:
 0250                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 251            }
 0252        }
 253
 254        /// <summary> Gets details about the specified ExpressRouteCrossConnection. </summary>
 255        /// <param name="resourceGroupName"> The name of the resource group (peering location of the circuit). </param>
 256        /// <param name="crossConnectionName"> The name of the ExpressRouteCrossConnection (service key of the circuit).
 257        /// <param name="cancellationToken"> The cancellation token to use. </param>
 258        public Response<ExpressRouteCrossConnection> Get(string resourceGroupName, string crossConnectionName, Cancellat
 259        {
 0260            if (resourceGroupName == null)
 261            {
 0262                throw new ArgumentNullException(nameof(resourceGroupName));
 263            }
 0264            if (crossConnectionName == null)
 265            {
 0266                throw new ArgumentNullException(nameof(crossConnectionName));
 267            }
 268
 0269            using var message = CreateGetRequest(resourceGroupName, crossConnectionName);
 0270            _pipeline.Send(message, cancellationToken);
 0271            switch (message.Response.Status)
 272            {
 273                case 200:
 274                    {
 0275                        ExpressRouteCrossConnection value = default;
 0276                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0277                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 278                        {
 0279                            value = null;
 280                        }
 281                        else
 282                        {
 0283                            value = ExpressRouteCrossConnection.DeserializeExpressRouteCrossConnection(document.RootElem
 284                        }
 0285                        return Response.FromValue(value, message.Response);
 286                    }
 287                default:
 0288                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 289            }
 0290        }
 291
 292        internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string crossConnectionName, ExpressRo
 293        {
 0294            var message = _pipeline.CreateMessage();
 0295            var request = message.Request;
 0296            request.Method = RequestMethod.Put;
 0297            var uri = new RawRequestUriBuilder();
 0298            uri.Reset(endpoint);
 0299            uri.AppendPath("/subscriptions/", false);
 0300            uri.AppendPath(subscriptionId, true);
 0301            uri.AppendPath("/resourceGroups/", false);
 0302            uri.AppendPath(resourceGroupName, true);
 0303            uri.AppendPath("/providers/Microsoft.Network/expressRouteCrossConnections/", false);
 0304            uri.AppendPath(crossConnectionName, true);
 0305            uri.AppendQuery("api-version", "2020-04-01", true);
 0306            request.Uri = uri;
 0307            request.Headers.Add("Content-Type", "application/json");
 0308            var content = new Utf8JsonRequestContent();
 0309            content.JsonWriter.WriteObjectValue(parameters);
 0310            request.Content = content;
 0311            return message;
 312        }
 313
 314        /// <summary> Update the specified ExpressRouteCrossConnection. </summary>
 315        /// <param name="resourceGroupName"> The name of the resource group. </param>
 316        /// <param name="crossConnectionName"> The name of the ExpressRouteCrossConnection. </param>
 317        /// <param name="parameters"> Parameters supplied to the update express route crossConnection operation. </param
 318        /// <param name="cancellationToken"> The cancellation token to use. </param>
 319        public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string crossConnectionName, ExpressRou
 320        {
 0321            if (resourceGroupName == null)
 322            {
 0323                throw new ArgumentNullException(nameof(resourceGroupName));
 324            }
 0325            if (crossConnectionName == null)
 326            {
 0327                throw new ArgumentNullException(nameof(crossConnectionName));
 328            }
 0329            if (parameters == null)
 330            {
 0331                throw new ArgumentNullException(nameof(parameters));
 332            }
 333
 0334            using var message = CreateCreateOrUpdateRequest(resourceGroupName, crossConnectionName, parameters);
 0335            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0336            switch (message.Response.Status)
 337            {
 338                case 200:
 0339                    return message.Response;
 340                default:
 0341                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 342            }
 0343        }
 344
 345        /// <summary> Update the specified ExpressRouteCrossConnection. </summary>
 346        /// <param name="resourceGroupName"> The name of the resource group. </param>
 347        /// <param name="crossConnectionName"> The name of the ExpressRouteCrossConnection. </param>
 348        /// <param name="parameters"> Parameters supplied to the update express route crossConnection operation. </param
 349        /// <param name="cancellationToken"> The cancellation token to use. </param>
 350        public Response CreateOrUpdate(string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection
 351        {
 0352            if (resourceGroupName == null)
 353            {
 0354                throw new ArgumentNullException(nameof(resourceGroupName));
 355            }
 0356            if (crossConnectionName == null)
 357            {
 0358                throw new ArgumentNullException(nameof(crossConnectionName));
 359            }
 0360            if (parameters == null)
 361            {
 0362                throw new ArgumentNullException(nameof(parameters));
 363            }
 364
 0365            using var message = CreateCreateOrUpdateRequest(resourceGroupName, crossConnectionName, parameters);
 0366            _pipeline.Send(message, cancellationToken);
 0367            switch (message.Response.Status)
 368            {
 369                case 200:
 0370                    return message.Response;
 371                default:
 0372                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 373            }
 0374        }
 375
 376        internal HttpMessage CreateUpdateTagsRequest(string resourceGroupName, string crossConnectionName, TagsObject cr
 377        {
 0378            var message = _pipeline.CreateMessage();
 0379            var request = message.Request;
 0380            request.Method = RequestMethod.Patch;
 0381            var uri = new RawRequestUriBuilder();
 0382            uri.Reset(endpoint);
 0383            uri.AppendPath("/subscriptions/", false);
 0384            uri.AppendPath(subscriptionId, true);
 0385            uri.AppendPath("/resourceGroups/", false);
 0386            uri.AppendPath(resourceGroupName, true);
 0387            uri.AppendPath("/providers/Microsoft.Network/expressRouteCrossConnections/", false);
 0388            uri.AppendPath(crossConnectionName, true);
 0389            uri.AppendQuery("api-version", "2020-04-01", true);
 0390            request.Uri = uri;
 0391            request.Headers.Add("Content-Type", "application/json");
 0392            var content = new Utf8JsonRequestContent();
 0393            content.JsonWriter.WriteObjectValue(crossConnectionParameters);
 0394            request.Content = content;
 0395            return message;
 396        }
 397
 398        /// <summary> Updates an express route cross connection tags. </summary>
 399        /// <param name="resourceGroupName"> The name of the resource group. </param>
 400        /// <param name="crossConnectionName"> The name of the cross connection. </param>
 401        /// <param name="crossConnectionParameters"> Parameters supplied to update express route cross connection tags. 
 402        /// <param name="cancellationToken"> The cancellation token to use. </param>
 403        public async Task<Response<ExpressRouteCrossConnection>> UpdateTagsAsync(string resourceGroupName, string crossC
 404        {
 0405            if (resourceGroupName == null)
 406            {
 0407                throw new ArgumentNullException(nameof(resourceGroupName));
 408            }
 0409            if (crossConnectionName == null)
 410            {
 0411                throw new ArgumentNullException(nameof(crossConnectionName));
 412            }
 0413            if (crossConnectionParameters == null)
 414            {
 0415                throw new ArgumentNullException(nameof(crossConnectionParameters));
 416            }
 417
 0418            using var message = CreateUpdateTagsRequest(resourceGroupName, crossConnectionName, crossConnectionParameter
 0419            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0420            switch (message.Response.Status)
 421            {
 422                case 200:
 423                    {
 0424                        ExpressRouteCrossConnection value = default;
 0425                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0426                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 427                        {
 0428                            value = null;
 429                        }
 430                        else
 431                        {
 0432                            value = ExpressRouteCrossConnection.DeserializeExpressRouteCrossConnection(document.RootElem
 433                        }
 0434                        return Response.FromValue(value, message.Response);
 435                    }
 436                default:
 0437                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 438            }
 0439        }
 440
 441        /// <summary> Updates an express route cross connection tags. </summary>
 442        /// <param name="resourceGroupName"> The name of the resource group. </param>
 443        /// <param name="crossConnectionName"> The name of the cross connection. </param>
 444        /// <param name="crossConnectionParameters"> Parameters supplied to update express route cross connection tags. 
 445        /// <param name="cancellationToken"> The cancellation token to use. </param>
 446        public Response<ExpressRouteCrossConnection> UpdateTags(string resourceGroupName, string crossConnectionName, Ta
 447        {
 0448            if (resourceGroupName == null)
 449            {
 0450                throw new ArgumentNullException(nameof(resourceGroupName));
 451            }
 0452            if (crossConnectionName == null)
 453            {
 0454                throw new ArgumentNullException(nameof(crossConnectionName));
 455            }
 0456            if (crossConnectionParameters == null)
 457            {
 0458                throw new ArgumentNullException(nameof(crossConnectionParameters));
 459            }
 460
 0461            using var message = CreateUpdateTagsRequest(resourceGroupName, crossConnectionName, crossConnectionParameter
 0462            _pipeline.Send(message, cancellationToken);
 0463            switch (message.Response.Status)
 464            {
 465                case 200:
 466                    {
 0467                        ExpressRouteCrossConnection value = default;
 0468                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0469                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 470                        {
 0471                            value = null;
 472                        }
 473                        else
 474                        {
 0475                            value = ExpressRouteCrossConnection.DeserializeExpressRouteCrossConnection(document.RootElem
 476                        }
 0477                        return Response.FromValue(value, message.Response);
 478                    }
 479                default:
 0480                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 481            }
 0482        }
 483
 484        internal HttpMessage CreateListArpTableRequest(string resourceGroupName, string crossConnectionName, string peer
 485        {
 0486            var message = _pipeline.CreateMessage();
 0487            var request = message.Request;
 0488            request.Method = RequestMethod.Post;
 0489            var uri = new RawRequestUriBuilder();
 0490            uri.Reset(endpoint);
 0491            uri.AppendPath("/subscriptions/", false);
 0492            uri.AppendPath(subscriptionId, true);
 0493            uri.AppendPath("/resourceGroups/", false);
 0494            uri.AppendPath(resourceGroupName, true);
 0495            uri.AppendPath("/providers/Microsoft.Network/expressRouteCrossConnections/", false);
 0496            uri.AppendPath(crossConnectionName, true);
 0497            uri.AppendPath("/peerings/", false);
 0498            uri.AppendPath(peeringName, true);
 0499            uri.AppendPath("/arpTables/", false);
 0500            uri.AppendPath(devicePath, true);
 0501            uri.AppendQuery("api-version", "2020-04-01", true);
 0502            request.Uri = uri;
 0503            return message;
 504        }
 505
 506        /// <summary> Gets the currently advertised ARP table associated with the express route cross connection in a re
 507        /// <param name="resourceGroupName"> The name of the resource group. </param>
 508        /// <param name="crossConnectionName"> The name of the ExpressRouteCrossConnection. </param>
 509        /// <param name="peeringName"> The name of the peering. </param>
 510        /// <param name="devicePath"> The path of the device. </param>
 511        /// <param name="cancellationToken"> The cancellation token to use. </param>
 512        public async Task<Response> ListArpTableAsync(string resourceGroupName, string crossConnectionName, string peeri
 513        {
 0514            if (resourceGroupName == null)
 515            {
 0516                throw new ArgumentNullException(nameof(resourceGroupName));
 517            }
 0518            if (crossConnectionName == null)
 519            {
 0520                throw new ArgumentNullException(nameof(crossConnectionName));
 521            }
 0522            if (peeringName == null)
 523            {
 0524                throw new ArgumentNullException(nameof(peeringName));
 525            }
 0526            if (devicePath == null)
 527            {
 0528                throw new ArgumentNullException(nameof(devicePath));
 529            }
 530
 0531            using var message = CreateListArpTableRequest(resourceGroupName, crossConnectionName, peeringName, devicePat
 0532            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0533            switch (message.Response.Status)
 534            {
 535                case 200:
 536                case 202:
 0537                    return message.Response;
 538                default:
 0539                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 540            }
 0541        }
 542
 543        /// <summary> Gets the currently advertised ARP table associated with the express route cross connection in a re
 544        /// <param name="resourceGroupName"> The name of the resource group. </param>
 545        /// <param name="crossConnectionName"> The name of the ExpressRouteCrossConnection. </param>
 546        /// <param name="peeringName"> The name of the peering. </param>
 547        /// <param name="devicePath"> The path of the device. </param>
 548        /// <param name="cancellationToken"> The cancellation token to use. </param>
 549        public Response ListArpTable(string resourceGroupName, string crossConnectionName, string peeringName, string de
 550        {
 0551            if (resourceGroupName == null)
 552            {
 0553                throw new ArgumentNullException(nameof(resourceGroupName));
 554            }
 0555            if (crossConnectionName == null)
 556            {
 0557                throw new ArgumentNullException(nameof(crossConnectionName));
 558            }
 0559            if (peeringName == null)
 560            {
 0561                throw new ArgumentNullException(nameof(peeringName));
 562            }
 0563            if (devicePath == null)
 564            {
 0565                throw new ArgumentNullException(nameof(devicePath));
 566            }
 567
 0568            using var message = CreateListArpTableRequest(resourceGroupName, crossConnectionName, peeringName, devicePat
 0569            _pipeline.Send(message, cancellationToken);
 0570            switch (message.Response.Status)
 571            {
 572                case 200:
 573                case 202:
 0574                    return message.Response;
 575                default:
 0576                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 577            }
 0578        }
 579
 580        internal HttpMessage CreateListRoutesTableSummaryRequest(string resourceGroupName, string crossConnectionName, s
 581        {
 0582            var message = _pipeline.CreateMessage();
 0583            var request = message.Request;
 0584            request.Method = RequestMethod.Post;
 0585            var uri = new RawRequestUriBuilder();
 0586            uri.Reset(endpoint);
 0587            uri.AppendPath("/subscriptions/", false);
 0588            uri.AppendPath(subscriptionId, true);
 0589            uri.AppendPath("/resourceGroups/", false);
 0590            uri.AppendPath(resourceGroupName, true);
 0591            uri.AppendPath("/providers/Microsoft.Network/expressRouteCrossConnections/", false);
 0592            uri.AppendPath(crossConnectionName, true);
 0593            uri.AppendPath("/peerings/", false);
 0594            uri.AppendPath(peeringName, true);
 0595            uri.AppendPath("/routeTablesSummary/", false);
 0596            uri.AppendPath(devicePath, true);
 0597            uri.AppendQuery("api-version", "2020-04-01", true);
 0598            request.Uri = uri;
 0599            return message;
 600        }
 601
 602        /// <summary> Gets the route table summary associated with the express route cross connection in a resource grou
 603        /// <param name="resourceGroupName"> The name of the resource group. </param>
 604        /// <param name="crossConnectionName"> The name of the ExpressRouteCrossConnection. </param>
 605        /// <param name="peeringName"> The name of the peering. </param>
 606        /// <param name="devicePath"> The path of the device. </param>
 607        /// <param name="cancellationToken"> The cancellation token to use. </param>
 608        public async Task<Response> ListRoutesTableSummaryAsync(string resourceGroupName, string crossConnectionName, st
 609        {
 0610            if (resourceGroupName == null)
 611            {
 0612                throw new ArgumentNullException(nameof(resourceGroupName));
 613            }
 0614            if (crossConnectionName == null)
 615            {
 0616                throw new ArgumentNullException(nameof(crossConnectionName));
 617            }
 0618            if (peeringName == null)
 619            {
 0620                throw new ArgumentNullException(nameof(peeringName));
 621            }
 0622            if (devicePath == null)
 623            {
 0624                throw new ArgumentNullException(nameof(devicePath));
 625            }
 626
 0627            using var message = CreateListRoutesTableSummaryRequest(resourceGroupName, crossConnectionName, peeringName,
 0628            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0629            switch (message.Response.Status)
 630            {
 631                case 200:
 632                case 202:
 0633                    return message.Response;
 634                default:
 0635                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 636            }
 0637        }
 638
 639        /// <summary> Gets the route table summary associated with the express route cross connection in a resource grou
 640        /// <param name="resourceGroupName"> The name of the resource group. </param>
 641        /// <param name="crossConnectionName"> The name of the ExpressRouteCrossConnection. </param>
 642        /// <param name="peeringName"> The name of the peering. </param>
 643        /// <param name="devicePath"> The path of the device. </param>
 644        /// <param name="cancellationToken"> The cancellation token to use. </param>
 645        public Response ListRoutesTableSummary(string resourceGroupName, string crossConnectionName, string peeringName,
 646        {
 0647            if (resourceGroupName == null)
 648            {
 0649                throw new ArgumentNullException(nameof(resourceGroupName));
 650            }
 0651            if (crossConnectionName == null)
 652            {
 0653                throw new ArgumentNullException(nameof(crossConnectionName));
 654            }
 0655            if (peeringName == null)
 656            {
 0657                throw new ArgumentNullException(nameof(peeringName));
 658            }
 0659            if (devicePath == null)
 660            {
 0661                throw new ArgumentNullException(nameof(devicePath));
 662            }
 663
 0664            using var message = CreateListRoutesTableSummaryRequest(resourceGroupName, crossConnectionName, peeringName,
 0665            _pipeline.Send(message, cancellationToken);
 0666            switch (message.Response.Status)
 667            {
 668                case 200:
 669                case 202:
 0670                    return message.Response;
 671                default:
 0672                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 673            }
 0674        }
 675
 676        internal HttpMessage CreateListRoutesTableRequest(string resourceGroupName, string crossConnectionName, string p
 677        {
 0678            var message = _pipeline.CreateMessage();
 0679            var request = message.Request;
 0680            request.Method = RequestMethod.Post;
 0681            var uri = new RawRequestUriBuilder();
 0682            uri.Reset(endpoint);
 0683            uri.AppendPath("/subscriptions/", false);
 0684            uri.AppendPath(subscriptionId, true);
 0685            uri.AppendPath("/resourceGroups/", false);
 0686            uri.AppendPath(resourceGroupName, true);
 0687            uri.AppendPath("/providers/Microsoft.Network/expressRouteCrossConnections/", false);
 0688            uri.AppendPath(crossConnectionName, true);
 0689            uri.AppendPath("/peerings/", false);
 0690            uri.AppendPath(peeringName, true);
 0691            uri.AppendPath("/routeTables/", false);
 0692            uri.AppendPath(devicePath, true);
 0693            uri.AppendQuery("api-version", "2020-04-01", true);
 0694            request.Uri = uri;
 0695            return message;
 696        }
 697
 698        /// <summary> Gets the currently advertised routes table associated with the express route cross connection in a
 699        /// <param name="resourceGroupName"> The name of the resource group. </param>
 700        /// <param name="crossConnectionName"> The name of the ExpressRouteCrossConnection. </param>
 701        /// <param name="peeringName"> The name of the peering. </param>
 702        /// <param name="devicePath"> The path of the device. </param>
 703        /// <param name="cancellationToken"> The cancellation token to use. </param>
 704        public async Task<Response> ListRoutesTableAsync(string resourceGroupName, string crossConnectionName, string pe
 705        {
 0706            if (resourceGroupName == null)
 707            {
 0708                throw new ArgumentNullException(nameof(resourceGroupName));
 709            }
 0710            if (crossConnectionName == null)
 711            {
 0712                throw new ArgumentNullException(nameof(crossConnectionName));
 713            }
 0714            if (peeringName == null)
 715            {
 0716                throw new ArgumentNullException(nameof(peeringName));
 717            }
 0718            if (devicePath == null)
 719            {
 0720                throw new ArgumentNullException(nameof(devicePath));
 721            }
 722
 0723            using var message = CreateListRoutesTableRequest(resourceGroupName, crossConnectionName, peeringName, device
 0724            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0725            switch (message.Response.Status)
 726            {
 727                case 200:
 728                case 202:
 0729                    return message.Response;
 730                default:
 0731                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 732            }
 0733        }
 734
 735        /// <summary> Gets the currently advertised routes table associated with the express route cross connection in a
 736        /// <param name="resourceGroupName"> The name of the resource group. </param>
 737        /// <param name="crossConnectionName"> The name of the ExpressRouteCrossConnection. </param>
 738        /// <param name="peeringName"> The name of the peering. </param>
 739        /// <param name="devicePath"> The path of the device. </param>
 740        /// <param name="cancellationToken"> The cancellation token to use. </param>
 741        public Response ListRoutesTable(string resourceGroupName, string crossConnectionName, string peeringName, string
 742        {
 0743            if (resourceGroupName == null)
 744            {
 0745                throw new ArgumentNullException(nameof(resourceGroupName));
 746            }
 0747            if (crossConnectionName == null)
 748            {
 0749                throw new ArgumentNullException(nameof(crossConnectionName));
 750            }
 0751            if (peeringName == null)
 752            {
 0753                throw new ArgumentNullException(nameof(peeringName));
 754            }
 0755            if (devicePath == null)
 756            {
 0757                throw new ArgumentNullException(nameof(devicePath));
 758            }
 759
 0760            using var message = CreateListRoutesTableRequest(resourceGroupName, crossConnectionName, peeringName, device
 0761            _pipeline.Send(message, cancellationToken);
 0762            switch (message.Response.Status)
 763            {
 764                case 200:
 765                case 202:
 0766                    return message.Response;
 767                default:
 0768                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 769            }
 0770        }
 771
 772        internal HttpMessage CreateListNextPageRequest(string nextLink)
 773        {
 0774            var message = _pipeline.CreateMessage();
 0775            var request = message.Request;
 0776            request.Method = RequestMethod.Get;
 0777            var uri = new RawRequestUriBuilder();
 0778            uri.Reset(endpoint);
 0779            uri.AppendRawNextLink(nextLink, false);
 0780            request.Uri = uri;
 0781            return message;
 782        }
 783
 784        /// <summary> Retrieves all the ExpressRouteCrossConnections in a subscription. </summary>
 785        /// <param name="nextLink"> The URL to the next page of results. </param>
 786        /// <param name="cancellationToken"> The cancellation token to use. </param>
 787        public async Task<Response<ExpressRouteCrossConnectionListResult>> ListNextPageAsync(string nextLink, Cancellati
 788        {
 0789            if (nextLink == null)
 790            {
 0791                throw new ArgumentNullException(nameof(nextLink));
 792            }
 793
 0794            using var message = CreateListNextPageRequest(nextLink);
 0795            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0796            switch (message.Response.Status)
 797            {
 798                case 200:
 799                    {
 0800                        ExpressRouteCrossConnectionListResult value = default;
 0801                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0802                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 803                        {
 0804                            value = null;
 805                        }
 806                        else
 807                        {
 0808                            value = ExpressRouteCrossConnectionListResult.DeserializeExpressRouteCrossConnectionListResu
 809                        }
 0810                        return Response.FromValue(value, message.Response);
 811                    }
 812                default:
 0813                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 814            }
 0815        }
 816
 817        /// <summary> Retrieves all the ExpressRouteCrossConnections in a subscription. </summary>
 818        /// <param name="nextLink"> The URL to the next page of results. </param>
 819        /// <param name="cancellationToken"> The cancellation token to use. </param>
 820        public Response<ExpressRouteCrossConnectionListResult> ListNextPage(string nextLink, CancellationToken cancellat
 821        {
 0822            if (nextLink == null)
 823            {
 0824                throw new ArgumentNullException(nameof(nextLink));
 825            }
 826
 0827            using var message = CreateListNextPageRequest(nextLink);
 0828            _pipeline.Send(message, cancellationToken);
 0829            switch (message.Response.Status)
 830            {
 831                case 200:
 832                    {
 0833                        ExpressRouteCrossConnectionListResult value = default;
 0834                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0835                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 836                        {
 0837                            value = null;
 838                        }
 839                        else
 840                        {
 0841                            value = ExpressRouteCrossConnectionListResult.DeserializeExpressRouteCrossConnectionListResu
 842                        }
 0843                        return Response.FromValue(value, message.Response);
 844                    }
 845                default:
 0846                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 847            }
 0848        }
 849
 850        internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string resourceGroupName)
 851        {
 0852            var message = _pipeline.CreateMessage();
 0853            var request = message.Request;
 0854            request.Method = RequestMethod.Get;
 0855            var uri = new RawRequestUriBuilder();
 0856            uri.Reset(endpoint);
 0857            uri.AppendRawNextLink(nextLink, false);
 0858            request.Uri = uri;
 0859            return message;
 860        }
 861
 862        /// <summary> Retrieves all the ExpressRouteCrossConnections in a resource group. </summary>
 863        /// <param name="nextLink"> The URL to the next page of results. </param>
 864        /// <param name="resourceGroupName"> The name of the resource group. </param>
 865        /// <param name="cancellationToken"> The cancellation token to use. </param>
 866        public async Task<Response<ExpressRouteCrossConnectionListResult>> ListByResourceGroupNextPageAsync(string nextL
 867        {
 0868            if (nextLink == null)
 869            {
 0870                throw new ArgumentNullException(nameof(nextLink));
 871            }
 0872            if (resourceGroupName == null)
 873            {
 0874                throw new ArgumentNullException(nameof(resourceGroupName));
 875            }
 876
 0877            using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName);
 0878            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0879            switch (message.Response.Status)
 880            {
 881                case 200:
 882                    {
 0883                        ExpressRouteCrossConnectionListResult value = default;
 0884                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0885                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 886                        {
 0887                            value = null;
 888                        }
 889                        else
 890                        {
 0891                            value = ExpressRouteCrossConnectionListResult.DeserializeExpressRouteCrossConnectionListResu
 892                        }
 0893                        return Response.FromValue(value, message.Response);
 894                    }
 895                default:
 0896                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 897            }
 0898        }
 899
 900        /// <summary> Retrieves all the ExpressRouteCrossConnections in a resource group. </summary>
 901        /// <param name="nextLink"> The URL to the next page of results. </param>
 902        /// <param name="resourceGroupName"> The name of the resource group. </param>
 903        /// <param name="cancellationToken"> The cancellation token to use. </param>
 904        public Response<ExpressRouteCrossConnectionListResult> ListByResourceGroupNextPage(string nextLink, string resou
 905        {
 0906            if (nextLink == null)
 907            {
 0908                throw new ArgumentNullException(nameof(nextLink));
 909            }
 0910            if (resourceGroupName == null)
 911            {
 0912                throw new ArgumentNullException(nameof(resourceGroupName));
 913            }
 914
 0915            using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName);
 0916            _pipeline.Send(message, cancellationToken);
 0917            switch (message.Response.Status)
 918            {
 919                case 200:
 920                    {
 0921                        ExpressRouteCrossConnectionListResult value = default;
 0922                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0923                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 924                        {
 0925                            value = null;
 926                        }
 927                        else
 928                        {
 0929                            value = ExpressRouteCrossConnectionListResult.DeserializeExpressRouteCrossConnectionListResu
 930                        }
 0931                        return Response.FromValue(value, message.Response);
 932                    }
 933                default:
 0934                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 935            }
 0936        }
 937    }
 938}