< Summary

Class:Azure.ResourceManager.AppConfiguration.PrivateEndpointConnectionsOperations
Assembly:Azure.ResourceManager.AppConfiguration
File(s):C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\src\Generated\PrivateEndpointConnectionsOperations.cs
Covered lines:66
Uncovered lines:58
Coverable lines:124
Total lines:323
Line coverage:53.2% (66 of 124)
Covered branches:18
Total branches:36
Branch coverage:50% (18 of 36)

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%
ListByConfigurationStoreAsync(...)-38.1%50%
<ListByConfigurationStoreAsync()-62.5%100%
<ListByConfigurationStoreAsync()-0%100%
ListByConfigurationStore(...)-38.1%50%
StartCreateOrUpdateAsync()-56.25%50%
StartCreateOrUpdate(...)-56.25%50%
StartDeleteAsync()-57.14%50%
StartDelete(...)-57.14%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\src\Generated\PrivateEndpointConnectionsOperations.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.AppConfiguration.Models;
 15
 16namespace Azure.ResourceManager.AppConfiguration
 17{
 18    /// <summary> The PrivateEndpointConnections service client. </summary>
 19    public partial class PrivateEndpointConnectionsOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 2423        internal PrivateEndpointConnectionsRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of PrivateEndpointConnectionsOperations for mocking. </summary>
 825        protected PrivateEndpointConnectionsOperations()
 26        {
 827        }
 28        /// <summary> Initializes a new instance of PrivateEndpointConnectionsOperations. </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 Microsoft Azure subscription ID. </param>
 32        /// <param name="endpoint"> server parameter. </param>
 33        /// <param name="apiVersion"> Api Version. </param>
 834        internal PrivateEndpointConnectionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string
 35        {
 836            RestClient = new PrivateEndpointConnectionsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpo
 837            _clientDiagnostics = clientDiagnostics;
 838            _pipeline = pipeline;
 839        }
 40
 41        /// <summary> Gets the specified private endpoint connection associated with the configuration store. </summary>
 42        /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p
 43        /// <param name="configStoreName"> The name of the configuration store. </param>
 44        /// <param name="privateEndpointConnectionName"> Private endpoint connection name. </param>
 45        /// <param name="cancellationToken"> The cancellation token to use. </param>
 46        public virtual async Task<Response<PrivateEndpointConnection>> GetAsync(string resourceGroupName, string configS
 47        {
 248            using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Get");
 249            scope.Start();
 50            try
 51            {
 252                return await RestClient.GetAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, canc
 53            }
 054            catch (Exception e)
 55            {
 056                scope.Failed(e);
 057                throw;
 58            }
 259        }
 60
 61        /// <summary> Gets the specified private endpoint connection associated with the configuration store. </summary>
 62        /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p
 63        /// <param name="configStoreName"> The name of the configuration store. </param>
 64        /// <param name="privateEndpointConnectionName"> Private endpoint connection name. </param>
 65        /// <param name="cancellationToken"> The cancellation token to use. </param>
 66        public virtual Response<PrivateEndpointConnection> Get(string resourceGroupName, string configStoreName, string 
 67        {
 268            using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Get");
 269            scope.Start();
 70            try
 71            {
 272                return RestClient.Get(resourceGroupName, configStoreName, privateEndpointConnectionName, cancellationTok
 73            }
 074            catch (Exception e)
 75            {
 076                scope.Failed(e);
 077                throw;
 78            }
 279        }
 80
 81        /// <summary> Lists all private endpoint connections for a configuration store. </summary>
 82        /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p
 83        /// <param name="configStoreName"> The name of the configuration store. </param>
 84        /// <param name="cancellationToken"> The cancellation token to use. </param>
 85        public virtual AsyncPageable<PrivateEndpointConnection> ListByConfigurationStoreAsync(string resourceGroupName, 
 86        {
 287            if (resourceGroupName == null)
 88            {
 089                throw new ArgumentNullException(nameof(resourceGroupName));
 90            }
 291            if (configStoreName == null)
 92            {
 093                throw new ArgumentNullException(nameof(configStoreName));
 94            }
 95
 96            async Task<Page<PrivateEndpointConnection>> FirstPageFunc(int? pageSizeHint)
 97            {
 298                using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.ListByConfigurati
 299                scope.Start();
 100                try
 101                {
 2102                    var response = await RestClient.ListByConfigurationStoreAsync(resourceGroupName, configStoreName, ca
 2103                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 104                }
 0105                catch (Exception e)
 106                {
 0107                    scope.Failed(e);
 0108                    throw;
 109                }
 2110            }
 111            async Task<Page<PrivateEndpointConnection>> NextPageFunc(string nextLink, int? pageSizeHint)
 112            {
 0113                using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.ListByConfigurati
 0114                scope.Start();
 115                try
 116                {
 0117                    var response = await RestClient.ListByConfigurationStoreNextPageAsync(nextLink, resourceGroupName, c
 0118                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 119                }
 0120                catch (Exception e)
 121                {
 0122                    scope.Failed(e);
 0123                    throw;
 124                }
 0125            }
 2126            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 127        }
 128
 129        /// <summary> Lists all private endpoint connections for a configuration store. </summary>
 130        /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p
 131        /// <param name="configStoreName"> The name of the configuration store. </param>
 132        /// <param name="cancellationToken"> The cancellation token to use. </param>
 133        public virtual Pageable<PrivateEndpointConnection> ListByConfigurationStore(string resourceGroupName, string con
 134        {
 2135            if (resourceGroupName == null)
 136            {
 0137                throw new ArgumentNullException(nameof(resourceGroupName));
 138            }
 2139            if (configStoreName == null)
 140            {
 0141                throw new ArgumentNullException(nameof(configStoreName));
 142            }
 143
 144            Page<PrivateEndpointConnection> FirstPageFunc(int? pageSizeHint)
 145            {
 2146                using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.ListByConfigurati
 2147                scope.Start();
 148                try
 149                {
 2150                    var response = RestClient.ListByConfigurationStore(resourceGroupName, configStoreName, cancellationT
 2151                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 152                }
 0153                catch (Exception e)
 154                {
 0155                    scope.Failed(e);
 0156                    throw;
 157                }
 2158            }
 159            Page<PrivateEndpointConnection> NextPageFunc(string nextLink, int? pageSizeHint)
 160            {
 0161                using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.ListByConfigurati
 0162                scope.Start();
 163                try
 164                {
 0165                    var response = RestClient.ListByConfigurationStoreNextPage(nextLink, resourceGroupName, configStoreN
 0166                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 167                }
 0168                catch (Exception e)
 169                {
 0170                    scope.Failed(e);
 0171                    throw;
 172                }
 0173            }
 2174            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 175        }
 176
 177        /// <summary> Update the state of the specified private endpoint connection associated with the configuration st
 178        /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p
 179        /// <param name="configStoreName"> The name of the configuration store. </param>
 180        /// <param name="privateEndpointConnectionName"> Private endpoint connection name. </param>
 181        /// <param name="privateEndpointConnection"> The private endpoint connection properties. </param>
 182        /// <param name="cancellationToken"> The cancellation token to use. </param>
 183        public virtual async Task<PrivateEndpointConnectionsCreateOrUpdateOperation> StartCreateOrUpdateAsync(string res
 184        {
 2185            if (resourceGroupName == null)
 186            {
 0187                throw new ArgumentNullException(nameof(resourceGroupName));
 188            }
 2189            if (configStoreName == null)
 190            {
 0191                throw new ArgumentNullException(nameof(configStoreName));
 192            }
 2193            if (privateEndpointConnectionName == null)
 194            {
 0195                throw new ArgumentNullException(nameof(privateEndpointConnectionName));
 196            }
 2197            if (privateEndpointConnection == null)
 198            {
 0199                throw new ArgumentNullException(nameof(privateEndpointConnection));
 200            }
 201
 2202            using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.StartCreateOrUpdate")
 2203            scope.Start();
 204            try
 205            {
 2206                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, configStoreName, privateE
 2207                return new PrivateEndpointConnectionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.C
 208            }
 0209            catch (Exception e)
 210            {
 0211                scope.Failed(e);
 0212                throw;
 213            }
 2214        }
 215
 216        /// <summary> Update the state of the specified private endpoint connection associated with the configuration st
 217        /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p
 218        /// <param name="configStoreName"> The name of the configuration store. </param>
 219        /// <param name="privateEndpointConnectionName"> Private endpoint connection name. </param>
 220        /// <param name="privateEndpointConnection"> The private endpoint connection properties. </param>
 221        /// <param name="cancellationToken"> The cancellation token to use. </param>
 222        public virtual PrivateEndpointConnectionsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, s
 223        {
 2224            if (resourceGroupName == null)
 225            {
 0226                throw new ArgumentNullException(nameof(resourceGroupName));
 227            }
 2228            if (configStoreName == null)
 229            {
 0230                throw new ArgumentNullException(nameof(configStoreName));
 231            }
 2232            if (privateEndpointConnectionName == null)
 233            {
 0234                throw new ArgumentNullException(nameof(privateEndpointConnectionName));
 235            }
 2236            if (privateEndpointConnection == null)
 237            {
 0238                throw new ArgumentNullException(nameof(privateEndpointConnection));
 239            }
 240
 2241            using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.StartCreateOrUpdate")
 2242            scope.Start();
 243            try
 244            {
 2245                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, configStoreName, privateEndpointConn
 2246                return new PrivateEndpointConnectionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.C
 247            }
 0248            catch (Exception e)
 249            {
 0250                scope.Failed(e);
 0251                throw;
 252            }
 2253        }
 254
 255        /// <summary> Deletes a private endpoint connection. </summary>
 256        /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p
 257        /// <param name="configStoreName"> The name of the configuration store. </param>
 258        /// <param name="privateEndpointConnectionName"> Private endpoint connection name. </param>
 259        /// <param name="cancellationToken"> The cancellation token to use. </param>
 260        public virtual async Task<PrivateEndpointConnectionsDeleteOperation> StartDeleteAsync(string resourceGroupName, 
 261        {
 2262            if (resourceGroupName == null)
 263            {
 0264                throw new ArgumentNullException(nameof(resourceGroupName));
 265            }
 2266            if (configStoreName == null)
 267            {
 0268                throw new ArgumentNullException(nameof(configStoreName));
 269            }
 2270            if (privateEndpointConnectionName == null)
 271            {
 0272                throw new ArgumentNullException(nameof(privateEndpointConnectionName));
 273            }
 274
 2275            using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.StartDelete");
 2276            scope.Start();
 277            try
 278            {
 2279                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, configStoreName, privateEndpointC
 2280                return new PrivateEndpointConnectionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDel
 281            }
 0282            catch (Exception e)
 283            {
 0284                scope.Failed(e);
 0285                throw;
 286            }
 2287        }
 288
 289        /// <summary> Deletes a private endpoint connection. </summary>
 290        /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p
 291        /// <param name="configStoreName"> The name of the configuration store. </param>
 292        /// <param name="privateEndpointConnectionName"> Private endpoint connection name. </param>
 293        /// <param name="cancellationToken"> The cancellation token to use. </param>
 294        public virtual PrivateEndpointConnectionsDeleteOperation StartDelete(string resourceGroupName, string configStor
 295        {
 2296            if (resourceGroupName == null)
 297            {
 0298                throw new ArgumentNullException(nameof(resourceGroupName));
 299            }
 2300            if (configStoreName == null)
 301            {
 0302                throw new ArgumentNullException(nameof(configStoreName));
 303            }
 2304            if (privateEndpointConnectionName == null)
 305            {
 0306                throw new ArgumentNullException(nameof(privateEndpointConnectionName));
 307            }
 308
 2309            using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.StartDelete");
 2310            scope.Start();
 311            try
 312            {
 2313                var originalResponse = RestClient.Delete(resourceGroupName, configStoreName, privateEndpointConnectionNa
 2314                return new PrivateEndpointConnectionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDel
 315            }
 0316            catch (Exception e)
 317            {
 0318                scope.Failed(e);
 0319                throw;
 320            }
 2321        }
 322    }
 323}