< Summary

Class:Azure.ResourceManager.Network.PrivateLinkServicesOperations
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\PrivateLinkServicesOperations.cs
Covered lines:24
Uncovered lines:352
Coverable lines:376
Total lines:922
Line coverage:6.3% (24 of 376)
Covered branches:6
Total branches:76
Branch coverage:7.8% (6 of 76)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-100%100%
.ctor()-100%100%
.ctor(...)-100%100%
GetAsync()-0%100%
Get(...)-0%100%
GetPrivateEndpointConnectionAsync()-0%100%
GetPrivateEndpointConnection(...)-0%100%
UpdatePrivateEndpointConnectionAsync()-0%100%
UpdatePrivateEndpointConnection(...)-0%100%
ListAsync(...)-0%0%
<ListAsync()-0%100%
<ListAsync()-0%100%
List(...)-0%0%
<ListBySubscriptionAsync()-0%100%
<ListBySubscriptionAsync()-0%100%
ListBySubscriptionAsync(...)-0%100%
ListBySubscription(...)-0%100%
ListPrivateEndpointConnectionsAsync(...)-0%0%
<ListPrivateEndpointConnectionsAsync()-0%100%
<ListPrivateEndpointConnectionsAsync()-0%100%
ListPrivateEndpointConnections(...)-0%0%
ListAutoApprovedPrivateLinkServicesAsync(...)-0%0%
<ListAutoApprovedPrivateLinkServicesAsync()-0%100%
<ListAutoApprovedPrivateLinkServicesAsync()-0%100%
ListAutoApprovedPrivateLinkServices(...)-0%0%
ListAutoApprovedPrivateLinkServicesByResourceGroupAsync(...)-0%0%
<ListAutoApprovedPrivateLinkServicesByResourceGroupAsync()-0%100%
<ListAutoApprovedPrivateLinkServicesByResourceGroupAsync()-0%100%
ListAutoApprovedPrivateLinkServicesByResourceGroup(...)-0%0%
StartDeleteAsync()-0%0%
StartDelete(...)-0%0%
StartCreateOrUpdateAsync()-0%0%
StartCreateOrUpdate(...)-0%0%
StartDeletePrivateEndpointConnectionAsync()-0%0%
StartDeletePrivateEndpointConnection(...)-0%0%
StartCheckPrivateLinkServiceVisibilityAsync()-0%0%
StartCheckPrivateLinkServiceVisibility(...)-0%0%
StartCheckPrivateLinkServiceVisibilityByResourceGroupAsync()-57.14%50%
StartCheckPrivateLinkServiceVisibilityByResourceGroup(...)-57.14%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\PrivateLinkServicesOperations.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 PrivateLinkServices service client. </summary>
 19    public partial class PrivateLinkServicesOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 823        internal PrivateLinkServicesRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of PrivateLinkServicesOperations for mocking. </summary>
 20425        protected PrivateLinkServicesOperations()
 26        {
 20427        }
 28        /// <summary> Initializes a new instance of PrivateLinkServicesOperations. </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 PrivateLinkServicesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscr
 34        {
 20435            RestClient = new PrivateLinkServicesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
 20436            _clientDiagnostics = clientDiagnostics;
 20437            _pipeline = pipeline;
 20438        }
 39
 40        /// <summary> Gets the specified private link service by resource group. </summary>
 41        /// <param name="resourceGroupName"> The name of the resource group. </param>
 42        /// <param name="serviceName"> The name of the private link service. </param>
 43        /// <param name="expand"> Expands referenced resources. </param>
 44        /// <param name="cancellationToken"> The cancellation token to use. </param>
 45        public virtual async Task<Response<PrivateLinkService>> GetAsync(string resourceGroupName, string serviceName, s
 46        {
 047            using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.Get");
 048            scope.Start();
 49            try
 50            {
 051                return await RestClient.GetAsync(resourceGroupName, serviceName, expand, cancellationToken).ConfigureAwa
 52            }
 053            catch (Exception e)
 54            {
 055                scope.Failed(e);
 056                throw;
 57            }
 058        }
 59
 60        /// <summary> Gets the specified private link service by resource group. </summary>
 61        /// <param name="resourceGroupName"> The name of the resource group. </param>
 62        /// <param name="serviceName"> The name of the private link service. </param>
 63        /// <param name="expand"> Expands referenced resources. </param>
 64        /// <param name="cancellationToken"> The cancellation token to use. </param>
 65        public virtual Response<PrivateLinkService> Get(string resourceGroupName, string serviceName, string expand = nu
 66        {
 067            using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.Get");
 068            scope.Start();
 69            try
 70            {
 071                return RestClient.Get(resourceGroupName, serviceName, expand, cancellationToken);
 72            }
 073            catch (Exception e)
 74            {
 075                scope.Failed(e);
 076                throw;
 77            }
 078        }
 79
 80        /// <summary> Get the specific private end point connection by specific private link service in the resource gro
 81        /// <param name="resourceGroupName"> The name of the resource group. </param>
 82        /// <param name="serviceName"> The name of the private link service. </param>
 83        /// <param name="peConnectionName"> The name of the private end point connection. </param>
 84        /// <param name="expand"> Expands referenced resources. </param>
 85        /// <param name="cancellationToken"> The cancellation token to use. </param>
 86        public virtual async Task<Response<PrivateEndpointConnection>> GetPrivateEndpointConnectionAsync(string resource
 87        {
 088            using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.GetPrivateEndpointConnection
 089            scope.Start();
 90            try
 91            {
 092                return await RestClient.GetPrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectionNa
 93            }
 094            catch (Exception e)
 95            {
 096                scope.Failed(e);
 097                throw;
 98            }
 099        }
 100
 101        /// <summary> Get the specific private end point connection by specific private link service in the resource gro
 102        /// <param name="resourceGroupName"> The name of the resource group. </param>
 103        /// <param name="serviceName"> The name of the private link service. </param>
 104        /// <param name="peConnectionName"> The name of the private end point connection. </param>
 105        /// <param name="expand"> Expands referenced resources. </param>
 106        /// <param name="cancellationToken"> The cancellation token to use. </param>
 107        public virtual Response<PrivateEndpointConnection> GetPrivateEndpointConnection(string resourceGroupName, string
 108        {
 0109            using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.GetPrivateEndpointConnection
 0110            scope.Start();
 111            try
 112            {
 0113                return RestClient.GetPrivateEndpointConnection(resourceGroupName, serviceName, peConnectionName, expand,
 114            }
 0115            catch (Exception e)
 116            {
 0117                scope.Failed(e);
 0118                throw;
 119            }
 0120        }
 121
 122        /// <summary> Approve or reject private end point connection for a private link service in a subscription. </sum
 123        /// <param name="resourceGroupName"> The name of the resource group. </param>
 124        /// <param name="serviceName"> The name of the private link service. </param>
 125        /// <param name="peConnectionName"> The name of the private end point connection. </param>
 126        /// <param name="parameters"> Parameters supplied to approve or reject the private end point connection. </param
 127        /// <param name="cancellationToken"> The cancellation token to use. </param>
 128        public virtual async Task<Response<PrivateEndpointConnection>> UpdatePrivateEndpointConnectionAsync(string resou
 129        {
 0130            using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.UpdatePrivateEndpointConnect
 0131            scope.Start();
 132            try
 133            {
 0134                return await RestClient.UpdatePrivateEndpointConnectionAsync(resourceGroupName, serviceName, peConnectio
 135            }
 0136            catch (Exception e)
 137            {
 0138                scope.Failed(e);
 0139                throw;
 140            }
 0141        }
 142
 143        /// <summary> Approve or reject private end point connection for a private link service in a subscription. </sum
 144        /// <param name="resourceGroupName"> The name of the resource group. </param>
 145        /// <param name="serviceName"> The name of the private link service. </param>
 146        /// <param name="peConnectionName"> The name of the private end point connection. </param>
 147        /// <param name="parameters"> Parameters supplied to approve or reject the private end point connection. </param
 148        /// <param name="cancellationToken"> The cancellation token to use. </param>
 149        public virtual Response<PrivateEndpointConnection> UpdatePrivateEndpointConnection(string resourceGroupName, str
 150        {
 0151            using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.UpdatePrivateEndpointConnect
 0152            scope.Start();
 153            try
 154            {
 0155                return RestClient.UpdatePrivateEndpointConnection(resourceGroupName, serviceName, peConnectionName, para
 156            }
 0157            catch (Exception e)
 158            {
 0159                scope.Failed(e);
 0160                throw;
 161            }
 0162        }
 163
 164        /// <summary> Gets all private link services in a resource group. </summary>
 165        /// <param name="resourceGroupName"> The name of the resource group. </param>
 166        /// <param name="cancellationToken"> The cancellation token to use. </param>
 167        public virtual AsyncPageable<PrivateLinkService> ListAsync(string resourceGroupName, CancellationToken cancellat
 168        {
 0169            if (resourceGroupName == null)
 170            {
 0171                throw new ArgumentNullException(nameof(resourceGroupName));
 172            }
 173
 174            async Task<Page<PrivateLinkService>> FirstPageFunc(int? pageSizeHint)
 175            {
 0176                using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.List");
 0177                scope.Start();
 178                try
 179                {
 0180                    var response = await RestClient.ListAsync(resourceGroupName, cancellationToken).ConfigureAwait(false
 0181                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 182                }
 0183                catch (Exception e)
 184                {
 0185                    scope.Failed(e);
 0186                    throw;
 187                }
 0188            }
 189            async Task<Page<PrivateLinkService>> NextPageFunc(string nextLink, int? pageSizeHint)
 190            {
 0191                using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.List");
 0192                scope.Start();
 193                try
 194                {
 0195                    var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, cancellationToken).Co
 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            }
 0204            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 205        }
 206
 207        /// <summary> Gets all private link services in a resource group. </summary>
 208        /// <param name="resourceGroupName"> The name of the resource group. </param>
 209        /// <param name="cancellationToken"> The cancellation token to use. </param>
 210        public virtual Pageable<PrivateLinkService> List(string resourceGroupName, CancellationToken cancellationToken =
 211        {
 0212            if (resourceGroupName == null)
 213            {
 0214                throw new ArgumentNullException(nameof(resourceGroupName));
 215            }
 216
 217            Page<PrivateLinkService> FirstPageFunc(int? pageSizeHint)
 218            {
 0219                using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.List");
 0220                scope.Start();
 221                try
 222                {
 0223                    var response = RestClient.List(resourceGroupName, cancellationToken);
 0224                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 225                }
 0226                catch (Exception e)
 227                {
 0228                    scope.Failed(e);
 0229                    throw;
 230                }
 0231            }
 232            Page<PrivateLinkService> NextPageFunc(string nextLink, int? pageSizeHint)
 233            {
 0234                using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.List");
 0235                scope.Start();
 236                try
 237                {
 0238                    var response = RestClient.ListNextPage(nextLink, resourceGroupName, cancellationToken);
 0239                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 240                }
 0241                catch (Exception e)
 242                {
 0243                    scope.Failed(e);
 0244                    throw;
 245                }
 0246            }
 0247            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 248        }
 249
 250        /// <summary> Gets all private link service in a subscription. </summary>
 251        /// <param name="cancellationToken"> The cancellation token to use. </param>
 252        public virtual AsyncPageable<PrivateLinkService> ListBySubscriptionAsync(CancellationToken cancellationToken = d
 253        {
 254            async Task<Page<PrivateLinkService>> FirstPageFunc(int? pageSizeHint)
 255            {
 0256                using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.ListBySubscription");
 0257                scope.Start();
 258                try
 259                {
 0260                    var response = await RestClient.ListBySubscriptionAsync(cancellationToken).ConfigureAwait(false);
 0261                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 262                }
 0263                catch (Exception e)
 264                {
 0265                    scope.Failed(e);
 0266                    throw;
 267                }
 0268            }
 269            async Task<Page<PrivateLinkService>> NextPageFunc(string nextLink, int? pageSizeHint)
 270            {
 0271                using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.ListBySubscription");
 0272                scope.Start();
 273                try
 274                {
 0275                    var response = await RestClient.ListBySubscriptionNextPageAsync(nextLink, cancellationToken).Configu
 0276                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 277                }
 0278                catch (Exception e)
 279                {
 0280                    scope.Failed(e);
 0281                    throw;
 282                }
 0283            }
 0284            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 285        }
 286
 287        /// <summary> Gets all private link service in a subscription. </summary>
 288        /// <param name="cancellationToken"> The cancellation token to use. </param>
 289        public virtual Pageable<PrivateLinkService> ListBySubscription(CancellationToken cancellationToken = default)
 290        {
 291            Page<PrivateLinkService> FirstPageFunc(int? pageSizeHint)
 292            {
 0293                using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.ListBySubscription");
 0294                scope.Start();
 295                try
 296                {
 0297                    var response = RestClient.ListBySubscription(cancellationToken);
 0298                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 299                }
 0300                catch (Exception e)
 301                {
 0302                    scope.Failed(e);
 0303                    throw;
 304                }
 0305            }
 306            Page<PrivateLinkService> NextPageFunc(string nextLink, int? pageSizeHint)
 307            {
 0308                using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.ListBySubscription");
 0309                scope.Start();
 310                try
 311                {
 0312                    var response = RestClient.ListBySubscriptionNextPage(nextLink, cancellationToken);
 0313                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 314                }
 0315                catch (Exception e)
 316                {
 0317                    scope.Failed(e);
 0318                    throw;
 319                }
 0320            }
 0321            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 322        }
 323
 324        /// <summary> Gets all private end point connections for a specific private link service. </summary>
 325        /// <param name="resourceGroupName"> The name of the resource group. </param>
 326        /// <param name="serviceName"> The name of the private link service. </param>
 327        /// <param name="cancellationToken"> The cancellation token to use. </param>
 328        public virtual AsyncPageable<PrivateEndpointConnection> ListPrivateEndpointConnectionsAsync(string resourceGroup
 329        {
 0330            if (resourceGroupName == null)
 331            {
 0332                throw new ArgumentNullException(nameof(resourceGroupName));
 333            }
 0334            if (serviceName == null)
 335            {
 0336                throw new ArgumentNullException(nameof(serviceName));
 337            }
 338
 339            async Task<Page<PrivateEndpointConnection>> FirstPageFunc(int? pageSizeHint)
 340            {
 0341                using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.ListPrivateEndpointConne
 0342                scope.Start();
 343                try
 344                {
 0345                    var response = await RestClient.ListPrivateEndpointConnectionsAsync(resourceGroupName, serviceName, 
 0346                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 347                }
 0348                catch (Exception e)
 349                {
 0350                    scope.Failed(e);
 0351                    throw;
 352                }
 0353            }
 354            async Task<Page<PrivateEndpointConnection>> NextPageFunc(string nextLink, int? pageSizeHint)
 355            {
 0356                using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.ListPrivateEndpointConne
 0357                scope.Start();
 358                try
 359                {
 0360                    var response = await RestClient.ListPrivateEndpointConnectionsNextPageAsync(nextLink, resourceGroupN
 0361                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 362                }
 0363                catch (Exception e)
 364                {
 0365                    scope.Failed(e);
 0366                    throw;
 367                }
 0368            }
 0369            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 370        }
 371
 372        /// <summary> Gets all private end point connections for a specific private link service. </summary>
 373        /// <param name="resourceGroupName"> The name of the resource group. </param>
 374        /// <param name="serviceName"> The name of the private link service. </param>
 375        /// <param name="cancellationToken"> The cancellation token to use. </param>
 376        public virtual Pageable<PrivateEndpointConnection> ListPrivateEndpointConnections(string resourceGroupName, stri
 377        {
 0378            if (resourceGroupName == null)
 379            {
 0380                throw new ArgumentNullException(nameof(resourceGroupName));
 381            }
 0382            if (serviceName == null)
 383            {
 0384                throw new ArgumentNullException(nameof(serviceName));
 385            }
 386
 387            Page<PrivateEndpointConnection> FirstPageFunc(int? pageSizeHint)
 388            {
 0389                using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.ListPrivateEndpointConne
 0390                scope.Start();
 391                try
 392                {
 0393                    var response = RestClient.ListPrivateEndpointConnections(resourceGroupName, serviceName, cancellatio
 0394                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 395                }
 0396                catch (Exception e)
 397                {
 0398                    scope.Failed(e);
 0399                    throw;
 400                }
 0401            }
 402            Page<PrivateEndpointConnection> NextPageFunc(string nextLink, int? pageSizeHint)
 403            {
 0404                using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.ListPrivateEndpointConne
 0405                scope.Start();
 406                try
 407                {
 0408                    var response = RestClient.ListPrivateEndpointConnectionsNextPage(nextLink, resourceGroupName, servic
 0409                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 410                }
 0411                catch (Exception e)
 412                {
 0413                    scope.Failed(e);
 0414                    throw;
 415                }
 0416            }
 0417            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 418        }
 419
 420        /// <summary> Returns all of the private link service ids that can be linked to a Private Endpoint with auto app
 421        /// <param name="location"> The location of the domain name. </param>
 422        /// <param name="cancellationToken"> The cancellation token to use. </param>
 423        public virtual AsyncPageable<AutoApprovedPrivateLinkService> ListAutoApprovedPrivateLinkServicesAsync(string loc
 424        {
 0425            if (location == null)
 426            {
 0427                throw new ArgumentNullException(nameof(location));
 428            }
 429
 430            async Task<Page<AutoApprovedPrivateLinkService>> FirstPageFunc(int? pageSizeHint)
 431            {
 0432                using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.ListAutoApprovedPrivateL
 0433                scope.Start();
 434                try
 435                {
 0436                    var response = await RestClient.ListAutoApprovedPrivateLinkServicesAsync(location, cancellationToken
 0437                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 438                }
 0439                catch (Exception e)
 440                {
 0441                    scope.Failed(e);
 0442                    throw;
 443                }
 0444            }
 445            async Task<Page<AutoApprovedPrivateLinkService>> NextPageFunc(string nextLink, int? pageSizeHint)
 446            {
 0447                using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.ListAutoApprovedPrivateL
 0448                scope.Start();
 449                try
 450                {
 0451                    var response = await RestClient.ListAutoApprovedPrivateLinkServicesNextPageAsync(nextLink, location,
 0452                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 453                }
 0454                catch (Exception e)
 455                {
 0456                    scope.Failed(e);
 0457                    throw;
 458                }
 0459            }
 0460            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 461        }
 462
 463        /// <summary> Returns all of the private link service ids that can be linked to a Private Endpoint with auto app
 464        /// <param name="location"> The location of the domain name. </param>
 465        /// <param name="cancellationToken"> The cancellation token to use. </param>
 466        public virtual Pageable<AutoApprovedPrivateLinkService> ListAutoApprovedPrivateLinkServices(string location, Can
 467        {
 0468            if (location == null)
 469            {
 0470                throw new ArgumentNullException(nameof(location));
 471            }
 472
 473            Page<AutoApprovedPrivateLinkService> FirstPageFunc(int? pageSizeHint)
 474            {
 0475                using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.ListAutoApprovedPrivateL
 0476                scope.Start();
 477                try
 478                {
 0479                    var response = RestClient.ListAutoApprovedPrivateLinkServices(location, cancellationToken);
 0480                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 481                }
 0482                catch (Exception e)
 483                {
 0484                    scope.Failed(e);
 0485                    throw;
 486                }
 0487            }
 488            Page<AutoApprovedPrivateLinkService> NextPageFunc(string nextLink, int? pageSizeHint)
 489            {
 0490                using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.ListAutoApprovedPrivateL
 0491                scope.Start();
 492                try
 493                {
 0494                    var response = RestClient.ListAutoApprovedPrivateLinkServicesNextPage(nextLink, location, cancellati
 0495                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 496                }
 0497                catch (Exception e)
 498                {
 0499                    scope.Failed(e);
 0500                    throw;
 501                }
 0502            }
 0503            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 504        }
 505
 506        /// <summary> Returns all of the private link service ids that can be linked to a Private Endpoint with auto app
 507        /// <param name="location"> The location of the domain name. </param>
 508        /// <param name="resourceGroupName"> The name of the resource group. </param>
 509        /// <param name="cancellationToken"> The cancellation token to use. </param>
 510        public virtual AsyncPageable<AutoApprovedPrivateLinkService> ListAutoApprovedPrivateLinkServicesByResourceGroupA
 511        {
 0512            if (location == null)
 513            {
 0514                throw new ArgumentNullException(nameof(location));
 515            }
 0516            if (resourceGroupName == null)
 517            {
 0518                throw new ArgumentNullException(nameof(resourceGroupName));
 519            }
 520
 521            async Task<Page<AutoApprovedPrivateLinkService>> FirstPageFunc(int? pageSizeHint)
 522            {
 0523                using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.ListAutoApprovedPrivateL
 0524                scope.Start();
 525                try
 526                {
 0527                    var response = await RestClient.ListAutoApprovedPrivateLinkServicesByResourceGroupAsync(location, re
 0528                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 529                }
 0530                catch (Exception e)
 531                {
 0532                    scope.Failed(e);
 0533                    throw;
 534                }
 0535            }
 536            async Task<Page<AutoApprovedPrivateLinkService>> NextPageFunc(string nextLink, int? pageSizeHint)
 537            {
 0538                using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.ListAutoApprovedPrivateL
 0539                scope.Start();
 540                try
 541                {
 0542                    var response = await RestClient.ListAutoApprovedPrivateLinkServicesByResourceGroupNextPageAsync(next
 0543                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 544                }
 0545                catch (Exception e)
 546                {
 0547                    scope.Failed(e);
 0548                    throw;
 549                }
 0550            }
 0551            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 552        }
 553
 554        /// <summary> Returns all of the private link service ids that can be linked to a Private Endpoint with auto app
 555        /// <param name="location"> The location of the domain name. </param>
 556        /// <param name="resourceGroupName"> The name of the resource group. </param>
 557        /// <param name="cancellationToken"> The cancellation token to use. </param>
 558        public virtual Pageable<AutoApprovedPrivateLinkService> ListAutoApprovedPrivateLinkServicesByResourceGroup(strin
 559        {
 0560            if (location == null)
 561            {
 0562                throw new ArgumentNullException(nameof(location));
 563            }
 0564            if (resourceGroupName == null)
 565            {
 0566                throw new ArgumentNullException(nameof(resourceGroupName));
 567            }
 568
 569            Page<AutoApprovedPrivateLinkService> FirstPageFunc(int? pageSizeHint)
 570            {
 0571                using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.ListAutoApprovedPrivateL
 0572                scope.Start();
 573                try
 574                {
 0575                    var response = RestClient.ListAutoApprovedPrivateLinkServicesByResourceGroup(location, resourceGroup
 0576                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 577                }
 0578                catch (Exception e)
 579                {
 0580                    scope.Failed(e);
 0581                    throw;
 582                }
 0583            }
 584            Page<AutoApprovedPrivateLinkService> NextPageFunc(string nextLink, int? pageSizeHint)
 585            {
 0586                using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.ListAutoApprovedPrivateL
 0587                scope.Start();
 588                try
 589                {
 0590                    var response = RestClient.ListAutoApprovedPrivateLinkServicesByResourceGroupNextPage(nextLink, locat
 0591                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 592                }
 0593                catch (Exception e)
 594                {
 0595                    scope.Failed(e);
 0596                    throw;
 597                }
 0598            }
 0599            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 600        }
 601
 602        /// <summary> Deletes the specified private link service. </summary>
 603        /// <param name="resourceGroupName"> The name of the resource group. </param>
 604        /// <param name="serviceName"> The name of the private link service. </param>
 605        /// <param name="cancellationToken"> The cancellation token to use. </param>
 606        public virtual async Task<PrivateLinkServicesDeleteOperation> StartDeleteAsync(string resourceGroupName, string 
 607        {
 0608            if (resourceGroupName == null)
 609            {
 0610                throw new ArgumentNullException(nameof(resourceGroupName));
 611            }
 0612            if (serviceName == null)
 613            {
 0614                throw new ArgumentNullException(nameof(serviceName));
 615            }
 616
 0617            using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.StartDelete");
 0618            scope.Start();
 619            try
 620            {
 0621                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, serviceName, cancellationToken).C
 0622                return new PrivateLinkServicesDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequ
 623            }
 0624            catch (Exception e)
 625            {
 0626                scope.Failed(e);
 0627                throw;
 628            }
 0629        }
 630
 631        /// <summary> Deletes the specified private link service. </summary>
 632        /// <param name="resourceGroupName"> The name of the resource group. </param>
 633        /// <param name="serviceName"> The name of the private link service. </param>
 634        /// <param name="cancellationToken"> The cancellation token to use. </param>
 635        public virtual PrivateLinkServicesDeleteOperation StartDelete(string resourceGroupName, string serviceName, Canc
 636        {
 0637            if (resourceGroupName == null)
 638            {
 0639                throw new ArgumentNullException(nameof(resourceGroupName));
 640            }
 0641            if (serviceName == null)
 642            {
 0643                throw new ArgumentNullException(nameof(serviceName));
 644            }
 645
 0646            using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.StartDelete");
 0647            scope.Start();
 648            try
 649            {
 0650                var originalResponse = RestClient.Delete(resourceGroupName, serviceName, cancellationToken);
 0651                return new PrivateLinkServicesDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequ
 652            }
 0653            catch (Exception e)
 654            {
 0655                scope.Failed(e);
 0656                throw;
 657            }
 0658        }
 659
 660        /// <summary> Creates or updates an private link service in the specified resource group. </summary>
 661        /// <param name="resourceGroupName"> The name of the resource group. </param>
 662        /// <param name="serviceName"> The name of the private link service. </param>
 663        /// <param name="parameters"> Parameters supplied to the create or update private link service operation. </para
 664        /// <param name="cancellationToken"> The cancellation token to use. </param>
 665        public virtual async Task<PrivateLinkServicesCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resourceGr
 666        {
 0667            if (resourceGroupName == null)
 668            {
 0669                throw new ArgumentNullException(nameof(resourceGroupName));
 670            }
 0671            if (serviceName == null)
 672            {
 0673                throw new ArgumentNullException(nameof(serviceName));
 674            }
 0675            if (parameters == null)
 676            {
 0677                throw new ArgumentNullException(nameof(parameters));
 678            }
 679
 0680            using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.StartCreateOrUpdate");
 0681            scope.Start();
 682            try
 683            {
 0684                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, serviceName, parameters, 
 0685                return new PrivateLinkServicesCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCr
 686            }
 0687            catch (Exception e)
 688            {
 0689                scope.Failed(e);
 0690                throw;
 691            }
 0692        }
 693
 694        /// <summary> Creates or updates an private link service in the specified resource group. </summary>
 695        /// <param name="resourceGroupName"> The name of the resource group. </param>
 696        /// <param name="serviceName"> The name of the private link service. </param>
 697        /// <param name="parameters"> Parameters supplied to the create or update private link service operation. </para
 698        /// <param name="cancellationToken"> The cancellation token to use. </param>
 699        public virtual PrivateLinkServicesCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string s
 700        {
 0701            if (resourceGroupName == null)
 702            {
 0703                throw new ArgumentNullException(nameof(resourceGroupName));
 704            }
 0705            if (serviceName == null)
 706            {
 0707                throw new ArgumentNullException(nameof(serviceName));
 708            }
 0709            if (parameters == null)
 710            {
 0711                throw new ArgumentNullException(nameof(parameters));
 712            }
 713
 0714            using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.StartCreateOrUpdate");
 0715            scope.Start();
 716            try
 717            {
 0718                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, serviceName, parameters, cancellatio
 0719                return new PrivateLinkServicesCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCr
 720            }
 0721            catch (Exception e)
 722            {
 0723                scope.Failed(e);
 0724                throw;
 725            }
 0726        }
 727
 728        /// <summary> Delete private end point connection for a private link service in a subscription. </summary>
 729        /// <param name="resourceGroupName"> The name of the resource group. </param>
 730        /// <param name="serviceName"> The name of the private link service. </param>
 731        /// <param name="peConnectionName"> The name of the private end point connection. </param>
 732        /// <param name="cancellationToken"> The cancellation token to use. </param>
 733        public virtual async Task<PrivateLinkServicesDeletePrivateEndpointConnectionOperation> StartDeletePrivateEndpoin
 734        {
 0735            if (resourceGroupName == null)
 736            {
 0737                throw new ArgumentNullException(nameof(resourceGroupName));
 738            }
 0739            if (serviceName == null)
 740            {
 0741                throw new ArgumentNullException(nameof(serviceName));
 742            }
 0743            if (peConnectionName == null)
 744            {
 0745                throw new ArgumentNullException(nameof(peConnectionName));
 746            }
 747
 0748            using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.StartDeletePrivateEndpointCo
 0749            scope.Start();
 750            try
 751            {
 0752                var originalResponse = await RestClient.DeletePrivateEndpointConnectionAsync(resourceGroupName, serviceN
 0753                return new PrivateLinkServicesDeletePrivateEndpointConnectionOperation(_clientDiagnostics, _pipeline, Re
 754            }
 0755            catch (Exception e)
 756            {
 0757                scope.Failed(e);
 0758                throw;
 759            }
 0760        }
 761
 762        /// <summary> Delete private end point connection for a private link service in a subscription. </summary>
 763        /// <param name="resourceGroupName"> The name of the resource group. </param>
 764        /// <param name="serviceName"> The name of the private link service. </param>
 765        /// <param name="peConnectionName"> The name of the private end point connection. </param>
 766        /// <param name="cancellationToken"> The cancellation token to use. </param>
 767        public virtual PrivateLinkServicesDeletePrivateEndpointConnectionOperation StartDeletePrivateEndpointConnection(
 768        {
 0769            if (resourceGroupName == null)
 770            {
 0771                throw new ArgumentNullException(nameof(resourceGroupName));
 772            }
 0773            if (serviceName == null)
 774            {
 0775                throw new ArgumentNullException(nameof(serviceName));
 776            }
 0777            if (peConnectionName == null)
 778            {
 0779                throw new ArgumentNullException(nameof(peConnectionName));
 780            }
 781
 0782            using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.StartDeletePrivateEndpointCo
 0783            scope.Start();
 784            try
 785            {
 0786                var originalResponse = RestClient.DeletePrivateEndpointConnection(resourceGroupName, serviceName, peConn
 0787                return new PrivateLinkServicesDeletePrivateEndpointConnectionOperation(_clientDiagnostics, _pipeline, Re
 788            }
 0789            catch (Exception e)
 790            {
 0791                scope.Failed(e);
 0792                throw;
 793            }
 0794        }
 795
 796        /// <summary> Checks whether the subscription is visible to private link service. </summary>
 797        /// <param name="location"> The location of the domain name. </param>
 798        /// <param name="parameters"> The request body of CheckPrivateLinkService API call. </param>
 799        /// <param name="cancellationToken"> The cancellation token to use. </param>
 800        public virtual async Task<PrivateLinkServicesCheckPrivateLinkServiceVisibilityOperation> StartCheckPrivateLinkSe
 801        {
 0802            if (location == null)
 803            {
 0804                throw new ArgumentNullException(nameof(location));
 805            }
 0806            if (parameters == null)
 807            {
 0808                throw new ArgumentNullException(nameof(parameters));
 809            }
 810
 0811            using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.StartCheckPrivateLinkService
 0812            scope.Start();
 813            try
 814            {
 0815                var originalResponse = await RestClient.CheckPrivateLinkServiceVisibilityAsync(location, parameters, can
 0816                return new PrivateLinkServicesCheckPrivateLinkServiceVisibilityOperation(_clientDiagnostics, _pipeline, 
 817            }
 0818            catch (Exception e)
 819            {
 0820                scope.Failed(e);
 0821                throw;
 822            }
 0823        }
 824
 825        /// <summary> Checks whether the subscription is visible to private link service. </summary>
 826        /// <param name="location"> The location of the domain name. </param>
 827        /// <param name="parameters"> The request body of CheckPrivateLinkService API call. </param>
 828        /// <param name="cancellationToken"> The cancellation token to use. </param>
 829        public virtual PrivateLinkServicesCheckPrivateLinkServiceVisibilityOperation StartCheckPrivateLinkServiceVisibil
 830        {
 0831            if (location == null)
 832            {
 0833                throw new ArgumentNullException(nameof(location));
 834            }
 0835            if (parameters == null)
 836            {
 0837                throw new ArgumentNullException(nameof(parameters));
 838            }
 839
 0840            using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.StartCheckPrivateLinkService
 0841            scope.Start();
 842            try
 843            {
 0844                var originalResponse = RestClient.CheckPrivateLinkServiceVisibility(location, parameters, cancellationTo
 0845                return new PrivateLinkServicesCheckPrivateLinkServiceVisibilityOperation(_clientDiagnostics, _pipeline, 
 846            }
 0847            catch (Exception e)
 848            {
 0849                scope.Failed(e);
 0850                throw;
 851            }
 0852        }
 853
 854        /// <summary> Checks whether the subscription is visible to private link service in the specified resource group
 855        /// <param name="location"> The location of the domain name. </param>
 856        /// <param name="resourceGroupName"> The name of the resource group. </param>
 857        /// <param name="parameters"> The request body of CheckPrivateLinkService API call. </param>
 858        /// <param name="cancellationToken"> The cancellation token to use. </param>
 859        public virtual async Task<PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupOperation> StartChe
 860        {
 2861            if (location == null)
 862            {
 0863                throw new ArgumentNullException(nameof(location));
 864            }
 2865            if (resourceGroupName == null)
 866            {
 0867                throw new ArgumentNullException(nameof(resourceGroupName));
 868            }
 2869            if (parameters == null)
 870            {
 0871                throw new ArgumentNullException(nameof(parameters));
 872            }
 873
 2874            using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.StartCheckPrivateLinkService
 2875            scope.Start();
 876            try
 877            {
 2878                var originalResponse = await RestClient.CheckPrivateLinkServiceVisibilityByResourceGroupAsync(location, 
 2879                return new PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupOperation(_clientDiagnosti
 880            }
 0881            catch (Exception e)
 882            {
 0883                scope.Failed(e);
 0884                throw;
 885            }
 2886        }
 887
 888        /// <summary> Checks whether the subscription is visible to private link service in the specified resource group
 889        /// <param name="location"> The location of the domain name. </param>
 890        /// <param name="resourceGroupName"> The name of the resource group. </param>
 891        /// <param name="parameters"> The request body of CheckPrivateLinkService API call. </param>
 892        /// <param name="cancellationToken"> The cancellation token to use. </param>
 893        public virtual PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupOperation StartCheckPrivateLin
 894        {
 2895            if (location == null)
 896            {
 0897                throw new ArgumentNullException(nameof(location));
 898            }
 2899            if (resourceGroupName == null)
 900            {
 0901                throw new ArgumentNullException(nameof(resourceGroupName));
 902            }
 2903            if (parameters == null)
 904            {
 0905                throw new ArgumentNullException(nameof(parameters));
 906            }
 907
 2908            using var scope = _clientDiagnostics.CreateScope("PrivateLinkServicesOperations.StartCheckPrivateLinkService
 2909            scope.Start();
 910            try
 911            {
 2912                var originalResponse = RestClient.CheckPrivateLinkServiceVisibilityByResourceGroup(location, resourceGro
 2913                return new PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupOperation(_clientDiagnosti
 914            }
 0915            catch (Exception e)
 916            {
 0917                scope.Failed(e);
 0918                throw;
 919            }
 2920        }
 921    }
 922}