< Summary

Class:Azure.ResourceManager.KeyVault.PrivateEndpointConnectionsOperations
Assembly:Azure.ResourceManager.KeyVault
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\PrivateEndpointConnectionsOperations.cs
Covered lines:0
Uncovered lines:64
Coverable lines:64
Total lines:192
Line coverage:0% (0 of 64)
Covered branches:0
Total branches:12
Branch coverage:0% (0 of 12)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-0%100%
.ctor()-0%100%
.ctor(...)-0%100%
GetAsync()-0%100%
Get(...)-0%100%
PutAsync()-0%100%
Put(...)-0%100%
StartDeleteAsync()-0%0%
StartDelete(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\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.Pipeline;
 13using Azure.ResourceManager.KeyVault.Models;
 14
 15namespace Azure.ResourceManager.KeyVault
 16{
 17    /// <summary> The PrivateEndpointConnections service client. </summary>
 18    public partial class PrivateEndpointConnectionsOperations
 19    {
 20        private readonly ClientDiagnostics _clientDiagnostics;
 21        private readonly HttpPipeline _pipeline;
 022        internal PrivateEndpointConnectionsRestOperations RestClient { get; }
 23        /// <summary> Initializes a new instance of PrivateEndpointConnectionsOperations for mocking. </summary>
 024        protected PrivateEndpointConnectionsOperations()
 25        {
 026        }
 27        /// <summary> Initializes a new instance of PrivateEndpointConnectionsOperations. </summary>
 28        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
 29        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
 30        /// <param name="subscriptionId"> Subscription credentials which uniquely identify Microsoft Azure subscription.
 31        /// <param name="endpoint"> server parameter. </param>
 32        /// <param name="apiVersion"> Api Version. </param>
 033        internal PrivateEndpointConnectionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string
 34        {
 035            RestClient = new PrivateEndpointConnectionsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpo
 036            _clientDiagnostics = clientDiagnostics;
 037            _pipeline = pipeline;
 038        }
 39
 40        /// <summary> Gets the specified private endpoint connection associated with the key vault. </summary>
 41        /// <param name="resourceGroupName"> Name of the resource group that contains the key vault. </param>
 42        /// <param name="vaultName"> The name of the key vault. </param>
 43        /// <param name="privateEndpointConnectionName"> Name of the private endpoint connection associated with the key
 44        /// <param name="cancellationToken"> The cancellation token to use. </param>
 45        public virtual async Task<Response<PrivateEndpointConnection>> GetAsync(string resourceGroupName, string vaultNa
 46        {
 047            using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Get");
 048            scope.Start();
 49            try
 50            {
 051                return await RestClient.GetAsync(resourceGroupName, vaultName, privateEndpointConnectionName, cancellati
 52            }
 053            catch (Exception e)
 54            {
 055                scope.Failed(e);
 056                throw;
 57            }
 058        }
 59
 60        /// <summary> Gets the specified private endpoint connection associated with the key vault. </summary>
 61        /// <param name="resourceGroupName"> Name of the resource group that contains the key vault. </param>
 62        /// <param name="vaultName"> The name of the key vault. </param>
 63        /// <param name="privateEndpointConnectionName"> Name of the private endpoint connection associated with the key
 64        /// <param name="cancellationToken"> The cancellation token to use. </param>
 65        public virtual Response<PrivateEndpointConnection> Get(string resourceGroupName, string vaultName, string privat
 66        {
 067            using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Get");
 068            scope.Start();
 69            try
 70            {
 071                return RestClient.Get(resourceGroupName, vaultName, privateEndpointConnectionName, cancellationToken);
 72            }
 073            catch (Exception e)
 74            {
 075                scope.Failed(e);
 076                throw;
 77            }
 078        }
 79
 80        /// <summary> Updates the specified private endpoint connection associated with the key vault. </summary>
 81        /// <param name="resourceGroupName"> Name of the resource group that contains the key vault. </param>
 82        /// <param name="vaultName"> The name of the key vault. </param>
 83        /// <param name="privateEndpointConnectionName"> Name of the private endpoint connection associated with the key
 84        /// <param name="properties"> The intended state of private endpoint connection. </param>
 85        /// <param name="cancellationToken"> The cancellation token to use. </param>
 86        public virtual async Task<Response<PrivateEndpointConnection>> PutAsync(string resourceGroupName, string vaultNa
 87        {
 088            using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Put");
 089            scope.Start();
 90            try
 91            {
 092                return await RestClient.PutAsync(resourceGroupName, vaultName, privateEndpointConnectionName, properties
 93            }
 094            catch (Exception e)
 95            {
 096                scope.Failed(e);
 097                throw;
 98            }
 099        }
 100
 101        /// <summary> Updates the specified private endpoint connection associated with the key vault. </summary>
 102        /// <param name="resourceGroupName"> Name of the resource group that contains the key vault. </param>
 103        /// <param name="vaultName"> The name of the key vault. </param>
 104        /// <param name="privateEndpointConnectionName"> Name of the private endpoint connection associated with the key
 105        /// <param name="properties"> The intended state of private endpoint connection. </param>
 106        /// <param name="cancellationToken"> The cancellation token to use. </param>
 107        public virtual Response<PrivateEndpointConnection> Put(string resourceGroupName, string vaultName, string privat
 108        {
 0109            using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Put");
 0110            scope.Start();
 111            try
 112            {
 0113                return RestClient.Put(resourceGroupName, vaultName, privateEndpointConnectionName, properties, cancellat
 114            }
 0115            catch (Exception e)
 116            {
 0117                scope.Failed(e);
 0118                throw;
 119            }
 0120        }
 121
 122        /// <summary> Deletes the specified private endpoint connection associated with the key vault. </summary>
 123        /// <param name="resourceGroupName"> Name of the resource group that contains the key vault. </param>
 124        /// <param name="vaultName"> The name of the key vault. </param>
 125        /// <param name="privateEndpointConnectionName"> Name of the private endpoint connection associated with the key
 126        /// <param name="cancellationToken"> The cancellation token to use. </param>
 127        /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/>, <paramref name="vaultName"/>,
 128        public virtual async Task<PrivateEndpointConnectionsDeleteOperation> StartDeleteAsync(string resourceGroupName, 
 129        {
 0130            if (resourceGroupName == null)
 131            {
 0132                throw new ArgumentNullException(nameof(resourceGroupName));
 133            }
 0134            if (vaultName == null)
 135            {
 0136                throw new ArgumentNullException(nameof(vaultName));
 137            }
 0138            if (privateEndpointConnectionName == null)
 139            {
 0140                throw new ArgumentNullException(nameof(privateEndpointConnectionName));
 141            }
 142
 0143            using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.StartDelete");
 0144            scope.Start();
 145            try
 146            {
 0147                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, vaultName, privateEndpointConnect
 0148                return new PrivateEndpointConnectionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDel
 149            }
 0150            catch (Exception e)
 151            {
 0152                scope.Failed(e);
 0153                throw;
 154            }
 0155        }
 156
 157        /// <summary> Deletes the specified private endpoint connection associated with the key vault. </summary>
 158        /// <param name="resourceGroupName"> Name of the resource group that contains the key vault. </param>
 159        /// <param name="vaultName"> The name of the key vault. </param>
 160        /// <param name="privateEndpointConnectionName"> Name of the private endpoint connection associated with the key
 161        /// <param name="cancellationToken"> The cancellation token to use. </param>
 162        /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/>, <paramref name="vaultName"/>,
 163        public virtual PrivateEndpointConnectionsDeleteOperation StartDelete(string resourceGroupName, string vaultName,
 164        {
 0165            if (resourceGroupName == null)
 166            {
 0167                throw new ArgumentNullException(nameof(resourceGroupName));
 168            }
 0169            if (vaultName == null)
 170            {
 0171                throw new ArgumentNullException(nameof(vaultName));
 172            }
 0173            if (privateEndpointConnectionName == null)
 174            {
 0175                throw new ArgumentNullException(nameof(privateEndpointConnectionName));
 176            }
 177
 0178            using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.StartDelete");
 0179            scope.Start();
 180            try
 181            {
 0182                var originalResponse = RestClient.Delete(resourceGroupName, vaultName, privateEndpointConnectionName, ca
 0183                return new PrivateEndpointConnectionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDel
 184            }
 0185            catch (Exception e)
 186            {
 0187                scope.Failed(e);
 0188                throw;
 189            }
 0190        }
 191    }
 192}