< Summary

Class:Azure.ResourceManager.Network.ServiceOperations
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\ServiceOperations.cs
Covered lines:16
Uncovered lines:220
Coverable lines:236
Total lines:590
Line coverage:6.7% (16 of 236)
Covered branches:0
Total branches:68
Branch coverage:0% (0 of 68)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-100%100%
.ctor()-100%100%
.ctor(...)-100%100%
CheckDnsNameAvailabilityAsync()-57.14%100%
CheckDnsNameAvailability(...)-57.14%100%
SupportedSecurityProvidersAsync()-0%100%
SupportedSecurityProviders(...)-0%100%
GetBastionShareableLinkAsync(...)-0%0%
<GetBastionShareableLinkAsync()-0%100%
<GetBastionShareableLinkAsync()-0%100%
GetBastionShareableLink(...)-0%0%
DisconnectActiveSessionsAsync(...)-0%0%
<DisconnectActiveSessionsAsync()-0%100%
<DisconnectActiveSessionsAsync()-0%100%
DisconnectActiveSessions(...)-0%0%
StartPutBastionShareableLinkAsync()-0%0%
StartPutBastionShareableLink(...)-0%0%
StartDeleteBastionShareableLinkAsync()-0%0%
StartDeleteBastionShareableLink(...)-0%0%
StartGetActiveSessionsAsync()-0%0%
StartGetActiveSessions(...)-0%0%
StartGeneratevirtualwanvpnserverconfigurationvpnprofileAsync()-0%0%
StartGeneratevirtualwanvpnserverconfigurationvpnprofile(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\ServiceOperations.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 Service service client. </summary>
 19    public partial class ServiceOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 423        internal ServiceRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of ServiceOperations for mocking. </summary>
 20425        protected ServiceOperations()
 26        {
 20427        }
 28        /// <summary> Initializes a new instance of ServiceOperations. </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>
 20433        internal ServiceOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Ur
 34        {
 20435            RestClient = new ServiceRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
 20436            _clientDiagnostics = clientDiagnostics;
 20437            _pipeline = pipeline;
 20438        }
 39
 40        /// <summary> Checks whether a domain name in the cloudapp.azure.com zone is available for use. </summary>
 41        /// <param name="location"> The location of the domain name. </param>
 42        /// <param name="domainNameLabel"> The domain name to be verified. It must conform to the following regular expr
 43        /// <param name="cancellationToken"> The cancellation token to use. </param>
 44        public virtual async Task<Response<DnsNameAvailabilityResult>> CheckDnsNameAvailabilityAsync(string location, st
 45        {
 246            using var scope = _clientDiagnostics.CreateScope("ServiceOperations.CheckDnsNameAvailability");
 247            scope.Start();
 48            try
 49            {
 250                return await RestClient.CheckDnsNameAvailabilityAsync(location, domainNameLabel, cancellationToken).Conf
 51            }
 052            catch (Exception e)
 53            {
 054                scope.Failed(e);
 055                throw;
 56            }
 257        }
 58
 59        /// <summary> Checks whether a domain name in the cloudapp.azure.com zone is available for use. </summary>
 60        /// <param name="location"> The location of the domain name. </param>
 61        /// <param name="domainNameLabel"> The domain name to be verified. It must conform to the following regular expr
 62        /// <param name="cancellationToken"> The cancellation token to use. </param>
 63        public virtual Response<DnsNameAvailabilityResult> CheckDnsNameAvailability(string location, string domainNameLa
 64        {
 265            using var scope = _clientDiagnostics.CreateScope("ServiceOperations.CheckDnsNameAvailability");
 266            scope.Start();
 67            try
 68            {
 269                return RestClient.CheckDnsNameAvailability(location, domainNameLabel, cancellationToken);
 70            }
 071            catch (Exception e)
 72            {
 073                scope.Failed(e);
 074                throw;
 75            }
 276        }
 77
 78        /// <summary> Gives the supported security providers for the virtual wan. </summary>
 79        /// <param name="resourceGroupName"> The resource group name. </param>
 80        /// <param name="virtualWANName"> The name of the VirtualWAN for which supported security providers are needed. 
 81        /// <param name="cancellationToken"> The cancellation token to use. </param>
 82        public virtual async Task<Response<VirtualWanSecurityProviders>> SupportedSecurityProvidersAsync(string resource
 83        {
 084            using var scope = _clientDiagnostics.CreateScope("ServiceOperations.SupportedSecurityProviders");
 085            scope.Start();
 86            try
 87            {
 088                return await RestClient.SupportedSecurityProvidersAsync(resourceGroupName, virtualWANName, cancellationT
 89            }
 090            catch (Exception e)
 91            {
 092                scope.Failed(e);
 093                throw;
 94            }
 095        }
 96
 97        /// <summary> Gives the supported security providers for the virtual wan. </summary>
 98        /// <param name="resourceGroupName"> The resource group name. </param>
 99        /// <param name="virtualWANName"> The name of the VirtualWAN for which supported security providers are needed. 
 100        /// <param name="cancellationToken"> The cancellation token to use. </param>
 101        public virtual Response<VirtualWanSecurityProviders> SupportedSecurityProviders(string resourceGroupName, string
 102        {
 0103            using var scope = _clientDiagnostics.CreateScope("ServiceOperations.SupportedSecurityProviders");
 0104            scope.Start();
 105            try
 106            {
 0107                return RestClient.SupportedSecurityProviders(resourceGroupName, virtualWANName, cancellationToken);
 108            }
 0109            catch (Exception e)
 110            {
 0111                scope.Failed(e);
 0112                throw;
 113            }
 0114        }
 115
 116        /// <summary> Return the Bastion Shareable Links for all the VMs specified in the request. </summary>
 117        /// <param name="resourceGroupName"> The name of the resource group. </param>
 118        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 119        /// <param name="bslRequest"> Post request for all the Bastion Shareable Link endpoints. </param>
 120        /// <param name="cancellationToken"> The cancellation token to use. </param>
 121        public virtual AsyncPageable<BastionShareableLink> GetBastionShareableLinkAsync(string resourceGroupName, string
 122        {
 0123            if (resourceGroupName == null)
 124            {
 0125                throw new ArgumentNullException(nameof(resourceGroupName));
 126            }
 0127            if (bastionHostName == null)
 128            {
 0129                throw new ArgumentNullException(nameof(bastionHostName));
 130            }
 0131            if (bslRequest == null)
 132            {
 0133                throw new ArgumentNullException(nameof(bslRequest));
 134            }
 135
 136            async Task<Page<BastionShareableLink>> FirstPageFunc(int? pageSizeHint)
 137            {
 0138                using var scope = _clientDiagnostics.CreateScope("ServiceOperations.GetBastionShareableLink");
 0139                scope.Start();
 140                try
 141                {
 0142                    var response = await RestClient.GetBastionShareableLinkAsync(resourceGroupName, bastionHostName, bsl
 0143                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 144                }
 0145                catch (Exception e)
 146                {
 0147                    scope.Failed(e);
 0148                    throw;
 149                }
 0150            }
 151            async Task<Page<BastionShareableLink>> NextPageFunc(string nextLink, int? pageSizeHint)
 152            {
 0153                using var scope = _clientDiagnostics.CreateScope("ServiceOperations.GetBastionShareableLink");
 0154                scope.Start();
 155                try
 156                {
 0157                    var response = await RestClient.GetBastionShareableLinkNextPageAsync(nextLink, resourceGroupName, ba
 0158                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 159                }
 0160                catch (Exception e)
 161                {
 0162                    scope.Failed(e);
 0163                    throw;
 164                }
 0165            }
 0166            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 167        }
 168
 169        /// <summary> Return the Bastion Shareable Links for all the VMs specified in the request. </summary>
 170        /// <param name="resourceGroupName"> The name of the resource group. </param>
 171        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 172        /// <param name="bslRequest"> Post request for all the Bastion Shareable Link endpoints. </param>
 173        /// <param name="cancellationToken"> The cancellation token to use. </param>
 174        public virtual Pageable<BastionShareableLink> GetBastionShareableLink(string resourceGroupName, string bastionHo
 175        {
 0176            if (resourceGroupName == null)
 177            {
 0178                throw new ArgumentNullException(nameof(resourceGroupName));
 179            }
 0180            if (bastionHostName == null)
 181            {
 0182                throw new ArgumentNullException(nameof(bastionHostName));
 183            }
 0184            if (bslRequest == null)
 185            {
 0186                throw new ArgumentNullException(nameof(bslRequest));
 187            }
 188
 189            Page<BastionShareableLink> FirstPageFunc(int? pageSizeHint)
 190            {
 0191                using var scope = _clientDiagnostics.CreateScope("ServiceOperations.GetBastionShareableLink");
 0192                scope.Start();
 193                try
 194                {
 0195                    var response = RestClient.GetBastionShareableLink(resourceGroupName, bastionHostName, bslRequest, ca
 0196                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 197                }
 0198                catch (Exception e)
 199                {
 0200                    scope.Failed(e);
 0201                    throw;
 202                }
 0203            }
 204            Page<BastionShareableLink> NextPageFunc(string nextLink, int? pageSizeHint)
 205            {
 0206                using var scope = _clientDiagnostics.CreateScope("ServiceOperations.GetBastionShareableLink");
 0207                scope.Start();
 208                try
 209                {
 0210                    var response = RestClient.GetBastionShareableLinkNextPage(nextLink, resourceGroupName, bastionHostNa
 0211                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 212                }
 0213                catch (Exception e)
 214                {
 0215                    scope.Failed(e);
 0216                    throw;
 217                }
 0218            }
 0219            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 220        }
 221
 222        /// <summary> Returns the list of currently active sessions on the Bastion. </summary>
 223        /// <param name="resourceGroupName"> The name of the resource group. </param>
 224        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 225        /// <param name="sessionIds"> The list of sessionids to disconnect. </param>
 226        /// <param name="cancellationToken"> The cancellation token to use. </param>
 227        public virtual AsyncPageable<BastionSessionState> DisconnectActiveSessionsAsync(string resourceGroupName, string
 228        {
 0229            if (resourceGroupName == null)
 230            {
 0231                throw new ArgumentNullException(nameof(resourceGroupName));
 232            }
 0233            if (bastionHostName == null)
 234            {
 0235                throw new ArgumentNullException(nameof(bastionHostName));
 236            }
 0237            if (sessionIds == null)
 238            {
 0239                throw new ArgumentNullException(nameof(sessionIds));
 240            }
 241
 242            async Task<Page<BastionSessionState>> FirstPageFunc(int? pageSizeHint)
 243            {
 0244                using var scope = _clientDiagnostics.CreateScope("ServiceOperations.DisconnectActiveSessions");
 0245                scope.Start();
 246                try
 247                {
 0248                    var response = await RestClient.DisconnectActiveSessionsAsync(resourceGroupName, bastionHostName, se
 0249                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 250                }
 0251                catch (Exception e)
 252                {
 0253                    scope.Failed(e);
 0254                    throw;
 255                }
 0256            }
 257            async Task<Page<BastionSessionState>> NextPageFunc(string nextLink, int? pageSizeHint)
 258            {
 0259                using var scope = _clientDiagnostics.CreateScope("ServiceOperations.DisconnectActiveSessions");
 0260                scope.Start();
 261                try
 262                {
 0263                    var response = await RestClient.DisconnectActiveSessionsNextPageAsync(nextLink, resourceGroupName, b
 0264                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 265                }
 0266                catch (Exception e)
 267                {
 0268                    scope.Failed(e);
 0269                    throw;
 270                }
 0271            }
 0272            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 273        }
 274
 275        /// <summary> Returns the list of currently active sessions on the Bastion. </summary>
 276        /// <param name="resourceGroupName"> The name of the resource group. </param>
 277        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 278        /// <param name="sessionIds"> The list of sessionids to disconnect. </param>
 279        /// <param name="cancellationToken"> The cancellation token to use. </param>
 280        public virtual Pageable<BastionSessionState> DisconnectActiveSessions(string resourceGroupName, string bastionHo
 281        {
 0282            if (resourceGroupName == null)
 283            {
 0284                throw new ArgumentNullException(nameof(resourceGroupName));
 285            }
 0286            if (bastionHostName == null)
 287            {
 0288                throw new ArgumentNullException(nameof(bastionHostName));
 289            }
 0290            if (sessionIds == null)
 291            {
 0292                throw new ArgumentNullException(nameof(sessionIds));
 293            }
 294
 295            Page<BastionSessionState> FirstPageFunc(int? pageSizeHint)
 296            {
 0297                using var scope = _clientDiagnostics.CreateScope("ServiceOperations.DisconnectActiveSessions");
 0298                scope.Start();
 299                try
 300                {
 0301                    var response = RestClient.DisconnectActiveSessions(resourceGroupName, bastionHostName, sessionIds, c
 0302                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 303                }
 0304                catch (Exception e)
 305                {
 0306                    scope.Failed(e);
 0307                    throw;
 308                }
 0309            }
 310            Page<BastionSessionState> NextPageFunc(string nextLink, int? pageSizeHint)
 311            {
 0312                using var scope = _clientDiagnostics.CreateScope("ServiceOperations.DisconnectActiveSessions");
 0313                scope.Start();
 314                try
 315                {
 0316                    var response = RestClient.DisconnectActiveSessionsNextPage(nextLink, resourceGroupName, bastionHostN
 0317                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 318                }
 0319                catch (Exception e)
 320                {
 0321                    scope.Failed(e);
 0322                    throw;
 323                }
 0324            }
 0325            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 326        }
 327
 328        /// <summary> Creates a Bastion Shareable Links for all the VMs specified in the request. </summary>
 329        /// <param name="resourceGroupName"> The name of the resource group. </param>
 330        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 331        /// <param name="bslRequest"> Post request for all the Bastion Shareable Link endpoints. </param>
 332        /// <param name="cancellationToken"> The cancellation token to use. </param>
 333        public virtual async Task<ServicePutBastionShareableLinkOperation> StartPutBastionShareableLinkAsync(string reso
 334        {
 0335            if (resourceGroupName == null)
 336            {
 0337                throw new ArgumentNullException(nameof(resourceGroupName));
 338            }
 0339            if (bastionHostName == null)
 340            {
 0341                throw new ArgumentNullException(nameof(bastionHostName));
 342            }
 0343            if (bslRequest == null)
 344            {
 0345                throw new ArgumentNullException(nameof(bslRequest));
 346            }
 347
 0348            using var scope = _clientDiagnostics.CreateScope("ServiceOperations.StartPutBastionShareableLink");
 0349            scope.Start();
 350            try
 351            {
 0352                var originalResponse = await RestClient.PutBastionShareableLinkAsync(resourceGroupName, bastionHostName,
 0353                return new ServicePutBastionShareableLinkOperation(_clientDiagnostics, _pipeline, RestClient.CreatePutBa
 354            }
 0355            catch (Exception e)
 356            {
 0357                scope.Failed(e);
 0358                throw;
 359            }
 0360        }
 361
 362        /// <summary> Creates a Bastion Shareable Links for all the VMs specified in the request. </summary>
 363        /// <param name="resourceGroupName"> The name of the resource group. </param>
 364        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 365        /// <param name="bslRequest"> Post request for all the Bastion Shareable Link endpoints. </param>
 366        /// <param name="cancellationToken"> The cancellation token to use. </param>
 367        public virtual ServicePutBastionShareableLinkOperation StartPutBastionShareableLink(string resourceGroupName, st
 368        {
 0369            if (resourceGroupName == null)
 370            {
 0371                throw new ArgumentNullException(nameof(resourceGroupName));
 372            }
 0373            if (bastionHostName == null)
 374            {
 0375                throw new ArgumentNullException(nameof(bastionHostName));
 376            }
 0377            if (bslRequest == null)
 378            {
 0379                throw new ArgumentNullException(nameof(bslRequest));
 380            }
 381
 0382            using var scope = _clientDiagnostics.CreateScope("ServiceOperations.StartPutBastionShareableLink");
 0383            scope.Start();
 384            try
 385            {
 0386                var originalResponse = RestClient.PutBastionShareableLink(resourceGroupName, bastionHostName, bslRequest
 0387                return new ServicePutBastionShareableLinkOperation(_clientDiagnostics, _pipeline, RestClient.CreatePutBa
 388            }
 0389            catch (Exception e)
 390            {
 0391                scope.Failed(e);
 0392                throw;
 393            }
 0394        }
 395
 396        /// <summary> Deletes the Bastion Shareable Links for all the VMs specified in the request. </summary>
 397        /// <param name="resourceGroupName"> The name of the resource group. </param>
 398        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 399        /// <param name="bslRequest"> Post request for all the Bastion Shareable Link endpoints. </param>
 400        /// <param name="cancellationToken"> The cancellation token to use. </param>
 401        public virtual async Task<ServiceDeleteBastionShareableLinkOperation> StartDeleteBastionShareableLinkAsync(strin
 402        {
 0403            if (resourceGroupName == null)
 404            {
 0405                throw new ArgumentNullException(nameof(resourceGroupName));
 406            }
 0407            if (bastionHostName == null)
 408            {
 0409                throw new ArgumentNullException(nameof(bastionHostName));
 410            }
 0411            if (bslRequest == null)
 412            {
 0413                throw new ArgumentNullException(nameof(bslRequest));
 414            }
 415
 0416            using var scope = _clientDiagnostics.CreateScope("ServiceOperations.StartDeleteBastionShareableLink");
 0417            scope.Start();
 418            try
 419            {
 0420                var originalResponse = await RestClient.DeleteBastionShareableLinkAsync(resourceGroupName, bastionHostNa
 0421                return new ServiceDeleteBastionShareableLinkOperation(_clientDiagnostics, _pipeline, RestClient.CreateDe
 422            }
 0423            catch (Exception e)
 424            {
 0425                scope.Failed(e);
 0426                throw;
 427            }
 0428        }
 429
 430        /// <summary> Deletes the Bastion Shareable Links for all the VMs specified in the request. </summary>
 431        /// <param name="resourceGroupName"> The name of the resource group. </param>
 432        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 433        /// <param name="bslRequest"> Post request for all the Bastion Shareable Link endpoints. </param>
 434        /// <param name="cancellationToken"> The cancellation token to use. </param>
 435        public virtual ServiceDeleteBastionShareableLinkOperation StartDeleteBastionShareableLink(string resourceGroupNa
 436        {
 0437            if (resourceGroupName == null)
 438            {
 0439                throw new ArgumentNullException(nameof(resourceGroupName));
 440            }
 0441            if (bastionHostName == null)
 442            {
 0443                throw new ArgumentNullException(nameof(bastionHostName));
 444            }
 0445            if (bslRequest == null)
 446            {
 0447                throw new ArgumentNullException(nameof(bslRequest));
 448            }
 449
 0450            using var scope = _clientDiagnostics.CreateScope("ServiceOperations.StartDeleteBastionShareableLink");
 0451            scope.Start();
 452            try
 453            {
 0454                var originalResponse = RestClient.DeleteBastionShareableLink(resourceGroupName, bastionHostName, bslRequ
 0455                return new ServiceDeleteBastionShareableLinkOperation(_clientDiagnostics, _pipeline, RestClient.CreateDe
 456            }
 0457            catch (Exception e)
 458            {
 0459                scope.Failed(e);
 0460                throw;
 461            }
 0462        }
 463
 464        /// <summary> Returns the list of currently active sessions on the Bastion. </summary>
 465        /// <param name="resourceGroupName"> The name of the resource group. </param>
 466        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 467        /// <param name="cancellationToken"> The cancellation token to use. </param>
 468        public virtual async Task<ServiceGetActiveSessionsOperation> StartGetActiveSessionsAsync(string resourceGroupNam
 469        {
 0470            if (resourceGroupName == null)
 471            {
 0472                throw new ArgumentNullException(nameof(resourceGroupName));
 473            }
 0474            if (bastionHostName == null)
 475            {
 0476                throw new ArgumentNullException(nameof(bastionHostName));
 477            }
 478
 0479            using var scope = _clientDiagnostics.CreateScope("ServiceOperations.StartGetActiveSessions");
 0480            scope.Start();
 481            try
 482            {
 0483                var originalResponse = await RestClient.GetActiveSessionsAsync(resourceGroupName, bastionHostName, cance
 0484                return new ServiceGetActiveSessionsOperation(_clientDiagnostics, _pipeline, RestClient.CreateGetActiveSe
 485            }
 0486            catch (Exception e)
 487            {
 0488                scope.Failed(e);
 0489                throw;
 490            }
 0491        }
 492
 493        /// <summary> Returns the list of currently active sessions on the Bastion. </summary>
 494        /// <param name="resourceGroupName"> The name of the resource group. </param>
 495        /// <param name="bastionHostName"> The name of the Bastion Host. </param>
 496        /// <param name="cancellationToken"> The cancellation token to use. </param>
 497        public virtual ServiceGetActiveSessionsOperation StartGetActiveSessions(string resourceGroupName, string bastion
 498        {
 0499            if (resourceGroupName == null)
 500            {
 0501                throw new ArgumentNullException(nameof(resourceGroupName));
 502            }
 0503            if (bastionHostName == null)
 504            {
 0505                throw new ArgumentNullException(nameof(bastionHostName));
 506            }
 507
 0508            using var scope = _clientDiagnostics.CreateScope("ServiceOperations.StartGetActiveSessions");
 0509            scope.Start();
 510            try
 511            {
 0512                var originalResponse = RestClient.GetActiveSessions(resourceGroupName, bastionHostName, cancellationToke
 0513                return new ServiceGetActiveSessionsOperation(_clientDiagnostics, _pipeline, RestClient.CreateGetActiveSe
 514            }
 0515            catch (Exception e)
 516            {
 0517                scope.Failed(e);
 0518                throw;
 519            }
 0520        }
 521
 522        /// <summary> Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguratio
 523        /// <param name="resourceGroupName"> The resource group name. </param>
 524        /// <param name="virtualWANName"> The name of the VirtualWAN whose associated VpnServerConfigurations is needed.
 525        /// <param name="vpnClientParams"> Parameters supplied to the generate VirtualWan VPN profile generation operati
 526        /// <param name="cancellationToken"> The cancellation token to use. </param>
 527        public virtual async Task<ServiceGeneratevirtualwanvpnserverconfigurationvpnprofileOperation> StartGeneratevirtu
 528        {
 0529            if (resourceGroupName == null)
 530            {
 0531                throw new ArgumentNullException(nameof(resourceGroupName));
 532            }
 0533            if (virtualWANName == null)
 534            {
 0535                throw new ArgumentNullException(nameof(virtualWANName));
 536            }
 0537            if (vpnClientParams == null)
 538            {
 0539                throw new ArgumentNullException(nameof(vpnClientParams));
 540            }
 541
 0542            using var scope = _clientDiagnostics.CreateScope("ServiceOperations.StartGeneratevirtualwanvpnserverconfigur
 0543            scope.Start();
 544            try
 545            {
 0546                var originalResponse = await RestClient.GeneratevirtualwanvpnserverconfigurationvpnprofileAsync(resource
 0547                return new ServiceGeneratevirtualwanvpnserverconfigurationvpnprofileOperation(_clientDiagnostics, _pipel
 548            }
 0549            catch (Exception e)
 550            {
 0551                scope.Failed(e);
 0552                throw;
 553            }
 0554        }
 555
 556        /// <summary> Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguratio
 557        /// <param name="resourceGroupName"> The resource group name. </param>
 558        /// <param name="virtualWANName"> The name of the VirtualWAN whose associated VpnServerConfigurations is needed.
 559        /// <param name="vpnClientParams"> Parameters supplied to the generate VirtualWan VPN profile generation operati
 560        /// <param name="cancellationToken"> The cancellation token to use. </param>
 561        public virtual ServiceGeneratevirtualwanvpnserverconfigurationvpnprofileOperation StartGeneratevirtualwanvpnserv
 562        {
 0563            if (resourceGroupName == null)
 564            {
 0565                throw new ArgumentNullException(nameof(resourceGroupName));
 566            }
 0567            if (virtualWANName == null)
 568            {
 0569                throw new ArgumentNullException(nameof(virtualWANName));
 570            }
 0571            if (vpnClientParams == null)
 572            {
 0573                throw new ArgumentNullException(nameof(vpnClientParams));
 574            }
 575
 0576            using var scope = _clientDiagnostics.CreateScope("ServiceOperations.StartGeneratevirtualwanvpnserverconfigur
 0577            scope.Start();
 578            try
 579            {
 0580                var originalResponse = RestClient.Generatevirtualwanvpnserverconfigurationvpnprofile(resourceGroupName, 
 0581                return new ServiceGeneratevirtualwanvpnserverconfigurationvpnprofileOperation(_clientDiagnostics, _pipel
 582            }
 0583            catch (Exception e)
 584            {
 0585                scope.Failed(e);
 0586                throw;
 587            }
 0588        }
 589    }
 590}