| | 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.Text.Json; |
| | 10 | | using System.Threading; |
| | 11 | | using System.Threading.Tasks; |
| | 12 | | using Azure; |
| | 13 | | using Azure.Core; |
| | 14 | | using Azure.Core.Pipeline; |
| | 15 | | using Azure.ResourceManager.AppConfiguration.Models; |
| | 16 | |
|
| | 17 | | namespace Azure.ResourceManager.AppConfiguration |
| | 18 | | { |
| | 19 | | internal partial class PrivateEndpointConnectionsRestOperations |
| | 20 | | { |
| | 21 | | private string subscriptionId; |
| | 22 | | private Uri endpoint; |
| | 23 | | private string apiVersion; |
| | 24 | | private ClientDiagnostics _clientDiagnostics; |
| | 25 | | private HttpPipeline _pipeline; |
| | 26 | |
|
| | 27 | | /// <summary> Initializes a new instance of PrivateEndpointConnectionsRestOperations. </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"> The Microsoft Azure subscription ID. </param> |
| | 31 | | /// <param name="endpoint"> server parameter. </param> |
| | 32 | | /// <param name="apiVersion"> Api Version. </param> |
| | 33 | | /// <exception cref="ArgumentNullException"> This occurs when one of the required arguments is null. </exception |
| 8 | 34 | | public PrivateEndpointConnectionsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, stri |
| | 35 | | { |
| 8 | 36 | | if (subscriptionId == null) |
| | 37 | | { |
| 0 | 38 | | throw new ArgumentNullException(nameof(subscriptionId)); |
| | 39 | | } |
| 8 | 40 | | endpoint ??= new Uri("https://management.azure.com"); |
| 8 | 41 | | if (apiVersion == null) |
| | 42 | | { |
| 0 | 43 | | throw new ArgumentNullException(nameof(apiVersion)); |
| | 44 | | } |
| | 45 | |
|
| 8 | 46 | | this.subscriptionId = subscriptionId; |
| 8 | 47 | | this.endpoint = endpoint; |
| 8 | 48 | | this.apiVersion = apiVersion; |
| 8 | 49 | | _clientDiagnostics = clientDiagnostics; |
| 8 | 50 | | _pipeline = pipeline; |
| 8 | 51 | | } |
| | 52 | |
|
| | 53 | | internal HttpMessage CreateListByConfigurationStoreRequest(string resourceGroupName, string configStoreName) |
| | 54 | | { |
| 4 | 55 | | var message = _pipeline.CreateMessage(); |
| 4 | 56 | | var request = message.Request; |
| 4 | 57 | | request.Method = RequestMethod.Get; |
| 4 | 58 | | var uri = new RawRequestUriBuilder(); |
| 4 | 59 | | uri.Reset(endpoint); |
| 4 | 60 | | uri.AppendPath("/subscriptions/", false); |
| 4 | 61 | | uri.AppendPath(subscriptionId, true); |
| 4 | 62 | | uri.AppendPath("/resourceGroups/", false); |
| 4 | 63 | | uri.AppendPath(resourceGroupName, true); |
| 4 | 64 | | uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); |
| 4 | 65 | | uri.AppendPath(configStoreName, true); |
| 4 | 66 | | uri.AppendPath("/privateEndpointConnections", false); |
| 4 | 67 | | uri.AppendQuery("api-version", apiVersion, true); |
| 4 | 68 | | request.Uri = uri; |
| 4 | 69 | | return message; |
| | 70 | | } |
| | 71 | |
|
| | 72 | | /// <summary> Lists all private endpoint connections for a configuration store. </summary> |
| | 73 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | 74 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | 75 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 76 | | public async Task<Response<PrivateEndpointConnectionListResult>> ListByConfigurationStoreAsync(string resourceGr |
| | 77 | | { |
| 2 | 78 | | if (resourceGroupName == null) |
| | 79 | | { |
| 0 | 80 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 81 | | } |
| 2 | 82 | | if (configStoreName == null) |
| | 83 | | { |
| 0 | 84 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | 85 | | } |
| | 86 | |
|
| 2 | 87 | | using var message = CreateListByConfigurationStoreRequest(resourceGroupName, configStoreName); |
| 2 | 88 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 2 | 89 | | switch (message.Response.Status) |
| | 90 | | { |
| | 91 | | case 200: |
| | 92 | | { |
| 2 | 93 | | PrivateEndpointConnectionListResult value = default; |
| 2 | 94 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 2 | 95 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 96 | | { |
| 0 | 97 | | value = null; |
| | 98 | | } |
| | 99 | | else |
| | 100 | | { |
| 2 | 101 | | value = PrivateEndpointConnectionListResult.DeserializePrivateEndpointConnectionListResult(d |
| | 102 | | } |
| 2 | 103 | | return Response.FromValue(value, message.Response); |
| | 104 | | } |
| | 105 | | default: |
| 0 | 106 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 107 | | } |
| 2 | 108 | | } |
| | 109 | |
|
| | 110 | | /// <summary> Lists all private endpoint connections for a configuration store. </summary> |
| | 111 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | 112 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | 113 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 114 | | public Response<PrivateEndpointConnectionListResult> ListByConfigurationStore(string resourceGroupName, string c |
| | 115 | | { |
| 2 | 116 | | if (resourceGroupName == null) |
| | 117 | | { |
| 0 | 118 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 119 | | } |
| 2 | 120 | | if (configStoreName == null) |
| | 121 | | { |
| 0 | 122 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | 123 | | } |
| | 124 | |
|
| 2 | 125 | | using var message = CreateListByConfigurationStoreRequest(resourceGroupName, configStoreName); |
| 2 | 126 | | _pipeline.Send(message, cancellationToken); |
| 2 | 127 | | switch (message.Response.Status) |
| | 128 | | { |
| | 129 | | case 200: |
| | 130 | | { |
| 2 | 131 | | PrivateEndpointConnectionListResult value = default; |
| 2 | 132 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 2 | 133 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 134 | | { |
| 0 | 135 | | value = null; |
| | 136 | | } |
| | 137 | | else |
| | 138 | | { |
| 2 | 139 | | value = PrivateEndpointConnectionListResult.DeserializePrivateEndpointConnectionListResult(d |
| | 140 | | } |
| 2 | 141 | | return Response.FromValue(value, message.Response); |
| | 142 | | } |
| | 143 | | default: |
| 0 | 144 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 145 | | } |
| 2 | 146 | | } |
| | 147 | |
|
| | 148 | | internal HttpMessage CreateGetRequest(string resourceGroupName, string configStoreName, string privateEndpointCo |
| | 149 | | { |
| 4 | 150 | | var message = _pipeline.CreateMessage(); |
| 4 | 151 | | var request = message.Request; |
| 4 | 152 | | request.Method = RequestMethod.Get; |
| 4 | 153 | | var uri = new RawRequestUriBuilder(); |
| 4 | 154 | | uri.Reset(endpoint); |
| 4 | 155 | | uri.AppendPath("/subscriptions/", false); |
| 4 | 156 | | uri.AppendPath(subscriptionId, true); |
| 4 | 157 | | uri.AppendPath("/resourceGroups/", false); |
| 4 | 158 | | uri.AppendPath(resourceGroupName, true); |
| 4 | 159 | | uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); |
| 4 | 160 | | uri.AppendPath(configStoreName, true); |
| 4 | 161 | | uri.AppendPath("/privateEndpointConnections/", false); |
| 4 | 162 | | uri.AppendPath(privateEndpointConnectionName, true); |
| 4 | 163 | | uri.AppendQuery("api-version", apiVersion, true); |
| 4 | 164 | | request.Uri = uri; |
| 4 | 165 | | return message; |
| | 166 | | } |
| | 167 | |
|
| | 168 | | /// <summary> Gets the specified private endpoint connection associated with the configuration store. </summary> |
| | 169 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | 170 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | 171 | | /// <param name="privateEndpointConnectionName"> Private endpoint connection name. </param> |
| | 172 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 173 | | public async Task<Response<PrivateEndpointConnection>> GetAsync(string resourceGroupName, string configStoreName |
| | 174 | | { |
| 2 | 175 | | if (resourceGroupName == null) |
| | 176 | | { |
| 0 | 177 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 178 | | } |
| 2 | 179 | | if (configStoreName == null) |
| | 180 | | { |
| 0 | 181 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | 182 | | } |
| 2 | 183 | | if (privateEndpointConnectionName == null) |
| | 184 | | { |
| 0 | 185 | | throw new ArgumentNullException(nameof(privateEndpointConnectionName)); |
| | 186 | | } |
| | 187 | |
|
| 2 | 188 | | using var message = CreateGetRequest(resourceGroupName, configStoreName, privateEndpointConnectionName); |
| 2 | 189 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 2 | 190 | | switch (message.Response.Status) |
| | 191 | | { |
| | 192 | | case 200: |
| | 193 | | { |
| 2 | 194 | | PrivateEndpointConnection value = default; |
| 2 | 195 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 2 | 196 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 197 | | { |
| 0 | 198 | | value = null; |
| | 199 | | } |
| | 200 | | else |
| | 201 | | { |
| 2 | 202 | | value = PrivateEndpointConnection.DeserializePrivateEndpointConnection(document.RootElement) |
| | 203 | | } |
| 2 | 204 | | return Response.FromValue(value, message.Response); |
| | 205 | | } |
| | 206 | | default: |
| 0 | 207 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 208 | | } |
| 2 | 209 | | } |
| | 210 | |
|
| | 211 | | /// <summary> Gets the specified private endpoint connection associated with the configuration store. </summary> |
| | 212 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | 213 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | 214 | | /// <param name="privateEndpointConnectionName"> Private endpoint connection name. </param> |
| | 215 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 216 | | public Response<PrivateEndpointConnection> Get(string resourceGroupName, string configStoreName, string privateE |
| | 217 | | { |
| 2 | 218 | | if (resourceGroupName == null) |
| | 219 | | { |
| 0 | 220 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 221 | | } |
| 2 | 222 | | if (configStoreName == null) |
| | 223 | | { |
| 0 | 224 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | 225 | | } |
| 2 | 226 | | if (privateEndpointConnectionName == null) |
| | 227 | | { |
| 0 | 228 | | throw new ArgumentNullException(nameof(privateEndpointConnectionName)); |
| | 229 | | } |
| | 230 | |
|
| 2 | 231 | | using var message = CreateGetRequest(resourceGroupName, configStoreName, privateEndpointConnectionName); |
| 2 | 232 | | _pipeline.Send(message, cancellationToken); |
| 2 | 233 | | switch (message.Response.Status) |
| | 234 | | { |
| | 235 | | case 200: |
| | 236 | | { |
| 2 | 237 | | PrivateEndpointConnection value = default; |
| 2 | 238 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 2 | 239 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 240 | | { |
| 0 | 241 | | value = null; |
| | 242 | | } |
| | 243 | | else |
| | 244 | | { |
| 2 | 245 | | value = PrivateEndpointConnection.DeserializePrivateEndpointConnection(document.RootElement) |
| | 246 | | } |
| 2 | 247 | | return Response.FromValue(value, message.Response); |
| | 248 | | } |
| | 249 | | default: |
| 0 | 250 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 251 | | } |
| 2 | 252 | | } |
| | 253 | |
|
| | 254 | | internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string configStoreName, string privat |
| | 255 | | { |
| 8 | 256 | | var message = _pipeline.CreateMessage(); |
| 8 | 257 | | var request = message.Request; |
| 8 | 258 | | request.Method = RequestMethod.Put; |
| 8 | 259 | | var uri = new RawRequestUriBuilder(); |
| 8 | 260 | | uri.Reset(endpoint); |
| 8 | 261 | | uri.AppendPath("/subscriptions/", false); |
| 8 | 262 | | uri.AppendPath(subscriptionId, true); |
| 8 | 263 | | uri.AppendPath("/resourceGroups/", false); |
| 8 | 264 | | uri.AppendPath(resourceGroupName, true); |
| 8 | 265 | | uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); |
| 8 | 266 | | uri.AppendPath(configStoreName, true); |
| 8 | 267 | | uri.AppendPath("/privateEndpointConnections/", false); |
| 8 | 268 | | uri.AppendPath(privateEndpointConnectionName, true); |
| 8 | 269 | | uri.AppendQuery("api-version", apiVersion, true); |
| 8 | 270 | | request.Uri = uri; |
| 8 | 271 | | request.Headers.Add("Content-Type", "application/json"); |
| 8 | 272 | | var content = new Utf8JsonRequestContent(); |
| 8 | 273 | | content.JsonWriter.WriteObjectValue(privateEndpointConnection); |
| 8 | 274 | | request.Content = content; |
| 8 | 275 | | return message; |
| | 276 | | } |
| | 277 | |
|
| | 278 | | /// <summary> Update the state of the specified private endpoint connection associated with the configuration st |
| | 279 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | 280 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | 281 | | /// <param name="privateEndpointConnectionName"> Private endpoint connection name. </param> |
| | 282 | | /// <param name="privateEndpointConnection"> The private endpoint connection properties. </param> |
| | 283 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 284 | | public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string configStoreName, string private |
| | 285 | | { |
| 2 | 286 | | if (resourceGroupName == null) |
| | 287 | | { |
| 0 | 288 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 289 | | } |
| 2 | 290 | | if (configStoreName == null) |
| | 291 | | { |
| 0 | 292 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | 293 | | } |
| 2 | 294 | | if (privateEndpointConnectionName == null) |
| | 295 | | { |
| 0 | 296 | | throw new ArgumentNullException(nameof(privateEndpointConnectionName)); |
| | 297 | | } |
| 2 | 298 | | if (privateEndpointConnection == null) |
| | 299 | | { |
| 0 | 300 | | throw new ArgumentNullException(nameof(privateEndpointConnection)); |
| | 301 | | } |
| | 302 | |
|
| 2 | 303 | | using var message = CreateCreateOrUpdateRequest(resourceGroupName, configStoreName, privateEndpointConnectio |
| 2 | 304 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 2 | 305 | | switch (message.Response.Status) |
| | 306 | | { |
| | 307 | | case 200: |
| | 308 | | case 201: |
| 2 | 309 | | return message.Response; |
| | 310 | | default: |
| 0 | 311 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 312 | | } |
| 2 | 313 | | } |
| | 314 | |
|
| | 315 | | /// <summary> Update the state of the specified private endpoint connection associated with the configuration st |
| | 316 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | 317 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | 318 | | /// <param name="privateEndpointConnectionName"> Private endpoint connection name. </param> |
| | 319 | | /// <param name="privateEndpointConnection"> The private endpoint connection properties. </param> |
| | 320 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 321 | | public Response CreateOrUpdate(string resourceGroupName, string configStoreName, string privateEndpointConnectio |
| | 322 | | { |
| 2 | 323 | | if (resourceGroupName == null) |
| | 324 | | { |
| 0 | 325 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 326 | | } |
| 2 | 327 | | if (configStoreName == null) |
| | 328 | | { |
| 0 | 329 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | 330 | | } |
| 2 | 331 | | if (privateEndpointConnectionName == null) |
| | 332 | | { |
| 0 | 333 | | throw new ArgumentNullException(nameof(privateEndpointConnectionName)); |
| | 334 | | } |
| 2 | 335 | | if (privateEndpointConnection == null) |
| | 336 | | { |
| 0 | 337 | | throw new ArgumentNullException(nameof(privateEndpointConnection)); |
| | 338 | | } |
| | 339 | |
|
| 2 | 340 | | using var message = CreateCreateOrUpdateRequest(resourceGroupName, configStoreName, privateEndpointConnectio |
| 2 | 341 | | _pipeline.Send(message, cancellationToken); |
| 2 | 342 | | switch (message.Response.Status) |
| | 343 | | { |
| | 344 | | case 200: |
| | 345 | | case 201: |
| 2 | 346 | | return message.Response; |
| | 347 | | default: |
| 0 | 348 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 349 | | } |
| 2 | 350 | | } |
| | 351 | |
|
| | 352 | | internal HttpMessage CreateDeleteRequest(string resourceGroupName, string configStoreName, string privateEndpoin |
| | 353 | | { |
| 8 | 354 | | var message = _pipeline.CreateMessage(); |
| 8 | 355 | | var request = message.Request; |
| 8 | 356 | | request.Method = RequestMethod.Delete; |
| 8 | 357 | | var uri = new RawRequestUriBuilder(); |
| 8 | 358 | | uri.Reset(endpoint); |
| 8 | 359 | | uri.AppendPath("/subscriptions/", false); |
| 8 | 360 | | uri.AppendPath(subscriptionId, true); |
| 8 | 361 | | uri.AppendPath("/resourceGroups/", false); |
| 8 | 362 | | uri.AppendPath(resourceGroupName, true); |
| 8 | 363 | | uri.AppendPath("/providers/Microsoft.AppConfiguration/configurationStores/", false); |
| 8 | 364 | | uri.AppendPath(configStoreName, true); |
| 8 | 365 | | uri.AppendPath("/privateEndpointConnections/", false); |
| 8 | 366 | | uri.AppendPath(privateEndpointConnectionName, true); |
| 8 | 367 | | uri.AppendQuery("api-version", apiVersion, true); |
| 8 | 368 | | request.Uri = uri; |
| 8 | 369 | | return message; |
| | 370 | | } |
| | 371 | |
|
| | 372 | | /// <summary> Deletes a private endpoint connection. </summary> |
| | 373 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | 374 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | 375 | | /// <param name="privateEndpointConnectionName"> Private endpoint connection name. </param> |
| | 376 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 377 | | public async Task<Response> DeleteAsync(string resourceGroupName, string configStoreName, string privateEndpoint |
| | 378 | | { |
| 2 | 379 | | if (resourceGroupName == null) |
| | 380 | | { |
| 0 | 381 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 382 | | } |
| 2 | 383 | | if (configStoreName == null) |
| | 384 | | { |
| 0 | 385 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | 386 | | } |
| 2 | 387 | | if (privateEndpointConnectionName == null) |
| | 388 | | { |
| 0 | 389 | | throw new ArgumentNullException(nameof(privateEndpointConnectionName)); |
| | 390 | | } |
| | 391 | |
|
| 2 | 392 | | using var message = CreateDeleteRequest(resourceGroupName, configStoreName, privateEndpointConnectionName); |
| 2 | 393 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 2 | 394 | | switch (message.Response.Status) |
| | 395 | | { |
| | 396 | | case 200: |
| | 397 | | case 202: |
| | 398 | | case 204: |
| 2 | 399 | | return message.Response; |
| | 400 | | default: |
| 0 | 401 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 402 | | } |
| 2 | 403 | | } |
| | 404 | |
|
| | 405 | | /// <summary> Deletes a private endpoint connection. </summary> |
| | 406 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | 407 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | 408 | | /// <param name="privateEndpointConnectionName"> Private endpoint connection name. </param> |
| | 409 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 410 | | public Response Delete(string resourceGroupName, string configStoreName, string privateEndpointConnectionName, C |
| | 411 | | { |
| 2 | 412 | | if (resourceGroupName == null) |
| | 413 | | { |
| 0 | 414 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 415 | | } |
| 2 | 416 | | if (configStoreName == null) |
| | 417 | | { |
| 0 | 418 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | 419 | | } |
| 2 | 420 | | if (privateEndpointConnectionName == null) |
| | 421 | | { |
| 0 | 422 | | throw new ArgumentNullException(nameof(privateEndpointConnectionName)); |
| | 423 | | } |
| | 424 | |
|
| 2 | 425 | | using var message = CreateDeleteRequest(resourceGroupName, configStoreName, privateEndpointConnectionName); |
| 2 | 426 | | _pipeline.Send(message, cancellationToken); |
| 2 | 427 | | switch (message.Response.Status) |
| | 428 | | { |
| | 429 | | case 200: |
| | 430 | | case 202: |
| | 431 | | case 204: |
| 2 | 432 | | return message.Response; |
| | 433 | | default: |
| 0 | 434 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 435 | | } |
| 2 | 436 | | } |
| | 437 | |
|
| | 438 | | internal HttpMessage CreateListByConfigurationStoreNextPageRequest(string nextLink, string resourceGroupName, st |
| | 439 | | { |
| 0 | 440 | | var message = _pipeline.CreateMessage(); |
| 0 | 441 | | var request = message.Request; |
| 0 | 442 | | request.Method = RequestMethod.Get; |
| 0 | 443 | | var uri = new RawRequestUriBuilder(); |
| 0 | 444 | | uri.Reset(endpoint); |
| 0 | 445 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 446 | | request.Uri = uri; |
| 0 | 447 | | return message; |
| | 448 | | } |
| | 449 | |
|
| | 450 | | /// <summary> Lists all private endpoint connections for a configuration store. </summary> |
| | 451 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 452 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | 453 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | 454 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 455 | | public async Task<Response<PrivateEndpointConnectionListResult>> ListByConfigurationStoreNextPageAsync(string ne |
| | 456 | | { |
| 0 | 457 | | if (nextLink == null) |
| | 458 | | { |
| 0 | 459 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 460 | | } |
| 0 | 461 | | if (resourceGroupName == null) |
| | 462 | | { |
| 0 | 463 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 464 | | } |
| 0 | 465 | | if (configStoreName == null) |
| | 466 | | { |
| 0 | 467 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | 468 | | } |
| | 469 | |
|
| 0 | 470 | | using var message = CreateListByConfigurationStoreNextPageRequest(nextLink, resourceGroupName, configStoreNa |
| 0 | 471 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 472 | | switch (message.Response.Status) |
| | 473 | | { |
| | 474 | | case 200: |
| | 475 | | { |
| 0 | 476 | | PrivateEndpointConnectionListResult value = default; |
| 0 | 477 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 478 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 479 | | { |
| 0 | 480 | | value = null; |
| | 481 | | } |
| | 482 | | else |
| | 483 | | { |
| 0 | 484 | | value = PrivateEndpointConnectionListResult.DeserializePrivateEndpointConnectionListResult(d |
| | 485 | | } |
| 0 | 486 | | return Response.FromValue(value, message.Response); |
| | 487 | | } |
| | 488 | | default: |
| 0 | 489 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 490 | | } |
| 0 | 491 | | } |
| | 492 | |
|
| | 493 | | /// <summary> Lists all private endpoint connections for a configuration store. </summary> |
| | 494 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 495 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | 496 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | 497 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 498 | | public Response<PrivateEndpointConnectionListResult> ListByConfigurationStoreNextPage(string nextLink, string re |
| | 499 | | { |
| 0 | 500 | | if (nextLink == null) |
| | 501 | | { |
| 0 | 502 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 503 | | } |
| 0 | 504 | | if (resourceGroupName == null) |
| | 505 | | { |
| 0 | 506 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 507 | | } |
| 0 | 508 | | if (configStoreName == null) |
| | 509 | | { |
| 0 | 510 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | 511 | | } |
| | 512 | |
|
| 0 | 513 | | using var message = CreateListByConfigurationStoreNextPageRequest(nextLink, resourceGroupName, configStoreNa |
| 0 | 514 | | _pipeline.Send(message, cancellationToken); |
| 0 | 515 | | switch (message.Response.Status) |
| | 516 | | { |
| | 517 | | case 200: |
| | 518 | | { |
| 0 | 519 | | PrivateEndpointConnectionListResult value = default; |
| 0 | 520 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 521 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 522 | | { |
| 0 | 523 | | value = null; |
| | 524 | | } |
| | 525 | | else |
| | 526 | | { |
| 0 | 527 | | value = PrivateEndpointConnectionListResult.DeserializePrivateEndpointConnectionListResult(d |
| | 528 | | } |
| 0 | 529 | | return Response.FromValue(value, message.Response); |
| | 530 | | } |
| | 531 | | default: |
| 0 | 532 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 533 | | } |
| 0 | 534 | | } |
| | 535 | | } |
| | 536 | | } |