< Summary

Class:Azure.ResourceManager.Storage.PrivateEndpointConnectionsOperations
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\PrivateEndpointConnectionsOperations.cs
Covered lines:7
Uncovered lines:69
Coverable lines:76
Total lines:229
Line coverage:9.2% (7 of 76)
Covered branches:0
Total branches:8
Branch coverage:0% (0 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-0%100%
.ctor()-100%100%
.ctor(...)-100%100%
GetAsync()-0%100%
Get(...)-0%100%
PutAsync()-0%100%
Put(...)-0%100%
DeleteAsync()-0%100%
Delete(...)-0%100%
ListAsync(...)-0%0%
<ListAsync()-0%100%
List(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\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.Storage.Models;
 15
 16namespace Azure.ResourceManager.Storage
 17{
 18    /// <summary> The PrivateEndpointConnections service client. </summary>
 19    public partial class PrivateEndpointConnectionsOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 023        internal PrivateEndpointConnectionsRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of PrivateEndpointConnectionsOperations for mocking. </summary>
 24025        protected PrivateEndpointConnectionsOperations()
 26        {
 24027        }
 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 ID of the target subscription. </param>
 32        /// <param name="endpoint"> server parameter. </param>
 33        /// <param name="apiVersion"> Api Version. </param>
 24034        internal PrivateEndpointConnectionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string
 35        {
 24036            RestClient = new PrivateEndpointConnectionsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpo
 24037            _clientDiagnostics = clientDiagnostics;
 24038            _pipeline = pipeline;
 24039        }
 40
 41        /// <summary> Gets the specified private endpoint connection associated with the storage account. </summary>
 42        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 43        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 44        /// <param name="privateEndpointConnectionName"> The name of the private endpoint connection associated with the
 45        /// <param name="cancellationToken"> The cancellation token to use. </param>
 46        public virtual async Task<Response<PrivateEndpointConnection>> GetAsync(string resourceGroupName, string account
 47        {
 048            using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Get");
 049            scope.Start();
 50            try
 51            {
 052                return await RestClient.GetAsync(resourceGroupName, accountName, privateEndpointConnectionName, cancella
 53            }
 054            catch (Exception e)
 55            {
 056                scope.Failed(e);
 057                throw;
 58            }
 059        }
 60
 61        /// <summary> Gets the specified private endpoint connection associated with the storage account. </summary>
 62        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 63        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 64        /// <param name="privateEndpointConnectionName"> The name of the private endpoint connection associated with the
 65        /// <param name="cancellationToken"> The cancellation token to use. </param>
 66        public virtual Response<PrivateEndpointConnection> Get(string resourceGroupName, string accountName, string priv
 67        {
 068            using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Get");
 069            scope.Start();
 70            try
 71            {
 072                return RestClient.Get(resourceGroupName, accountName, privateEndpointConnectionName, cancellationToken);
 73            }
 074            catch (Exception e)
 75            {
 076                scope.Failed(e);
 077                throw;
 78            }
 079        }
 80
 81        /// <summary> Update the state of specified private endpoint connection associated with the storage account. </s
 82        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 83        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 84        /// <param name="privateEndpointConnectionName"> The name of the private endpoint connection associated with the
 85        /// <param name="properties"> The private endpoint connection properties. </param>
 86        /// <param name="cancellationToken"> The cancellation token to use. </param>
 87        public virtual async Task<Response<PrivateEndpointConnection>> PutAsync(string resourceGroupName, string account
 88        {
 089            using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Put");
 090            scope.Start();
 91            try
 92            {
 093                return await RestClient.PutAsync(resourceGroupName, accountName, privateEndpointConnectionName, properti
 94            }
 095            catch (Exception e)
 96            {
 097                scope.Failed(e);
 098                throw;
 99            }
 0100        }
 101
 102        /// <summary> Update the state of specified private endpoint connection associated with the storage account. </s
 103        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 104        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 105        /// <param name="privateEndpointConnectionName"> The name of the private endpoint connection associated with the
 106        /// <param name="properties"> The private endpoint connection properties. </param>
 107        /// <param name="cancellationToken"> The cancellation token to use. </param>
 108        public virtual Response<PrivateEndpointConnection> Put(string resourceGroupName, string accountName, string priv
 109        {
 0110            using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Put");
 0111            scope.Start();
 112            try
 113            {
 0114                return RestClient.Put(resourceGroupName, accountName, privateEndpointConnectionName, properties, cancell
 115            }
 0116            catch (Exception e)
 117            {
 0118                scope.Failed(e);
 0119                throw;
 120            }
 0121        }
 122
 123        /// <summary> Deletes the specified private endpoint connection associated with the storage account. </summary>
 124        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 125        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 126        /// <param name="privateEndpointConnectionName"> The name of the private endpoint connection associated with the
 127        /// <param name="cancellationToken"> The cancellation token to use. </param>
 128        public virtual async Task<Response> DeleteAsync(string resourceGroupName, string accountName, string privateEndp
 129        {
 0130            using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Delete");
 0131            scope.Start();
 132            try
 133            {
 0134                return await RestClient.DeleteAsync(resourceGroupName, accountName, privateEndpointConnectionName, cance
 135            }
 0136            catch (Exception e)
 137            {
 0138                scope.Failed(e);
 0139                throw;
 140            }
 0141        }
 142
 143        /// <summary> Deletes the specified private endpoint connection associated with the storage account. </summary>
 144        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 145        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 146        /// <param name="privateEndpointConnectionName"> The name of the private endpoint connection associated with the
 147        /// <param name="cancellationToken"> The cancellation token to use. </param>
 148        public virtual Response Delete(string resourceGroupName, string accountName, string privateEndpointConnectionNam
 149        {
 0150            using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Delete");
 0151            scope.Start();
 152            try
 153            {
 0154                return RestClient.Delete(resourceGroupName, accountName, privateEndpointConnectionName, cancellationToke
 155            }
 0156            catch (Exception e)
 157            {
 0158                scope.Failed(e);
 0159                throw;
 160            }
 0161        }
 162
 163        /// <summary> List all the private endpoint connections associated with the storage account. </summary>
 164        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 165        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 166        /// <param name="cancellationToken"> The cancellation token to use. </param>
 167        public virtual AsyncPageable<PrivateEndpointConnection> ListAsync(string resourceGroupName, string accountName, 
 168        {
 0169            if (resourceGroupName == null)
 170            {
 0171                throw new ArgumentNullException(nameof(resourceGroupName));
 172            }
 0173            if (accountName == null)
 174            {
 0175                throw new ArgumentNullException(nameof(accountName));
 176            }
 177
 178            async Task<Page<PrivateEndpointConnection>> FirstPageFunc(int? pageSizeHint)
 179            {
 0180                using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.List");
 0181                scope.Start();
 182                try
 183                {
 0184                    var response = await RestClient.ListAsync(resourceGroupName, accountName, cancellationToken).Configu
 0185                    return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
 186                }
 0187                catch (Exception e)
 188                {
 0189                    scope.Failed(e);
 0190                    throw;
 191                }
 0192            }
 0193            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null);
 194        }
 195
 196        /// <summary> List all the private endpoint connections associated with the storage account. </summary>
 197        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 198        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 199        /// <param name="cancellationToken"> The cancellation token to use. </param>
 200        public virtual Pageable<PrivateEndpointConnection> List(string resourceGroupName, string accountName, Cancellati
 201        {
 0202            if (resourceGroupName == null)
 203            {
 0204                throw new ArgumentNullException(nameof(resourceGroupName));
 205            }
 0206            if (accountName == null)
 207            {
 0208                throw new ArgumentNullException(nameof(accountName));
 209            }
 210
 211            Page<PrivateEndpointConnection> FirstPageFunc(int? pageSizeHint)
 212            {
 0213                using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.List");
 0214                scope.Start();
 215                try
 216                {
 0217                    var response = RestClient.List(resourceGroupName, accountName, cancellationToken);
 0218                    return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
 219                }
 0220                catch (Exception e)
 221                {
 0222                    scope.Failed(e);
 0223                    throw;
 224                }
 0225            }
 0226            return PageableHelpers.CreateEnumerable(FirstPageFunc, null);
 227        }
 228    }
 229}