| | 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; |
| | 13 | | using Azure.Core.Pipeline; |
| | 14 | | using Azure.ResourceManager.AppConfiguration.Models; |
| | 15 | |
|
| | 16 | | namespace 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; |
| 24 | 23 | | internal PrivateEndpointConnectionsRestOperations RestClient { get; } |
| | 24 | | /// <summary> Initializes a new instance of PrivateEndpointConnectionsOperations for mocking. </summary> |
| 8 | 25 | | protected PrivateEndpointConnectionsOperations() |
| | 26 | | { |
| 8 | 27 | | } |
| | 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> |
| 8 | 34 | | internal PrivateEndpointConnectionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string |
| | 35 | | { |
| 8 | 36 | | RestClient = new PrivateEndpointConnectionsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpo |
| 8 | 37 | | _clientDiagnostics = clientDiagnostics; |
| 8 | 38 | | _pipeline = pipeline; |
| 8 | 39 | | } |
| | 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 | | { |
| 2 | 48 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Get"); |
| 2 | 49 | | scope.Start(); |
| | 50 | | try |
| | 51 | | { |
| 2 | 52 | | return await RestClient.GetAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, canc |
| | 53 | | } |
| 0 | 54 | | catch (Exception e) |
| | 55 | | { |
| 0 | 56 | | scope.Failed(e); |
| 0 | 57 | | throw; |
| | 58 | | } |
| 2 | 59 | | } |
| | 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 | | { |
| 2 | 68 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Get"); |
| 2 | 69 | | scope.Start(); |
| | 70 | | try |
| | 71 | | { |
| 2 | 72 | | return RestClient.Get(resourceGroupName, configStoreName, privateEndpointConnectionName, cancellationTok |
| | 73 | | } |
| 0 | 74 | | catch (Exception e) |
| | 75 | | { |
| 0 | 76 | | scope.Failed(e); |
| 0 | 77 | | throw; |
| | 78 | | } |
| 2 | 79 | | } |
| | 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 | | { |
| 2 | 87 | | if (resourceGroupName == null) |
| | 88 | | { |
| 0 | 89 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 90 | | } |
| 2 | 91 | | if (configStoreName == null) |
| | 92 | | { |
| 0 | 93 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | 94 | | } |
| | 95 | |
|
| | 96 | | async Task<Page<PrivateEndpointConnection>> FirstPageFunc(int? pageSizeHint) |
| | 97 | | { |
| 2 | 98 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.ListByConfigurati |
| 2 | 99 | | scope.Start(); |
| | 100 | | try |
| | 101 | | { |
| 2 | 102 | | var response = await RestClient.ListByConfigurationStoreAsync(resourceGroupName, configStoreName, ca |
| 2 | 103 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 104 | | } |
| 0 | 105 | | catch (Exception e) |
| | 106 | | { |
| 0 | 107 | | scope.Failed(e); |
| 0 | 108 | | throw; |
| | 109 | | } |
| 2 | 110 | | } |
| | 111 | | async Task<Page<PrivateEndpointConnection>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 112 | | { |
| 0 | 113 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.ListByConfigurati |
| 0 | 114 | | scope.Start(); |
| | 115 | | try |
| | 116 | | { |
| 0 | 117 | | var response = await RestClient.ListByConfigurationStoreNextPageAsync(nextLink, resourceGroupName, c |
| 0 | 118 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 119 | | } |
| 0 | 120 | | catch (Exception e) |
| | 121 | | { |
| 0 | 122 | | scope.Failed(e); |
| 0 | 123 | | throw; |
| | 124 | | } |
| 0 | 125 | | } |
| 2 | 126 | | 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 | | { |
| 2 | 135 | | if (resourceGroupName == null) |
| | 136 | | { |
| 0 | 137 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 138 | | } |
| 2 | 139 | | if (configStoreName == null) |
| | 140 | | { |
| 0 | 141 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | 142 | | } |
| | 143 | |
|
| | 144 | | Page<PrivateEndpointConnection> FirstPageFunc(int? pageSizeHint) |
| | 145 | | { |
| 2 | 146 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.ListByConfigurati |
| 2 | 147 | | scope.Start(); |
| | 148 | | try |
| | 149 | | { |
| 2 | 150 | | var response = RestClient.ListByConfigurationStore(resourceGroupName, configStoreName, cancellationT |
| 2 | 151 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 152 | | } |
| 0 | 153 | | catch (Exception e) |
| | 154 | | { |
| 0 | 155 | | scope.Failed(e); |
| 0 | 156 | | throw; |
| | 157 | | } |
| 2 | 158 | | } |
| | 159 | | Page<PrivateEndpointConnection> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 160 | | { |
| 0 | 161 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.ListByConfigurati |
| 0 | 162 | | scope.Start(); |
| | 163 | | try |
| | 164 | | { |
| 0 | 165 | | var response = RestClient.ListByConfigurationStoreNextPage(nextLink, resourceGroupName, configStoreN |
| 0 | 166 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 167 | | } |
| 0 | 168 | | catch (Exception e) |
| | 169 | | { |
| 0 | 170 | | scope.Failed(e); |
| 0 | 171 | | throw; |
| | 172 | | } |
| 0 | 173 | | } |
| 2 | 174 | | 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 | | { |
| 2 | 185 | | if (resourceGroupName == null) |
| | 186 | | { |
| 0 | 187 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 188 | | } |
| 2 | 189 | | if (configStoreName == null) |
| | 190 | | { |
| 0 | 191 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | 192 | | } |
| 2 | 193 | | if (privateEndpointConnectionName == null) |
| | 194 | | { |
| 0 | 195 | | throw new ArgumentNullException(nameof(privateEndpointConnectionName)); |
| | 196 | | } |
| 2 | 197 | | if (privateEndpointConnection == null) |
| | 198 | | { |
| 0 | 199 | | throw new ArgumentNullException(nameof(privateEndpointConnection)); |
| | 200 | | } |
| | 201 | |
|
| 2 | 202 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.StartCreateOrUpdate") |
| 2 | 203 | | scope.Start(); |
| | 204 | | try |
| | 205 | | { |
| 2 | 206 | | var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, configStoreName, privateE |
| 2 | 207 | | return new PrivateEndpointConnectionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.C |
| | 208 | | } |
| 0 | 209 | | catch (Exception e) |
| | 210 | | { |
| 0 | 211 | | scope.Failed(e); |
| 0 | 212 | | throw; |
| | 213 | | } |
| 2 | 214 | | } |
| | 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 | | { |
| 2 | 224 | | if (resourceGroupName == null) |
| | 225 | | { |
| 0 | 226 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 227 | | } |
| 2 | 228 | | if (configStoreName == null) |
| | 229 | | { |
| 0 | 230 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | 231 | | } |
| 2 | 232 | | if (privateEndpointConnectionName == null) |
| | 233 | | { |
| 0 | 234 | | throw new ArgumentNullException(nameof(privateEndpointConnectionName)); |
| | 235 | | } |
| 2 | 236 | | if (privateEndpointConnection == null) |
| | 237 | | { |
| 0 | 238 | | throw new ArgumentNullException(nameof(privateEndpointConnection)); |
| | 239 | | } |
| | 240 | |
|
| 2 | 241 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.StartCreateOrUpdate") |
| 2 | 242 | | scope.Start(); |
| | 243 | | try |
| | 244 | | { |
| 2 | 245 | | var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, configStoreName, privateEndpointConn |
| 2 | 246 | | return new PrivateEndpointConnectionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.C |
| | 247 | | } |
| 0 | 248 | | catch (Exception e) |
| | 249 | | { |
| 0 | 250 | | scope.Failed(e); |
| 0 | 251 | | throw; |
| | 252 | | } |
| 2 | 253 | | } |
| | 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 | | { |
| 2 | 262 | | if (resourceGroupName == null) |
| | 263 | | { |
| 0 | 264 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 265 | | } |
| 2 | 266 | | if (configStoreName == null) |
| | 267 | | { |
| 0 | 268 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | 269 | | } |
| 2 | 270 | | if (privateEndpointConnectionName == null) |
| | 271 | | { |
| 0 | 272 | | throw new ArgumentNullException(nameof(privateEndpointConnectionName)); |
| | 273 | | } |
| | 274 | |
|
| 2 | 275 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.StartDelete"); |
| 2 | 276 | | scope.Start(); |
| | 277 | | try |
| | 278 | | { |
| 2 | 279 | | var originalResponse = await RestClient.DeleteAsync(resourceGroupName, configStoreName, privateEndpointC |
| 2 | 280 | | return new PrivateEndpointConnectionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDel |
| | 281 | | } |
| 0 | 282 | | catch (Exception e) |
| | 283 | | { |
| 0 | 284 | | scope.Failed(e); |
| 0 | 285 | | throw; |
| | 286 | | } |
| 2 | 287 | | } |
| | 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 | | { |
| 2 | 296 | | if (resourceGroupName == null) |
| | 297 | | { |
| 0 | 298 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 299 | | } |
| 2 | 300 | | if (configStoreName == null) |
| | 301 | | { |
| 0 | 302 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | 303 | | } |
| 2 | 304 | | if (privateEndpointConnectionName == null) |
| | 305 | | { |
| 0 | 306 | | throw new ArgumentNullException(nameof(privateEndpointConnectionName)); |
| | 307 | | } |
| | 308 | |
|
| 2 | 309 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.StartDelete"); |
| 2 | 310 | | scope.Start(); |
| | 311 | | try |
| | 312 | | { |
| 2 | 313 | | var originalResponse = RestClient.Delete(resourceGroupName, configStoreName, privateEndpointConnectionNa |
| 2 | 314 | | return new PrivateEndpointConnectionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDel |
| | 315 | | } |
| 0 | 316 | | catch (Exception e) |
| | 317 | | { |
| 0 | 318 | | scope.Failed(e); |
| 0 | 319 | | throw; |
| | 320 | | } |
| 2 | 321 | | } |
| | 322 | | } |
| | 323 | | } |