< Summary

Class:Azure.ResourceManager.Network.VirtualNetworkGatewaysOperations
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\VirtualNetworkGatewaysOperations.cs
Covered lines:48
Uncovered lines:522
Coverable lines:570
Total lines:1410
Line coverage:8.4% (48 of 570)
Covered branches:10
Total branches:180
Branch coverage:5.5% (10 of 180)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-100%100%
.ctor()-100%100%
.ctor(...)-100%100%
GetAsync()-57.14%100%
Get(...)-57.14%100%
SupportedVpnDevicesAsync()-0%100%
SupportedVpnDevices(...)-0%100%
VpnDeviceConfigurationScriptAsync()-0%100%
VpnDeviceConfigurationScript(...)-0%100%
ListAsync(...)-0%0%
<ListAsync()-0%100%
<ListAsync()-0%100%
List(...)-0%0%
ListConnectionsAsync(...)-38.1%50%
<ListConnectionsAsync()-62.5%100%
<ListConnectionsAsync()-0%100%
ListConnections(...)-38.1%50%
StartCreateOrUpdateAsync()-57.14%50%
StartCreateOrUpdate(...)-57.14%50%
StartDeleteAsync()-0%0%
StartDelete(...)-0%0%
StartUpdateTagsAsync()-0%0%
StartUpdateTags(...)-0%0%
StartResetAsync()-0%0%
StartReset(...)-0%0%
StartResetVpnClientSharedKeyAsync()-0%0%
StartResetVpnClientSharedKey(...)-0%0%
StartGeneratevpnclientpackageAsync()-0%0%
StartGeneratevpnclientpackage(...)-0%0%
StartGenerateVpnProfileAsync()-0%0%
StartGenerateVpnProfile(...)-0%0%
StartGetVpnProfilePackageUrlAsync()-0%0%
StartGetVpnProfilePackageUrl(...)-0%0%
StartGetBgpPeerStatusAsync()-0%0%
StartGetBgpPeerStatus(...)-0%0%
StartGetLearnedRoutesAsync()-0%0%
StartGetLearnedRoutes(...)-0%0%
StartGetAdvertisedRoutesAsync()-0%0%
StartGetAdvertisedRoutes(...)-0%0%
StartSetVpnclientIpsecParametersAsync()-0%0%
StartSetVpnclientIpsecParameters(...)-0%0%
StartGetVpnclientIpsecParametersAsync()-0%0%
StartGetVpnclientIpsecParameters(...)-0%0%
StartStartPacketCaptureAsync()-0%0%
StartStartPacketCapture(...)-0%0%
StartStopPacketCaptureAsync()-0%0%
StartStopPacketCapture(...)-0%0%
StartGetVpnclientConnectionHealthAsync()-0%0%
StartGetVpnclientConnectionHealth(...)-0%0%
StartDisconnectVirtualNetworkGatewayVpnConnectionsAsync()-0%0%
StartDisconnectVirtualNetworkGatewayVpnConnections(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\VirtualNetworkGatewaysOperations.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.Threading;
 10using System.Threading.Tasks;
 11using Azure;
 12using Azure.Core;
 13using Azure.Core.Pipeline;
 14using Azure.ResourceManager.Network.Models;
 15
 16namespace Azure.ResourceManager.Network
 17{
 18    /// <summary> The VirtualNetworkGateways service client. </summary>
 19    public partial class VirtualNetworkGatewaysOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 5223        internal VirtualNetworkGatewaysRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of VirtualNetworkGatewaysOperations for mocking. </summary>
 3625        protected VirtualNetworkGatewaysOperations()
 26        {
 3627        }
 28        /// <summary> Initializes a new instance of VirtualNetworkGatewaysOperations. </summary>
 29        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
 30        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
 31        /// <param name="subscriptionId"> The subscription credentials which uniquely identify the Microsoft Azure subsc
 32        /// <param name="endpoint"> server parameter. </param>
 3633        internal VirtualNetworkGatewaysOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string sub
 34        {
 3635            RestClient = new VirtualNetworkGatewaysRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint)
 3636            _clientDiagnostics = clientDiagnostics;
 3637            _pipeline = pipeline;
 3638        }
 39
 40        /// <summary> Gets the specified virtual network gateway by resource group. </summary>
 41        /// <param name="resourceGroupName"> The name of the resource group. </param>
 42        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 43        /// <param name="cancellationToken"> The cancellation token to use. </param>
 44        public virtual async Task<Response<VirtualNetworkGateway>> GetAsync(string resourceGroupName, string virtualNetw
 45        {
 846            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.Get");
 847            scope.Start();
 48            try
 49            {
 850                return await RestClient.GetAsync(resourceGroupName, virtualNetworkGatewayName, cancellationToken).Config
 51            }
 052            catch (Exception e)
 53            {
 054                scope.Failed(e);
 055                throw;
 56            }
 857        }
 58
 59        /// <summary> Gets the specified virtual network gateway by resource group. </summary>
 60        /// <param name="resourceGroupName"> The name of the resource group. </param>
 61        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 62        /// <param name="cancellationToken"> The cancellation token to use. </param>
 63        public virtual Response<VirtualNetworkGateway> Get(string resourceGroupName, string virtualNetworkGatewayName, C
 64        {
 865            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.Get");
 866            scope.Start();
 67            try
 68            {
 869                return RestClient.Get(resourceGroupName, virtualNetworkGatewayName, cancellationToken);
 70            }
 071            catch (Exception e)
 72            {
 073                scope.Failed(e);
 074                throw;
 75            }
 876        }
 77
 78        /// <summary> Gets a xml format representation for supported vpn devices. </summary>
 79        /// <param name="resourceGroupName"> The name of the resource group. </param>
 80        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 81        /// <param name="cancellationToken"> The cancellation token to use. </param>
 82        public virtual async Task<Response<string>> SupportedVpnDevicesAsync(string resourceGroupName, string virtualNet
 83        {
 084            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.SupportedVpnDevices");
 085            scope.Start();
 86            try
 87            {
 088                return await RestClient.SupportedVpnDevicesAsync(resourceGroupName, virtualNetworkGatewayName, cancellat
 89            }
 090            catch (Exception e)
 91            {
 092                scope.Failed(e);
 093                throw;
 94            }
 095        }
 96
 97        /// <summary> Gets a xml format representation for supported vpn devices. </summary>
 98        /// <param name="resourceGroupName"> The name of the resource group. </param>
 99        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 100        /// <param name="cancellationToken"> The cancellation token to use. </param>
 101        public virtual Response<string> SupportedVpnDevices(string resourceGroupName, string virtualNetworkGatewayName, 
 102        {
 0103            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.SupportedVpnDevices");
 0104            scope.Start();
 105            try
 106            {
 0107                return RestClient.SupportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, cancellationToken);
 108            }
 0109            catch (Exception e)
 110            {
 0111                scope.Failed(e);
 0112                throw;
 113            }
 0114        }
 115
 116        /// <summary> Gets a xml format representation for vpn device configuration script. </summary>
 117        /// <param name="resourceGroupName"> The name of the resource group. </param>
 118        /// <param name="virtualNetworkGatewayConnectionName"> The name of the virtual network gateway connection for wh
 119        /// <param name="parameters"> Parameters supplied to the generate vpn device script operation. </param>
 120        /// <param name="cancellationToken"> The cancellation token to use. </param>
 121        public virtual async Task<Response<string>> VpnDeviceConfigurationScriptAsync(string resourceGroupName, string v
 122        {
 0123            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.VpnDeviceConfigurationScr
 0124            scope.Start();
 125            try
 126            {
 0127                return await RestClient.VpnDeviceConfigurationScriptAsync(resourceGroupName, virtualNetworkGatewayConnec
 128            }
 0129            catch (Exception e)
 130            {
 0131                scope.Failed(e);
 0132                throw;
 133            }
 0134        }
 135
 136        /// <summary> Gets a xml format representation for vpn device configuration script. </summary>
 137        /// <param name="resourceGroupName"> The name of the resource group. </param>
 138        /// <param name="virtualNetworkGatewayConnectionName"> The name of the virtual network gateway connection for wh
 139        /// <param name="parameters"> Parameters supplied to the generate vpn device script operation. </param>
 140        /// <param name="cancellationToken"> The cancellation token to use. </param>
 141        public virtual Response<string> VpnDeviceConfigurationScript(string resourceGroupName, string virtualNetworkGate
 142        {
 0143            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.VpnDeviceConfigurationScr
 0144            scope.Start();
 145            try
 146            {
 0147                return RestClient.VpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayConnectionName, p
 148            }
 0149            catch (Exception e)
 150            {
 0151                scope.Failed(e);
 0152                throw;
 153            }
 0154        }
 155
 156        /// <summary> Gets all virtual network gateways by resource group. </summary>
 157        /// <param name="resourceGroupName"> The name of the resource group. </param>
 158        /// <param name="cancellationToken"> The cancellation token to use. </param>
 159        public virtual AsyncPageable<VirtualNetworkGateway> ListAsync(string resourceGroupName, CancellationToken cancel
 160        {
 0161            if (resourceGroupName == null)
 162            {
 0163                throw new ArgumentNullException(nameof(resourceGroupName));
 164            }
 165
 166            async Task<Page<VirtualNetworkGateway>> FirstPageFunc(int? pageSizeHint)
 167            {
 0168                using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.List");
 0169                scope.Start();
 170                try
 171                {
 0172                    var response = await RestClient.ListAsync(resourceGroupName, cancellationToken).ConfigureAwait(false
 0173                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 174                }
 0175                catch (Exception e)
 176                {
 0177                    scope.Failed(e);
 0178                    throw;
 179                }
 0180            }
 181            async Task<Page<VirtualNetworkGateway>> NextPageFunc(string nextLink, int? pageSizeHint)
 182            {
 0183                using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.List");
 0184                scope.Start();
 185                try
 186                {
 0187                    var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, cancellationToken).Co
 0188                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 189                }
 0190                catch (Exception e)
 191                {
 0192                    scope.Failed(e);
 0193                    throw;
 194                }
 0195            }
 0196            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 197        }
 198
 199        /// <summary> Gets all virtual network gateways by resource group. </summary>
 200        /// <param name="resourceGroupName"> The name of the resource group. </param>
 201        /// <param name="cancellationToken"> The cancellation token to use. </param>
 202        public virtual Pageable<VirtualNetworkGateway> List(string resourceGroupName, CancellationToken cancellationToke
 203        {
 0204            if (resourceGroupName == null)
 205            {
 0206                throw new ArgumentNullException(nameof(resourceGroupName));
 207            }
 208
 209            Page<VirtualNetworkGateway> FirstPageFunc(int? pageSizeHint)
 210            {
 0211                using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.List");
 0212                scope.Start();
 213                try
 214                {
 0215                    var response = RestClient.List(resourceGroupName, cancellationToken);
 0216                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 217                }
 0218                catch (Exception e)
 219                {
 0220                    scope.Failed(e);
 0221                    throw;
 222                }
 0223            }
 224            Page<VirtualNetworkGateway> NextPageFunc(string nextLink, int? pageSizeHint)
 225            {
 0226                using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.List");
 0227                scope.Start();
 228                try
 229                {
 0230                    var response = RestClient.ListNextPage(nextLink, resourceGroupName, cancellationToken);
 0231                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 232                }
 0233                catch (Exception e)
 234                {
 0235                    scope.Failed(e);
 0236                    throw;
 237                }
 0238            }
 0239            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 240        }
 241
 242        /// <summary> Gets all the connections in a virtual network gateway. </summary>
 243        /// <param name="resourceGroupName"> The name of the resource group. </param>
 244        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 245        /// <param name="cancellationToken"> The cancellation token to use. </param>
 246        public virtual AsyncPageable<VirtualNetworkGatewayConnectionListEntity> ListConnectionsAsync(string resourceGrou
 247        {
 2248            if (resourceGroupName == null)
 249            {
 0250                throw new ArgumentNullException(nameof(resourceGroupName));
 251            }
 2252            if (virtualNetworkGatewayName == null)
 253            {
 0254                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 255            }
 256
 257            async Task<Page<VirtualNetworkGatewayConnectionListEntity>> FirstPageFunc(int? pageSizeHint)
 258            {
 2259                using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.ListConnections");
 2260                scope.Start();
 261                try
 262                {
 2263                    var response = await RestClient.ListConnectionsAsync(resourceGroupName, virtualNetworkGatewayName, c
 2264                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 265                }
 0266                catch (Exception e)
 267                {
 0268                    scope.Failed(e);
 0269                    throw;
 270                }
 2271            }
 272            async Task<Page<VirtualNetworkGatewayConnectionListEntity>> NextPageFunc(string nextLink, int? pageSizeHint)
 273            {
 0274                using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.ListConnections");
 0275                scope.Start();
 276                try
 277                {
 0278                    var response = await RestClient.ListConnectionsNextPageAsync(nextLink, resourceGroupName, virtualNet
 0279                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 280                }
 0281                catch (Exception e)
 282                {
 0283                    scope.Failed(e);
 0284                    throw;
 285                }
 0286            }
 2287            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 288        }
 289
 290        /// <summary> Gets all the connections in a virtual network gateway. </summary>
 291        /// <param name="resourceGroupName"> The name of the resource group. </param>
 292        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 293        /// <param name="cancellationToken"> The cancellation token to use. </param>
 294        public virtual Pageable<VirtualNetworkGatewayConnectionListEntity> ListConnections(string resourceGroupName, str
 295        {
 2296            if (resourceGroupName == null)
 297            {
 0298                throw new ArgumentNullException(nameof(resourceGroupName));
 299            }
 2300            if (virtualNetworkGatewayName == null)
 301            {
 0302                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 303            }
 304
 305            Page<VirtualNetworkGatewayConnectionListEntity> FirstPageFunc(int? pageSizeHint)
 306            {
 2307                using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.ListConnections");
 2308                scope.Start();
 309                try
 310                {
 2311                    var response = RestClient.ListConnections(resourceGroupName, virtualNetworkGatewayName, cancellation
 2312                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 313                }
 0314                catch (Exception e)
 315                {
 0316                    scope.Failed(e);
 0317                    throw;
 318                }
 2319            }
 320            Page<VirtualNetworkGatewayConnectionListEntity> NextPageFunc(string nextLink, int? pageSizeHint)
 321            {
 0322                using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.ListConnections");
 0323                scope.Start();
 324                try
 325                {
 0326                    var response = RestClient.ListConnectionsNextPage(nextLink, resourceGroupName, virtualNetworkGateway
 0327                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 328                }
 0329                catch (Exception e)
 330                {
 0331                    scope.Failed(e);
 0332                    throw;
 333                }
 0334            }
 2335            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 336        }
 337
 338        /// <summary> Creates or updates a virtual network gateway in the specified resource group. </summary>
 339        /// <param name="resourceGroupName"> The name of the resource group. </param>
 340        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 341        /// <param name="parameters"> Parameters supplied to create or update virtual network gateway operation. </param
 342        /// <param name="cancellationToken"> The cancellation token to use. </param>
 343        public virtual async Task<VirtualNetworkGatewaysCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resourc
 344        {
 8345            if (resourceGroupName == null)
 346            {
 0347                throw new ArgumentNullException(nameof(resourceGroupName));
 348            }
 8349            if (virtualNetworkGatewayName == null)
 350            {
 0351                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 352            }
 8353            if (parameters == null)
 354            {
 0355                throw new ArgumentNullException(nameof(parameters));
 356            }
 357
 8358            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartCreateOrUpdate");
 8359            scope.Start();
 360            try
 361            {
 8362                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName
 8363                return new VirtualNetworkGatewaysCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.Creat
 364            }
 0365            catch (Exception e)
 366            {
 0367                scope.Failed(e);
 0368                throw;
 369            }
 8370        }
 371
 372        /// <summary> Creates or updates a virtual network gateway in the specified resource group. </summary>
 373        /// <param name="resourceGroupName"> The name of the resource group. </param>
 374        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 375        /// <param name="parameters"> Parameters supplied to create or update virtual network gateway operation. </param
 376        /// <param name="cancellationToken"> The cancellation token to use. </param>
 377        public virtual VirtualNetworkGatewaysCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, strin
 378        {
 8379            if (resourceGroupName == null)
 380            {
 0381                throw new ArgumentNullException(nameof(resourceGroupName));
 382            }
 8383            if (virtualNetworkGatewayName == null)
 384            {
 0385                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 386            }
 8387            if (parameters == null)
 388            {
 0389                throw new ArgumentNullException(nameof(parameters));
 390            }
 391
 8392            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartCreateOrUpdate");
 8393            scope.Start();
 394            try
 395            {
 8396                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameter
 8397                return new VirtualNetworkGatewaysCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.Creat
 398            }
 0399            catch (Exception e)
 400            {
 0401                scope.Failed(e);
 0402                throw;
 403            }
 8404        }
 405
 406        /// <summary> Deletes the specified virtual network gateway. </summary>
 407        /// <param name="resourceGroupName"> The name of the resource group. </param>
 408        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 409        /// <param name="cancellationToken"> The cancellation token to use. </param>
 410        public virtual async Task<VirtualNetworkGatewaysDeleteOperation> StartDeleteAsync(string resourceGroupName, stri
 411        {
 0412            if (resourceGroupName == null)
 413            {
 0414                throw new ArgumentNullException(nameof(resourceGroupName));
 415            }
 0416            if (virtualNetworkGatewayName == null)
 417            {
 0418                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 419            }
 420
 0421            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartDelete");
 0422            scope.Start();
 423            try
 424            {
 0425                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, virtualNetworkGatewayName, cancel
 0426                return new VirtualNetworkGatewaysDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteR
 427            }
 0428            catch (Exception e)
 429            {
 0430                scope.Failed(e);
 0431                throw;
 432            }
 0433        }
 434
 435        /// <summary> Deletes the specified virtual network gateway. </summary>
 436        /// <param name="resourceGroupName"> The name of the resource group. </param>
 437        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 438        /// <param name="cancellationToken"> The cancellation token to use. </param>
 439        public virtual VirtualNetworkGatewaysDeleteOperation StartDelete(string resourceGroupName, string virtualNetwork
 440        {
 0441            if (resourceGroupName == null)
 442            {
 0443                throw new ArgumentNullException(nameof(resourceGroupName));
 444            }
 0445            if (virtualNetworkGatewayName == null)
 446            {
 0447                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 448            }
 449
 0450            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartDelete");
 0451            scope.Start();
 452            try
 453            {
 0454                var originalResponse = RestClient.Delete(resourceGroupName, virtualNetworkGatewayName, cancellationToken
 0455                return new VirtualNetworkGatewaysDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteR
 456            }
 0457            catch (Exception e)
 458            {
 0459                scope.Failed(e);
 0460                throw;
 461            }
 0462        }
 463
 464        /// <summary> Updates a virtual network gateway tags. </summary>
 465        /// <param name="resourceGroupName"> The name of the resource group. </param>
 466        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 467        /// <param name="parameters"> Parameters supplied to update virtual network gateway tags. </param>
 468        /// <param name="cancellationToken"> The cancellation token to use. </param>
 469        public virtual async Task<VirtualNetworkGatewaysUpdateTagsOperation> StartUpdateTagsAsync(string resourceGroupNa
 470        {
 0471            if (resourceGroupName == null)
 472            {
 0473                throw new ArgumentNullException(nameof(resourceGroupName));
 474            }
 0475            if (virtualNetworkGatewayName == null)
 476            {
 0477                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 478            }
 0479            if (parameters == null)
 480            {
 0481                throw new ArgumentNullException(nameof(parameters));
 482            }
 483
 0484            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartUpdateTags");
 0485            scope.Start();
 486            try
 487            {
 0488                var originalResponse = await RestClient.UpdateTagsAsync(resourceGroupName, virtualNetworkGatewayName, pa
 0489                return new VirtualNetworkGatewaysUpdateTagsOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpd
 490            }
 0491            catch (Exception e)
 492            {
 0493                scope.Failed(e);
 0494                throw;
 495            }
 0496        }
 497
 498        /// <summary> Updates a virtual network gateway tags. </summary>
 499        /// <param name="resourceGroupName"> The name of the resource group. </param>
 500        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 501        /// <param name="parameters"> Parameters supplied to update virtual network gateway tags. </param>
 502        /// <param name="cancellationToken"> The cancellation token to use. </param>
 503        public virtual VirtualNetworkGatewaysUpdateTagsOperation StartUpdateTags(string resourceGroupName, string virtua
 504        {
 0505            if (resourceGroupName == null)
 506            {
 0507                throw new ArgumentNullException(nameof(resourceGroupName));
 508            }
 0509            if (virtualNetworkGatewayName == null)
 510            {
 0511                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 512            }
 0513            if (parameters == null)
 514            {
 0515                throw new ArgumentNullException(nameof(parameters));
 516            }
 517
 0518            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartUpdateTags");
 0519            scope.Start();
 520            try
 521            {
 0522                var originalResponse = RestClient.UpdateTags(resourceGroupName, virtualNetworkGatewayName, parameters, c
 0523                return new VirtualNetworkGatewaysUpdateTagsOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpd
 524            }
 0525            catch (Exception e)
 526            {
 0527                scope.Failed(e);
 0528                throw;
 529            }
 0530        }
 531
 532        /// <summary> Resets the primary of the virtual network gateway in the specified resource group. </summary>
 533        /// <param name="resourceGroupName"> The name of the resource group. </param>
 534        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 535        /// <param name="gatewayVip"> Virtual network gateway vip address supplied to the begin reset of the active-acti
 536        /// <param name="cancellationToken"> The cancellation token to use. </param>
 537        public virtual async Task<VirtualNetworkGatewaysResetOperation> StartResetAsync(string resourceGroupName, string
 538        {
 0539            if (resourceGroupName == null)
 540            {
 0541                throw new ArgumentNullException(nameof(resourceGroupName));
 542            }
 0543            if (virtualNetworkGatewayName == null)
 544            {
 0545                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 546            }
 547
 0548            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartReset");
 0549            scope.Start();
 550            try
 551            {
 0552                var originalResponse = await RestClient.ResetAsync(resourceGroupName, virtualNetworkGatewayName, gateway
 0553                return new VirtualNetworkGatewaysResetOperation(_clientDiagnostics, _pipeline, RestClient.CreateResetReq
 554            }
 0555            catch (Exception e)
 556            {
 0557                scope.Failed(e);
 0558                throw;
 559            }
 0560        }
 561
 562        /// <summary> Resets the primary of the virtual network gateway in the specified resource group. </summary>
 563        /// <param name="resourceGroupName"> The name of the resource group. </param>
 564        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 565        /// <param name="gatewayVip"> Virtual network gateway vip address supplied to the begin reset of the active-acti
 566        /// <param name="cancellationToken"> The cancellation token to use. </param>
 567        public virtual VirtualNetworkGatewaysResetOperation StartReset(string resourceGroupName, string virtualNetworkGa
 568        {
 0569            if (resourceGroupName == null)
 570            {
 0571                throw new ArgumentNullException(nameof(resourceGroupName));
 572            }
 0573            if (virtualNetworkGatewayName == null)
 574            {
 0575                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 576            }
 577
 0578            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartReset");
 0579            scope.Start();
 580            try
 581            {
 0582                var originalResponse = RestClient.Reset(resourceGroupName, virtualNetworkGatewayName, gatewayVip, cancel
 0583                return new VirtualNetworkGatewaysResetOperation(_clientDiagnostics, _pipeline, RestClient.CreateResetReq
 584            }
 0585            catch (Exception e)
 586            {
 0587                scope.Failed(e);
 0588                throw;
 589            }
 0590        }
 591
 592        /// <summary> Resets the VPN client shared key of the virtual network gateway in the specified resource group. <
 593        /// <param name="resourceGroupName"> The name of the resource group. </param>
 594        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 595        /// <param name="cancellationToken"> The cancellation token to use. </param>
 596        public virtual async Task<VirtualNetworkGatewaysResetVpnClientSharedKeyOperation> StartResetVpnClientSharedKeyAs
 597        {
 0598            if (resourceGroupName == null)
 599            {
 0600                throw new ArgumentNullException(nameof(resourceGroupName));
 601            }
 0602            if (virtualNetworkGatewayName == null)
 603            {
 0604                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 605            }
 606
 0607            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartResetVpnClientShared
 0608            scope.Start();
 609            try
 610            {
 0611                var originalResponse = await RestClient.ResetVpnClientSharedKeyAsync(resourceGroupName, virtualNetworkGa
 0612                return new VirtualNetworkGatewaysResetVpnClientSharedKeyOperation(_clientDiagnostics, _pipeline, RestCli
 613            }
 0614            catch (Exception e)
 615            {
 0616                scope.Failed(e);
 0617                throw;
 618            }
 0619        }
 620
 621        /// <summary> Resets the VPN client shared key of the virtual network gateway in the specified resource group. <
 622        /// <param name="resourceGroupName"> The name of the resource group. </param>
 623        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 624        /// <param name="cancellationToken"> The cancellation token to use. </param>
 625        public virtual VirtualNetworkGatewaysResetVpnClientSharedKeyOperation StartResetVpnClientSharedKey(string resour
 626        {
 0627            if (resourceGroupName == null)
 628            {
 0629                throw new ArgumentNullException(nameof(resourceGroupName));
 630            }
 0631            if (virtualNetworkGatewayName == null)
 632            {
 0633                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 634            }
 635
 0636            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartResetVpnClientShared
 0637            scope.Start();
 638            try
 639            {
 0640                var originalResponse = RestClient.ResetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, 
 0641                return new VirtualNetworkGatewaysResetVpnClientSharedKeyOperation(_clientDiagnostics, _pipeline, RestCli
 642            }
 0643            catch (Exception e)
 644            {
 0645                scope.Failed(e);
 0646                throw;
 647            }
 0648        }
 649
 650        /// <summary> Generates VPN client package for P2S client of the virtual network gateway in the specified resour
 651        /// <param name="resourceGroupName"> The name of the resource group. </param>
 652        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 653        /// <param name="parameters"> Parameters supplied to the generate virtual network gateway VPN client package ope
 654        /// <param name="cancellationToken"> The cancellation token to use. </param>
 655        public virtual async Task<VirtualNetworkGatewaysGeneratevpnclientpackageOperation> StartGeneratevpnclientpackage
 656        {
 0657            if (resourceGroupName == null)
 658            {
 0659                throw new ArgumentNullException(nameof(resourceGroupName));
 660            }
 0661            if (virtualNetworkGatewayName == null)
 662            {
 0663                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 664            }
 0665            if (parameters == null)
 666            {
 0667                throw new ArgumentNullException(nameof(parameters));
 668            }
 669
 0670            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartGeneratevpnclientpac
 0671            scope.Start();
 672            try
 673            {
 0674                var originalResponse = await RestClient.GeneratevpnclientpackageAsync(resourceGroupName, virtualNetworkG
 0675                return new VirtualNetworkGatewaysGeneratevpnclientpackageOperation(_clientDiagnostics, _pipeline, RestCl
 676            }
 0677            catch (Exception e)
 678            {
 0679                scope.Failed(e);
 0680                throw;
 681            }
 0682        }
 683
 684        /// <summary> Generates VPN client package for P2S client of the virtual network gateway in the specified resour
 685        /// <param name="resourceGroupName"> The name of the resource group. </param>
 686        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 687        /// <param name="parameters"> Parameters supplied to the generate virtual network gateway VPN client package ope
 688        /// <param name="cancellationToken"> The cancellation token to use. </param>
 689        public virtual VirtualNetworkGatewaysGeneratevpnclientpackageOperation StartGeneratevpnclientpackage(string reso
 690        {
 0691            if (resourceGroupName == null)
 692            {
 0693                throw new ArgumentNullException(nameof(resourceGroupName));
 694            }
 0695            if (virtualNetworkGatewayName == null)
 696            {
 0697                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 698            }
 0699            if (parameters == null)
 700            {
 0701                throw new ArgumentNullException(nameof(parameters));
 702            }
 703
 0704            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartGeneratevpnclientpac
 0705            scope.Start();
 706            try
 707            {
 0708                var originalResponse = RestClient.Generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName,
 0709                return new VirtualNetworkGatewaysGeneratevpnclientpackageOperation(_clientDiagnostics, _pipeline, RestCl
 710            }
 0711            catch (Exception e)
 712            {
 0713                scope.Failed(e);
 0714                throw;
 715            }
 0716        }
 717
 718        /// <summary> Generates VPN profile for P2S client of the virtual network gateway in the specified resource grou
 719        /// <param name="resourceGroupName"> The name of the resource group. </param>
 720        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 721        /// <param name="parameters"> Parameters supplied to the generate virtual network gateway VPN client package ope
 722        /// <param name="cancellationToken"> The cancellation token to use. </param>
 723        public virtual async Task<VirtualNetworkGatewaysGenerateVpnProfileOperation> StartGenerateVpnProfileAsync(string
 724        {
 0725            if (resourceGroupName == null)
 726            {
 0727                throw new ArgumentNullException(nameof(resourceGroupName));
 728            }
 0729            if (virtualNetworkGatewayName == null)
 730            {
 0731                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 732            }
 0733            if (parameters == null)
 734            {
 0735                throw new ArgumentNullException(nameof(parameters));
 736            }
 737
 0738            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartGenerateVpnProfile")
 0739            scope.Start();
 740            try
 741            {
 0742                var originalResponse = await RestClient.GenerateVpnProfileAsync(resourceGroupName, virtualNetworkGateway
 0743                return new VirtualNetworkGatewaysGenerateVpnProfileOperation(_clientDiagnostics, _pipeline, RestClient.C
 744            }
 0745            catch (Exception e)
 746            {
 0747                scope.Failed(e);
 0748                throw;
 749            }
 0750        }
 751
 752        /// <summary> Generates VPN profile for P2S client of the virtual network gateway in the specified resource grou
 753        /// <param name="resourceGroupName"> The name of the resource group. </param>
 754        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 755        /// <param name="parameters"> Parameters supplied to the generate virtual network gateway VPN client package ope
 756        /// <param name="cancellationToken"> The cancellation token to use. </param>
 757        public virtual VirtualNetworkGatewaysGenerateVpnProfileOperation StartGenerateVpnProfile(string resourceGroupNam
 758        {
 0759            if (resourceGroupName == null)
 760            {
 0761                throw new ArgumentNullException(nameof(resourceGroupName));
 762            }
 0763            if (virtualNetworkGatewayName == null)
 764            {
 0765                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 766            }
 0767            if (parameters == null)
 768            {
 0769                throw new ArgumentNullException(nameof(parameters));
 770            }
 771
 0772            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartGenerateVpnProfile")
 0773            scope.Start();
 774            try
 775            {
 0776                var originalResponse = RestClient.GenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, param
 0777                return new VirtualNetworkGatewaysGenerateVpnProfileOperation(_clientDiagnostics, _pipeline, RestClient.C
 778            }
 0779            catch (Exception e)
 780            {
 0781                scope.Failed(e);
 0782                throw;
 783            }
 0784        }
 785
 786        /// <summary> Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified reso
 787        /// <param name="resourceGroupName"> The name of the resource group. </param>
 788        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 789        /// <param name="cancellationToken"> The cancellation token to use. </param>
 790        public virtual async Task<VirtualNetworkGatewaysGetVpnProfilePackageUrlOperation> StartGetVpnProfilePackageUrlAs
 791        {
 0792            if (resourceGroupName == null)
 793            {
 0794                throw new ArgumentNullException(nameof(resourceGroupName));
 795            }
 0796            if (virtualNetworkGatewayName == null)
 797            {
 0798                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 799            }
 800
 0801            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartGetVpnProfilePackage
 0802            scope.Start();
 803            try
 804            {
 0805                var originalResponse = await RestClient.GetVpnProfilePackageUrlAsync(resourceGroupName, virtualNetworkGa
 0806                return new VirtualNetworkGatewaysGetVpnProfilePackageUrlOperation(_clientDiagnostics, _pipeline, RestCli
 807            }
 0808            catch (Exception e)
 809            {
 0810                scope.Failed(e);
 0811                throw;
 812            }
 0813        }
 814
 815        /// <summary> Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified reso
 816        /// <param name="resourceGroupName"> The name of the resource group. </param>
 817        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 818        /// <param name="cancellationToken"> The cancellation token to use. </param>
 819        public virtual VirtualNetworkGatewaysGetVpnProfilePackageUrlOperation StartGetVpnProfilePackageUrl(string resour
 820        {
 0821            if (resourceGroupName == null)
 822            {
 0823                throw new ArgumentNullException(nameof(resourceGroupName));
 824            }
 0825            if (virtualNetworkGatewayName == null)
 826            {
 0827                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 828            }
 829
 0830            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartGetVpnProfilePackage
 0831            scope.Start();
 832            try
 833            {
 0834                var originalResponse = RestClient.GetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, 
 0835                return new VirtualNetworkGatewaysGetVpnProfilePackageUrlOperation(_clientDiagnostics, _pipeline, RestCli
 836            }
 0837            catch (Exception e)
 838            {
 0839                scope.Failed(e);
 0840                throw;
 841            }
 0842        }
 843
 844        /// <summary> The GetBgpPeerStatus operation retrieves the status of all BGP peers. </summary>
 845        /// <param name="resourceGroupName"> The name of the resource group. </param>
 846        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 847        /// <param name="peer"> The IP address of the peer to retrieve the status of. </param>
 848        /// <param name="cancellationToken"> The cancellation token to use. </param>
 849        public virtual async Task<VirtualNetworkGatewaysGetBgpPeerStatusOperation> StartGetBgpPeerStatusAsync(string res
 850        {
 0851            if (resourceGroupName == null)
 852            {
 0853                throw new ArgumentNullException(nameof(resourceGroupName));
 854            }
 0855            if (virtualNetworkGatewayName == null)
 856            {
 0857                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 858            }
 859
 0860            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartGetBgpPeerStatus");
 0861            scope.Start();
 862            try
 863            {
 0864                var originalResponse = await RestClient.GetBgpPeerStatusAsync(resourceGroupName, virtualNetworkGatewayNa
 0865                return new VirtualNetworkGatewaysGetBgpPeerStatusOperation(_clientDiagnostics, _pipeline, RestClient.Cre
 866            }
 0867            catch (Exception e)
 868            {
 0869                scope.Failed(e);
 0870                throw;
 871            }
 0872        }
 873
 874        /// <summary> The GetBgpPeerStatus operation retrieves the status of all BGP peers. </summary>
 875        /// <param name="resourceGroupName"> The name of the resource group. </param>
 876        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 877        /// <param name="peer"> The IP address of the peer to retrieve the status of. </param>
 878        /// <param name="cancellationToken"> The cancellation token to use. </param>
 879        public virtual VirtualNetworkGatewaysGetBgpPeerStatusOperation StartGetBgpPeerStatus(string resourceGroupName, s
 880        {
 0881            if (resourceGroupName == null)
 882            {
 0883                throw new ArgumentNullException(nameof(resourceGroupName));
 884            }
 0885            if (virtualNetworkGatewayName == null)
 886            {
 0887                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 888            }
 889
 0890            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartGetBgpPeerStatus");
 0891            scope.Start();
 892            try
 893            {
 0894                var originalResponse = RestClient.GetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, peer, c
 0895                return new VirtualNetworkGatewaysGetBgpPeerStatusOperation(_clientDiagnostics, _pipeline, RestClient.Cre
 896            }
 0897            catch (Exception e)
 898            {
 0899                scope.Failed(e);
 0900                throw;
 901            }
 0902        }
 903
 904        /// <summary> This operation retrieves a list of routes the virtual network gateway has learned, including route
 905        /// <param name="resourceGroupName"> The name of the resource group. </param>
 906        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 907        /// <param name="cancellationToken"> The cancellation token to use. </param>
 908        public virtual async Task<VirtualNetworkGatewaysGetLearnedRoutesOperation> StartGetLearnedRoutesAsync(string res
 909        {
 0910            if (resourceGroupName == null)
 911            {
 0912                throw new ArgumentNullException(nameof(resourceGroupName));
 913            }
 0914            if (virtualNetworkGatewayName == null)
 915            {
 0916                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 917            }
 918
 0919            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartGetLearnedRoutes");
 0920            scope.Start();
 921            try
 922            {
 0923                var originalResponse = await RestClient.GetLearnedRoutesAsync(resourceGroupName, virtualNetworkGatewayNa
 0924                return new VirtualNetworkGatewaysGetLearnedRoutesOperation(_clientDiagnostics, _pipeline, RestClient.Cre
 925            }
 0926            catch (Exception e)
 927            {
 0928                scope.Failed(e);
 0929                throw;
 930            }
 0931        }
 932
 933        /// <summary> This operation retrieves a list of routes the virtual network gateway has learned, including route
 934        /// <param name="resourceGroupName"> The name of the resource group. </param>
 935        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 936        /// <param name="cancellationToken"> The cancellation token to use. </param>
 937        public virtual VirtualNetworkGatewaysGetLearnedRoutesOperation StartGetLearnedRoutes(string resourceGroupName, s
 938        {
 0939            if (resourceGroupName == null)
 940            {
 0941                throw new ArgumentNullException(nameof(resourceGroupName));
 942            }
 0943            if (virtualNetworkGatewayName == null)
 944            {
 0945                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 946            }
 947
 0948            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartGetLearnedRoutes");
 0949            scope.Start();
 950            try
 951            {
 0952                var originalResponse = RestClient.GetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, cancell
 0953                return new VirtualNetworkGatewaysGetLearnedRoutesOperation(_clientDiagnostics, _pipeline, RestClient.Cre
 954            }
 0955            catch (Exception e)
 956            {
 0957                scope.Failed(e);
 0958                throw;
 959            }
 0960        }
 961
 962        /// <summary> This operation retrieves a list of routes the virtual network gateway is advertising to the specif
 963        /// <param name="resourceGroupName"> The name of the resource group. </param>
 964        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 965        /// <param name="peer"> The IP address of the peer. </param>
 966        /// <param name="cancellationToken"> The cancellation token to use. </param>
 967        public virtual async Task<VirtualNetworkGatewaysGetAdvertisedRoutesOperation> StartGetAdvertisedRoutesAsync(stri
 968        {
 0969            if (resourceGroupName == null)
 970            {
 0971                throw new ArgumentNullException(nameof(resourceGroupName));
 972            }
 0973            if (virtualNetworkGatewayName == null)
 974            {
 0975                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 976            }
 0977            if (peer == null)
 978            {
 0979                throw new ArgumentNullException(nameof(peer));
 980            }
 981
 0982            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartGetAdvertisedRoutes"
 0983            scope.Start();
 984            try
 985            {
 0986                var originalResponse = await RestClient.GetAdvertisedRoutesAsync(resourceGroupName, virtualNetworkGatewa
 0987                return new VirtualNetworkGatewaysGetAdvertisedRoutesOperation(_clientDiagnostics, _pipeline, RestClient.
 988            }
 0989            catch (Exception e)
 990            {
 0991                scope.Failed(e);
 0992                throw;
 993            }
 0994        }
 995
 996        /// <summary> This operation retrieves a list of routes the virtual network gateway is advertising to the specif
 997        /// <param name="resourceGroupName"> The name of the resource group. </param>
 998        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 999        /// <param name="peer"> The IP address of the peer. </param>
 1000        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1001        public virtual VirtualNetworkGatewaysGetAdvertisedRoutesOperation StartGetAdvertisedRoutes(string resourceGroupN
 1002        {
 01003            if (resourceGroupName == null)
 1004            {
 01005                throw new ArgumentNullException(nameof(resourceGroupName));
 1006            }
 01007            if (virtualNetworkGatewayName == null)
 1008            {
 01009                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1010            }
 01011            if (peer == null)
 1012            {
 01013                throw new ArgumentNullException(nameof(peer));
 1014            }
 1015
 01016            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartGetAdvertisedRoutes"
 01017            scope.Start();
 1018            try
 1019            {
 01020                var originalResponse = RestClient.GetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer
 01021                return new VirtualNetworkGatewaysGetAdvertisedRoutesOperation(_clientDiagnostics, _pipeline, RestClient.
 1022            }
 01023            catch (Exception e)
 1024            {
 01025                scope.Failed(e);
 01026                throw;
 1027            }
 01028        }
 1029
 1030        /// <summary> The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtu
 1031        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1032        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1033        /// <param name="vpnclientIpsecParams"> Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtu
 1034        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1035        public virtual async Task<VirtualNetworkGatewaysSetVpnclientIpsecParametersOperation> StartSetVpnclientIpsecPara
 1036        {
 01037            if (resourceGroupName == null)
 1038            {
 01039                throw new ArgumentNullException(nameof(resourceGroupName));
 1040            }
 01041            if (virtualNetworkGatewayName == null)
 1042            {
 01043                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1044            }
 01045            if (vpnclientIpsecParams == null)
 1046            {
 01047                throw new ArgumentNullException(nameof(vpnclientIpsecParams));
 1048            }
 1049
 01050            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartSetVpnclientIpsecPar
 01051            scope.Start();
 1052            try
 1053            {
 01054                var originalResponse = await RestClient.SetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetwo
 01055                return new VirtualNetworkGatewaysSetVpnclientIpsecParametersOperation(_clientDiagnostics, _pipeline, Res
 1056            }
 01057            catch (Exception e)
 1058            {
 01059                scope.Failed(e);
 01060                throw;
 1061            }
 01062        }
 1063
 1064        /// <summary> The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtu
 1065        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1066        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1067        /// <param name="vpnclientIpsecParams"> Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtu
 1068        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1069        public virtual VirtualNetworkGatewaysSetVpnclientIpsecParametersOperation StartSetVpnclientIpsecParameters(strin
 1070        {
 01071            if (resourceGroupName == null)
 1072            {
 01073                throw new ArgumentNullException(nameof(resourceGroupName));
 1074            }
 01075            if (virtualNetworkGatewayName == null)
 1076            {
 01077                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1078            }
 01079            if (vpnclientIpsecParams == null)
 1080            {
 01081                throw new ArgumentNullException(nameof(vpnclientIpsecParams));
 1082            }
 1083
 01084            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartSetVpnclientIpsecPar
 01085            scope.Start();
 1086            try
 1087            {
 01088                var originalResponse = RestClient.SetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayNa
 01089                return new VirtualNetworkGatewaysSetVpnclientIpsecParametersOperation(_clientDiagnostics, _pipeline, Res
 1090            }
 01091            catch (Exception e)
 1092            {
 01093                scope.Failed(e);
 01094                throw;
 1095            }
 01096        }
 1097
 1098        /// <summary> The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy 
 1099        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1100        /// <param name="virtualNetworkGatewayName"> The virtual network gateway name. </param>
 1101        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1102        public virtual async Task<VirtualNetworkGatewaysGetVpnclientIpsecParametersOperation> StartGetVpnclientIpsecPara
 1103        {
 01104            if (resourceGroupName == null)
 1105            {
 01106                throw new ArgumentNullException(nameof(resourceGroupName));
 1107            }
 01108            if (virtualNetworkGatewayName == null)
 1109            {
 01110                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1111            }
 1112
 01113            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartGetVpnclientIpsecPar
 01114            scope.Start();
 1115            try
 1116            {
 01117                var originalResponse = await RestClient.GetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetwo
 01118                return new VirtualNetworkGatewaysGetVpnclientIpsecParametersOperation(_clientDiagnostics, _pipeline, Res
 1119            }
 01120            catch (Exception e)
 1121            {
 01122                scope.Failed(e);
 01123                throw;
 1124            }
 01125        }
 1126
 1127        /// <summary> The Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy 
 1128        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1129        /// <param name="virtualNetworkGatewayName"> The virtual network gateway name. </param>
 1130        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1131        public virtual VirtualNetworkGatewaysGetVpnclientIpsecParametersOperation StartGetVpnclientIpsecParameters(strin
 1132        {
 01133            if (resourceGroupName == null)
 1134            {
 01135                throw new ArgumentNullException(nameof(resourceGroupName));
 1136            }
 01137            if (virtualNetworkGatewayName == null)
 1138            {
 01139                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1140            }
 1141
 01142            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartGetVpnclientIpsecPar
 01143            scope.Start();
 1144            try
 1145            {
 01146                var originalResponse = RestClient.GetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayNa
 01147                return new VirtualNetworkGatewaysGetVpnclientIpsecParametersOperation(_clientDiagnostics, _pipeline, Res
 1148            }
 01149            catch (Exception e)
 1150            {
 01151                scope.Failed(e);
 01152                throw;
 1153            }
 01154        }
 1155
 1156        /// <summary> Starts packet capture on virtual network gateway in the specified resource group. </summary>
 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="parameters"> Virtual network gateway packet capture parameters supplied to start packet capture
 1160        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1161        public virtual async Task<VirtualNetworkGatewaysStartPacketCaptureOperation> StartStartPacketCaptureAsync(string
 1162        {
 01163            if (resourceGroupName == null)
 1164            {
 01165                throw new ArgumentNullException(nameof(resourceGroupName));
 1166            }
 01167            if (virtualNetworkGatewayName == null)
 1168            {
 01169                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1170            }
 1171
 01172            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartStartPacketCapture")
 01173            scope.Start();
 1174            try
 1175            {
 01176                var originalResponse = await RestClient.StartPacketCaptureAsync(resourceGroupName, virtualNetworkGateway
 01177                return new VirtualNetworkGatewaysStartPacketCaptureOperation(_clientDiagnostics, _pipeline, RestClient.C
 1178            }
 01179            catch (Exception e)
 1180            {
 01181                scope.Failed(e);
 01182                throw;
 1183            }
 01184        }
 1185
 1186        /// <summary> Starts packet capture on virtual network gateway in the specified resource group. </summary>
 1187        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1188        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1189        /// <param name="parameters"> Virtual network gateway packet capture parameters supplied to start packet capture
 1190        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1191        public virtual VirtualNetworkGatewaysStartPacketCaptureOperation StartStartPacketCapture(string resourceGroupNam
 1192        {
 01193            if (resourceGroupName == null)
 1194            {
 01195                throw new ArgumentNullException(nameof(resourceGroupName));
 1196            }
 01197            if (virtualNetworkGatewayName == null)
 1198            {
 01199                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1200            }
 1201
 01202            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartStartPacketCapture")
 01203            scope.Start();
 1204            try
 1205            {
 01206                var originalResponse = RestClient.StartPacketCapture(resourceGroupName, virtualNetworkGatewayName, param
 01207                return new VirtualNetworkGatewaysStartPacketCaptureOperation(_clientDiagnostics, _pipeline, RestClient.C
 1208            }
 01209            catch (Exception e)
 1210            {
 01211                scope.Failed(e);
 01212                throw;
 1213            }
 01214        }
 1215
 1216        /// <summary> Stops packet capture on virtual network gateway in the specified resource group. </summary>
 1217        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1218        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1219        /// <param name="parameters"> Virtual network gateway packet capture parameters supplied to stop packet capture 
 1220        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1221        public virtual async Task<VirtualNetworkGatewaysStopPacketCaptureOperation> StartStopPacketCaptureAsync(string r
 1222        {
 01223            if (resourceGroupName == null)
 1224            {
 01225                throw new ArgumentNullException(nameof(resourceGroupName));
 1226            }
 01227            if (virtualNetworkGatewayName == null)
 1228            {
 01229                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1230            }
 01231            if (parameters == null)
 1232            {
 01233                throw new ArgumentNullException(nameof(parameters));
 1234            }
 1235
 01236            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartStopPacketCapture");
 01237            scope.Start();
 1238            try
 1239            {
 01240                var originalResponse = await RestClient.StopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayN
 01241                return new VirtualNetworkGatewaysStopPacketCaptureOperation(_clientDiagnostics, _pipeline, RestClient.Cr
 1242            }
 01243            catch (Exception e)
 1244            {
 01245                scope.Failed(e);
 01246                throw;
 1247            }
 01248        }
 1249
 1250        /// <summary> Stops packet capture on virtual network gateway in the specified resource group. </summary>
 1251        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1252        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1253        /// <param name="parameters"> Virtual network gateway packet capture parameters supplied to stop packet capture 
 1254        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1255        public virtual VirtualNetworkGatewaysStopPacketCaptureOperation StartStopPacketCapture(string resourceGroupName,
 1256        {
 01257            if (resourceGroupName == null)
 1258            {
 01259                throw new ArgumentNullException(nameof(resourceGroupName));
 1260            }
 01261            if (virtualNetworkGatewayName == null)
 1262            {
 01263                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1264            }
 01265            if (parameters == null)
 1266            {
 01267                throw new ArgumentNullException(nameof(parameters));
 1268            }
 1269
 01270            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartStopPacketCapture");
 01271            scope.Start();
 1272            try
 1273            {
 01274                var originalResponse = RestClient.StopPacketCapture(resourceGroupName, virtualNetworkGatewayName, parame
 01275                return new VirtualNetworkGatewaysStopPacketCaptureOperation(_clientDiagnostics, _pipeline, RestClient.Cr
 1276            }
 01277            catch (Exception e)
 1278            {
 01279                scope.Failed(e);
 01280                throw;
 1281            }
 01282        }
 1283
 1284        /// <summary> Get VPN client connection health detail per P2S client connection of the virtual network gateway i
 1285        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1286        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1287        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1288        public virtual async Task<VirtualNetworkGatewaysGetVpnclientConnectionHealthOperation> StartGetVpnclientConnecti
 1289        {
 01290            if (resourceGroupName == null)
 1291            {
 01292                throw new ArgumentNullException(nameof(resourceGroupName));
 1293            }
 01294            if (virtualNetworkGatewayName == null)
 1295            {
 01296                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1297            }
 1298
 01299            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartGetVpnclientConnecti
 01300            scope.Start();
 1301            try
 1302            {
 01303                var originalResponse = await RestClient.GetVpnclientConnectionHealthAsync(resourceGroupName, virtualNetw
 01304                return new VirtualNetworkGatewaysGetVpnclientConnectionHealthOperation(_clientDiagnostics, _pipeline, Re
 1305            }
 01306            catch (Exception e)
 1307            {
 01308                scope.Failed(e);
 01309                throw;
 1310            }
 01311        }
 1312
 1313        /// <summary> Get VPN client connection health detail per P2S client connection of the virtual network gateway i
 1314        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1315        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1316        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1317        public virtual VirtualNetworkGatewaysGetVpnclientConnectionHealthOperation StartGetVpnclientConnectionHealth(str
 1318        {
 01319            if (resourceGroupName == null)
 1320            {
 01321                throw new ArgumentNullException(nameof(resourceGroupName));
 1322            }
 01323            if (virtualNetworkGatewayName == null)
 1324            {
 01325                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1326            }
 1327
 01328            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartGetVpnclientConnecti
 01329            scope.Start();
 1330            try
 1331            {
 01332                var originalResponse = RestClient.GetVpnclientConnectionHealth(resourceGroupName, virtualNetworkGatewayN
 01333                return new VirtualNetworkGatewaysGetVpnclientConnectionHealthOperation(_clientDiagnostics, _pipeline, Re
 1334            }
 01335            catch (Exception e)
 1336            {
 01337                scope.Failed(e);
 01338                throw;
 1339            }
 01340        }
 1341
 1342        /// <summary> Disconnect vpn connections of virtual network gateway in the specified resource group. </summary>
 1343        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1344        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1345        /// <param name="request"> The parameters are supplied to disconnect vpn connections. </param>
 1346        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1347        public virtual async Task<VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsOperation> StartDis
 1348        {
 01349            if (resourceGroupName == null)
 1350            {
 01351                throw new ArgumentNullException(nameof(resourceGroupName));
 1352            }
 01353            if (virtualNetworkGatewayName == null)
 1354            {
 01355                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1356            }
 01357            if (request == null)
 1358            {
 01359                throw new ArgumentNullException(nameof(request));
 1360            }
 1361
 01362            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartDisconnectVirtualNet
 01363            scope.Start();
 1364            try
 1365            {
 01366                var originalResponse = await RestClient.DisconnectVirtualNetworkGatewayVpnConnectionsAsync(resourceGroup
 01367                return new VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsOperation(_clientDiagnosti
 1368            }
 01369            catch (Exception e)
 1370            {
 01371                scope.Failed(e);
 01372                throw;
 1373            }
 01374        }
 1375
 1376        /// <summary> Disconnect vpn connections of virtual network gateway in the specified resource group. </summary>
 1377        /// <param name="resourceGroupName"> The name of the resource group. </param>
 1378        /// <param name="virtualNetworkGatewayName"> The name of the virtual network gateway. </param>
 1379        /// <param name="request"> The parameters are supplied to disconnect vpn connections. </param>
 1380        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1381        public virtual VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsOperation StartDisconnectVirtu
 1382        {
 01383            if (resourceGroupName == null)
 1384            {
 01385                throw new ArgumentNullException(nameof(resourceGroupName));
 1386            }
 01387            if (virtualNetworkGatewayName == null)
 1388            {
 01389                throw new ArgumentNullException(nameof(virtualNetworkGatewayName));
 1390            }
 01391            if (request == null)
 1392            {
 01393                throw new ArgumentNullException(nameof(request));
 1394            }
 1395
 01396            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewaysOperations.StartDisconnectVirtualNet
 01397            scope.Start();
 1398            try
 1399            {
 01400                var originalResponse = RestClient.DisconnectVirtualNetworkGatewayVpnConnections(resourceGroupName, virtu
 01401                return new VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsOperation(_clientDiagnosti
 1402            }
 01403            catch (Exception e)
 1404            {
 01405                scope.Failed(e);
 01406                throw;
 1407            }
 01408        }
 1409    }
 1410}