< Summary

Class:Azure.ResourceManager.Network.VirtualNetworkGatewayConnectionsOperations
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\VirtualNetworkGatewayConnectionsOperations.cs
Covered lines:60
Uncovered lines:202
Coverable lines:262
Total lines:660
Line coverage:22.9% (60 of 262)
Covered branches:12
Total branches:80
Branch coverage:15% (12 of 80)

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%
GetSharedKeyAsync()-0%100%
GetSharedKey(...)-0%100%
ListAsync(...)-36.84%50%
<ListAsync()-62.5%100%
<ListAsync()-0%100%
List(...)-36.84%50%
StartCreateOrUpdateAsync()-57.14%50%
StartCreateOrUpdate(...)-57.14%50%
StartDeleteAsync()-58.33%50%
StartDelete(...)-58.33%50%
StartUpdateTagsAsync()-0%0%
StartUpdateTags(...)-0%0%
StartSetSharedKeyAsync()-0%0%
StartSetSharedKey(...)-0%0%
StartResetSharedKeyAsync()-0%0%
StartResetSharedKey(...)-0%0%
StartStartPacketCaptureAsync()-0%0%
StartStartPacketCapture(...)-0%0%
StartStopPacketCaptureAsync()-0%0%
StartStopPacketCapture(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\VirtualNetworkGatewayConnectionsOperations.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 VirtualNetworkGatewayConnections service client. </summary>
 19    public partial class VirtualNetworkGatewayConnectionsOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 12023        internal VirtualNetworkGatewayConnectionsRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of VirtualNetworkGatewayConnectionsOperations for mocking. </summary>
 8425        protected VirtualNetworkGatewayConnectionsOperations()
 26        {
 8427        }
 28        /// <summary> Initializes a new instance of VirtualNetworkGatewayConnectionsOperations. </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>
 8433        internal VirtualNetworkGatewayConnectionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, 
 34        {
 8435            RestClient = new VirtualNetworkGatewayConnectionsRestOperations(clientDiagnostics, pipeline, subscriptionId,
 8436            _clientDiagnostics = clientDiagnostics;
 8437            _pipeline = pipeline;
 8438        }
 39
 40        /// <summary> Gets the specified virtual network gateway connection by resource group. </summary>
 41        /// <param name="resourceGroupName"> The name of the resource group. </param>
 42        /// <param name="virtualNetworkGatewayConnectionName"> The name of the virtual network gateway connection. </par
 43        /// <param name="cancellationToken"> The cancellation token to use. </param>
 44        public virtual async Task<Response<VirtualNetworkGatewayConnection>> GetAsync(string resourceGroupName, string v
 45        {
 1246            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewayConnectionsOperations.Get");
 1247            scope.Start();
 48            try
 49            {
 1250                return await RestClient.GetAsync(resourceGroupName, virtualNetworkGatewayConnectionName, cancellationTok
 51            }
 052            catch (Exception e)
 53            {
 054                scope.Failed(e);
 055                throw;
 56            }
 1257        }
 58
 59        /// <summary> Gets the specified virtual network gateway connection by resource group. </summary>
 60        /// <param name="resourceGroupName"> The name of the resource group. </param>
 61        /// <param name="virtualNetworkGatewayConnectionName"> The name of the virtual network gateway connection. </par
 62        /// <param name="cancellationToken"> The cancellation token to use. </param>
 63        public virtual Response<VirtualNetworkGatewayConnection> Get(string resourceGroupName, string virtualNetworkGate
 64        {
 1265            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewayConnectionsOperations.Get");
 1266            scope.Start();
 67            try
 68            {
 1269                return RestClient.Get(resourceGroupName, virtualNetworkGatewayConnectionName, cancellationToken);
 70            }
 071            catch (Exception e)
 72            {
 073                scope.Failed(e);
 074                throw;
 75            }
 1276        }
 77
 78        /// <summary> The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specifi
 79        /// <param name="resourceGroupName"> The name of the resource group. </param>
 80        /// <param name="virtualNetworkGatewayConnectionName"> The virtual network gateway connection shared key name. <
 81        /// <param name="cancellationToken"> The cancellation token to use. </param>
 82        public virtual async Task<Response<ConnectionSharedKey>> GetSharedKeyAsync(string resourceGroupName, string virt
 83        {
 084            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewayConnectionsOperations.GetSharedKey");
 085            scope.Start();
 86            try
 87            {
 088                return await RestClient.GetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, cancel
 89            }
 090            catch (Exception e)
 91            {
 092                scope.Failed(e);
 093                throw;
 94            }
 095        }
 96
 97        /// <summary> The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specifi
 98        /// <param name="resourceGroupName"> The name of the resource group. </param>
 99        /// <param name="virtualNetworkGatewayConnectionName"> The virtual network gateway connection shared key name. <
 100        /// <param name="cancellationToken"> The cancellation token to use. </param>
 101        public virtual Response<ConnectionSharedKey> GetSharedKey(string resourceGroupName, string virtualNetworkGateway
 102        {
 0103            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewayConnectionsOperations.GetSharedKey");
 0104            scope.Start();
 105            try
 106            {
 0107                return RestClient.GetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, cancellationToken
 108            }
 0109            catch (Exception e)
 110            {
 0111                scope.Failed(e);
 0112                throw;
 113            }
 0114        }
 115
 116        /// <summary> The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways con
 117        /// <param name="resourceGroupName"> The name of the resource group. </param>
 118        /// <param name="cancellationToken"> The cancellation token to use. </param>
 119        public virtual AsyncPageable<VirtualNetworkGatewayConnection> ListAsync(string resourceGroupName, CancellationTo
 120        {
 12121            if (resourceGroupName == null)
 122            {
 0123                throw new ArgumentNullException(nameof(resourceGroupName));
 124            }
 125
 126            async Task<Page<VirtualNetworkGatewayConnection>> FirstPageFunc(int? pageSizeHint)
 127            {
 12128                using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewayConnectionsOperations.List");
 12129                scope.Start();
 130                try
 131                {
 12132                    var response = await RestClient.ListAsync(resourceGroupName, cancellationToken).ConfigureAwait(false
 12133                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 134                }
 0135                catch (Exception e)
 136                {
 0137                    scope.Failed(e);
 0138                    throw;
 139                }
 12140            }
 141            async Task<Page<VirtualNetworkGatewayConnection>> NextPageFunc(string nextLink, int? pageSizeHint)
 142            {
 0143                using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewayConnectionsOperations.List");
 0144                scope.Start();
 145                try
 146                {
 0147                    var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, cancellationToken).Co
 0148                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 149                }
 0150                catch (Exception e)
 151                {
 0152                    scope.Failed(e);
 0153                    throw;
 154                }
 0155            }
 12156            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 157        }
 158
 159        /// <summary> The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways con
 160        /// <param name="resourceGroupName"> The name of the resource group. </param>
 161        /// <param name="cancellationToken"> The cancellation token to use. </param>
 162        public virtual Pageable<VirtualNetworkGatewayConnection> List(string resourceGroupName, CancellationToken cancel
 163        {
 12164            if (resourceGroupName == null)
 165            {
 0166                throw new ArgumentNullException(nameof(resourceGroupName));
 167            }
 168
 169            Page<VirtualNetworkGatewayConnection> FirstPageFunc(int? pageSizeHint)
 170            {
 12171                using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewayConnectionsOperations.List");
 12172                scope.Start();
 173                try
 174                {
 12175                    var response = RestClient.List(resourceGroupName, cancellationToken);
 12176                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 177                }
 0178                catch (Exception e)
 179                {
 0180                    scope.Failed(e);
 0181                    throw;
 182                }
 12183            }
 184            Page<VirtualNetworkGatewayConnection> NextPageFunc(string nextLink, int? pageSizeHint)
 185            {
 0186                using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewayConnectionsOperations.List");
 0187                scope.Start();
 188                try
 189                {
 0190                    var response = RestClient.ListNextPage(nextLink, resourceGroupName, cancellationToken);
 0191                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 192                }
 0193                catch (Exception e)
 194                {
 0195                    scope.Failed(e);
 0196                    throw;
 197                }
 0198            }
 12199            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 200        }
 201
 202        /// <summary> Creates or updates a virtual network gateway connection in the specified resource group. </summary
 203        /// <param name="resourceGroupName"> The name of the resource group. </param>
 204        /// <param name="virtualNetworkGatewayConnectionName"> The name of the virtual network gateway connection. </par
 205        /// <param name="parameters"> Parameters supplied to the create or update virtual network gateway connection ope
 206        /// <param name="cancellationToken"> The cancellation token to use. </param>
 207        public virtual async Task<VirtualNetworkGatewayConnectionsCreateOrUpdateOperation> StartCreateOrUpdateAsync(stri
 208        {
 12209            if (resourceGroupName == null)
 210            {
 0211                throw new ArgumentNullException(nameof(resourceGroupName));
 212            }
 12213            if (virtualNetworkGatewayConnectionName == null)
 214            {
 0215                throw new ArgumentNullException(nameof(virtualNetworkGatewayConnectionName));
 216            }
 12217            if (parameters == null)
 218            {
 0219                throw new ArgumentNullException(nameof(parameters));
 220            }
 221
 12222            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewayConnectionsOperations.StartCreateOrUp
 12223            scope.Start();
 224            try
 225            {
 12226                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConn
 12227                return new VirtualNetworkGatewayConnectionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestCl
 228            }
 0229            catch (Exception e)
 230            {
 0231                scope.Failed(e);
 0232                throw;
 233            }
 12234        }
 235
 236        /// <summary> Creates or updates a virtual network gateway connection in the specified resource group. </summary
 237        /// <param name="resourceGroupName"> The name of the resource group. </param>
 238        /// <param name="virtualNetworkGatewayConnectionName"> The name of the virtual network gateway connection. </par
 239        /// <param name="parameters"> Parameters supplied to the create or update virtual network gateway connection ope
 240        /// <param name="cancellationToken"> The cancellation token to use. </param>
 241        public virtual VirtualNetworkGatewayConnectionsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupN
 242        {
 12243            if (resourceGroupName == null)
 244            {
 0245                throw new ArgumentNullException(nameof(resourceGroupName));
 246            }
 12247            if (virtualNetworkGatewayConnectionName == null)
 248            {
 0249                throw new ArgumentNullException(nameof(virtualNetworkGatewayConnectionName));
 250            }
 12251            if (parameters == null)
 252            {
 0253                throw new ArgumentNullException(nameof(parameters));
 254            }
 255
 12256            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewayConnectionsOperations.StartCreateOrUp
 12257            scope.Start();
 258            try
 259            {
 12260                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName,
 12261                return new VirtualNetworkGatewayConnectionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestCl
 262            }
 0263            catch (Exception e)
 264            {
 0265                scope.Failed(e);
 0266                throw;
 267            }
 12268        }
 269
 270        /// <summary> Deletes the specified virtual network Gateway connection. </summary>
 271        /// <param name="resourceGroupName"> The name of the resource group. </param>
 272        /// <param name="virtualNetworkGatewayConnectionName"> The name of the virtual network gateway connection. </par
 273        /// <param name="cancellationToken"> The cancellation token to use. </param>
 274        public virtual async Task<VirtualNetworkGatewayConnectionsDeleteOperation> StartDeleteAsync(string resourceGroup
 275        {
 6276            if (resourceGroupName == null)
 277            {
 0278                throw new ArgumentNullException(nameof(resourceGroupName));
 279            }
 6280            if (virtualNetworkGatewayConnectionName == null)
 281            {
 0282                throw new ArgumentNullException(nameof(virtualNetworkGatewayConnectionName));
 283            }
 284
 6285            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewayConnectionsOperations.StartDelete");
 6286            scope.Start();
 287            try
 288            {
 6289                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionNa
 6290                return new VirtualNetworkGatewayConnectionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.Cre
 291            }
 0292            catch (Exception e)
 293            {
 0294                scope.Failed(e);
 0295                throw;
 296            }
 6297        }
 298
 299        /// <summary> Deletes the specified virtual network Gateway connection. </summary>
 300        /// <param name="resourceGroupName"> The name of the resource group. </param>
 301        /// <param name="virtualNetworkGatewayConnectionName"> The name of the virtual network gateway connection. </par
 302        /// <param name="cancellationToken"> The cancellation token to use. </param>
 303        public virtual VirtualNetworkGatewayConnectionsDeleteOperation StartDelete(string resourceGroupName, string virt
 304        {
 6305            if (resourceGroupName == null)
 306            {
 0307                throw new ArgumentNullException(nameof(resourceGroupName));
 308            }
 6309            if (virtualNetworkGatewayConnectionName == null)
 310            {
 0311                throw new ArgumentNullException(nameof(virtualNetworkGatewayConnectionName));
 312            }
 313
 6314            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewayConnectionsOperations.StartDelete");
 6315            scope.Start();
 316            try
 317            {
 6318                var originalResponse = RestClient.Delete(resourceGroupName, virtualNetworkGatewayConnectionName, cancell
 6319                return new VirtualNetworkGatewayConnectionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.Cre
 320            }
 0321            catch (Exception e)
 322            {
 0323                scope.Failed(e);
 0324                throw;
 325            }
 6326        }
 327
 328        /// <summary> Updates a virtual network gateway connection tags. </summary>
 329        /// <param name="resourceGroupName"> The name of the resource group. </param>
 330        /// <param name="virtualNetworkGatewayConnectionName"> The name of the virtual network gateway connection. </par
 331        /// <param name="parameters"> Parameters supplied to update virtual network gateway connection tags. </param>
 332        /// <param name="cancellationToken"> The cancellation token to use. </param>
 333        public virtual async Task<VirtualNetworkGatewayConnectionsUpdateTagsOperation> StartUpdateTagsAsync(string resou
 334        {
 0335            if (resourceGroupName == null)
 336            {
 0337                throw new ArgumentNullException(nameof(resourceGroupName));
 338            }
 0339            if (virtualNetworkGatewayConnectionName == null)
 340            {
 0341                throw new ArgumentNullException(nameof(virtualNetworkGatewayConnectionName));
 342            }
 0343            if (parameters == null)
 344            {
 0345                throw new ArgumentNullException(nameof(parameters));
 346            }
 347
 0348            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewayConnectionsOperations.StartUpdateTags
 0349            scope.Start();
 350            try
 351            {
 0352                var originalResponse = await RestClient.UpdateTagsAsync(resourceGroupName, virtualNetworkGatewayConnecti
 0353                return new VirtualNetworkGatewayConnectionsUpdateTagsOperation(_clientDiagnostics, _pipeline, RestClient
 354            }
 0355            catch (Exception e)
 356            {
 0357                scope.Failed(e);
 0358                throw;
 359            }
 0360        }
 361
 362        /// <summary> Updates a virtual network gateway connection tags. </summary>
 363        /// <param name="resourceGroupName"> The name of the resource group. </param>
 364        /// <param name="virtualNetworkGatewayConnectionName"> The name of the virtual network gateway connection. </par
 365        /// <param name="parameters"> Parameters supplied to update virtual network gateway connection tags. </param>
 366        /// <param name="cancellationToken"> The cancellation token to use. </param>
 367        public virtual VirtualNetworkGatewayConnectionsUpdateTagsOperation StartUpdateTags(string resourceGroupName, str
 368        {
 0369            if (resourceGroupName == null)
 370            {
 0371                throw new ArgumentNullException(nameof(resourceGroupName));
 372            }
 0373            if (virtualNetworkGatewayConnectionName == null)
 374            {
 0375                throw new ArgumentNullException(nameof(virtualNetworkGatewayConnectionName));
 376            }
 0377            if (parameters == null)
 378            {
 0379                throw new ArgumentNullException(nameof(parameters));
 380            }
 381
 0382            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewayConnectionsOperations.StartUpdateTags
 0383            scope.Start();
 384            try
 385            {
 0386                var originalResponse = RestClient.UpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, par
 0387                return new VirtualNetworkGatewayConnectionsUpdateTagsOperation(_clientDiagnostics, _pipeline, RestClient
 388            }
 0389            catch (Exception e)
 390            {
 0391                scope.Failed(e);
 0392                throw;
 393            }
 0394        }
 395
 396        /// <summary> The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connec
 397        /// <param name="resourceGroupName"> The name of the resource group. </param>
 398        /// <param name="virtualNetworkGatewayConnectionName"> The virtual network gateway connection name. </param>
 399        /// <param name="parameters"> Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key
 400        /// <param name="cancellationToken"> The cancellation token to use. </param>
 401        public virtual async Task<VirtualNetworkGatewayConnectionsSetSharedKeyOperation> StartSetSharedKeyAsync(string r
 402        {
 0403            if (resourceGroupName == null)
 404            {
 0405                throw new ArgumentNullException(nameof(resourceGroupName));
 406            }
 0407            if (virtualNetworkGatewayConnectionName == null)
 408            {
 0409                throw new ArgumentNullException(nameof(virtualNetworkGatewayConnectionName));
 410            }
 0411            if (parameters == null)
 412            {
 0413                throw new ArgumentNullException(nameof(parameters));
 414            }
 415
 0416            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewayConnectionsOperations.StartSetSharedK
 0417            scope.Start();
 418            try
 419            {
 0420                var originalResponse = await RestClient.SetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnec
 0421                return new VirtualNetworkGatewayConnectionsSetSharedKeyOperation(_clientDiagnostics, _pipeline, RestClie
 422            }
 0423            catch (Exception e)
 424            {
 0425                scope.Failed(e);
 0426                throw;
 427            }
 0428        }
 429
 430        /// <summary> The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connec
 431        /// <param name="resourceGroupName"> The name of the resource group. </param>
 432        /// <param name="virtualNetworkGatewayConnectionName"> The virtual network gateway connection name. </param>
 433        /// <param name="parameters"> Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key
 434        /// <param name="cancellationToken"> The cancellation token to use. </param>
 435        public virtual VirtualNetworkGatewayConnectionsSetSharedKeyOperation StartSetSharedKey(string resourceGroupName,
 436        {
 0437            if (resourceGroupName == null)
 438            {
 0439                throw new ArgumentNullException(nameof(resourceGroupName));
 440            }
 0441            if (virtualNetworkGatewayConnectionName == null)
 442            {
 0443                throw new ArgumentNullException(nameof(virtualNetworkGatewayConnectionName));
 444            }
 0445            if (parameters == null)
 446            {
 0447                throw new ArgumentNullException(nameof(parameters));
 448            }
 449
 0450            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewayConnectionsOperations.StartSetSharedK
 0451            scope.Start();
 452            try
 453            {
 0454                var originalResponse = RestClient.SetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, p
 0455                return new VirtualNetworkGatewayConnectionsSetSharedKeyOperation(_clientDiagnostics, _pipeline, RestClie
 456            }
 0457            catch (Exception e)
 458            {
 0459                scope.Failed(e);
 0460                throw;
 461            }
 0462        }
 463
 464        /// <summary> The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway con
 465        /// <param name="resourceGroupName"> The name of the resource group. </param>
 466        /// <param name="virtualNetworkGatewayConnectionName"> The virtual network gateway connection reset shared key N
 467        /// <param name="parameters"> Parameters supplied to the begin reset virtual network gateway connection shared k
 468        /// <param name="cancellationToken"> The cancellation token to use. </param>
 469        public virtual async Task<VirtualNetworkGatewayConnectionsResetSharedKeyOperation> StartResetSharedKeyAsync(stri
 470        {
 0471            if (resourceGroupName == null)
 472            {
 0473                throw new ArgumentNullException(nameof(resourceGroupName));
 474            }
 0475            if (virtualNetworkGatewayConnectionName == null)
 476            {
 0477                throw new ArgumentNullException(nameof(virtualNetworkGatewayConnectionName));
 478            }
 0479            if (parameters == null)
 480            {
 0481                throw new ArgumentNullException(nameof(parameters));
 482            }
 483
 0484            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewayConnectionsOperations.StartResetShare
 0485            scope.Start();
 486            try
 487            {
 0488                var originalResponse = await RestClient.ResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConn
 0489                return new VirtualNetworkGatewayConnectionsResetSharedKeyOperation(_clientDiagnostics, _pipeline, RestCl
 490            }
 0491            catch (Exception e)
 492            {
 0493                scope.Failed(e);
 0494                throw;
 495            }
 0496        }
 497
 498        /// <summary> The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway con
 499        /// <param name="resourceGroupName"> The name of the resource group. </param>
 500        /// <param name="virtualNetworkGatewayConnectionName"> The virtual network gateway connection reset shared key N
 501        /// <param name="parameters"> Parameters supplied to the begin reset virtual network gateway connection shared k
 502        /// <param name="cancellationToken"> The cancellation token to use. </param>
 503        public virtual VirtualNetworkGatewayConnectionsResetSharedKeyOperation StartResetSharedKey(string resourceGroupN
 504        {
 0505            if (resourceGroupName == null)
 506            {
 0507                throw new ArgumentNullException(nameof(resourceGroupName));
 508            }
 0509            if (virtualNetworkGatewayConnectionName == null)
 510            {
 0511                throw new ArgumentNullException(nameof(virtualNetworkGatewayConnectionName));
 512            }
 0513            if (parameters == null)
 514            {
 0515                throw new ArgumentNullException(nameof(parameters));
 516            }
 517
 0518            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewayConnectionsOperations.StartResetShare
 0519            scope.Start();
 520            try
 521            {
 0522                var originalResponse = RestClient.ResetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName,
 0523                return new VirtualNetworkGatewayConnectionsResetSharedKeyOperation(_clientDiagnostics, _pipeline, RestCl
 524            }
 0525            catch (Exception e)
 526            {
 0527                scope.Failed(e);
 0528                throw;
 529            }
 0530        }
 531
 532        /// <summary> Starts packet capture on virtual network gateway connection in the specified resource group. </sum
 533        /// <param name="resourceGroupName"> The name of the resource group. </param>
 534        /// <param name="virtualNetworkGatewayConnectionName"> The name of the virtual network gateway connection. </par
 535        /// <param name="parameters"> Virtual network gateway packet capture parameters supplied to start packet capture
 536        /// <param name="cancellationToken"> The cancellation token to use. </param>
 537        public virtual async Task<VirtualNetworkGatewayConnectionsStartPacketCaptureOperation> StartStartPacketCaptureAs
 538        {
 0539            if (resourceGroupName == null)
 540            {
 0541                throw new ArgumentNullException(nameof(resourceGroupName));
 542            }
 0543            if (virtualNetworkGatewayConnectionName == null)
 544            {
 0545                throw new ArgumentNullException(nameof(virtualNetworkGatewayConnectionName));
 546            }
 547
 0548            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewayConnectionsOperations.StartStartPacke
 0549            scope.Start();
 550            try
 551            {
 0552                var originalResponse = await RestClient.StartPacketCaptureAsync(resourceGroupName, virtualNetworkGateway
 0553                return new VirtualNetworkGatewayConnectionsStartPacketCaptureOperation(_clientDiagnostics, _pipeline, Re
 554            }
 0555            catch (Exception e)
 556            {
 0557                scope.Failed(e);
 0558                throw;
 559            }
 0560        }
 561
 562        /// <summary> Starts packet capture on virtual network gateway connection in the specified resource group. </sum
 563        /// <param name="resourceGroupName"> The name of the resource group. </param>
 564        /// <param name="virtualNetworkGatewayConnectionName"> The name of the virtual network gateway connection. </par
 565        /// <param name="parameters"> Virtual network gateway packet capture parameters supplied to start packet capture
 566        /// <param name="cancellationToken"> The cancellation token to use. </param>
 567        public virtual VirtualNetworkGatewayConnectionsStartPacketCaptureOperation StartStartPacketCapture(string resour
 568        {
 0569            if (resourceGroupName == null)
 570            {
 0571                throw new ArgumentNullException(nameof(resourceGroupName));
 572            }
 0573            if (virtualNetworkGatewayConnectionName == null)
 574            {
 0575                throw new ArgumentNullException(nameof(virtualNetworkGatewayConnectionName));
 576            }
 577
 0578            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewayConnectionsOperations.StartStartPacke
 0579            scope.Start();
 580            try
 581            {
 0582                var originalResponse = RestClient.StartPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionN
 0583                return new VirtualNetworkGatewayConnectionsStartPacketCaptureOperation(_clientDiagnostics, _pipeline, Re
 584            }
 0585            catch (Exception e)
 586            {
 0587                scope.Failed(e);
 0588                throw;
 589            }
 0590        }
 591
 592        /// <summary> Stops packet capture on virtual network gateway connection in the specified resource group. </summ
 593        /// <param name="resourceGroupName"> The name of the resource group. </param>
 594        /// <param name="virtualNetworkGatewayConnectionName"> The name of the virtual network gateway Connection. </par
 595        /// <param name="parameters"> Virtual network gateway packet capture parameters supplied to stop packet capture 
 596        /// <param name="cancellationToken"> The cancellation token to use. </param>
 597        public virtual async Task<VirtualNetworkGatewayConnectionsStopPacketCaptureOperation> StartStopPacketCaptureAsyn
 598        {
 0599            if (resourceGroupName == null)
 600            {
 0601                throw new ArgumentNullException(nameof(resourceGroupName));
 602            }
 0603            if (virtualNetworkGatewayConnectionName == null)
 604            {
 0605                throw new ArgumentNullException(nameof(virtualNetworkGatewayConnectionName));
 606            }
 0607            if (parameters == null)
 608            {
 0609                throw new ArgumentNullException(nameof(parameters));
 610            }
 611
 0612            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewayConnectionsOperations.StartStopPacket
 0613            scope.Start();
 614            try
 615            {
 0616                var originalResponse = await RestClient.StopPacketCaptureAsync(resourceGroupName, virtualNetworkGatewayC
 0617                return new VirtualNetworkGatewayConnectionsStopPacketCaptureOperation(_clientDiagnostics, _pipeline, Res
 618            }
 0619            catch (Exception e)
 620            {
 0621                scope.Failed(e);
 0622                throw;
 623            }
 0624        }
 625
 626        /// <summary> Stops packet capture on virtual network gateway connection in the specified resource group. </summ
 627        /// <param name="resourceGroupName"> The name of the resource group. </param>
 628        /// <param name="virtualNetworkGatewayConnectionName"> The name of the virtual network gateway Connection. </par
 629        /// <param name="parameters"> Virtual network gateway packet capture parameters supplied to stop packet capture 
 630        /// <param name="cancellationToken"> The cancellation token to use. </param>
 631        public virtual VirtualNetworkGatewayConnectionsStopPacketCaptureOperation StartStopPacketCapture(string resource
 632        {
 0633            if (resourceGroupName == null)
 634            {
 0635                throw new ArgumentNullException(nameof(resourceGroupName));
 636            }
 0637            if (virtualNetworkGatewayConnectionName == null)
 638            {
 0639                throw new ArgumentNullException(nameof(virtualNetworkGatewayConnectionName));
 640            }
 0641            if (parameters == null)
 642            {
 0643                throw new ArgumentNullException(nameof(parameters));
 644            }
 645
 0646            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkGatewayConnectionsOperations.StartStopPacket
 0647            scope.Start();
 648            try
 649            {
 0650                var originalResponse = RestClient.StopPacketCapture(resourceGroupName, virtualNetworkGatewayConnectionNa
 0651                return new VirtualNetworkGatewayConnectionsStopPacketCaptureOperation(_clientDiagnostics, _pipeline, Res
 652            }
 0653            catch (Exception e)
 654            {
 0655                scope.Failed(e);
 0656                throw;
 657            }
 0658        }
 659    }
 660}