< Summary

Class:Azure.ResourceManager.Network.VirtualNetworkGatewaysRestOperations
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\VirtualNetworkGatewaysRestOperations.cs
Covered lines:115
Uncovered lines:862
Coverable lines:977
Total lines:2076
Line coverage:11.7% (115 of 977)
Covered branches:26
Total branches:426
Branch coverage:6.1% (26 of 426)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-88.89%50%
CreateCreateOrUpdateRequest(...)-100%100%
CreateOrUpdateAsync()-66.67%50%
CreateOrUpdate(...)-66.67%50%
CreateGetRequest(...)-100%100%
GetAsync()-73.33%50%
Get(...)-73.33%50%
CreateDeleteRequest(...)-0%100%
DeleteAsync()-0%0%
Delete(...)-0%0%
CreateUpdateTagsRequest(...)-0%100%
UpdateTagsAsync()-0%0%
UpdateTags(...)-0%0%
CreateListRequest(...)-0%100%
ListAsync()-0%0%
List(...)-0%0%
CreateListConnectionsRequest(...)-100%100%
ListConnectionsAsync()-73.33%50%
ListConnections(...)-73.33%50%
CreateResetRequest(...)-0%0%
ResetAsync()-0%0%
Reset(...)-0%0%
CreateResetVpnClientSharedKeyRequest(...)-0%100%
ResetVpnClientSharedKeyAsync()-0%0%
ResetVpnClientSharedKey(...)-0%0%
CreateGeneratevpnclientpackageRequest(...)-0%100%
GeneratevpnclientpackageAsync()-0%0%
Generatevpnclientpackage(...)-0%0%
CreateGenerateVpnProfileRequest(...)-0%100%
GenerateVpnProfileAsync()-0%0%
GenerateVpnProfile(...)-0%0%
CreateGetVpnProfilePackageUrlRequest(...)-0%100%
GetVpnProfilePackageUrlAsync()-0%0%
GetVpnProfilePackageUrl(...)-0%0%
CreateGetBgpPeerStatusRequest(...)-0%0%
GetBgpPeerStatusAsync()-0%0%
GetBgpPeerStatus(...)-0%0%
CreateSupportedVpnDevicesRequest(...)-0%100%
SupportedVpnDevicesAsync()-0%0%
SupportedVpnDevices(...)-0%0%
CreateGetLearnedRoutesRequest(...)-0%100%
GetLearnedRoutesAsync()-0%0%
GetLearnedRoutes(...)-0%0%
CreateGetAdvertisedRoutesRequest(...)-0%100%
GetAdvertisedRoutesAsync()-0%0%
GetAdvertisedRoutes(...)-0%0%
CreateSetVpnclientIpsecParametersRequest(...)-0%100%
SetVpnclientIpsecParametersAsync()-0%0%
SetVpnclientIpsecParameters(...)-0%0%
CreateGetVpnclientIpsecParametersRequest(...)-0%100%
GetVpnclientIpsecParametersAsync()-0%0%
GetVpnclientIpsecParameters(...)-0%0%
CreateVpnDeviceConfigurationScriptRequest(...)-0%100%
VpnDeviceConfigurationScriptAsync()-0%0%
VpnDeviceConfigurationScript(...)-0%0%
CreateStartPacketCaptureRequest(...)-0%0%
StartPacketCaptureAsync()-0%0%
StartPacketCapture(...)-0%0%
CreateStopPacketCaptureRequest(...)-0%100%
StopPacketCaptureAsync()-0%0%
StopPacketCapture(...)-0%0%
CreateGetVpnclientConnectionHealthRequest(...)-0%100%
GetVpnclientConnectionHealthAsync()-0%0%
GetVpnclientConnectionHealth(...)-0%0%
CreateDisconnectVirtualNetworkGatewayVpnConnectionsRequest(...)-0%100%
DisconnectVirtualNetworkGatewayVpnConnectionsAsync()-0%0%
DisconnectVirtualNetworkGatewayVpnConnections(...)-0%0%
CreateListNextPageRequest(...)-0%100%
ListNextPageAsync()-0%0%
ListNextPage(...)-0%0%
CreateListConnectionsNextPageRequest(...)-0%100%
ListConnectionsNextPageAsync()-0%0%
ListConnectionsNextPage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\VirtualNetworkGatewaysRestOperations.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 VirtualNetworkGatewaysRestOperations
 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 VirtualNetworkGatewaysRestOperations. </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
 3632        public VirtualNetworkGatewaysRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string s
 33        {
 3634            if (subscriptionId == null)
 35            {
 036                throw new ArgumentNullException(nameof(subscriptionId));
 37            }
 3638            endpoint ??= new Uri("https://management.azure.com");
 39
 3640            this.subscriptionId = subscriptionId;
 3641            this.endpoint = endpoint;
 3642            _clientDiagnostics = clientDiagnostics;
 3643            _pipeline = pipeline;
 3644        }
 45
 46        internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string virtualNetworkGatewayName, Vir
 47        {
 3248            var message = _pipeline.CreateMessage();
 3249            var request = message.Request;
 3250            request.Method = RequestMethod.Put;
 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/virtualNetworkGateways/", false);
 3258            uri.AppendPath(virtualNetworkGatewayName, true);
 3259            uri.AppendQuery("api-version", "2020-04-01", true);
 3260            request.Uri = uri;
 3261            request.Headers.Add("Content-Type", "application/json");
 3262            var content = new Utf8JsonRequestContent();
 3263            content.JsonWriter.WriteObjectValue(parameters);
 3264            request.Content = content;
 3265            return message;
 66        }
 67
 68        /// <summary> Creates or updates a virtual network gateway in the specified resource group. </summary>
 69        /// <param name="resourceGroupName"> The name of the resource group. </param>
 70        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 71        /// <param name="parameters"> Parameters supplied to create or update virtual network gateway operation. </param
 72        /// <param name="cancellationToken"> The cancellation token to use. </param>
 73        public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string virtualNetworkGatewayName, Virt
 74        {
 875            if (resourceGroupName == null)
 76            {
 077                throw new ArgumentNullException(nameof(resourceGroupName));
 78            }
 879            if (virtualNetworkGatewayName == null)
 80            {
 081                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 82            }
 883            if (parameters == null)
 84            {
 085                throw new ArgumentNullException(nameof(parameters));
 86            }
 87
 888            using var message = CreateCreateOrUpdateRequest(resourceGroupName, virtualNetworkGatewayName, parameters);
 889            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 890            switch (message.Response.Status)
 91            {
 92                case 200:
 93                case 201:
 894                    return message.Response;
 95                default:
 096                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 97            }
 898        }
 99
 100        /// <summary> Creates or updates a virtual network gateway in the specified resource group. </summary>
 101        /// <param name="resourceGroupName"> The name of the resource group. </param>
 102        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 103        /// <param name="parameters"> Parameters supplied to create or update virtual network gateway operation. </param
 104        /// <param name="cancellationToken"> The cancellation token to use. </param>
 105        public Response CreateOrUpdate(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway
 106        {
 8107            if (resourceGroupName == null)
 108            {
 0109                throw new ArgumentNullException(nameof(resourceGroupName));
 110            }
 8111            if (virtualNetworkGatewayName == null)
 112            {
 0113                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 114            }
 8115            if (parameters == null)
 116            {
 0117                throw new ArgumentNullException(nameof(parameters));
 118            }
 119
 8120            using var message = CreateCreateOrUpdateRequest(resourceGroupName, virtualNetworkGatewayName, parameters);
 8121            _pipeline.Send(message, cancellationToken);
 8122            switch (message.Response.Status)
 123            {
 124                case 200:
 125                case 201:
 8126                    return message.Response;
 127                default:
 0128                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 129            }
 8130        }
 131
 132        internal HttpMessage CreateGetRequest(string resourceGroupName, string virtualNetworkGatewayName)
 133        {
 16134            var message = _pipeline.CreateMessage();
 16135            var request = message.Request;
 16136            request.Method = RequestMethod.Get;
 16137            var uri = new RawRequestUriBuilder();
 16138            uri.Reset(endpoint);
 16139            uri.AppendPath("/subscriptions/", false);
 16140            uri.AppendPath(subscriptionId, true);
 16141            uri.AppendPath("/resourceGroups/", false);
 16142            uri.AppendPath(resourceGroupName, true);
 16143            uri.AppendPath("/providers/Microsoft.Network/virtualNetworkGateways/", false);
 16144            uri.AppendPath(virtualNetworkGatewayName, true);
 16145            uri.AppendQuery("api-version", "2020-04-01", true);
 16146            request.Uri = uri;
 16147            return message;
 148        }
 149
 150        /// <summary> Gets the specified virtual network gateway by resource group. </summary>
 151        /// <param name="resourceGroupName"> The name of the resource group. </param>
 152        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 153        /// <param name="cancellationToken"> The cancellation token to use. </param>
 154        public async Task<Response<VirtualNetworkGateway>> GetAsync(string resourceGroupName, string virtualNetworkGatew
 155        {
 8156            if (resourceGroupName == null)
 157            {
 0158                throw new ArgumentNullException(nameof(resourceGroupName));
 159            }
 8160            if (virtualNetworkGatewayName == null)
 161            {
 0162                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 163            }
 164
 8165            using var message = CreateGetRequest(resourceGroupName, virtualNetworkGatewayName);
 8166            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 8167            switch (message.Response.Status)
 168            {
 169                case 200:
 170                    {
 8171                        VirtualNetworkGateway value = default;
 8172                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 8173                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 174                        {
 0175                            value = null;
 176                        }
 177                        else
 178                        {
 8179                            value = VirtualNetworkGateway.DeserializeVirtualNetworkGateway(document.RootElement);
 180                        }
 8181                        return Response.FromValue(value, message.Response);
 182                    }
 183                default:
 0184                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 185            }
 8186        }
 187
 188        /// <summary> Gets the specified virtual network gateway by resource group. </summary>
 189        /// <param name="resourceGroupName"> The name of the resource group. </param>
 190        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 191        /// <param name="cancellationToken"> The cancellation token to use. </param>
 192        public Response<VirtualNetworkGateway> Get(string resourceGroupName, string virtualNetworkGatewayName, Cancellat
 193        {
 8194            if (resourceGroupName == null)
 195            {
 0196                throw new ArgumentNullException(nameof(resourceGroupName));
 197            }
 8198            if (virtualNetworkGatewayName == null)
 199            {
 0200                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 201            }
 202
 8203            using var message = CreateGetRequest(resourceGroupName, virtualNetworkGatewayName);
 8204            _pipeline.Send(message, cancellationToken);
 8205            switch (message.Response.Status)
 206            {
 207                case 200:
 208                    {
 8209                        VirtualNetworkGateway value = default;
 8210                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 8211                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 212                        {
 0213                            value = null;
 214                        }
 215                        else
 216                        {
 8217                            value = VirtualNetworkGateway.DeserializeVirtualNetworkGateway(document.RootElement);
 218                        }
 8219                        return Response.FromValue(value, message.Response);
 220                    }
 221                default:
 0222                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 223            }
 8224        }
 225
 226        internal HttpMessage CreateDeleteRequest(string resourceGroupName, string virtualNetworkGatewayName)
 227        {
 0228            var message = _pipeline.CreateMessage();
 0229            var request = message.Request;
 0230            request.Method = RequestMethod.Delete;
 0231            var uri = new RawRequestUriBuilder();
 0232            uri.Reset(endpoint);
 0233            uri.AppendPath("/subscriptions/", false);
 0234            uri.AppendPath(subscriptionId, true);
 0235            uri.AppendPath("/resourceGroups/", false);
 0236            uri.AppendPath(resourceGroupName, true);
 0237            uri.AppendPath("/providers/Microsoft.Network/virtualNetworkGateways/", false);
 0238            uri.AppendPath(virtualNetworkGatewayName, true);
 0239            uri.AppendQuery("api-version", "2020-04-01", true);
 0240            request.Uri = uri;
 0241            return message;
 242        }
 243
 244        /// <summary> Deletes the specified virtual network gateway. </summary>
 245        /// <param name="resourceGroupName"> The name of the resource group. </param>
 246        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 247        /// <param name="cancellationToken"> The cancellation token to use. </param>
 248        public async Task<Response> DeleteAsync(string resourceGroupName, string virtualNetworkGatewayName, Cancellation
 249        {
 0250            if (resourceGroupName == null)
 251            {
 0252                throw new ArgumentNullException(nameof(resourceGroupName));
 253            }
 0254            if (virtualNetworkGatewayName == null)
 255            {
 0256                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 257            }
 258
 0259            using var message = CreateDeleteRequest(resourceGroupName, virtualNetworkGatewayName);
 0260            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0261            switch (message.Response.Status)
 262            {
 263                case 200:
 264                case 202:
 265                case 204:
 0266                    return message.Response;
 267                default:
 0268                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 269            }
 0270        }
 271
 272        /// <summary> Deletes the specified virtual network gateway. </summary>
 273        /// <param name="resourceGroupName"> The name of the resource group. </param>
 274        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 275        /// <param name="cancellationToken"> The cancellation token to use. </param>
 276        public Response Delete(string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellatio
 277        {
 0278            if (resourceGroupName == null)
 279            {
 0280                throw new ArgumentNullException(nameof(resourceGroupName));
 281            }
 0282            if (virtualNetworkGatewayName == null)
 283            {
 0284                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 285            }
 286
 0287            using var message = CreateDeleteRequest(resourceGroupName, virtualNetworkGatewayName);
 0288            _pipeline.Send(message, cancellationToken);
 0289            switch (message.Response.Status)
 290            {
 291                case 200:
 292                case 202:
 293                case 204:
 0294                    return message.Response;
 295                default:
 0296                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 297            }
 0298        }
 299
 300        internal HttpMessage CreateUpdateTagsRequest(string resourceGroupName, string virtualNetworkGatewayName, TagsObj
 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/virtualNetworkGateways/", false);
 0312            uri.AppendPath(virtualNetworkGatewayName, true);
 0313            uri.AppendQuery("api-version", "2020-04-01", true);
 0314            request.Uri = uri;
 0315            request.Headers.Add("Content-Type", "application/json");
 0316            var content = new Utf8JsonRequestContent();
 0317            content.JsonWriter.WriteObjectValue(parameters);
 0318            request.Content = content;
 0319            return message;
 320        }
 321
 322        /// <summary> Updates a virtual network gateway tags. </summary>
 323        /// <param name="resourceGroupName"> The name of the resource group. </param>
 324        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 325        /// <param name="parameters"> Parameters supplied to update virtual network gateway tags. </param>
 326        /// <param name="cancellationToken"> The cancellation token to use. </param>
 327        public async Task<Response> UpdateTagsAsync(string resourceGroupName, string virtualNetworkGatewayName, TagsObje
 328        {
 0329            if (resourceGroupName == null)
 330            {
 0331                throw new ArgumentNullException(nameof(resourceGroupName));
 332            }
 0333            if (virtualNetworkGatewayName == null)
 334            {
 0335                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 336            }
 0337            if (parameters == null)
 338            {
 0339                throw new ArgumentNullException(nameof(parameters));
 340            }
 341
 0342            using var message = CreateUpdateTagsRequest(resourceGroupName, virtualNetworkGatewayName, parameters);
 0343            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0344            switch (message.Response.Status)
 345            {
 346                case 200:
 347                case 202:
 0348                    return message.Response;
 349                default:
 0350                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 351            }
 0352        }
 353
 354        /// <summary> Updates a virtual network gateway tags. </summary>
 355        /// <param name="resourceGroupName"> The name of the resource group. </param>
 356        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 357        /// <param name="parameters"> Parameters supplied to update virtual network gateway tags. </param>
 358        /// <param name="cancellationToken"> The cancellation token to use. </param>
 359        public Response UpdateTags(string resourceGroupName, string virtualNetworkGatewayName, TagsObject parameters, Ca
 360        {
 0361            if (resourceGroupName == null)
 362            {
 0363                throw new ArgumentNullException(nameof(resourceGroupName));
 364            }
 0365            if (virtualNetworkGatewayName == null)
 366            {
 0367                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 368            }
 0369            if (parameters == null)
 370            {
 0371                throw new ArgumentNullException(nameof(parameters));
 372            }
 373
 0374            using var message = CreateUpdateTagsRequest(resourceGroupName, virtualNetworkGatewayName, parameters);
 0375            _pipeline.Send(message, cancellationToken);
 0376            switch (message.Response.Status)
 377            {
 378                case 200:
 379                case 202:
 0380                    return message.Response;
 381                default:
 0382                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 383            }
 0384        }
 385
 386        internal HttpMessage CreateListRequest(string resourceGroupName)
 387        {
 0388            var message = _pipeline.CreateMessage();
 0389            var request = message.Request;
 0390            request.Method = RequestMethod.Get;
 0391            var uri = new RawRequestUriBuilder();
 0392            uri.Reset(endpoint);
 0393            uri.AppendPath("/subscriptions/", false);
 0394            uri.AppendPath(subscriptionId, true);
 0395            uri.AppendPath("/resourceGroups/", false);
 0396            uri.AppendPath(resourceGroupName, true);
 0397            uri.AppendPath("/providers/Microsoft.Network/virtualNetworkGateways", false);
 0398            uri.AppendQuery("api-version", "2020-04-01", true);
 0399            request.Uri = uri;
 0400            return message;
 401        }
 402
 403        /// <summary> Gets all virtual network gateways by resource group. </summary>
 404        /// <param name="resourceGroupName"> The name of the resource group. </param>
 405        /// <param name="cancellationToken"> The cancellation token to use. </param>
 406        public async Task<Response<VirtualNetworkGatewayListResult>> ListAsync(string resourceGroupName, CancellationTok
 407        {
 0408            if (resourceGroupName == null)
 409            {
 0410                throw new ArgumentNullException(nameof(resourceGroupName));
 411            }
 412
 0413            using var message = CreateListRequest(resourceGroupName);
 0414            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0415            switch (message.Response.Status)
 416            {
 417                case 200:
 418                    {
 0419                        VirtualNetworkGatewayListResult value = default;
 0420                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0421                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 422                        {
 0423                            value = null;
 424                        }
 425                        else
 426                        {
 0427                            value = VirtualNetworkGatewayListResult.DeserializeVirtualNetworkGatewayListResult(document.
 428                        }
 0429                        return Response.FromValue(value, message.Response);
 430                    }
 431                default:
 0432                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 433            }
 0434        }
 435
 436        /// <summary> Gets all virtual network gateways by resource group. </summary>
 437        /// <param name="resourceGroupName"> The name of the resource group. </param>
 438        /// <param name="cancellationToken"> The cancellation token to use. </param>
 439        public Response<VirtualNetworkGatewayListResult> List(string resourceGroupName, CancellationToken cancellationTo
 440        {
 0441            if (resourceGroupName == null)
 442            {
 0443                throw new ArgumentNullException(nameof(resourceGroupName));
 444            }
 445
 0446            using var message = CreateListRequest(resourceGroupName);
 0447            _pipeline.Send(message, cancellationToken);
 0448            switch (message.Response.Status)
 449            {
 450                case 200:
 451                    {
 0452                        VirtualNetworkGatewayListResult value = default;
 0453                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0454                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 455                        {
 0456                            value = null;
 457                        }
 458                        else
 459                        {
 0460                            value = VirtualNetworkGatewayListResult.DeserializeVirtualNetworkGatewayListResult(document.
 461                        }
 0462                        return Response.FromValue(value, message.Response);
 463                    }
 464                default:
 0465                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 466            }
 0467        }
 468
 469        internal HttpMessage CreateListConnectionsRequest(string resourceGroupName, string virtualNetworkGatewayName)
 470        {
 4471            var message = _pipeline.CreateMessage();
 4472            var request = message.Request;
 4473            request.Method = RequestMethod.Get;
 4474            var uri = new RawRequestUriBuilder();
 4475            uri.Reset(endpoint);
 4476            uri.AppendPath("/subscriptions/", false);
 4477            uri.AppendPath(subscriptionId, true);
 4478            uri.AppendPath("/resourceGroups/", false);
 4479            uri.AppendPath(resourceGroupName, true);
 4480            uri.AppendPath("/providers/Microsoft.Network/virtualNetworkGateways/", false);
 4481            uri.AppendPath(virtualNetworkGatewayName, true);
 4482            uri.AppendPath("/connections", false);
 4483            uri.AppendQuery("api-version", "2020-04-01", true);
 4484            request.Uri = uri;
 4485            return message;
 486        }
 487
 488        /// <summary> Gets all the connections in a virtual network gateway. </summary>
 489        /// <param name="resourceGroupName"> The name of the resource group. </param>
 490        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 491        /// <param name="cancellationToken"> The cancellation token to use. </param>
 492        public async Task<Response<VirtualNetworkGatewayListConnectionsResult>> ListConnectionsAsync(string resourceGrou
 493        {
 2494            if (resourceGroupName == null)
 495            {
 0496                throw new ArgumentNullException(nameof(resourceGroupName));
 497            }
 2498            if (virtualNetworkGatewayName == null)
 499            {
 0500                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 501            }
 502
 2503            using var message = CreateListConnectionsRequest(resourceGroupName, virtualNetworkGatewayName);
 2504            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 2505            switch (message.Response.Status)
 506            {
 507                case 200:
 508                    {
 2509                        VirtualNetworkGatewayListConnectionsResult value = default;
 2510                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 2511                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 512                        {
 0513                            value = null;
 514                        }
 515                        else
 516                        {
 2517                            value = VirtualNetworkGatewayListConnectionsResult.DeserializeVirtualNetworkGatewayListConne
 518                        }
 2519                        return Response.FromValue(value, message.Response);
 520                    }
 521                default:
 0522                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 523            }
 2524        }
 525
 526        /// <summary> Gets all the connections in a virtual network gateway. </summary>
 527        /// <param name="resourceGroupName"> The name of the resource group. </param>
 528        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 529        /// <param name="cancellationToken"> The cancellation token to use. </param>
 530        public Response<VirtualNetworkGatewayListConnectionsResult> ListConnections(string resourceGroupName, string vir
 531        {
 2532            if (resourceGroupName == null)
 533            {
 0534                throw new ArgumentNullException(nameof(resourceGroupName));
 535            }
 2536            if (virtualNetworkGatewayName == null)
 537            {
 0538                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 539            }
 540
 2541            using var message = CreateListConnectionsRequest(resourceGroupName, virtualNetworkGatewayName);
 2542            _pipeline.Send(message, cancellationToken);
 2543            switch (message.Response.Status)
 544            {
 545                case 200:
 546                    {
 2547                        VirtualNetworkGatewayListConnectionsResult value = default;
 2548                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 2549                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 550                        {
 0551                            value = null;
 552                        }
 553                        else
 554                        {
 2555                            value = VirtualNetworkGatewayListConnectionsResult.DeserializeVirtualNetworkGatewayListConne
 556                        }
 2557                        return Response.FromValue(value, message.Response);
 558                    }
 559                default:
 0560                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 561            }
 2562        }
 563
 564        internal HttpMessage CreateResetRequest(string resourceGroupName, string virtualNetworkGatewayName, string gatew
 565        {
 0566            var message = _pipeline.CreateMessage();
 0567            var request = message.Request;
 0568            request.Method = RequestMethod.Post;
 0569            var uri = new RawRequestUriBuilder();
 0570            uri.Reset(endpoint);
 0571            uri.AppendPath("/subscriptions/", false);
 0572            uri.AppendPath(subscriptionId, true);
 0573            uri.AppendPath("/resourceGroups/", false);
 0574            uri.AppendPath(resourceGroupName, true);
 0575            uri.AppendPath("/providers/Microsoft.Network/virtualNetworkGateways/", false);
 0576            uri.AppendPath(virtualNetworkGatewayName, true);
 0577            uri.AppendPath("/reset", false);
 0578            if (gatewayVip != null)
 579            {
 0580                uri.AppendQuery("gatewayVip", gatewayVip, true);
 581            }
 0582            uri.AppendQuery("api-version", "2020-04-01", true);
 0583            request.Uri = uri;
 0584            return message;
 585        }
 586
 587        /// <summary> Resets the primary of the virtual network gateway in the specified resource group. </summary>
 588        /// <param name="resourceGroupName"> The name of the resource group. </param>
 589        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 590        /// <param name="gatewayVip"> Virtual network gateway vip address supplied to the begin reset of the active-acti
 591        /// <param name="cancellationToken"> The cancellation token to use. </param>
 592        public async Task<Response> ResetAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewa
 593        {
 0594            if (resourceGroupName == null)
 595            {
 0596                throw new ArgumentNullException(nameof(resourceGroupName));
 597            }
 0598            if (virtualNetworkGatewayName == null)
 599            {
 0600                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 601            }
 602
 0603            using var message = CreateResetRequest(resourceGroupName, virtualNetworkGatewayName, gatewayVip);
 0604            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0605            switch (message.Response.Status)
 606            {
 607                case 200:
 608                case 202:
 0609                    return message.Response;
 610                default:
 0611                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 612            }
 0613        }
 614
 615        /// <summary> Resets the primary of the virtual network gateway in the specified resource group. </summary>
 616        /// <param name="resourceGroupName"> The name of the resource group. </param>
 617        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 618        /// <param name="gatewayVip"> Virtual network gateway vip address supplied to the begin reset of the active-acti
 619        /// <param name="cancellationToken"> The cancellation token to use. </param>
 620        public Response Reset(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = null, Canc
 621        {
 0622            if (resourceGroupName == null)
 623            {
 0624                throw new ArgumentNullException(nameof(resourceGroupName));
 625            }
 0626            if (virtualNetworkGatewayName == null)
 627            {
 0628                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 629            }
 630
 0631            using var message = CreateResetRequest(resourceGroupName, virtualNetworkGatewayName, gatewayVip);
 0632            _pipeline.Send(message, cancellationToken);
 0633            switch (message.Response.Status)
 634            {
 635                case 200:
 636                case 202:
 0637                    return message.Response;
 638                default:
 0639                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 640            }
 0641        }
 642
 643        internal HttpMessage CreateResetVpnClientSharedKeyRequest(string resourceGroupName, string virtualNetworkGateway
 644        {
 0645            var message = _pipeline.CreateMessage();
 0646            var request = message.Request;
 0647            request.Method = RequestMethod.Post;
 0648            var uri = new RawRequestUriBuilder();
 0649            uri.Reset(endpoint);
 0650            uri.AppendPath("/subscriptions/", false);
 0651            uri.AppendPath(subscriptionId, true);
 0652            uri.AppendPath("/resourceGroups/", false);
 0653            uri.AppendPath(resourceGroupName, true);
 0654            uri.AppendPath("/providers/Microsoft.Network/virtualNetworkGateways/", false);
 0655            uri.AppendPath(virtualNetworkGatewayName, true);
 0656            uri.AppendPath("/resetvpnclientsharedkey", false);
 0657            uri.AppendQuery("api-version", "2020-04-01", true);
 0658            request.Uri = uri;
 0659            return message;
 660        }
 661
 662        /// <summary> Resets the VPN client shared key of the virtual network gateway in the specified resource group. <
 663        /// <param name="resourceGroupName"> The name of the resource group. </param>
 664        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 665        /// <param name="cancellationToken"> The cancellation token to use. </param>
 666        public async Task<Response> ResetVpnClientSharedKeyAsync(string resourceGroupName, string virtualNetworkGatewayN
 667        {
 0668            if (resourceGroupName == null)
 669            {
 0670                throw new ArgumentNullException(nameof(resourceGroupName));
 671            }
 0672            if (virtualNetworkGatewayName == null)
 673            {
 0674                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 675            }
 676
 0677            using var message = CreateResetVpnClientSharedKeyRequest(resourceGroupName, virtualNetworkGatewayName);
 0678            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0679            switch (message.Response.Status)
 680            {
 681                case 200:
 682                case 202:
 0683                    return message.Response;
 684                default:
 0685                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 686            }
 0687        }
 688
 689        /// <summary> Resets the VPN client shared key of the virtual network gateway in the specified resource group. <
 690        /// <param name="resourceGroupName"> The name of the resource group. </param>
 691        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 692        /// <param name="cancellationToken"> The cancellation token to use. </param>
 693        public Response ResetVpnClientSharedKey(string resourceGroupName, string virtualNetworkGatewayName, Cancellation
 694        {
 0695            if (resourceGroupName == null)
 696            {
 0697                throw new ArgumentNullException(nameof(resourceGroupName));
 698            }
 0699            if (virtualNetworkGatewayName == null)
 700            {
 0701                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 702            }
 703
 0704            using var message = CreateResetVpnClientSharedKeyRequest(resourceGroupName, virtualNetworkGatewayName);
 0705            _pipeline.Send(message, cancellationToken);
 0706            switch (message.Response.Status)
 707            {
 708                case 200:
 709                case 202:
 0710                    return message.Response;
 711                default:
 0712                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 713            }
 0714        }
 715
 716        internal HttpMessage CreateGeneratevpnclientpackageRequest(string resourceGroupName, string virtualNetworkGatewa
 717        {
 0718            var message = _pipeline.CreateMessage();
 0719            var request = message.Request;
 0720            request.Method = RequestMethod.Post;
 0721            var uri = new RawRequestUriBuilder();
 0722            uri.Reset(endpoint);
 0723            uri.AppendPath("/subscriptions/", false);
 0724            uri.AppendPath(subscriptionId, true);
 0725            uri.AppendPath("/resourceGroups/", false);
 0726            uri.AppendPath(resourceGroupName, true);
 0727            uri.AppendPath("/providers/Microsoft.Network/virtualNetworkGateways/", false);
 0728            uri.AppendPath(virtualNetworkGatewayName, true);
 0729            uri.AppendPath("/generatevpnclientpackage", false);
 0730            uri.AppendQuery("api-version", "2020-04-01", true);
 0731            request.Uri = uri;
 0732            request.Headers.Add("Content-Type", "application/json");
 0733            var content = new Utf8JsonRequestContent();
 0734            content.JsonWriter.WriteObjectValue(parameters);
 0735            request.Content = content;
 0736            return message;
 737        }
 738
 739        /// <summary> Generates VPN client package for P2S client of the virtual network gateway in the specified resour
 740        /// <param name="resourceGroupName"> The name of the resource group. </param>
 741        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 742        /// <param name="parameters"> Parameters supplied to the generate virtual network gateway VPN client package ope
 743        /// <param name="cancellationToken"> The cancellation token to use. </param>
 744        public async Task<Response> GeneratevpnclientpackageAsync(string resourceGroupName, string virtualNetworkGateway
 745        {
 0746            if (resourceGroupName == null)
 747            {
 0748                throw new ArgumentNullException(nameof(resourceGroupName));
 749            }
 0750            if (virtualNetworkGatewayName == null)
 751            {
 0752                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 753            }
 0754            if (parameters == null)
 755            {
 0756                throw new ArgumentNullException(nameof(parameters));
 757            }
 758
 0759            using var message = CreateGeneratevpnclientpackageRequest(resourceGroupName, virtualNetworkGatewayName, para
 0760            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0761            switch (message.Response.Status)
 762            {
 763                case 200:
 764                case 202:
 0765                    return message.Response;
 766                default:
 0767                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 768            }
 0769        }
 770
 771        /// <summary> Generates VPN client package for P2S client of the virtual network gateway in the specified resour
 772        /// <param name="resourceGroupName"> The name of the resource group. </param>
 773        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 774        /// <param name="parameters"> Parameters supplied to the generate virtual network gateway VPN client package ope
 775        /// <param name="cancellationToken"> The cancellation token to use. </param>
 776        public Response Generatevpnclientpackage(string resourceGroupName, string virtualNetworkGatewayName, VpnClientPa
 777        {
 0778            if (resourceGroupName == null)
 779            {
 0780                throw new ArgumentNullException(nameof(resourceGroupName));
 781            }
 0782            if (virtualNetworkGatewayName == null)
 783            {
 0784                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 785            }
 0786            if (parameters == null)
 787            {
 0788                throw new ArgumentNullException(nameof(parameters));
 789            }
 790
 0791            using var message = CreateGeneratevpnclientpackageRequest(resourceGroupName, virtualNetworkGatewayName, para
 0792            _pipeline.Send(message, cancellationToken);
 0793            switch (message.Response.Status)
 794            {
 795                case 200:
 796                case 202:
 0797                    return message.Response;
 798                default:
 0799                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 800            }
 0801        }
 802
 803        internal HttpMessage CreateGenerateVpnProfileRequest(string resourceGroupName, string virtualNetworkGatewayName,
 804        {
 0805            var message = _pipeline.CreateMessage();
 0806            var request = message.Request;
 0807            request.Method = RequestMethod.Post;
 0808            var uri = new RawRequestUriBuilder();
 0809            uri.Reset(endpoint);
 0810            uri.AppendPath("/subscriptions/", false);
 0811            uri.AppendPath(subscriptionId, true);
 0812            uri.AppendPath("/resourceGroups/", false);
 0813            uri.AppendPath(resourceGroupName, true);
 0814            uri.AppendPath("/providers/Microsoft.Network/virtualNetworkGateways/", false);
 0815            uri.AppendPath(virtualNetworkGatewayName, true);
 0816            uri.AppendPath("/generatevpnprofile", false);
 0817            uri.AppendQuery("api-version", "2020-04-01", true);
 0818            request.Uri = uri;
 0819            request.Headers.Add("Content-Type", "application/json");
 0820            var content = new Utf8JsonRequestContent();
 0821            content.JsonWriter.WriteObjectValue(parameters);
 0822            request.Content = content;
 0823            return message;
 824        }
 825
 826        /// <summary> Generates VPN profile for P2S client of the virtual network gateway in the specified resource grou
 827        /// <param name="resourceGroupName"> The name of the resource group. </param>
 828        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 829        /// <param name="parameters"> Parameters supplied to the generate virtual network gateway VPN client package ope
 830        /// <param name="cancellationToken"> The cancellation token to use. </param>
 831        public async Task<Response> GenerateVpnProfileAsync(string resourceGroupName, string virtualNetworkGatewayName, 
 832        {
 0833            if (resourceGroupName == null)
 834            {
 0835                throw new ArgumentNullException(nameof(resourceGroupName));
 836            }
 0837            if (virtualNetworkGatewayName == null)
 838            {
 0839                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 840            }
 0841            if (parameters == null)
 842            {
 0843                throw new ArgumentNullException(nameof(parameters));
 844            }
 845
 0846            using var message = CreateGenerateVpnProfileRequest(resourceGroupName, virtualNetworkGatewayName, parameters
 0847            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0848            switch (message.Response.Status)
 849            {
 850                case 200:
 851                case 202:
 0852                    return message.Response;
 853                default:
 0854                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 855            }
 0856        }
 857
 858        /// <summary> Generates VPN profile for P2S client of the virtual network gateway in the specified resource grou
 859        /// <param name="resourceGroupName"> The name of the resource group. </param>
 860        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 861        /// <param name="parameters"> Parameters supplied to the generate virtual network gateway VPN client package ope
 862        /// <param name="cancellationToken"> The cancellation token to use. </param>
 863        public Response GenerateVpnProfile(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParamete
 864        {
 0865            if (resourceGroupName == null)
 866            {
 0867                throw new ArgumentNullException(nameof(resourceGroupName));
 868            }
 0869            if (virtualNetworkGatewayName == null)
 870            {
 0871                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 872            }
 0873            if (parameters == null)
 874            {
 0875                throw new ArgumentNullException(nameof(parameters));
 876            }
 877
 0878            using var message = CreateGenerateVpnProfileRequest(resourceGroupName, virtualNetworkGatewayName, parameters
 0879            _pipeline.Send(message, cancellationToken);
 0880            switch (message.Response.Status)
 881            {
 882                case 200:
 883                case 202:
 0884                    return message.Response;
 885                default:
 0886                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 887            }
 0888        }
 889
 890        internal HttpMessage CreateGetVpnProfilePackageUrlRequest(string resourceGroupName, string virtualNetworkGateway
 891        {
 0892            var message = _pipeline.CreateMessage();
 0893            var request = message.Request;
 0894            request.Method = RequestMethod.Post;
 0895            var uri = new RawRequestUriBuilder();
 0896            uri.Reset(endpoint);
 0897            uri.AppendPath("/subscriptions/", false);
 0898            uri.AppendPath(subscriptionId, true);
 0899            uri.AppendPath("/resourceGroups/", false);
 0900            uri.AppendPath(resourceGroupName, true);
 0901            uri.AppendPath("/providers/Microsoft.Network/virtualNetworkGateways/", false);
 0902            uri.AppendPath(virtualNetworkGatewayName, true);
 0903            uri.AppendPath("/getvpnprofilepackageurl", false);
 0904            uri.AppendQuery("api-version", "2020-04-01", true);
 0905            request.Uri = uri;
 0906            return message;
 907        }
 908
 909        /// <summary> Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified reso
 910        /// <param name="resourceGroupName"> The name of the resource group. </param>
 911        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 912        /// <param name="cancellationToken"> The cancellation token to use. </param>
 913        public async Task<Response> GetVpnProfilePackageUrlAsync(string resourceGroupName, string virtualNetworkGatewayN
 914        {
 0915            if (resourceGroupName == null)
 916            {
 0917                throw new ArgumentNullException(nameof(resourceGroupName));
 918            }
 0919            if (virtualNetworkGatewayName == null)
 920            {
 0921                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 922            }
 923
 0924            using var message = CreateGetVpnProfilePackageUrlRequest(resourceGroupName, virtualNetworkGatewayName);
 0925            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0926            switch (message.Response.Status)
 927            {
 928                case 200:
 929                case 202:
 0930                    return message.Response;
 931                default:
 0932                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 933            }
 0934        }
 935
 936        /// <summary> Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified reso
 937        /// <param name="resourceGroupName"> The name of the resource group. </param>
 938        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 939        /// <param name="cancellationToken"> The cancellation token to use. </param>
 940        public Response GetVpnProfilePackageUrl(string resourceGroupName, string virtualNetworkGatewayName, Cancellation
 941        {
 0942            if (resourceGroupName == null)
 943            {
 0944                throw new ArgumentNullException(nameof(resourceGroupName));
 945            }
 0946            if (virtualNetworkGatewayName == null)
 947            {
 0948                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 949            }
 950
 0951            using var message = CreateGetVpnProfilePackageUrlRequest(resourceGroupName, virtualNetworkGatewayName);
 0952            _pipeline.Send(message, cancellationToken);
 0953            switch (message.Response.Status)
 954            {
 955                case 200:
 956                case 202:
 0957                    return message.Response;
 958                default:
 0959                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 960            }
 0961        }
 962
 963        internal HttpMessage CreateGetBgpPeerStatusRequest(string resourceGroupName, string virtualNetworkGatewayName, s
 964        {
 0965            var message = _pipeline.CreateMessage();
 0966            var request = message.Request;
 0967            request.Method = RequestMethod.Post;
 0968            var uri = new RawRequestUriBuilder();
 0969            uri.Reset(endpoint);
 0970            uri.AppendPath("/subscriptions/", false);
 0971            uri.AppendPath(subscriptionId, true);
 0972            uri.AppendPath("/resourceGroups/", false);
 0973            uri.AppendPath(resourceGroupName, true);
 0974            uri.AppendPath("/providers/Microsoft.Network/virtualNetworkGateways/", false);
 0975            uri.AppendPath(virtualNetworkGatewayName, true);
 0976            uri.AppendPath("/getBgpPeerStatus", false);
 0977            if (peer != null)
 978            {
 0979                uri.AppendQuery("peer", peer, true);
 980            }
 0981            uri.AppendQuery("api-version", "2020-04-01", true);
 0982            request.Uri = uri;
 0983            return message;
 984        }
 985
 986        /// <summary> The GetBgpPeerStatus operation retrieves the status of all BGP peers. </summary>
 987        /// <param name="resourceGroupName"> The name of the resource group. </param>
 988        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 989        /// <param name="peer"> The IP address of the peer to retrieve the status of. </param>
 990        /// <param name="cancellationToken"> The cancellation token to use. </param>
 991        public async Task<Response> GetBgpPeerStatusAsync(string resourceGroupName, string virtualNetworkGatewayName, st
 992        {
 0993            if (resourceGroupName == null)
 994            {
 0995                throw new ArgumentNullException(nameof(resourceGroupName));
 996            }
 0997            if (virtualNetworkGatewayName == null)
 998            {
 0999                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1000            }
 1001
 01002            using var message = CreateGetBgpPeerStatusRequest(resourceGroupName, virtualNetworkGatewayName, peer);
 01003            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01004            switch (message.Response.Status)
 1005            {
 1006                case 200:
 1007                case 202:
 01008                    return message.Response;
 1009                default:
 01010                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1011            }
 01012        }
 1013
 1014        /// <summary> The GetBgpPeerStatus operation retrieves the status of all BGP peers. </summary>
 1015        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1016        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1017        /// <param name="peer"> The IP address of the peer to retrieve the status of. </param>
 1018        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1019        public Response GetBgpPeerStatus(string resourceGroupName, string virtualNetworkGatewayName, string peer = null,
 1020        {
 01021            if (resourceGroupName == null)
 1022            {
 01023                throw new ArgumentNullException(nameof(resourceGroupName));
 1024            }
 01025            if (virtualNetworkGatewayName == null)
 1026            {
 01027                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1028            }
 1029
 01030            using var message = CreateGetBgpPeerStatusRequest(resourceGroupName, virtualNetworkGatewayName, peer);
 01031            _pipeline.Send(message, cancellationToken);
 01032            switch (message.Response.Status)
 1033            {
 1034                case 200:
 1035                case 202:
 01036                    return message.Response;
 1037                default:
 01038                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1039            }
 01040        }
 1041
 1042        internal HttpMessage CreateSupportedVpnDevicesRequest(string resourceGroupName, string virtualNetworkGatewayName
 1043        {
 01044            var message = _pipeline.CreateMessage();
 01045            var request = message.Request;
 01046            request.Method = RequestMethod.Post;
 01047            var uri = new RawRequestUriBuilder();
 01048            uri.Reset(endpoint);
 01049            uri.AppendPath("/subscriptions/", false);
 01050            uri.AppendPath(subscriptionId, true);
 01051            uri.AppendPath("/resourceGroups/", false);
 01052            uri.AppendPath(resourceGroupName, true);
 01053            uri.AppendPath("/providers/Microsoft.Network/virtualNetworkGateways/", false);
 01054            uri.AppendPath(virtualNetworkGatewayName, true);
 01055            uri.AppendPath("/supportedvpndevices", false);
 01056            uri.AppendQuery("api-version", "2020-04-01", true);
 01057            request.Uri = uri;
 01058            return message;
 1059        }
 1060
 1061        /// <summary> Gets a xml format representation for supported vpn devices. </summary>
 1062        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1063        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1064        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1065        public async Task<Response<string>> SupportedVpnDevicesAsync(string resourceGroupName, string virtualNetworkGate
 1066        {
 01067            if (resourceGroupName == null)
 1068            {
 01069                throw new ArgumentNullException(nameof(resourceGroupName));
 1070            }
 01071            if (virtualNetworkGatewayName == null)
 1072            {
 01073                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1074            }
 1075
 01076            using var message = CreateSupportedVpnDevicesRequest(resourceGroupName, virtualNetworkGatewayName);
 01077            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01078            switch (message.Response.Status)
 1079            {
 1080                case 200:
 1081                    {
 01082                        string value = default;
 01083                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 01084                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1085                        {
 01086                            value = null;
 1087                        }
 1088                        else
 1089                        {
 01090                            value = document.RootElement.GetString();
 1091                        }
 01092                        return Response.FromValue(value, message.Response);
 1093                    }
 1094                default:
 01095                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1096            }
 01097        }
 1098
 1099        /// <summary> Gets a xml format representation for supported vpn devices. </summary>
 1100        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1101        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1102        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1103        public Response<string> SupportedVpnDevices(string resourceGroupName, string virtualNetworkGatewayName, Cancella
 1104        {
 01105            if (resourceGroupName == null)
 1106            {
 01107                throw new ArgumentNullException(nameof(resourceGroupName));
 1108            }
 01109            if (virtualNetworkGatewayName == null)
 1110            {
 01111                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1112            }
 1113
 01114            using var message = CreateSupportedVpnDevicesRequest(resourceGroupName, virtualNetworkGatewayName);
 01115            _pipeline.Send(message, cancellationToken);
 01116            switch (message.Response.Status)
 1117            {
 1118                case 200:
 1119                    {
 01120                        string value = default;
 01121                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01122                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1123                        {
 01124                            value = null;
 1125                        }
 1126                        else
 1127                        {
 01128                            value = document.RootElement.GetString();
 1129                        }
 01130                        return Response.FromValue(value, message.Response);
 1131                    }
 1132                default:
 01133                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1134            }
 01135        }
 1136
 1137        internal HttpMessage CreateGetLearnedRoutesRequest(string resourceGroupName, string virtualNetworkGatewayName)
 1138        {
 01139            var message = _pipeline.CreateMessage();
 01140            var request = message.Request;
 01141            request.Method = RequestMethod.Post;
 01142            var uri = new RawRequestUriBuilder();
 01143            uri.Reset(endpoint);
 01144            uri.AppendPath("/subscriptions/", false);
 01145            uri.AppendPath(subscriptionId, true);
 01146            uri.AppendPath("/resourceGroups/", false);
 01147            uri.AppendPath(resourceGroupName, true);
 01148            uri.AppendPath("/providers/Microsoft.Network/virtualNetworkGateways/", false);
 01149            uri.AppendPath(virtualNetworkGatewayName, true);
 01150            uri.AppendPath("/getLearnedRoutes", false);
 01151            uri.AppendQuery("api-version", "2020-04-01", true);
 01152            request.Uri = uri;
 01153            return message;
 1154        }
 1155
 1156        /// <summary> This operation retrieves a list of routes the virtual network gateway has learned, including route
 1157        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1158        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1159        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1160        public async Task<Response> GetLearnedRoutesAsync(string resourceGroupName, string virtualNetworkGatewayName, Ca
 1161        {
 01162            if (resourceGroupName == null)
 1163            {
 01164                throw new ArgumentNullException(nameof(resourceGroupName));
 1165            }
 01166            if (virtualNetworkGatewayName == null)
 1167            {
 01168                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1169            }
 1170
 01171            using var message = CreateGetLearnedRoutesRequest(resourceGroupName, virtualNetworkGatewayName);
 01172            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01173            switch (message.Response.Status)
 1174            {
 1175                case 200:
 1176                case 202:
 01177                    return message.Response;
 1178                default:
 01179                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1180            }
 01181        }
 1182
 1183        /// <summary> This operation retrieves a list of routes the virtual network gateway has learned, including route
 1184        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1185        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1186        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1187        public Response GetLearnedRoutes(string resourceGroupName, string virtualNetworkGatewayName, CancellationToken c
 1188        {
 01189            if (resourceGroupName == null)
 1190            {
 01191                throw new ArgumentNullException(nameof(resourceGroupName));
 1192            }
 01193            if (virtualNetworkGatewayName == null)
 1194            {
 01195                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1196            }
 1197
 01198            using var message = CreateGetLearnedRoutesRequest(resourceGroupName, virtualNetworkGatewayName);
 01199            _pipeline.Send(message, cancellationToken);
 01200            switch (message.Response.Status)
 1201            {
 1202                case 200:
 1203                case 202:
 01204                    return message.Response;
 1205                default:
 01206                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1207            }
 01208        }
 1209
 1210        internal HttpMessage CreateGetAdvertisedRoutesRequest(string resourceGroupName, string virtualNetworkGatewayName
 1211        {
 01212            var message = _pipeline.CreateMessage();
 01213            var request = message.Request;
 01214            request.Method = RequestMethod.Post;
 01215            var uri = new RawRequestUriBuilder();
 01216            uri.Reset(endpoint);
 01217            uri.AppendPath("/subscriptions/", false);
 01218            uri.AppendPath(subscriptionId, true);
 01219            uri.AppendPath("/resourceGroups/", false);
 01220            uri.AppendPath(resourceGroupName, true);
 01221            uri.AppendPath("/providers/Microsoft.Network/virtualNetworkGateways/", false);
 01222            uri.AppendPath(virtualNetworkGatewayName, true);
 01223            uri.AppendPath("/getAdvertisedRoutes", false);
 01224            uri.AppendQuery("peer", peer, true);
 01225            uri.AppendQuery("api-version", "2020-04-01", true);
 01226            request.Uri = uri;
 01227            return message;
 1228        }
 1229
 1230        /// <summary> This operation retrieves a list of routes the virtual network gateway is advertising to the specif
 1231        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1232        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1233        /// <param name="peer"> The IP address of the peer. </param>
 1234        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1235        public async Task<Response> GetAdvertisedRoutesAsync(string resourceGroupName, string virtualNetworkGatewayName,
 1236        {
 01237            if (resourceGroupName == null)
 1238            {
 01239                throw new ArgumentNullException(nameof(resourceGroupName));
 1240            }
 01241            if (virtualNetworkGatewayName == null)
 1242            {
 01243                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1244            }
 01245            if (peer == null)
 1246            {
 01247                throw new ArgumentNullException(nameof(peer));
 1248            }
 1249
 01250            using var message = CreateGetAdvertisedRoutesRequest(resourceGroupName, virtualNetworkGatewayName, peer);
 01251            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01252            switch (message.Response.Status)
 1253            {
 1254                case 200:
 1255                case 202:
 01256                    return message.Response;
 1257                default:
 01258                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1259            }
 01260        }
 1261
 1262        /// <summary> This operation retrieves a list of routes the virtual network gateway is advertising to the specif
 1263        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1264        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1265        /// <param name="peer"> The IP address of the peer. </param>
 1266        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1267        public Response GetAdvertisedRoutes(string resourceGroupName, string virtualNetworkGatewayName, string peer, Can
 1268        {
 01269            if (resourceGroupName == null)
 1270            {
 01271                throw new ArgumentNullException(nameof(resourceGroupName));
 1272            }
 01273            if (virtualNetworkGatewayName == null)
 1274            {
 01275                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1276            }
 01277            if (peer == null)
 1278            {
 01279                throw new ArgumentNullException(nameof(peer));
 1280            }
 1281
 01282            using var message = CreateGetAdvertisedRoutesRequest(resourceGroupName, virtualNetworkGatewayName, peer);
 01283            _pipeline.Send(message, cancellationToken);
 01284            switch (message.Response.Status)
 1285            {
 1286                case 200:
 1287                case 202:
 01288                    return message.Response;
 1289                default:
 01290                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1291            }
 01292        }
 1293
 1294        internal HttpMessage CreateSetVpnclientIpsecParametersRequest(string resourceGroupName, string virtualNetworkGat
 1295        {
 01296            var message = _pipeline.CreateMessage();
 01297            var request = message.Request;
 01298            request.Method = RequestMethod.Post;
 01299            var uri = new RawRequestUriBuilder();
 01300            uri.Reset(endpoint);
 01301            uri.AppendPath("/subscriptions/", false);
 01302            uri.AppendPath(subscriptionId, true);
 01303            uri.AppendPath("/resourceGroups/", false);
 01304            uri.AppendPath(resourceGroupName, true);
 01305            uri.AppendPath("/providers/Microsoft.Network/virtualNetworkGateways/", false);
 01306            uri.AppendPath(virtualNetworkGatewayName, true);
 01307            uri.AppendPath("/setvpnclientipsecparameters", false);
 01308            uri.AppendQuery("api-version", "2020-04-01", true);
 01309            request.Uri = uri;
 01310            request.Headers.Add("Content-Type", "application/json");
 01311            var content = new Utf8JsonRequestContent();
 01312            content.JsonWriter.WriteObjectValue(vpnclientIpsecParams);
 01313            request.Content = content;
 01314            return message;
 1315        }
 1316
 1317        /// <summary> The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtu
 1318        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1319        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1320        /// <param name="vpnclientIpsecParams"> Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtu
 1321        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1322        public async Task<Response> SetVpnclientIpsecParametersAsync(string resourceGroupName, string virtualNetworkGate
 1323        {
 01324            if (resourceGroupName == null)
 1325            {
 01326                throw new ArgumentNullException(nameof(resourceGroupName));
 1327            }
 01328            if (virtualNetworkGatewayName == null)
 1329            {
 01330                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1331            }
 01332            if (vpnclientIpsecParams == null)
 1333            {
 01334                throw new ArgumentNullException(nameof(vpnclientIpsecParams));
 1335            }
 1336
 01337            using var message = CreateSetVpnclientIpsecParametersRequest(resourceGroupName, virtualNetworkGatewayName, v
 01338            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01339            switch (message.Response.Status)
 1340            {
 1341                case 200:
 1342                case 202:
 01343                    return message.Response;
 1344                default:
 01345                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1346            }
 01347        }
 1348
 1349        /// <summary> The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtu
 1350        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1351        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1352        /// <param name="vpnclientIpsecParams"> Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtu
 1353        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1354        public Response SetVpnclientIpsecParameters(string resourceGroupName, string virtualNetworkGatewayName, VpnClien
 1355        {
 01356            if (resourceGroupName == null)
 1357            {
 01358                throw new ArgumentNullException(nameof(resourceGroupName));
 1359            }
 01360            if (virtualNetworkGatewayName == null)
 1361            {
 01362                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1363            }
 01364            if (vpnclientIpsecParams == null)
 1365            {
 01366                throw new ArgumentNullException(nameof(vpnclientIpsecParams));
 1367            }
 1368
 01369            using var message = CreateSetVpnclientIpsecParametersRequest(resourceGroupName, virtualNetworkGatewayName, v
 01370            _pipeline.Send(message, cancellationToken);
 01371            switch (message.Response.Status)
 1372            {
 1373                case 200:
 1374                case 202:
 01375                    return message.Response;
 1376                default:
 01377                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1378            }
 01379        }
 1380
 1381        internal HttpMessage CreateGetVpnclientIpsecParametersRequest(string resourceGroupName, string virtualNetworkGat
 1382        {
 01383            var message = _pipeline.CreateMessage();
 01384            var request = message.Request;
 01385            request.Method = RequestMethod.Post;
 01386            var uri = new RawRequestUriBuilder();
 01387            uri.Reset(endpoint);
 01388            uri.AppendPath("/subscriptions/", false);
 01389            uri.AppendPath(subscriptionId, true);
 01390            uri.AppendPath("/resourceGroups/", false);
 01391            uri.AppendPath(resourceGroupName, true);
 01392            uri.AppendPath("/providers/Microsoft.Network/virtualNetworkGateways/", false);
 01393            uri.AppendPath(virtualNetworkGatewayName, true);
 01394            uri.AppendPath("/getvpnclientipsecparameters", false);
 01395            uri.AppendQuery("api-version", "2020-04-01", true);
 01396            request.Uri = uri;
 01397            return message;
 1398        }
 1399
 1400        /// <summary> The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy 
 1401        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1402        /// <param name="virtualNetworkGatewayName"> The virtual network gateway name. </param>
 1403        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1404        public async Task<Response> GetVpnclientIpsecParametersAsync(string resourceGroupName, string virtualNetworkGate
 1405        {
 01406            if (resourceGroupName == null)
 1407            {
 01408                throw new ArgumentNullException(nameof(resourceGroupName));
 1409            }
 01410            if (virtualNetworkGatewayName == null)
 1411            {
 01412                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1413            }
 1414
 01415            using var message = CreateGetVpnclientIpsecParametersRequest(resourceGroupName, virtualNetworkGatewayName);
 01416            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01417            switch (message.Response.Status)
 1418            {
 1419                case 200:
 01420                    return message.Response;
 1421                default:
 01422                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1423            }
 01424        }
 1425
 1426        /// <summary> The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy 
 1427        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1428        /// <param name="virtualNetworkGatewayName"> The virtual network gateway name. </param>
 1429        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1430        public Response GetVpnclientIpsecParameters(string resourceGroupName, string virtualNetworkGatewayName, Cancella
 1431        {
 01432            if (resourceGroupName == null)
 1433            {
 01434                throw new ArgumentNullException(nameof(resourceGroupName));
 1435            }
 01436            if (virtualNetworkGatewayName == null)
 1437            {
 01438                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1439            }
 1440
 01441            using var message = CreateGetVpnclientIpsecParametersRequest(resourceGroupName, virtualNetworkGatewayName);
 01442            _pipeline.Send(message, cancellationToken);
 01443            switch (message.Response.Status)
 1444            {
 1445                case 200:
 01446                    return message.Response;
 1447                default:
 01448                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1449            }
 01450        }
 1451
 1452        internal HttpMessage CreateVpnDeviceConfigurationScriptRequest(string resourceGroupName, string virtualNetworkGa
 1453        {
 01454            var message = _pipeline.CreateMessage();
 01455            var request = message.Request;
 01456            request.Method = RequestMethod.Post;
 01457            var uri = new RawRequestUriBuilder();
 01458            uri.Reset(endpoint);
 01459            uri.AppendPath("/subscriptions/", false);
 01460            uri.AppendPath(subscriptionId, true);
 01461            uri.AppendPath("/resourceGroups/", false);
 01462            uri.AppendPath(resourceGroupName, true);
 01463            uri.AppendPath("/providers/Microsoft.Network/connections/", false);
 01464            uri.AppendPath(virtualNetworkGatewayConnectionName, true);
 01465            uri.AppendPath("/vpndeviceconfigurationscript", false);
 01466            uri.AppendQuery("api-version", "2020-04-01", true);
 01467            request.Uri = uri;
 01468            request.Headers.Add("Content-Type", "application/json");
 01469            var content = new Utf8JsonRequestContent();
 01470            content.JsonWriter.WriteObjectValue(parameters);
 01471            request.Content = content;
 01472            return message;
 1473        }
 1474
 1475        /// <summary> Gets a xml format representation for vpn device configuration script. </summary>
 1476        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1477        /// <param name="virtualNetworkGatewayConnectionName"> The name of the virtual network gateway connection for wh
 1478        /// <param name="parameters"> Parameters supplied to the generate vpn device script operation. </param>
 1479        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1480        public async Task<Response<string>> VpnDeviceConfigurationScriptAsync(string resourceGroupName, string virtualNe
 1481        {
 01482            if (resourceGroupName == null)
 1483            {
 01484                throw new ArgumentNullException(nameof(resourceGroupName));
 1485            }
 01486            if (virtualNetworkGatewayConnectionName == null)
 1487            {
 01488                throw new ArgumentNullException(nameof(virtualNetworkGatewayConnectionName));
 1489            }
 01490            if (parameters == null)
 1491            {
 01492                throw new ArgumentNullException(nameof(parameters));
 1493            }
 1494
 01495            using var message = CreateVpnDeviceConfigurationScriptRequest(resourceGroupName, virtualNetworkGatewayConnec
 01496            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01497            switch (message.Response.Status)
 1498            {
 1499                case 200:
 1500                    {
 01501                        string value = default;
 01502                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 01503                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1504                        {
 01505                            value = null;
 1506                        }
 1507                        else
 1508                        {
 01509                            value = document.RootElement.GetString();
 1510                        }
 01511                        return Response.FromValue(value, message.Response);
 1512                    }
 1513                default:
 01514                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1515            }
 01516        }
 1517
 1518        /// <summary> Gets a xml format representation for vpn device configuration script. </summary>
 1519        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1520        /// <param name="virtualNetworkGatewayConnectionName"> The name of the virtual network gateway connection for wh
 1521        /// <param name="parameters"> Parameters supplied to the generate vpn device script operation. </param>
 1522        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1523        public Response<string> VpnDeviceConfigurationScript(string resourceGroupName, string virtualNetworkGatewayConne
 1524        {
 01525            if (resourceGroupName == null)
 1526            {
 01527                throw new ArgumentNullException(nameof(resourceGroupName));
 1528            }
 01529            if (virtualNetworkGatewayConnectionName == null)
 1530            {
 01531                throw new ArgumentNullException(nameof(virtualNetworkGatewayConnectionName));
 1532            }
 01533            if (parameters == null)
 1534            {
 01535                throw new ArgumentNullException(nameof(parameters));
 1536            }
 1537
 01538            using var message = CreateVpnDeviceConfigurationScriptRequest(resourceGroupName, virtualNetworkGatewayConnec
 01539            _pipeline.Send(message, cancellationToken);
 01540            switch (message.Response.Status)
 1541            {
 1542                case 200:
 1543                    {
 01544                        string value = default;
 01545                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01546                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1547                        {
 01548                            value = null;
 1549                        }
 1550                        else
 1551                        {
 01552                            value = document.RootElement.GetString();
 1553                        }
 01554                        return Response.FromValue(value, message.Response);
 1555                    }
 1556                default:
 01557                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1558            }
 01559        }
 1560
 1561        internal HttpMessage CreateStartPacketCaptureRequest(string resourceGroupName, string virtualNetworkGatewayName,
 1562        {
 01563            var message = _pipeline.CreateMessage();
 01564            var request = message.Request;
 01565            request.Method = RequestMethod.Post;
 01566            var uri = new RawRequestUriBuilder();
 01567            uri.Reset(endpoint);
 01568            uri.AppendPath("/subscriptions/", false);
 01569            uri.AppendPath(subscriptionId, true);
 01570            uri.AppendPath("/resourceGroups/", false);
 01571            uri.AppendPath(resourceGroupName, true);
 01572            uri.AppendPath("/providers/Microsoft.Network/virtualNetworkGateways/", false);
 01573            uri.AppendPath(virtualNetworkGatewayName, true);
 01574            uri.AppendPath("/startPacketCapture", false);
 01575            uri.AppendQuery("api-version", "2020-04-01", true);
 01576            request.Uri = uri;
 01577            request.Headers.Add("Content-Type", "application/json");
 01578            if (parameters != null)
 1579            {
 01580                var content = new Utf8JsonRequestContent();
 01581                content.JsonWriter.WriteObjectValue(parameters);
 01582                request.Content = content;
 1583            }
 01584            return message;
 1585        }
 1586
 1587        /// <summary> Starts packet capture on virtual network gateway in the specified resource group. </summary>
 1588        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1589        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1590        /// <param name="parameters"> Virtual network gateway packet capture parameters supplied to start packet capture
 1591        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1592        public async Task<Response> StartPacketCaptureAsync(string resourceGroupName, string virtualNetworkGatewayName, 
 1593        {
 01594            if (resourceGroupName == null)
 1595            {
 01596                throw new ArgumentNullException(nameof(resourceGroupName));
 1597            }
 01598            if (virtualNetworkGatewayName == null)
 1599            {
 01600                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1601            }
 1602
 01603            using var message = CreateStartPacketCaptureRequest(resourceGroupName, virtualNetworkGatewayName, parameters
 01604            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01605            switch (message.Response.Status)
 1606            {
 1607                case 200:
 1608                case 202:
 01609                    return message.Response;
 1610                default:
 01611                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1612            }
 01613        }
 1614
 1615        /// <summary> Starts packet capture on virtual network gateway in the specified resource group. </summary>
 1616        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1617        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1618        /// <param name="parameters"> Virtual network gateway packet capture parameters supplied to start packet capture
 1619        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1620        public Response StartPacketCapture(string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureS
 1621        {
 01622            if (resourceGroupName == null)
 1623            {
 01624                throw new ArgumentNullException(nameof(resourceGroupName));
 1625            }
 01626            if (virtualNetworkGatewayName == null)
 1627            {
 01628                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1629            }
 1630
 01631            using var message = CreateStartPacketCaptureRequest(resourceGroupName, virtualNetworkGatewayName, parameters
 01632            _pipeline.Send(message, cancellationToken);
 01633            switch (message.Response.Status)
 1634            {
 1635                case 200:
 1636                case 202:
 01637                    return message.Response;
 1638                default:
 01639                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1640            }
 01641        }
 1642
 1643        internal HttpMessage CreateStopPacketCaptureRequest(string resourceGroupName, string virtualNetworkGatewayName, 
 1644        {
 01645            var message = _pipeline.CreateMessage();
 01646            var request = message.Request;
 01647            request.Method = RequestMethod.Post;
 01648            var uri = new RawRequestUriBuilder();
 01649            uri.Reset(endpoint);
 01650            uri.AppendPath("/subscriptions/", false);
 01651            uri.AppendPath(subscriptionId, true);
 01652            uri.AppendPath("/resourceGroups/", false);
 01653            uri.AppendPath(resourceGroupName, true);
 01654            uri.AppendPath("/providers/Microsoft.Network/virtualNetworkGateways/", false);
 01655            uri.AppendPath(virtualNetworkGatewayName, true);
 01656            uri.AppendPath("/stopPacketCapture", false);
 01657            uri.AppendQuery("api-version", "2020-04-01", true);
 01658            request.Uri = uri;
 01659            request.Headers.Add("Content-Type", "application/json");
 01660            var content = new Utf8JsonRequestContent();
 01661            content.JsonWriter.WriteObjectValue(parameters);
 01662            request.Content = content;
 01663            return message;
 1664        }
 1665
 1666        /// <summary> Stops packet capture on virtual network gateway in the specified resource group. </summary>
 1667        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1668        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1669        /// <param name="parameters"> Virtual network gateway packet capture parameters supplied to stop packet capture 
 1670        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1671        public async Task<Response> StopPacketCaptureAsync(string resourceGroupName, string virtualNetworkGatewayName, V
 1672        {
 01673            if (resourceGroupName == null)
 1674            {
 01675                throw new ArgumentNullException(nameof(resourceGroupName));
 1676            }
 01677            if (virtualNetworkGatewayName == null)
 1678            {
 01679                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1680            }
 01681            if (parameters == null)
 1682            {
 01683                throw new ArgumentNullException(nameof(parameters));
 1684            }
 1685
 01686            using var message = CreateStopPacketCaptureRequest(resourceGroupName, virtualNetworkGatewayName, parameters)
 01687            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01688            switch (message.Response.Status)
 1689            {
 1690                case 200:
 1691                case 202:
 01692                    return message.Response;
 1693                default:
 01694                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1695            }
 01696        }
 1697
 1698        /// <summary> Stops packet capture on virtual network gateway in the specified resource group. </summary>
 1699        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1700        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1701        /// <param name="parameters"> Virtual network gateway packet capture parameters supplied to stop packet capture 
 1702        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1703        public Response StopPacketCapture(string resourceGroupName, string virtualNetworkGatewayName, VpnPacketCaptureSt
 1704        {
 01705            if (resourceGroupName == null)
 1706            {
 01707                throw new ArgumentNullException(nameof(resourceGroupName));
 1708            }
 01709            if (virtualNetworkGatewayName == null)
 1710            {
 01711                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1712            }
 01713            if (parameters == null)
 1714            {
 01715                throw new ArgumentNullException(nameof(parameters));
 1716            }
 1717
 01718            using var message = CreateStopPacketCaptureRequest(resourceGroupName, virtualNetworkGatewayName, parameters)
 01719            _pipeline.Send(message, cancellationToken);
 01720            switch (message.Response.Status)
 1721            {
 1722                case 200:
 1723                case 202:
 01724                    return message.Response;
 1725                default:
 01726                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1727            }
 01728        }
 1729
 1730        internal HttpMessage CreateGetVpnclientConnectionHealthRequest(string resourceGroupName, string virtualNetworkGa
 1731        {
 01732            var message = _pipeline.CreateMessage();
 01733            var request = message.Request;
 01734            request.Method = RequestMethod.Post;
 01735            var uri = new RawRequestUriBuilder();
 01736            uri.Reset(endpoint);
 01737            uri.AppendPath("/subscriptions/", false);
 01738            uri.AppendPath(subscriptionId, true);
 01739            uri.AppendPath("/resourceGroups/", false);
 01740            uri.AppendPath(resourceGroupName, true);
 01741            uri.AppendPath("/providers/Microsoft.Network/virtualNetworkGateways/", false);
 01742            uri.AppendPath(virtualNetworkGatewayName, true);
 01743            uri.AppendPath("/getVpnClientConnectionHealth", false);
 01744            uri.AppendQuery("api-version", "2020-04-01", true);
 01745            request.Uri = uri;
 01746            return message;
 1747        }
 1748
 1749        /// <summary> Get VPN client connection health detail per P2S client connection of the virtual network gateway i
 1750        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1751        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1752        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1753        public async Task<Response> GetVpnclientConnectionHealthAsync(string resourceGroupName, string virtualNetworkGat
 1754        {
 01755            if (resourceGroupName == null)
 1756            {
 01757                throw new ArgumentNullException(nameof(resourceGroupName));
 1758            }
 01759            if (virtualNetworkGatewayName == null)
 1760            {
 01761                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1762            }
 1763
 01764            using var message = CreateGetVpnclientConnectionHealthRequest(resourceGroupName, virtualNetworkGatewayName);
 01765            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01766            switch (message.Response.Status)
 1767            {
 1768                case 200:
 1769                case 202:
 01770                    return message.Response;
 1771                default:
 01772                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1773            }
 01774        }
 1775
 1776        /// <summary> Get VPN client connection health detail per P2S client connection of the virtual network gateway i
 1777        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1778        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1779        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1780        public Response GetVpnclientConnectionHealth(string resourceGroupName, string virtualNetworkGatewayName, Cancell
 1781        {
 01782            if (resourceGroupName == null)
 1783            {
 01784                throw new ArgumentNullException(nameof(resourceGroupName));
 1785            }
 01786            if (virtualNetworkGatewayName == null)
 1787            {
 01788                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1789            }
 1790
 01791            using var message = CreateGetVpnclientConnectionHealthRequest(resourceGroupName, virtualNetworkGatewayName);
 01792            _pipeline.Send(message, cancellationToken);
 01793            switch (message.Response.Status)
 1794            {
 1795                case 200:
 1796                case 202:
 01797                    return message.Response;
 1798                default:
 01799                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1800            }
 01801        }
 1802
 1803        internal HttpMessage CreateDisconnectVirtualNetworkGatewayVpnConnectionsRequest(string resourceGroupName, string
 1804        {
 01805            var message = _pipeline.CreateMessage();
 01806            var request0 = message.Request;
 01807            request0.Method = RequestMethod.Post;
 01808            var uri = new RawRequestUriBuilder();
 01809            uri.Reset(endpoint);
 01810            uri.AppendPath("/subscriptions/", false);
 01811            uri.AppendPath(subscriptionId, true);
 01812            uri.AppendPath("/resourceGroups/", false);
 01813            uri.AppendPath(resourceGroupName, true);
 01814            uri.AppendPath("/providers/Microsoft.Network/virtualNetworkGateways/", false);
 01815            uri.AppendPath(virtualNetworkGatewayName, true);
 01816            uri.AppendPath("/disconnectVirtualNetworkGatewayVpnConnections", false);
 01817            uri.AppendQuery("api-version", "2020-04-01", true);
 01818            request0.Uri = uri;
 01819            request0.Headers.Add("Content-Type", "application/json");
 01820            var content = new Utf8JsonRequestContent();
 01821            content.JsonWriter.WriteObjectValue(request);
 01822            request0.Content = content;
 01823            return message;
 1824        }
 1825
 1826        /// <summary> Disconnect vpn connections of virtual network gateway in the specified resource group. </summary>
 1827        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1828        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1829        /// <param name="request"> The parameters are supplied to disconnect vpn connections. </param>
 1830        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1831        public async Task<Response> DisconnectVirtualNetworkGatewayVpnConnectionsAsync(string resourceGroupName, string 
 1832        {
 01833            if (resourceGroupName == null)
 1834            {
 01835                throw new ArgumentNullException(nameof(resourceGroupName));
 1836            }
 01837            if (virtualNetworkGatewayName == null)
 1838            {
 01839                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1840            }
 01841            if (request == null)
 1842            {
 01843                throw new ArgumentNullException(nameof(request));
 1844            }
 1845
 01846            using var message = CreateDisconnectVirtualNetworkGatewayVpnConnectionsRequest(resourceGroupName, virtualNet
 01847            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01848            switch (message.Response.Status)
 1849            {
 1850                case 200:
 1851                case 202:
 01852                    return message.Response;
 1853                default:
 01854                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1855            }
 01856        }
 1857
 1858        /// <summary> Disconnect vpn connections of virtual network gateway in the specified resource group. </summary>
 1859        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1860        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1861        /// <param name="request"> The parameters are supplied to disconnect vpn connections. </param>
 1862        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1863        public Response DisconnectVirtualNetworkGatewayVpnConnections(string resourceGroupName, string virtualNetworkGat
 1864        {
 01865            if (resourceGroupName == null)
 1866            {
 01867                throw new ArgumentNullException(nameof(resourceGroupName));
 1868            }
 01869            if (virtualNetworkGatewayName == null)
 1870            {
 01871                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1872            }
 01873            if (request == null)
 1874            {
 01875                throw new ArgumentNullException(nameof(request));
 1876            }
 1877
 01878            using var message = CreateDisconnectVirtualNetworkGatewayVpnConnectionsRequest(resourceGroupName, virtualNet
 01879            _pipeline.Send(message, cancellationToken);
 01880            switch (message.Response.Status)
 1881            {
 1882                case 200:
 1883                case 202:
 01884                    return message.Response;
 1885                default:
 01886                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1887            }
 01888        }
 1889
 1890        internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName)
 1891        {
 01892            var message = _pipeline.CreateMessage();
 01893            var request = message.Request;
 01894            request.Method = RequestMethod.Get;
 01895            var uri = new RawRequestUriBuilder();
 01896            uri.Reset(endpoint);
 01897            uri.AppendRawNextLink(nextLink, false);
 01898            request.Uri = uri;
 01899            return message;
 1900        }
 1901
 1902        /// <summary> Gets all virtual network gateways by resource group. </summary>
 1903        /// <param name="nextLink"> The URL to the next page of results. </param>
 1904        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1905        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1906        public async Task<Response<VirtualNetworkGatewayListResult>> ListNextPageAsync(string nextLink, string resourceG
 1907        {
 01908            if (nextLink == null)
 1909            {
 01910                throw new ArgumentNullException(nameof(nextLink));
 1911            }
 01912            if (resourceGroupName == null)
 1913            {
 01914                throw new ArgumentNullException(nameof(resourceGroupName));
 1915            }
 1916
 01917            using var message = CreateListNextPageRequest(nextLink, resourceGroupName);
 01918            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01919            switch (message.Response.Status)
 1920            {
 1921                case 200:
 1922                    {
 01923                        VirtualNetworkGatewayListResult value = default;
 01924                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 01925                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1926                        {
 01927                            value = null;
 1928                        }
 1929                        else
 1930                        {
 01931                            value = VirtualNetworkGatewayListResult.DeserializeVirtualNetworkGatewayListResult(document.
 1932                        }
 01933                        return Response.FromValue(value, message.Response);
 1934                    }
 1935                default:
 01936                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1937            }
 01938        }
 1939
 1940        /// <summary> Gets all virtual network gateways by resource group. </summary>
 1941        /// <param name="nextLink"> The URL to the next page of results. </param>
 1942        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1943        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1944        public Response<VirtualNetworkGatewayListResult> ListNextPage(string nextLink, string resourceGroupName, Cancell
 1945        {
 01946            if (nextLink == null)
 1947            {
 01948                throw new ArgumentNullException(nameof(nextLink));
 1949            }
 01950            if (resourceGroupName == null)
 1951            {
 01952                throw new ArgumentNullException(nameof(resourceGroupName));
 1953            }
 1954
 01955            using var message = CreateListNextPageRequest(nextLink, resourceGroupName);
 01956            _pipeline.Send(message, cancellationToken);
 01957            switch (message.Response.Status)
 1958            {
 1959                case 200:
 1960                    {
 01961                        VirtualNetworkGatewayListResult value = default;
 01962                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01963                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1964                        {
 01965                            value = null;
 1966                        }
 1967                        else
 1968                        {
 01969                            value = VirtualNetworkGatewayListResult.DeserializeVirtualNetworkGatewayListResult(document.
 1970                        }
 01971                        return Response.FromValue(value, message.Response);
 1972                    }
 1973                default:
 01974                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1975            }
 01976        }
 1977
 1978        internal HttpMessage CreateListConnectionsNextPageRequest(string nextLink, string resourceGroupName, string virt
 1979        {
 01980            var message = _pipeline.CreateMessage();
 01981            var request = message.Request;
 01982            request.Method = RequestMethod.Get;
 01983            var uri = new RawRequestUriBuilder();
 01984            uri.Reset(endpoint);
 01985            uri.AppendRawNextLink(nextLink, false);
 01986            request.Uri = uri;
 01987            return message;
 1988        }
 1989
 1990        /// <summary> Gets all the connections in a virtual network gateway. </summary>
 1991        /// <param name="nextLink"> The URL to the next page of results. </param>
 1992        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1993        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1994        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1995        public async Task<Response<VirtualNetworkGatewayListConnectionsResult>> ListConnectionsNextPageAsync(string next
 1996        {
 01997            if (nextLink == null)
 1998            {
 01999                throw new ArgumentNullException(nameof(nextLink));
 2000            }
 02001            if (resourceGroupName == null)
 2002            {
 02003                throw new ArgumentNullException(nameof(resourceGroupName));
 2004            }
 02005            if (virtualNetworkGatewayName == null)
 2006            {
 02007                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 2008            }
 2009
 02010            using var message = CreateListConnectionsNextPageRequest(nextLink, resourceGroupName, virtualNetworkGatewayN
 02011            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 02012            switch (message.Response.Status)
 2013            {
 2014                case 200:
 2015                    {
 02016                        VirtualNetworkGatewayListConnectionsResult value = default;
 02017                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 02018                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 2019                        {
 02020                            value = null;
 2021                        }
 2022                        else
 2023                        {
 02024                            value = VirtualNetworkGatewayListConnectionsResult.DeserializeVirtualNetworkGatewayListConne
 2025                        }
 02026                        return Response.FromValue(value, message.Response);
 2027                    }
 2028                default:
 02029                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 2030            }
 02031        }
 2032
 2033        /// <summary> Gets all the connections in a virtual network gateway. </summary>
 2034        /// <param name="nextLink"> The URL to the next page of results. </param>
 2035        /// <param name="resourceGroupName"> The name of the resource group. </param>
 2036        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 2037        /// <param name="cancellationToken"> The cancellation token to use. </param>
 2038        public Response<VirtualNetworkGatewayListConnectionsResult> ListConnectionsNextPage(string nextLink, string reso
 2039        {
 02040            if (nextLink == null)
 2041            {
 02042                throw new ArgumentNullException(nameof(nextLink));
 2043            }
 02044            if (resourceGroupName == null)
 2045            {
 02046                throw new ArgumentNullException(nameof(resourceGroupName));
 2047            }
 02048            if (virtualNetworkGatewayName == null)
 2049            {
 02050                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 2051            }
 2052
 02053            using var message = CreateListConnectionsNextPageRequest(nextLink, resourceGroupName, virtualNetworkGatewayN
 02054            _pipeline.Send(message, cancellationToken);
 02055            switch (message.Response.Status)
 2056            {
 2057                case 200:
 2058                    {
 02059                        VirtualNetworkGatewayListConnectionsResult value = default;
 02060                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 02061                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 2062                        {
 02063                            value = null;
 2064                        }
 2065                        else
 2066                        {
 02067                            value = VirtualNetworkGatewayListConnectionsResult.DeserializeVirtualNetworkGatewayListConne
 2068                        }
 02069                        return Response.FromValue(value, message.Response);
 2070                    }
 2071                default:
 02072                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 2073            }
 02074        }
 2075    }
 2076}

Methods/Properties

.ctor(...)
CreateCreateOrUpdateRequest(...)
CreateOrUpdateAsync()
CreateOrUpdate(...)
CreateGetRequest(...)
GetAsync()
Get(...)
CreateDeleteRequest(...)
DeleteAsync()
Delete(...)
CreateUpdateTagsRequest(...)
UpdateTagsAsync()
UpdateTags(...)
CreateListRequest(...)
ListAsync()
List(...)
CreateListConnectionsRequest(...)
ListConnectionsAsync()
ListConnections(...)
CreateResetRequest(...)
ResetAsync()
Reset(...)
CreateResetVpnClientSharedKeyRequest(...)
ResetVpnClientSharedKeyAsync()
ResetVpnClientSharedKey(...)
CreateGeneratevpnclientpackageRequest(...)
GeneratevpnclientpackageAsync()
Generatevpnclientpackage(...)
CreateGenerateVpnProfileRequest(...)
GenerateVpnProfileAsync()
GenerateVpnProfile(...)
CreateGetVpnProfilePackageUrlRequest(...)
GetVpnProfilePackageUrlAsync()
GetVpnProfilePackageUrl(...)
CreateGetBgpPeerStatusRequest(...)
GetBgpPeerStatusAsync()
GetBgpPeerStatus(...)
CreateSupportedVpnDevicesRequest(...)
SupportedVpnDevicesAsync()
SupportedVpnDevices(...)
CreateGetLearnedRoutesRequest(...)
GetLearnedRoutesAsync()
GetLearnedRoutes(...)
CreateGetAdvertisedRoutesRequest(...)
GetAdvertisedRoutesAsync()
GetAdvertisedRoutes(...)
CreateSetVpnclientIpsecParametersRequest(...)
SetVpnclientIpsecParametersAsync()
SetVpnclientIpsecParameters(...)
CreateGetVpnclientIpsecParametersRequest(...)
GetVpnclientIpsecParametersAsync()
GetVpnclientIpsecParameters(...)
CreateVpnDeviceConfigurationScriptRequest(...)
VpnDeviceConfigurationScriptAsync()
VpnDeviceConfigurationScript(...)
CreateStartPacketCaptureRequest(...)
StartPacketCaptureAsync()
StartPacketCapture(...)
CreateStopPacketCaptureRequest(...)
StopPacketCaptureAsync()
StopPacketCapture(...)
CreateGetVpnclientConnectionHealthRequest(...)
GetVpnclientConnectionHealthAsync()
GetVpnclientConnectionHealth(...)
CreateDisconnectVirtualNetworkGatewayVpnConnectionsRequest(...)
DisconnectVirtualNetworkGatewayVpnConnectionsAsync()
DisconnectVirtualNetworkGatewayVpnConnections(...)
CreateListNextPageRequest(...)
ListNextPageAsync()
ListNextPage(...)
CreateListConnectionsNextPageRequest(...)
ListConnectionsNextPageAsync()
ListConnectionsNextPage(...)