| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System; |
| | 9 | | using System.Threading; |
| | 10 | | using System.Threading.Tasks; |
| | 11 | | using Azure; |
| | 12 | | using Azure.Core.Pipeline; |
| | 13 | | using Azure.ResourceManager.KeyVault.Models; |
| | 14 | |
|
| | 15 | | namespace 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; |
| 0 | 22 | | internal PrivateEndpointConnectionsRestOperations RestClient { get; } |
| | 23 | | /// <summary> Initializes a new instance of PrivateEndpointConnectionsOperations for mocking. </summary> |
| 0 | 24 | | protected PrivateEndpointConnectionsOperations() |
| | 25 | | { |
| 0 | 26 | | } |
| | 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> |
| 0 | 33 | | internal PrivateEndpointConnectionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string |
| | 34 | | { |
| 0 | 35 | | RestClient = new PrivateEndpointConnectionsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpo |
| 0 | 36 | | _clientDiagnostics = clientDiagnostics; |
| 0 | 37 | | _pipeline = pipeline; |
| 0 | 38 | | } |
| | 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 | | { |
| 0 | 47 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Get"); |
| 0 | 48 | | scope.Start(); |
| | 49 | | try |
| | 50 | | { |
| 0 | 51 | | return await RestClient.GetAsync(resourceGroupName, vaultName, privateEndpointConnectionName, cancellati |
| | 52 | | } |
| 0 | 53 | | catch (Exception e) |
| | 54 | | { |
| 0 | 55 | | scope.Failed(e); |
| 0 | 56 | | throw; |
| | 57 | | } |
| 0 | 58 | | } |
| | 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 | | { |
| 0 | 67 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Get"); |
| 0 | 68 | | scope.Start(); |
| | 69 | | try |
| | 70 | | { |
| 0 | 71 | | return RestClient.Get(resourceGroupName, vaultName, privateEndpointConnectionName, cancellationToken); |
| | 72 | | } |
| 0 | 73 | | catch (Exception e) |
| | 74 | | { |
| 0 | 75 | | scope.Failed(e); |
| 0 | 76 | | throw; |
| | 77 | | } |
| 0 | 78 | | } |
| | 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 | | { |
| 0 | 88 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Put"); |
| 0 | 89 | | scope.Start(); |
| | 90 | | try |
| | 91 | | { |
| 0 | 92 | | return await RestClient.PutAsync(resourceGroupName, vaultName, privateEndpointConnectionName, properties |
| | 93 | | } |
| 0 | 94 | | catch (Exception e) |
| | 95 | | { |
| 0 | 96 | | scope.Failed(e); |
| 0 | 97 | | throw; |
| | 98 | | } |
| 0 | 99 | | } |
| | 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 | | { |
| 0 | 109 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Put"); |
| 0 | 110 | | scope.Start(); |
| | 111 | | try |
| | 112 | | { |
| 0 | 113 | | return RestClient.Put(resourceGroupName, vaultName, privateEndpointConnectionName, properties, cancellat |
| | 114 | | } |
| 0 | 115 | | catch (Exception e) |
| | 116 | | { |
| 0 | 117 | | scope.Failed(e); |
| 0 | 118 | | throw; |
| | 119 | | } |
| 0 | 120 | | } |
| | 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 | | { |
| 0 | 130 | | if (resourceGroupName == null) |
| | 131 | | { |
| 0 | 132 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 133 | | } |
| 0 | 134 | | if (vaultName == null) |
| | 135 | | { |
| 0 | 136 | | throw new ArgumentNullException(nameof(vaultName)); |
| | 137 | | } |
| 0 | 138 | | if (privateEndpointConnectionName == null) |
| | 139 | | { |
| 0 | 140 | | throw new ArgumentNullException(nameof(privateEndpointConnectionName)); |
| | 141 | | } |
| | 142 | |
|
| 0 | 143 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.StartDelete"); |
| 0 | 144 | | scope.Start(); |
| | 145 | | try |
| | 146 | | { |
| 0 | 147 | | var originalResponse = await RestClient.DeleteAsync(resourceGroupName, vaultName, privateEndpointConnect |
| 0 | 148 | | return new PrivateEndpointConnectionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDel |
| | 149 | | } |
| 0 | 150 | | catch (Exception e) |
| | 151 | | { |
| 0 | 152 | | scope.Failed(e); |
| 0 | 153 | | throw; |
| | 154 | | } |
| 0 | 155 | | } |
| | 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 | | { |
| 0 | 165 | | if (resourceGroupName == null) |
| | 166 | | { |
| 0 | 167 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 168 | | } |
| 0 | 169 | | if (vaultName == null) |
| | 170 | | { |
| 0 | 171 | | throw new ArgumentNullException(nameof(vaultName)); |
| | 172 | | } |
| 0 | 173 | | if (privateEndpointConnectionName == null) |
| | 174 | | { |
| 0 | 175 | | throw new ArgumentNullException(nameof(privateEndpointConnectionName)); |
| | 176 | | } |
| | 177 | |
|
| 0 | 178 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.StartDelete"); |
| 0 | 179 | | scope.Start(); |
| | 180 | | try |
| | 181 | | { |
| 0 | 182 | | var originalResponse = RestClient.Delete(resourceGroupName, vaultName, privateEndpointConnectionName, ca |
| 0 | 183 | | return new PrivateEndpointConnectionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDel |
| | 184 | | } |
| 0 | 185 | | catch (Exception e) |
| | 186 | | { |
| 0 | 187 | | scope.Failed(e); |
| 0 | 188 | | throw; |
| | 189 | | } |
| 0 | 190 | | } |
| | 191 | | } |
| | 192 | | } |