| | 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.Network.Models; |
| | 16 | |
|
| | 17 | | namespace Azure.ResourceManager.Network |
| | 18 | | { |
| | 19 | | internal partial class PrivateLinkServicesRestOperations |
| | 20 | | { |
| | 21 | | private string subscriptionId; |
| | 22 | | private Uri endpoint; |
| | 23 | | private ClientDiagnostics _clientDiagnostics; |
| | 24 | | private HttpPipeline _pipeline; |
| | 25 | |
|
| | 26 | | /// <summary> Initializes a new instance of PrivateLinkServicesRestOperations. </summary> |
| | 27 | | /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param> |
| | 28 | | /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param> |
| | 29 | | /// <param name="subscriptionId"> The subscription credentials which uniquely identify the Microsoft Azure subsc |
| | 30 | | /// <param name="endpoint"> server parameter. </param> |
| | 31 | | /// <exception cref="ArgumentNullException"> This occurs when one of the required arguments is null. </exception |
| 204 | 32 | | public PrivateLinkServicesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subs |
| | 33 | | { |
| 204 | 34 | | if (subscriptionId == null) |
| | 35 | | { |
| 0 | 36 | | throw new ArgumentNullException(nameof(subscriptionId)); |
| | 37 | | } |
| 204 | 38 | | endpoint ??= new Uri("https://management.azure.com"); |
| | 39 | |
|
| 204 | 40 | | this.subscriptionId = subscriptionId; |
| 204 | 41 | | this.endpoint = endpoint; |
| 204 | 42 | | _clientDiagnostics = clientDiagnostics; |
| 204 | 43 | | _pipeline = pipeline; |
| 204 | 44 | | } |
| | 45 | |
|
| | 46 | | internal HttpMessage CreateDeleteRequest(string resourceGroupName, string serviceName) |
| | 47 | | { |
| 0 | 48 | | var message = _pipeline.CreateMessage(); |
| 0 | 49 | | var request = message.Request; |
| 0 | 50 | | request.Method = RequestMethod.Delete; |
| 0 | 51 | | var uri = new RawRequestUriBuilder(); |
| 0 | 52 | | uri.Reset(endpoint); |
| 0 | 53 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 54 | | uri.AppendPath(subscriptionId, true); |
| 0 | 55 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 56 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 57 | | uri.AppendPath("/providers/Microsoft.Network/privateLinkServices/", false); |
| 0 | 58 | | uri.AppendPath(serviceName, true); |
| 0 | 59 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 60 | | request.Uri = uri; |
| 0 | 61 | | return message; |
| | 62 | | } |
| | 63 | |
|
| | 64 | | /// <summary> Deletes the specified private link service. </summary> |
| | 65 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 66 | | /// <param name="serviceName"> The name of the private link service. </param> |
| | 67 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 68 | | public async Task<Response> DeleteAsync(string resourceGroupName, string serviceName, CancellationToken cancella |
| | 69 | | { |
| 0 | 70 | | if (resourceGroupName == null) |
| | 71 | | { |
| 0 | 72 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 73 | | } |
| 0 | 74 | | if (serviceName == null) |
| | 75 | | { |
| 0 | 76 | | throw new ArgumentNullException(nameof(serviceName)); |
| | 77 | | } |
| | 78 | |
|
| 0 | 79 | | using var message = CreateDeleteRequest(resourceGroupName, serviceName); |
| 0 | 80 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 81 | | switch (message.Response.Status) |
| | 82 | | { |
| | 83 | | case 200: |
| | 84 | | case 202: |
| | 85 | | case 204: |
| 0 | 86 | | return message.Response; |
| | 87 | | default: |
| 0 | 88 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 89 | | } |
| 0 | 90 | | } |
| | 91 | |
|
| | 92 | | /// <summary> Deletes the specified private link service. </summary> |
| | 93 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 94 | | /// <param name="serviceName"> The name of the private link service. </param> |
| | 95 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 96 | | public Response Delete(string resourceGroupName, string serviceName, CancellationToken cancellationToken = defau |
| | 97 | | { |
| 0 | 98 | | if (resourceGroupName == null) |
| | 99 | | { |
| 0 | 100 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 101 | | } |
| 0 | 102 | | if (serviceName == null) |
| | 103 | | { |
| 0 | 104 | | throw new ArgumentNullException(nameof(serviceName)); |
| | 105 | | } |
| | 106 | |
|
| 0 | 107 | | using var message = CreateDeleteRequest(resourceGroupName, serviceName); |
| 0 | 108 | | _pipeline.Send(message, cancellationToken); |
| 0 | 109 | | switch (message.Response.Status) |
| | 110 | | { |
| | 111 | | case 200: |
| | 112 | | case 202: |
| | 113 | | case 204: |
| 0 | 114 | | return message.Response; |
| | 115 | | default: |
| 0 | 116 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 117 | | } |
| 0 | 118 | | } |
| | 119 | |
|
| | 120 | | internal HttpMessage CreateGetRequest(string resourceGroupName, string serviceName, string expand) |
| | 121 | | { |
| 0 | 122 | | var message = _pipeline.CreateMessage(); |
| 0 | 123 | | var request = message.Request; |
| 0 | 124 | | request.Method = RequestMethod.Get; |
| 0 | 125 | | var uri = new RawRequestUriBuilder(); |
| 0 | 126 | | uri.Reset(endpoint); |
| 0 | 127 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 128 | | uri.AppendPath(subscriptionId, true); |
| 0 | 129 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 130 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 131 | | uri.AppendPath("/providers/Microsoft.Network/privateLinkServices/", false); |
| 0 | 132 | | uri.AppendPath(serviceName, true); |
| 0 | 133 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 134 | | if (expand != null) |
| | 135 | | { |
| 0 | 136 | | uri.AppendQuery("$expand", expand, true); |
| | 137 | | } |
| 0 | 138 | | request.Uri = uri; |
| 0 | 139 | | return message; |
| | 140 | | } |
| | 141 | |
|
| | 142 | | /// <summary> Gets the specified private link service by resource group. </summary> |
| | 143 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 144 | | /// <param name="serviceName"> The name of the private link service. </param> |
| | 145 | | /// <param name="expand"> Expands referenced resources. </param> |
| | 146 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 147 | | public async Task<Response<PrivateLinkService>> GetAsync(string resourceGroupName, string serviceName, string ex |
| | 148 | | { |
| 0 | 149 | | if (resourceGroupName == null) |
| | 150 | | { |
| 0 | 151 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 152 | | } |
| 0 | 153 | | if (serviceName == null) |
| | 154 | | { |
| 0 | 155 | | throw new ArgumentNullException(nameof(serviceName)); |
| | 156 | | } |
| | 157 | |
|
| 0 | 158 | | using var message = CreateGetRequest(resourceGroupName, serviceName, expand); |
| 0 | 159 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 160 | | switch (message.Response.Status) |
| | 161 | | { |
| | 162 | | case 200: |
| | 163 | | { |
| 0 | 164 | | PrivateLinkService value = default; |
| 0 | 165 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 166 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 167 | | { |
| 0 | 168 | | value = null; |
| | 169 | | } |
| | 170 | | else |
| | 171 | | { |
| 0 | 172 | | value = PrivateLinkService.DeserializePrivateLinkService(document.RootElement); |
| | 173 | | } |
| 0 | 174 | | return Response.FromValue(value, message.Response); |
| | 175 | | } |
| | 176 | | default: |
| 0 | 177 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 178 | | } |
| 0 | 179 | | } |
| | 180 | |
|
| | 181 | | /// <summary> Gets the specified private link service by resource group. </summary> |
| | 182 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 183 | | /// <param name="serviceName"> The name of the private link service. </param> |
| | 184 | | /// <param name="expand"> Expands referenced resources. </param> |
| | 185 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 186 | | public Response<PrivateLinkService> Get(string resourceGroupName, string serviceName, string expand = null, Canc |
| | 187 | | { |
| 0 | 188 | | if (resourceGroupName == null) |
| | 189 | | { |
| 0 | 190 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 191 | | } |
| 0 | 192 | | if (serviceName == null) |
| | 193 | | { |
| 0 | 194 | | throw new ArgumentNullException(nameof(serviceName)); |
| | 195 | | } |
| | 196 | |
|
| 0 | 197 | | using var message = CreateGetRequest(resourceGroupName, serviceName, expand); |
| 0 | 198 | | _pipeline.Send(message, cancellationToken); |
| 0 | 199 | | switch (message.Response.Status) |
| | 200 | | { |
| | 201 | | case 200: |
| | 202 | | { |
| 0 | 203 | | PrivateLinkService value = default; |
| 0 | 204 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 205 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 206 | | { |
| 0 | 207 | | value = null; |
| | 208 | | } |
| | 209 | | else |
| | 210 | | { |
| 0 | 211 | | value = PrivateLinkService.DeserializePrivateLinkService(document.RootElement); |
| | 212 | | } |
| 0 | 213 | | return Response.FromValue(value, message.Response); |
| | 214 | | } |
| | 215 | | default: |
| 0 | 216 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 217 | | } |
| 0 | 218 | | } |
| | 219 | |
|
| | 220 | | internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string serviceName, PrivateLinkServic |
| | 221 | | { |
| 0 | 222 | | var message = _pipeline.CreateMessage(); |
| 0 | 223 | | var request = message.Request; |
| 0 | 224 | | request.Method = RequestMethod.Put; |
| 0 | 225 | | var uri = new RawRequestUriBuilder(); |
| 0 | 226 | | uri.Reset(endpoint); |
| 0 | 227 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 228 | | uri.AppendPath(subscriptionId, true); |
| 0 | 229 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 230 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 231 | | uri.AppendPath("/providers/Microsoft.Network/privateLinkServices/", false); |
| 0 | 232 | | uri.AppendPath(serviceName, true); |
| 0 | 233 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 234 | | request.Uri = uri; |
| 0 | 235 | | request.Headers.Add("Content-Type", "application/json"); |
| 0 | 236 | | var content = new Utf8JsonRequestContent(); |
| 0 | 237 | | content.JsonWriter.WriteObjectValue(parameters); |
| 0 | 238 | | request.Content = content; |
| 0 | 239 | | return message; |
| | 240 | | } |
| | 241 | |
|
| | 242 | | /// <summary> Creates or updates an private link service in the specified resource group. </summary> |
| | 243 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 244 | | /// <param name="serviceName"> The name of the private link service. </param> |
| | 245 | | /// <param name="parameters"> Parameters supplied to the create or update private link service operation. </para |
| | 246 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 247 | | public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string serviceName, PrivateLinkService |
| | 248 | | { |
| 0 | 249 | | if (resourceGroupName == null) |
| | 250 | | { |
| 0 | 251 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 252 | | } |
| 0 | 253 | | if (serviceName == null) |
| | 254 | | { |
| 0 | 255 | | throw new ArgumentNullException(nameof(serviceName)); |
| | 256 | | } |
| 0 | 257 | | if (parameters == null) |
| | 258 | | { |
| 0 | 259 | | throw new ArgumentNullException(nameof(parameters)); |
| | 260 | | } |
| | 261 | |
|
| 0 | 262 | | using var message = CreateCreateOrUpdateRequest(resourceGroupName, serviceName, parameters); |
| 0 | 263 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 264 | | switch (message.Response.Status) |
| | 265 | | { |
| | 266 | | case 200: |
| | 267 | | case 201: |
| 0 | 268 | | return message.Response; |
| | 269 | | default: |
| 0 | 270 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 271 | | } |
| 0 | 272 | | } |
| | 273 | |
|
| | 274 | | /// <summary> Creates or updates an private link service in the specified resource group. </summary> |
| | 275 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 276 | | /// <param name="serviceName"> The name of the private link service. </param> |
| | 277 | | /// <param name="parameters"> Parameters supplied to the create or update private link service operation. </para |
| | 278 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 279 | | public Response CreateOrUpdate(string resourceGroupName, string serviceName, PrivateLinkService parameters, Canc |
| | 280 | | { |
| 0 | 281 | | if (resourceGroupName == null) |
| | 282 | | { |
| 0 | 283 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 284 | | } |
| 0 | 285 | | if (serviceName == null) |
| | 286 | | { |
| 0 | 287 | | throw new ArgumentNullException(nameof(serviceName)); |
| | 288 | | } |
| 0 | 289 | | if (parameters == null) |
| | 290 | | { |
| 0 | 291 | | throw new ArgumentNullException(nameof(parameters)); |
| | 292 | | } |
| | 293 | |
|
| 0 | 294 | | using var message = CreateCreateOrUpdateRequest(resourceGroupName, serviceName, parameters); |
| 0 | 295 | | _pipeline.Send(message, cancellationToken); |
| 0 | 296 | | switch (message.Response.Status) |
| | 297 | | { |
| | 298 | | case 200: |
| | 299 | | case 201: |
| 0 | 300 | | return message.Response; |
| | 301 | | default: |
| 0 | 302 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 303 | | } |
| 0 | 304 | | } |
| | 305 | |
|
| | 306 | | internal HttpMessage CreateListRequest(string resourceGroupName) |
| | 307 | | { |
| 0 | 308 | | var message = _pipeline.CreateMessage(); |
| 0 | 309 | | var request = message.Request; |
| 0 | 310 | | request.Method = RequestMethod.Get; |
| 0 | 311 | | var uri = new RawRequestUriBuilder(); |
| 0 | 312 | | uri.Reset(endpoint); |
| 0 | 313 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 314 | | uri.AppendPath(subscriptionId, true); |
| 0 | 315 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 316 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 317 | | uri.AppendPath("/providers/Microsoft.Network/privateLinkServices", false); |
| 0 | 318 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 319 | | request.Uri = uri; |
| 0 | 320 | | return message; |
| | 321 | | } |
| | 322 | |
|
| | 323 | | /// <summary> Gets all private link services in a resource group. </summary> |
| | 324 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 325 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 326 | | public async Task<Response<PrivateLinkServiceListResult>> ListAsync(string resourceGroupName, CancellationToken |
| | 327 | | { |
| 0 | 328 | | if (resourceGroupName == null) |
| | 329 | | { |
| 0 | 330 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 331 | | } |
| | 332 | |
|
| 0 | 333 | | using var message = CreateListRequest(resourceGroupName); |
| 0 | 334 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 335 | | switch (message.Response.Status) |
| | 336 | | { |
| | 337 | | case 200: |
| | 338 | | { |
| 0 | 339 | | PrivateLinkServiceListResult value = default; |
| 0 | 340 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 341 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 342 | | { |
| 0 | 343 | | value = null; |
| | 344 | | } |
| | 345 | | else |
| | 346 | | { |
| 0 | 347 | | value = PrivateLinkServiceListResult.DeserializePrivateLinkServiceListResult(document.RootEl |
| | 348 | | } |
| 0 | 349 | | return Response.FromValue(value, message.Response); |
| | 350 | | } |
| | 351 | | default: |
| 0 | 352 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 353 | | } |
| 0 | 354 | | } |
| | 355 | |
|
| | 356 | | /// <summary> Gets all private link services in a resource group. </summary> |
| | 357 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 358 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 359 | | public Response<PrivateLinkServiceListResult> List(string resourceGroupName, CancellationToken cancellationToken |
| | 360 | | { |
| 0 | 361 | | if (resourceGroupName == null) |
| | 362 | | { |
| 0 | 363 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 364 | | } |
| | 365 | |
|
| 0 | 366 | | using var message = CreateListRequest(resourceGroupName); |
| 0 | 367 | | _pipeline.Send(message, cancellationToken); |
| 0 | 368 | | switch (message.Response.Status) |
| | 369 | | { |
| | 370 | | case 200: |
| | 371 | | { |
| 0 | 372 | | PrivateLinkServiceListResult value = default; |
| 0 | 373 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 374 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 375 | | { |
| 0 | 376 | | value = null; |
| | 377 | | } |
| | 378 | | else |
| | 379 | | { |
| 0 | 380 | | value = PrivateLinkServiceListResult.DeserializePrivateLinkServiceListResult(document.RootEl |
| | 381 | | } |
| 0 | 382 | | return Response.FromValue(value, message.Response); |
| | 383 | | } |
| | 384 | | default: |
| 0 | 385 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 386 | | } |
| 0 | 387 | | } |
| | 388 | |
|
| | 389 | | internal HttpMessage CreateListBySubscriptionRequest() |
| | 390 | | { |
| 0 | 391 | | var message = _pipeline.CreateMessage(); |
| 0 | 392 | | var request = message.Request; |
| 0 | 393 | | request.Method = RequestMethod.Get; |
| 0 | 394 | | var uri = new RawRequestUriBuilder(); |
| 0 | 395 | | uri.Reset(endpoint); |
| 0 | 396 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 397 | | uri.AppendPath(subscriptionId, true); |
| 0 | 398 | | uri.AppendPath("/providers/Microsoft.Network/privateLinkServices", false); |
| 0 | 399 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 400 | | request.Uri = uri; |
| 0 | 401 | | return message; |
| | 402 | | } |
| | 403 | |
|
| | 404 | | /// <summary> Gets all private link service in a subscription. </summary> |
| | 405 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 406 | | public async Task<Response<PrivateLinkServiceListResult>> ListBySubscriptionAsync(CancellationToken cancellation |
| | 407 | | { |
| 0 | 408 | | using var message = CreateListBySubscriptionRequest(); |
| 0 | 409 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 410 | | switch (message.Response.Status) |
| | 411 | | { |
| | 412 | | case 200: |
| | 413 | | { |
| 0 | 414 | | PrivateLinkServiceListResult value = default; |
| 0 | 415 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 416 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 417 | | { |
| 0 | 418 | | value = null; |
| | 419 | | } |
| | 420 | | else |
| | 421 | | { |
| 0 | 422 | | value = PrivateLinkServiceListResult.DeserializePrivateLinkServiceListResult(document.RootEl |
| | 423 | | } |
| 0 | 424 | | return Response.FromValue(value, message.Response); |
| | 425 | | } |
| | 426 | | default: |
| 0 | 427 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 428 | | } |
| 0 | 429 | | } |
| | 430 | |
|
| | 431 | | /// <summary> Gets all private link service in a subscription. </summary> |
| | 432 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 433 | | public Response<PrivateLinkServiceListResult> ListBySubscription(CancellationToken cancellationToken = default) |
| | 434 | | { |
| 0 | 435 | | using var message = CreateListBySubscriptionRequest(); |
| 0 | 436 | | _pipeline.Send(message, cancellationToken); |
| 0 | 437 | | switch (message.Response.Status) |
| | 438 | | { |
| | 439 | | case 200: |
| | 440 | | { |
| 0 | 441 | | PrivateLinkServiceListResult value = default; |
| 0 | 442 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 443 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 444 | | { |
| 0 | 445 | | value = null; |
| | 446 | | } |
| | 447 | | else |
| | 448 | | { |
| 0 | 449 | | value = PrivateLinkServiceListResult.DeserializePrivateLinkServiceListResult(document.RootEl |
| | 450 | | } |
| 0 | 451 | | return Response.FromValue(value, message.Response); |
| | 452 | | } |
| | 453 | | default: |
| 0 | 454 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 455 | | } |
| 0 | 456 | | } |
| | 457 | |
|
| | 458 | | internal HttpMessage CreateGetPrivateEndpointConnectionRequest(string resourceGroupName, string serviceName, str |
| | 459 | | { |
| 0 | 460 | | var message = _pipeline.CreateMessage(); |
| 0 | 461 | | var request = message.Request; |
| 0 | 462 | | request.Method = RequestMethod.Get; |
| 0 | 463 | | var uri = new RawRequestUriBuilder(); |
| 0 | 464 | | uri.Reset(endpoint); |
| 0 | 465 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 466 | | uri.AppendPath(subscriptionId, true); |
| 0 | 467 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 468 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 469 | | uri.AppendPath("/providers/Microsoft.Network/privateLinkServices/", false); |
| 0 | 470 | | uri.AppendPath(serviceName, true); |
| 0 | 471 | | uri.AppendPath("/privateEndpointConnections/", false); |
| 0 | 472 | | uri.AppendPath(peConnectionName, true); |
| 0 | 473 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 474 | | if (expand != null) |
| | 475 | | { |
| 0 | 476 | | uri.AppendQuery("$expand", expand, true); |
| | 477 | | } |
| 0 | 478 | | request.Uri = uri; |
| 0 | 479 | | return message; |
| | 480 | | } |
| | 481 | |
|
| | 482 | | /// <summary> Get the specific private end point connection by specific private link service in the resource gro |
| | 483 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 484 | | /// <param name="serviceName"> The name of the private link service. </param> |
| | 485 | | /// <param name="peConnectionName"> The name of the private end point connection. </param> |
| | 486 | | /// <param name="expand"> Expands referenced resources. </param> |
| | 487 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 488 | | public async Task<Response<PrivateEndpointConnection>> GetPrivateEndpointConnectionAsync(string resourceGroupNam |
| | 489 | | { |
| 0 | 490 | | if (resourceGroupName == null) |
| | 491 | | { |
| 0 | 492 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 493 | | } |
| 0 | 494 | | if (serviceName == null) |
| | 495 | | { |
| 0 | 496 | | throw new ArgumentNullException(nameof(serviceName)); |
| | 497 | | } |
| 0 | 498 | | if (peConnectionName == null) |
| | 499 | | { |
| 0 | 500 | | throw new ArgumentNullException(nameof(peConnectionName)); |
| | 501 | | } |
| | 502 | |
|
| 0 | 503 | | using var message = CreateGetPrivateEndpointConnectionRequest(resourceGroupName, serviceName, peConnectionNa |
| 0 | 504 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 505 | | switch (message.Response.Status) |
| | 506 | | { |
| | 507 | | case 200: |
| | 508 | | { |
| 0 | 509 | | PrivateEndpointConnection value = default; |
| 0 | 510 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 511 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 512 | | { |
| 0 | 513 | | value = null; |
| | 514 | | } |
| | 515 | | else |
| | 516 | | { |
| 0 | 517 | | value = PrivateEndpointConnection.DeserializePrivateEndpointConnection(document.RootElement) |
| | 518 | | } |
| 0 | 519 | | return Response.FromValue(value, message.Response); |
| | 520 | | } |
| | 521 | | default: |
| 0 | 522 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 523 | | } |
| 0 | 524 | | } |
| | 525 | |
|
| | 526 | | /// <summary> Get the specific private end point connection by specific private link service in the resource gro |
| | 527 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 528 | | /// <param name="serviceName"> The name of the private link service. </param> |
| | 529 | | /// <param name="peConnectionName"> The name of the private end point connection. </param> |
| | 530 | | /// <param name="expand"> Expands referenced resources. </param> |
| | 531 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 532 | | public Response<PrivateEndpointConnection> GetPrivateEndpointConnection(string resourceGroupName, string service |
| | 533 | | { |
| 0 | 534 | | if (resourceGroupName == null) |
| | 535 | | { |
| 0 | 536 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 537 | | } |
| 0 | 538 | | if (serviceName == null) |
| | 539 | | { |
| 0 | 540 | | throw new ArgumentNullException(nameof(serviceName)); |
| | 541 | | } |
| 0 | 542 | | if (peConnectionName == null) |
| | 543 | | { |
| 0 | 544 | | throw new ArgumentNullException(nameof(peConnectionName)); |
| | 545 | | } |
| | 546 | |
|
| 0 | 547 | | using var message = CreateGetPrivateEndpointConnectionRequest(resourceGroupName, serviceName, peConnectionNa |
| 0 | 548 | | _pipeline.Send(message, cancellationToken); |
| 0 | 549 | | switch (message.Response.Status) |
| | 550 | | { |
| | 551 | | case 200: |
| | 552 | | { |
| 0 | 553 | | PrivateEndpointConnection value = default; |
| 0 | 554 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 555 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 556 | | { |
| 0 | 557 | | value = null; |
| | 558 | | } |
| | 559 | | else |
| | 560 | | { |
| 0 | 561 | | value = PrivateEndpointConnection.DeserializePrivateEndpointConnection(document.RootElement) |
| | 562 | | } |
| 0 | 563 | | return Response.FromValue(value, message.Response); |
| | 564 | | } |
| | 565 | | default: |
| 0 | 566 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 567 | | } |
| 0 | 568 | | } |
| | 569 | |
|
| | 570 | | internal HttpMessage CreateUpdatePrivateEndpointConnectionRequest(string resourceGroupName, string serviceName, |
| | 571 | | { |
| 0 | 572 | | var message = _pipeline.CreateMessage(); |
| 0 | 573 | | var request = message.Request; |
| 0 | 574 | | request.Method = RequestMethod.Put; |
| 0 | 575 | | var uri = new RawRequestUriBuilder(); |
| 0 | 576 | | uri.Reset(endpoint); |
| 0 | 577 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 578 | | uri.AppendPath(subscriptionId, true); |
| 0 | 579 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 580 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 581 | | uri.AppendPath("/providers/Microsoft.Network/privateLinkServices/", false); |
| 0 | 582 | | uri.AppendPath(serviceName, true); |
| 0 | 583 | | uri.AppendPath("/privateEndpointConnections/", false); |
| 0 | 584 | | uri.AppendPath(peConnectionName, true); |
| 0 | 585 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 586 | | request.Uri = uri; |
| 0 | 587 | | request.Headers.Add("Content-Type", "application/json"); |
| 0 | 588 | | var content = new Utf8JsonRequestContent(); |
| 0 | 589 | | content.JsonWriter.WriteObjectValue(parameters); |
| 0 | 590 | | request.Content = content; |
| 0 | 591 | | return message; |
| | 592 | | } |
| | 593 | |
|
| | 594 | | /// <summary> Approve or reject private end point connection for a private link service in a subscription. </sum |
| | 595 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 596 | | /// <param name="serviceName"> The name of the private link service. </param> |
| | 597 | | /// <param name="peConnectionName"> The name of the private end point connection. </param> |
| | 598 | | /// <param name="parameters"> Parameters supplied to approve or reject the private end point connection. </param |
| | 599 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 600 | | public async Task<Response<PrivateEndpointConnection>> UpdatePrivateEndpointConnectionAsync(string resourceGroup |
| | 601 | | { |
| 0 | 602 | | if (resourceGroupName == null) |
| | 603 | | { |
| 0 | 604 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 605 | | } |
| 0 | 606 | | if (serviceName == null) |
| | 607 | | { |
| 0 | 608 | | throw new ArgumentNullException(nameof(serviceName)); |
| | 609 | | } |
| 0 | 610 | | if (peConnectionName == null) |
| | 611 | | { |
| 0 | 612 | | throw new ArgumentNullException(nameof(peConnectionName)); |
| | 613 | | } |
| 0 | 614 | | if (parameters == null) |
| | 615 | | { |
| 0 | 616 | | throw new ArgumentNullException(nameof(parameters)); |
| | 617 | | } |
| | 618 | |
|
| 0 | 619 | | using var message = CreateUpdatePrivateEndpointConnectionRequest(resourceGroupName, serviceName, peConnectio |
| 0 | 620 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 621 | | switch (message.Response.Status) |
| | 622 | | { |
| | 623 | | case 200: |
| | 624 | | { |
| 0 | 625 | | PrivateEndpointConnection value = default; |
| 0 | 626 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 627 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 628 | | { |
| 0 | 629 | | value = null; |
| | 630 | | } |
| | 631 | | else |
| | 632 | | { |
| 0 | 633 | | value = PrivateEndpointConnection.DeserializePrivateEndpointConnection(document.RootElement) |
| | 634 | | } |
| 0 | 635 | | return Response.FromValue(value, message.Response); |
| | 636 | | } |
| | 637 | | default: |
| 0 | 638 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 639 | | } |
| 0 | 640 | | } |
| | 641 | |
|
| | 642 | | /// <summary> Approve or reject private end point connection for a private link service in a subscription. </sum |
| | 643 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 644 | | /// <param name="serviceName"> The name of the private link service. </param> |
| | 645 | | /// <param name="peConnectionName"> The name of the private end point connection. </param> |
| | 646 | | /// <param name="parameters"> Parameters supplied to approve or reject the private end point connection. </param |
| | 647 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 648 | | public Response<PrivateEndpointConnection> UpdatePrivateEndpointConnection(string resourceGroupName, string serv |
| | 649 | | { |
| 0 | 650 | | if (resourceGroupName == null) |
| | 651 | | { |
| 0 | 652 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 653 | | } |
| 0 | 654 | | if (serviceName == null) |
| | 655 | | { |
| 0 | 656 | | throw new ArgumentNullException(nameof(serviceName)); |
| | 657 | | } |
| 0 | 658 | | if (peConnectionName == null) |
| | 659 | | { |
| 0 | 660 | | throw new ArgumentNullException(nameof(peConnectionName)); |
| | 661 | | } |
| 0 | 662 | | if (parameters == null) |
| | 663 | | { |
| 0 | 664 | | throw new ArgumentNullException(nameof(parameters)); |
| | 665 | | } |
| | 666 | |
|
| 0 | 667 | | using var message = CreateUpdatePrivateEndpointConnectionRequest(resourceGroupName, serviceName, peConnectio |
| 0 | 668 | | _pipeline.Send(message, cancellationToken); |
| 0 | 669 | | switch (message.Response.Status) |
| | 670 | | { |
| | 671 | | case 200: |
| | 672 | | { |
| 0 | 673 | | PrivateEndpointConnection value = default; |
| 0 | 674 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 675 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 676 | | { |
| 0 | 677 | | value = null; |
| | 678 | | } |
| | 679 | | else |
| | 680 | | { |
| 0 | 681 | | value = PrivateEndpointConnection.DeserializePrivateEndpointConnection(document.RootElement) |
| | 682 | | } |
| 0 | 683 | | return Response.FromValue(value, message.Response); |
| | 684 | | } |
| | 685 | | default: |
| 0 | 686 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 687 | | } |
| 0 | 688 | | } |
| | 689 | |
|
| | 690 | | internal HttpMessage CreateDeletePrivateEndpointConnectionRequest(string resourceGroupName, string serviceName, |
| | 691 | | { |
| 0 | 692 | | var message = _pipeline.CreateMessage(); |
| 0 | 693 | | var request = message.Request; |
| 0 | 694 | | request.Method = RequestMethod.Delete; |
| 0 | 695 | | var uri = new RawRequestUriBuilder(); |
| 0 | 696 | | uri.Reset(endpoint); |
| 0 | 697 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 698 | | uri.AppendPath(subscriptionId, true); |
| 0 | 699 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 700 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 701 | | uri.AppendPath("/providers/Microsoft.Network/privateLinkServices/", false); |
| 0 | 702 | | uri.AppendPath(serviceName, true); |
| 0 | 703 | | uri.AppendPath("/privateEndpointConnections/", false); |
| 0 | 704 | | uri.AppendPath(peConnectionName, true); |
| 0 | 705 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 706 | | request.Uri = uri; |
| 0 | 707 | | return message; |
| | 708 | | } |
| | 709 | |
|
| | 710 | | /// <summary> Delete private end point connection for a private link service in a subscription. </summary> |
| | 711 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 712 | | /// <param name="serviceName"> The name of the private link service. </param> |
| | 713 | | /// <param name="peConnectionName"> The name of the private end point connection. </param> |
| | 714 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 715 | | public async Task<Response> DeletePrivateEndpointConnectionAsync(string resourceGroupName, string serviceName, s |
| | 716 | | { |
| 0 | 717 | | if (resourceGroupName == null) |
| | 718 | | { |
| 0 | 719 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 720 | | } |
| 0 | 721 | | if (serviceName == null) |
| | 722 | | { |
| 0 | 723 | | throw new ArgumentNullException(nameof(serviceName)); |
| | 724 | | } |
| 0 | 725 | | if (peConnectionName == null) |
| | 726 | | { |
| 0 | 727 | | throw new ArgumentNullException(nameof(peConnectionName)); |
| | 728 | | } |
| | 729 | |
|
| 0 | 730 | | using var message = CreateDeletePrivateEndpointConnectionRequest(resourceGroupName, serviceName, peConnectio |
| 0 | 731 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 732 | | switch (message.Response.Status) |
| | 733 | | { |
| | 734 | | case 200: |
| | 735 | | case 202: |
| | 736 | | case 204: |
| 0 | 737 | | return message.Response; |
| | 738 | | default: |
| 0 | 739 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 740 | | } |
| 0 | 741 | | } |
| | 742 | |
|
| | 743 | | /// <summary> Delete private end point connection for a private link service in a subscription. </summary> |
| | 744 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 745 | | /// <param name="serviceName"> The name of the private link service. </param> |
| | 746 | | /// <param name="peConnectionName"> The name of the private end point connection. </param> |
| | 747 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 748 | | public Response DeletePrivateEndpointConnection(string resourceGroupName, string serviceName, string peConnectio |
| | 749 | | { |
| 0 | 750 | | if (resourceGroupName == null) |
| | 751 | | { |
| 0 | 752 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 753 | | } |
| 0 | 754 | | if (serviceName == null) |
| | 755 | | { |
| 0 | 756 | | throw new ArgumentNullException(nameof(serviceName)); |
| | 757 | | } |
| 0 | 758 | | if (peConnectionName == null) |
| | 759 | | { |
| 0 | 760 | | throw new ArgumentNullException(nameof(peConnectionName)); |
| | 761 | | } |
| | 762 | |
|
| 0 | 763 | | using var message = CreateDeletePrivateEndpointConnectionRequest(resourceGroupName, serviceName, peConnectio |
| 0 | 764 | | _pipeline.Send(message, cancellationToken); |
| 0 | 765 | | switch (message.Response.Status) |
| | 766 | | { |
| | 767 | | case 200: |
| | 768 | | case 202: |
| | 769 | | case 204: |
| 0 | 770 | | return message.Response; |
| | 771 | | default: |
| 0 | 772 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 773 | | } |
| 0 | 774 | | } |
| | 775 | |
|
| | 776 | | internal HttpMessage CreateListPrivateEndpointConnectionsRequest(string resourceGroupName, string serviceName) |
| | 777 | | { |
| 0 | 778 | | var message = _pipeline.CreateMessage(); |
| 0 | 779 | | var request = message.Request; |
| 0 | 780 | | request.Method = RequestMethod.Get; |
| 0 | 781 | | var uri = new RawRequestUriBuilder(); |
| 0 | 782 | | uri.Reset(endpoint); |
| 0 | 783 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 784 | | uri.AppendPath(subscriptionId, true); |
| 0 | 785 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 786 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 787 | | uri.AppendPath("/providers/Microsoft.Network/privateLinkServices/", false); |
| 0 | 788 | | uri.AppendPath(serviceName, true); |
| 0 | 789 | | uri.AppendPath("/privateEndpointConnections", false); |
| 0 | 790 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 791 | | request.Uri = uri; |
| 0 | 792 | | return message; |
| | 793 | | } |
| | 794 | |
|
| | 795 | | /// <summary> Gets all private end point connections for a specific private link service. </summary> |
| | 796 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 797 | | /// <param name="serviceName"> The name of the private link service. </param> |
| | 798 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 799 | | public async Task<Response<PrivateEndpointConnectionListResult>> ListPrivateEndpointConnectionsAsync(string reso |
| | 800 | | { |
| 0 | 801 | | if (resourceGroupName == null) |
| | 802 | | { |
| 0 | 803 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 804 | | } |
| 0 | 805 | | if (serviceName == null) |
| | 806 | | { |
| 0 | 807 | | throw new ArgumentNullException(nameof(serviceName)); |
| | 808 | | } |
| | 809 | |
|
| 0 | 810 | | using var message = CreateListPrivateEndpointConnectionsRequest(resourceGroupName, serviceName); |
| 0 | 811 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 812 | | switch (message.Response.Status) |
| | 813 | | { |
| | 814 | | case 200: |
| | 815 | | { |
| 0 | 816 | | PrivateEndpointConnectionListResult value = default; |
| 0 | 817 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 818 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 819 | | { |
| 0 | 820 | | value = null; |
| | 821 | | } |
| | 822 | | else |
| | 823 | | { |
| 0 | 824 | | value = PrivateEndpointConnectionListResult.DeserializePrivateEndpointConnectionListResult(d |
| | 825 | | } |
| 0 | 826 | | return Response.FromValue(value, message.Response); |
| | 827 | | } |
| | 828 | | default: |
| 0 | 829 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 830 | | } |
| 0 | 831 | | } |
| | 832 | |
|
| | 833 | | /// <summary> Gets all private end point connections for a specific private link service. </summary> |
| | 834 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 835 | | /// <param name="serviceName"> The name of the private link service. </param> |
| | 836 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 837 | | public Response<PrivateEndpointConnectionListResult> ListPrivateEndpointConnections(string resourceGroupName, st |
| | 838 | | { |
| 0 | 839 | | if (resourceGroupName == null) |
| | 840 | | { |
| 0 | 841 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 842 | | } |
| 0 | 843 | | if (serviceName == null) |
| | 844 | | { |
| 0 | 845 | | throw new ArgumentNullException(nameof(serviceName)); |
| | 846 | | } |
| | 847 | |
|
| 0 | 848 | | using var message = CreateListPrivateEndpointConnectionsRequest(resourceGroupName, serviceName); |
| 0 | 849 | | _pipeline.Send(message, cancellationToken); |
| 0 | 850 | | switch (message.Response.Status) |
| | 851 | | { |
| | 852 | | case 200: |
| | 853 | | { |
| 0 | 854 | | PrivateEndpointConnectionListResult value = default; |
| 0 | 855 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 856 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 857 | | { |
| 0 | 858 | | value = null; |
| | 859 | | } |
| | 860 | | else |
| | 861 | | { |
| 0 | 862 | | value = PrivateEndpointConnectionListResult.DeserializePrivateEndpointConnectionListResult(d |
| | 863 | | } |
| 0 | 864 | | return Response.FromValue(value, message.Response); |
| | 865 | | } |
| | 866 | | default: |
| 0 | 867 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 868 | | } |
| 0 | 869 | | } |
| | 870 | |
|
| | 871 | | internal HttpMessage CreateCheckPrivateLinkServiceVisibilityRequest(string location, CheckPrivateLinkServiceVisi |
| | 872 | | { |
| 0 | 873 | | var message = _pipeline.CreateMessage(); |
| 0 | 874 | | var request = message.Request; |
| 0 | 875 | | request.Method = RequestMethod.Post; |
| 0 | 876 | | var uri = new RawRequestUriBuilder(); |
| 0 | 877 | | uri.Reset(endpoint); |
| 0 | 878 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 879 | | uri.AppendPath(subscriptionId, true); |
| 0 | 880 | | uri.AppendPath("/providers/Microsoft.Network/locations/", false); |
| 0 | 881 | | uri.AppendPath(location, true); |
| 0 | 882 | | uri.AppendPath("/checkPrivateLinkServiceVisibility", false); |
| 0 | 883 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 884 | | request.Uri = uri; |
| 0 | 885 | | request.Headers.Add("Content-Type", "application/json"); |
| 0 | 886 | | var content = new Utf8JsonRequestContent(); |
| 0 | 887 | | content.JsonWriter.WriteObjectValue(parameters); |
| 0 | 888 | | request.Content = content; |
| 0 | 889 | | return message; |
| | 890 | | } |
| | 891 | |
|
| | 892 | | /// <summary> Checks whether the subscription is visible to private link service. </summary> |
| | 893 | | /// <param name="location"> The location of the domain name. </param> |
| | 894 | | /// <param name="parameters"> The request body of CheckPrivateLinkService API call. </param> |
| | 895 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 896 | | public async Task<Response> CheckPrivateLinkServiceVisibilityAsync(string location, CheckPrivateLinkServiceVisib |
| | 897 | | { |
| 0 | 898 | | if (location == null) |
| | 899 | | { |
| 0 | 900 | | throw new ArgumentNullException(nameof(location)); |
| | 901 | | } |
| 0 | 902 | | if (parameters == null) |
| | 903 | | { |
| 0 | 904 | | throw new ArgumentNullException(nameof(parameters)); |
| | 905 | | } |
| | 906 | |
|
| 0 | 907 | | using var message = CreateCheckPrivateLinkServiceVisibilityRequest(location, parameters); |
| 0 | 908 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 909 | | switch (message.Response.Status) |
| | 910 | | { |
| | 911 | | case 200: |
| | 912 | | case 202: |
| 0 | 913 | | return message.Response; |
| | 914 | | default: |
| 0 | 915 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 916 | | } |
| 0 | 917 | | } |
| | 918 | |
|
| | 919 | | /// <summary> Checks whether the subscription is visible to private link service. </summary> |
| | 920 | | /// <param name="location"> The location of the domain name. </param> |
| | 921 | | /// <param name="parameters"> The request body of CheckPrivateLinkService API call. </param> |
| | 922 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 923 | | public Response CheckPrivateLinkServiceVisibility(string location, CheckPrivateLinkServiceVisibilityRequest para |
| | 924 | | { |
| 0 | 925 | | if (location == null) |
| | 926 | | { |
| 0 | 927 | | throw new ArgumentNullException(nameof(location)); |
| | 928 | | } |
| 0 | 929 | | if (parameters == null) |
| | 930 | | { |
| 0 | 931 | | throw new ArgumentNullException(nameof(parameters)); |
| | 932 | | } |
| | 933 | |
|
| 0 | 934 | | using var message = CreateCheckPrivateLinkServiceVisibilityRequest(location, parameters); |
| 0 | 935 | | _pipeline.Send(message, cancellationToken); |
| 0 | 936 | | switch (message.Response.Status) |
| | 937 | | { |
| | 938 | | case 200: |
| | 939 | | case 202: |
| 0 | 940 | | return message.Response; |
| | 941 | | default: |
| 0 | 942 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 943 | | } |
| 0 | 944 | | } |
| | 945 | |
|
| | 946 | | internal HttpMessage CreateCheckPrivateLinkServiceVisibilityByResourceGroupRequest(string location, string resou |
| | 947 | | { |
| 8 | 948 | | var message = _pipeline.CreateMessage(); |
| 8 | 949 | | var request = message.Request; |
| 8 | 950 | | request.Method = RequestMethod.Post; |
| 8 | 951 | | var uri = new RawRequestUriBuilder(); |
| 8 | 952 | | uri.Reset(endpoint); |
| 8 | 953 | | uri.AppendPath("/subscriptions/", false); |
| 8 | 954 | | uri.AppendPath(subscriptionId, true); |
| 8 | 955 | | uri.AppendPath("/resourceGroups/", false); |
| 8 | 956 | | uri.AppendPath(resourceGroupName, true); |
| 8 | 957 | | uri.AppendPath("/providers/Microsoft.Network/locations/", false); |
| 8 | 958 | | uri.AppendPath(location, true); |
| 8 | 959 | | uri.AppendPath("/checkPrivateLinkServiceVisibility", false); |
| 8 | 960 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 8 | 961 | | request.Uri = uri; |
| 8 | 962 | | request.Headers.Add("Content-Type", "application/json"); |
| 8 | 963 | | var content = new Utf8JsonRequestContent(); |
| 8 | 964 | | content.JsonWriter.WriteObjectValue(parameters); |
| 8 | 965 | | request.Content = content; |
| 8 | 966 | | return message; |
| | 967 | | } |
| | 968 | |
|
| | 969 | | /// <summary> Checks whether the subscription is visible to private link service in the specified resource group |
| | 970 | | /// <param name="location"> The location of the domain name. </param> |
| | 971 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 972 | | /// <param name="parameters"> The request body of CheckPrivateLinkService API call. </param> |
| | 973 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 974 | | public async Task<Response> CheckPrivateLinkServiceVisibilityByResourceGroupAsync(string location, string resour |
| | 975 | | { |
| 2 | 976 | | if (location == null) |
| | 977 | | { |
| 0 | 978 | | throw new ArgumentNullException(nameof(location)); |
| | 979 | | } |
| 2 | 980 | | if (resourceGroupName == null) |
| | 981 | | { |
| 0 | 982 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 983 | | } |
| 2 | 984 | | if (parameters == null) |
| | 985 | | { |
| 0 | 986 | | throw new ArgumentNullException(nameof(parameters)); |
| | 987 | | } |
| | 988 | |
|
| 2 | 989 | | using var message = CreateCheckPrivateLinkServiceVisibilityByResourceGroupRequest(location, resourceGroupNam |
| 2 | 990 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 2 | 991 | | switch (message.Response.Status) |
| | 992 | | { |
| | 993 | | case 200: |
| | 994 | | case 202: |
| 2 | 995 | | return message.Response; |
| | 996 | | default: |
| 0 | 997 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 998 | | } |
| 2 | 999 | | } |
| | 1000 | |
|
| | 1001 | | /// <summary> Checks whether the subscription is visible to private link service in the specified resource group |
| | 1002 | | /// <param name="location"> The location of the domain name. </param> |
| | 1003 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1004 | | /// <param name="parameters"> The request body of CheckPrivateLinkService API call. </param> |
| | 1005 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1006 | | public Response CheckPrivateLinkServiceVisibilityByResourceGroup(string location, string resourceGroupName, Chec |
| | 1007 | | { |
| 2 | 1008 | | if (location == null) |
| | 1009 | | { |
| 0 | 1010 | | throw new ArgumentNullException(nameof(location)); |
| | 1011 | | } |
| 2 | 1012 | | if (resourceGroupName == null) |
| | 1013 | | { |
| 0 | 1014 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1015 | | } |
| 2 | 1016 | | if (parameters == null) |
| | 1017 | | { |
| 0 | 1018 | | throw new ArgumentNullException(nameof(parameters)); |
| | 1019 | | } |
| | 1020 | |
|
| 2 | 1021 | | using var message = CreateCheckPrivateLinkServiceVisibilityByResourceGroupRequest(location, resourceGroupNam |
| 2 | 1022 | | _pipeline.Send(message, cancellationToken); |
| 2 | 1023 | | switch (message.Response.Status) |
| | 1024 | | { |
| | 1025 | | case 200: |
| | 1026 | | case 202: |
| 2 | 1027 | | return message.Response; |
| | 1028 | | default: |
| 0 | 1029 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1030 | | } |
| 2 | 1031 | | } |
| | 1032 | |
|
| | 1033 | | internal HttpMessage CreateListAutoApprovedPrivateLinkServicesRequest(string location) |
| | 1034 | | { |
| 0 | 1035 | | var message = _pipeline.CreateMessage(); |
| 0 | 1036 | | var request = message.Request; |
| 0 | 1037 | | request.Method = RequestMethod.Get; |
| 0 | 1038 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1039 | | uri.Reset(endpoint); |
| 0 | 1040 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 1041 | | uri.AppendPath(subscriptionId, true); |
| 0 | 1042 | | uri.AppendPath("/providers/Microsoft.Network/locations/", false); |
| 0 | 1043 | | uri.AppendPath(location, true); |
| 0 | 1044 | | uri.AppendPath("/autoApprovedPrivateLinkServices", false); |
| 0 | 1045 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 1046 | | request.Uri = uri; |
| 0 | 1047 | | return message; |
| | 1048 | | } |
| | 1049 | |
|
| | 1050 | | /// <summary> Returns all of the private link service ids that can be linked to a Private Endpoint with auto app |
| | 1051 | | /// <param name="location"> The location of the domain name. </param> |
| | 1052 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1053 | | public async Task<Response<AutoApprovedPrivateLinkServicesResult>> ListAutoApprovedPrivateLinkServicesAsync(stri |
| | 1054 | | { |
| 0 | 1055 | | if (location == null) |
| | 1056 | | { |
| 0 | 1057 | | throw new ArgumentNullException(nameof(location)); |
| | 1058 | | } |
| | 1059 | |
|
| 0 | 1060 | | using var message = CreateListAutoApprovedPrivateLinkServicesRequest(location); |
| 0 | 1061 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1062 | | switch (message.Response.Status) |
| | 1063 | | { |
| | 1064 | | case 200: |
| | 1065 | | { |
| 0 | 1066 | | AutoApprovedPrivateLinkServicesResult value = default; |
| 0 | 1067 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1068 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1069 | | { |
| 0 | 1070 | | value = null; |
| | 1071 | | } |
| | 1072 | | else |
| | 1073 | | { |
| 0 | 1074 | | value = AutoApprovedPrivateLinkServicesResult.DeserializeAutoApprovedPrivateLinkServicesResu |
| | 1075 | | } |
| 0 | 1076 | | return Response.FromValue(value, message.Response); |
| | 1077 | | } |
| | 1078 | | default: |
| 0 | 1079 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1080 | | } |
| 0 | 1081 | | } |
| | 1082 | |
|
| | 1083 | | /// <summary> Returns all of the private link service ids that can be linked to a Private Endpoint with auto app |
| | 1084 | | /// <param name="location"> The location of the domain name. </param> |
| | 1085 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1086 | | public Response<AutoApprovedPrivateLinkServicesResult> ListAutoApprovedPrivateLinkServices(string location, Canc |
| | 1087 | | { |
| 0 | 1088 | | if (location == null) |
| | 1089 | | { |
| 0 | 1090 | | throw new ArgumentNullException(nameof(location)); |
| | 1091 | | } |
| | 1092 | |
|
| 0 | 1093 | | using var message = CreateListAutoApprovedPrivateLinkServicesRequest(location); |
| 0 | 1094 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1095 | | switch (message.Response.Status) |
| | 1096 | | { |
| | 1097 | | case 200: |
| | 1098 | | { |
| 0 | 1099 | | AutoApprovedPrivateLinkServicesResult value = default; |
| 0 | 1100 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1101 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1102 | | { |
| 0 | 1103 | | value = null; |
| | 1104 | | } |
| | 1105 | | else |
| | 1106 | | { |
| 0 | 1107 | | value = AutoApprovedPrivateLinkServicesResult.DeserializeAutoApprovedPrivateLinkServicesResu |
| | 1108 | | } |
| 0 | 1109 | | return Response.FromValue(value, message.Response); |
| | 1110 | | } |
| | 1111 | | default: |
| 0 | 1112 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1113 | | } |
| 0 | 1114 | | } |
| | 1115 | |
|
| | 1116 | | internal HttpMessage CreateListAutoApprovedPrivateLinkServicesByResourceGroupRequest(string location, string res |
| | 1117 | | { |
| 0 | 1118 | | var message = _pipeline.CreateMessage(); |
| 0 | 1119 | | var request = message.Request; |
| 0 | 1120 | | request.Method = RequestMethod.Get; |
| 0 | 1121 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1122 | | uri.Reset(endpoint); |
| 0 | 1123 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 1124 | | uri.AppendPath(subscriptionId, true); |
| 0 | 1125 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 1126 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 1127 | | uri.AppendPath("/providers/Microsoft.Network/locations/", false); |
| 0 | 1128 | | uri.AppendPath(location, true); |
| 0 | 1129 | | uri.AppendPath("/autoApprovedPrivateLinkServices", false); |
| 0 | 1130 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 1131 | | request.Uri = uri; |
| 0 | 1132 | | return message; |
| | 1133 | | } |
| | 1134 | |
|
| | 1135 | | /// <summary> Returns all of the private link service ids that can be linked to a Private Endpoint with auto app |
| | 1136 | | /// <param name="location"> The location of the domain name. </param> |
| | 1137 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1138 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1139 | | public async Task<Response<AutoApprovedPrivateLinkServicesResult>> ListAutoApprovedPrivateLinkServicesByResource |
| | 1140 | | { |
| 0 | 1141 | | if (location == null) |
| | 1142 | | { |
| 0 | 1143 | | throw new ArgumentNullException(nameof(location)); |
| | 1144 | | } |
| 0 | 1145 | | if (resourceGroupName == null) |
| | 1146 | | { |
| 0 | 1147 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1148 | | } |
| | 1149 | |
|
| 0 | 1150 | | using var message = CreateListAutoApprovedPrivateLinkServicesByResourceGroupRequest(location, resourceGroupN |
| 0 | 1151 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1152 | | switch (message.Response.Status) |
| | 1153 | | { |
| | 1154 | | case 200: |
| | 1155 | | { |
| 0 | 1156 | | AutoApprovedPrivateLinkServicesResult value = default; |
| 0 | 1157 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1158 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1159 | | { |
| 0 | 1160 | | value = null; |
| | 1161 | | } |
| | 1162 | | else |
| | 1163 | | { |
| 0 | 1164 | | value = AutoApprovedPrivateLinkServicesResult.DeserializeAutoApprovedPrivateLinkServicesResu |
| | 1165 | | } |
| 0 | 1166 | | return Response.FromValue(value, message.Response); |
| | 1167 | | } |
| | 1168 | | default: |
| 0 | 1169 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1170 | | } |
| 0 | 1171 | | } |
| | 1172 | |
|
| | 1173 | | /// <summary> Returns all of the private link service ids that can be linked to a Private Endpoint with auto app |
| | 1174 | | /// <param name="location"> The location of the domain name. </param> |
| | 1175 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1176 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1177 | | public Response<AutoApprovedPrivateLinkServicesResult> ListAutoApprovedPrivateLinkServicesByResourceGroup(string |
| | 1178 | | { |
| 0 | 1179 | | if (location == null) |
| | 1180 | | { |
| 0 | 1181 | | throw new ArgumentNullException(nameof(location)); |
| | 1182 | | } |
| 0 | 1183 | | if (resourceGroupName == null) |
| | 1184 | | { |
| 0 | 1185 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1186 | | } |
| | 1187 | |
|
| 0 | 1188 | | using var message = CreateListAutoApprovedPrivateLinkServicesByResourceGroupRequest(location, resourceGroupN |
| 0 | 1189 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1190 | | switch (message.Response.Status) |
| | 1191 | | { |
| | 1192 | | case 200: |
| | 1193 | | { |
| 0 | 1194 | | AutoApprovedPrivateLinkServicesResult value = default; |
| 0 | 1195 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1196 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1197 | | { |
| 0 | 1198 | | value = null; |
| | 1199 | | } |
| | 1200 | | else |
| | 1201 | | { |
| 0 | 1202 | | value = AutoApprovedPrivateLinkServicesResult.DeserializeAutoApprovedPrivateLinkServicesResu |
| | 1203 | | } |
| 0 | 1204 | | return Response.FromValue(value, message.Response); |
| | 1205 | | } |
| | 1206 | | default: |
| 0 | 1207 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1208 | | } |
| 0 | 1209 | | } |
| | 1210 | |
|
| | 1211 | | internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName) |
| | 1212 | | { |
| 0 | 1213 | | var message = _pipeline.CreateMessage(); |
| 0 | 1214 | | var request = message.Request; |
| 0 | 1215 | | request.Method = RequestMethod.Get; |
| 0 | 1216 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1217 | | uri.Reset(endpoint); |
| 0 | 1218 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 1219 | | request.Uri = uri; |
| 0 | 1220 | | return message; |
| | 1221 | | } |
| | 1222 | |
|
| | 1223 | | /// <summary> Gets all private link services in a resource group. </summary> |
| | 1224 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1225 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1226 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1227 | | public async Task<Response<PrivateLinkServiceListResult>> ListNextPageAsync(string nextLink, string resourceGrou |
| | 1228 | | { |
| 0 | 1229 | | if (nextLink == null) |
| | 1230 | | { |
| 0 | 1231 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1232 | | } |
| 0 | 1233 | | if (resourceGroupName == null) |
| | 1234 | | { |
| 0 | 1235 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1236 | | } |
| | 1237 | |
|
| 0 | 1238 | | using var message = CreateListNextPageRequest(nextLink, resourceGroupName); |
| 0 | 1239 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1240 | | switch (message.Response.Status) |
| | 1241 | | { |
| | 1242 | | case 200: |
| | 1243 | | { |
| 0 | 1244 | | PrivateLinkServiceListResult value = default; |
| 0 | 1245 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1246 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1247 | | { |
| 0 | 1248 | | value = null; |
| | 1249 | | } |
| | 1250 | | else |
| | 1251 | | { |
| 0 | 1252 | | value = PrivateLinkServiceListResult.DeserializePrivateLinkServiceListResult(document.RootEl |
| | 1253 | | } |
| 0 | 1254 | | return Response.FromValue(value, message.Response); |
| | 1255 | | } |
| | 1256 | | default: |
| 0 | 1257 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1258 | | } |
| 0 | 1259 | | } |
| | 1260 | |
|
| | 1261 | | /// <summary> Gets all private link services in a resource group. </summary> |
| | 1262 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1263 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1264 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1265 | | public Response<PrivateLinkServiceListResult> ListNextPage(string nextLink, string resourceGroupName, Cancellati |
| | 1266 | | { |
| 0 | 1267 | | if (nextLink == null) |
| | 1268 | | { |
| 0 | 1269 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1270 | | } |
| 0 | 1271 | | if (resourceGroupName == null) |
| | 1272 | | { |
| 0 | 1273 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1274 | | } |
| | 1275 | |
|
| 0 | 1276 | | using var message = CreateListNextPageRequest(nextLink, resourceGroupName); |
| 0 | 1277 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1278 | | switch (message.Response.Status) |
| | 1279 | | { |
| | 1280 | | case 200: |
| | 1281 | | { |
| 0 | 1282 | | PrivateLinkServiceListResult value = default; |
| 0 | 1283 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1284 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1285 | | { |
| 0 | 1286 | | value = null; |
| | 1287 | | } |
| | 1288 | | else |
| | 1289 | | { |
| 0 | 1290 | | value = PrivateLinkServiceListResult.DeserializePrivateLinkServiceListResult(document.RootEl |
| | 1291 | | } |
| 0 | 1292 | | return Response.FromValue(value, message.Response); |
| | 1293 | | } |
| | 1294 | | default: |
| 0 | 1295 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1296 | | } |
| 0 | 1297 | | } |
| | 1298 | |
|
| | 1299 | | internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink) |
| | 1300 | | { |
| 0 | 1301 | | var message = _pipeline.CreateMessage(); |
| 0 | 1302 | | var request = message.Request; |
| 0 | 1303 | | request.Method = RequestMethod.Get; |
| 0 | 1304 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1305 | | uri.Reset(endpoint); |
| 0 | 1306 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 1307 | | request.Uri = uri; |
| 0 | 1308 | | return message; |
| | 1309 | | } |
| | 1310 | |
|
| | 1311 | | /// <summary> Gets all private link service in a subscription. </summary> |
| | 1312 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1313 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1314 | | public async Task<Response<PrivateLinkServiceListResult>> ListBySubscriptionNextPageAsync(string nextLink, Cance |
| | 1315 | | { |
| 0 | 1316 | | if (nextLink == null) |
| | 1317 | | { |
| 0 | 1318 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1319 | | } |
| | 1320 | |
|
| 0 | 1321 | | using var message = CreateListBySubscriptionNextPageRequest(nextLink); |
| 0 | 1322 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1323 | | switch (message.Response.Status) |
| | 1324 | | { |
| | 1325 | | case 200: |
| | 1326 | | { |
| 0 | 1327 | | PrivateLinkServiceListResult value = default; |
| 0 | 1328 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1329 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1330 | | { |
| 0 | 1331 | | value = null; |
| | 1332 | | } |
| | 1333 | | else |
| | 1334 | | { |
| 0 | 1335 | | value = PrivateLinkServiceListResult.DeserializePrivateLinkServiceListResult(document.RootEl |
| | 1336 | | } |
| 0 | 1337 | | return Response.FromValue(value, message.Response); |
| | 1338 | | } |
| | 1339 | | default: |
| 0 | 1340 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1341 | | } |
| 0 | 1342 | | } |
| | 1343 | |
|
| | 1344 | | /// <summary> Gets all private link service in a subscription. </summary> |
| | 1345 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1346 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1347 | | public Response<PrivateLinkServiceListResult> ListBySubscriptionNextPage(string nextLink, CancellationToken canc |
| | 1348 | | { |
| 0 | 1349 | | if (nextLink == null) |
| | 1350 | | { |
| 0 | 1351 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1352 | | } |
| | 1353 | |
|
| 0 | 1354 | | using var message = CreateListBySubscriptionNextPageRequest(nextLink); |
| 0 | 1355 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1356 | | switch (message.Response.Status) |
| | 1357 | | { |
| | 1358 | | case 200: |
| | 1359 | | { |
| 0 | 1360 | | PrivateLinkServiceListResult value = default; |
| 0 | 1361 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1362 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1363 | | { |
| 0 | 1364 | | value = null; |
| | 1365 | | } |
| | 1366 | | else |
| | 1367 | | { |
| 0 | 1368 | | value = PrivateLinkServiceListResult.DeserializePrivateLinkServiceListResult(document.RootEl |
| | 1369 | | } |
| 0 | 1370 | | return Response.FromValue(value, message.Response); |
| | 1371 | | } |
| | 1372 | | default: |
| 0 | 1373 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1374 | | } |
| 0 | 1375 | | } |
| | 1376 | |
|
| | 1377 | | internal HttpMessage CreateListPrivateEndpointConnectionsNextPageRequest(string nextLink, string resourceGroupNa |
| | 1378 | | { |
| 0 | 1379 | | var message = _pipeline.CreateMessage(); |
| 0 | 1380 | | var request = message.Request; |
| 0 | 1381 | | request.Method = RequestMethod.Get; |
| 0 | 1382 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1383 | | uri.Reset(endpoint); |
| 0 | 1384 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 1385 | | request.Uri = uri; |
| 0 | 1386 | | return message; |
| | 1387 | | } |
| | 1388 | |
|
| | 1389 | | /// <summary> Gets all private end point connections for a specific private link service. </summary> |
| | 1390 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1391 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1392 | | /// <param name="serviceName"> The name of the private link service. </param> |
| | 1393 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1394 | | public async Task<Response<PrivateEndpointConnectionListResult>> ListPrivateEndpointConnectionsNextPageAsync(str |
| | 1395 | | { |
| 0 | 1396 | | if (nextLink == null) |
| | 1397 | | { |
| 0 | 1398 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1399 | | } |
| 0 | 1400 | | if (resourceGroupName == null) |
| | 1401 | | { |
| 0 | 1402 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1403 | | } |
| 0 | 1404 | | if (serviceName == null) |
| | 1405 | | { |
| 0 | 1406 | | throw new ArgumentNullException(nameof(serviceName)); |
| | 1407 | | } |
| | 1408 | |
|
| 0 | 1409 | | using var message = CreateListPrivateEndpointConnectionsNextPageRequest(nextLink, resourceGroupName, service |
| 0 | 1410 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1411 | | switch (message.Response.Status) |
| | 1412 | | { |
| | 1413 | | case 200: |
| | 1414 | | { |
| 0 | 1415 | | PrivateEndpointConnectionListResult value = default; |
| 0 | 1416 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1417 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1418 | | { |
| 0 | 1419 | | value = null; |
| | 1420 | | } |
| | 1421 | | else |
| | 1422 | | { |
| 0 | 1423 | | value = PrivateEndpointConnectionListResult.DeserializePrivateEndpointConnectionListResult(d |
| | 1424 | | } |
| 0 | 1425 | | return Response.FromValue(value, message.Response); |
| | 1426 | | } |
| | 1427 | | default: |
| 0 | 1428 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1429 | | } |
| 0 | 1430 | | } |
| | 1431 | |
|
| | 1432 | | /// <summary> Gets all private end point connections for a specific private link service. </summary> |
| | 1433 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1434 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1435 | | /// <param name="serviceName"> The name of the private link service. </param> |
| | 1436 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1437 | | public Response<PrivateEndpointConnectionListResult> ListPrivateEndpointConnectionsNextPage(string nextLink, str |
| | 1438 | | { |
| 0 | 1439 | | if (nextLink == null) |
| | 1440 | | { |
| 0 | 1441 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1442 | | } |
| 0 | 1443 | | if (resourceGroupName == null) |
| | 1444 | | { |
| 0 | 1445 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1446 | | } |
| 0 | 1447 | | if (serviceName == null) |
| | 1448 | | { |
| 0 | 1449 | | throw new ArgumentNullException(nameof(serviceName)); |
| | 1450 | | } |
| | 1451 | |
|
| 0 | 1452 | | using var message = CreateListPrivateEndpointConnectionsNextPageRequest(nextLink, resourceGroupName, service |
| 0 | 1453 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1454 | | switch (message.Response.Status) |
| | 1455 | | { |
| | 1456 | | case 200: |
| | 1457 | | { |
| 0 | 1458 | | PrivateEndpointConnectionListResult value = default; |
| 0 | 1459 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1460 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1461 | | { |
| 0 | 1462 | | value = null; |
| | 1463 | | } |
| | 1464 | | else |
| | 1465 | | { |
| 0 | 1466 | | value = PrivateEndpointConnectionListResult.DeserializePrivateEndpointConnectionListResult(d |
| | 1467 | | } |
| 0 | 1468 | | return Response.FromValue(value, message.Response); |
| | 1469 | | } |
| | 1470 | | default: |
| 0 | 1471 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1472 | | } |
| 0 | 1473 | | } |
| | 1474 | |
|
| | 1475 | | internal HttpMessage CreateListAutoApprovedPrivateLinkServicesNextPageRequest(string nextLink, string location) |
| | 1476 | | { |
| 0 | 1477 | | var message = _pipeline.CreateMessage(); |
| 0 | 1478 | | var request = message.Request; |
| 0 | 1479 | | request.Method = RequestMethod.Get; |
| 0 | 1480 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1481 | | uri.Reset(endpoint); |
| 0 | 1482 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 1483 | | request.Uri = uri; |
| 0 | 1484 | | return message; |
| | 1485 | | } |
| | 1486 | |
|
| | 1487 | | /// <summary> Returns all of the private link service ids that can be linked to a Private Endpoint with auto app |
| | 1488 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1489 | | /// <param name="location"> The location of the domain name. </param> |
| | 1490 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1491 | | public async Task<Response<AutoApprovedPrivateLinkServicesResult>> ListAutoApprovedPrivateLinkServicesNextPageAs |
| | 1492 | | { |
| 0 | 1493 | | if (nextLink == null) |
| | 1494 | | { |
| 0 | 1495 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1496 | | } |
| 0 | 1497 | | if (location == null) |
| | 1498 | | { |
| 0 | 1499 | | throw new ArgumentNullException(nameof(location)); |
| | 1500 | | } |
| | 1501 | |
|
| 0 | 1502 | | using var message = CreateListAutoApprovedPrivateLinkServicesNextPageRequest(nextLink, location); |
| 0 | 1503 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1504 | | switch (message.Response.Status) |
| | 1505 | | { |
| | 1506 | | case 200: |
| | 1507 | | { |
| 0 | 1508 | | AutoApprovedPrivateLinkServicesResult value = default; |
| 0 | 1509 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1510 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1511 | | { |
| 0 | 1512 | | value = null; |
| | 1513 | | } |
| | 1514 | | else |
| | 1515 | | { |
| 0 | 1516 | | value = AutoApprovedPrivateLinkServicesResult.DeserializeAutoApprovedPrivateLinkServicesResu |
| | 1517 | | } |
| 0 | 1518 | | return Response.FromValue(value, message.Response); |
| | 1519 | | } |
| | 1520 | | default: |
| 0 | 1521 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1522 | | } |
| 0 | 1523 | | } |
| | 1524 | |
|
| | 1525 | | /// <summary> Returns all of the private link service ids that can be linked to a Private Endpoint with auto app |
| | 1526 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1527 | | /// <param name="location"> The location of the domain name. </param> |
| | 1528 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1529 | | public Response<AutoApprovedPrivateLinkServicesResult> ListAutoApprovedPrivateLinkServicesNextPage(string nextLi |
| | 1530 | | { |
| 0 | 1531 | | if (nextLink == null) |
| | 1532 | | { |
| 0 | 1533 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1534 | | } |
| 0 | 1535 | | if (location == null) |
| | 1536 | | { |
| 0 | 1537 | | throw new ArgumentNullException(nameof(location)); |
| | 1538 | | } |
| | 1539 | |
|
| 0 | 1540 | | using var message = CreateListAutoApprovedPrivateLinkServicesNextPageRequest(nextLink, location); |
| 0 | 1541 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1542 | | switch (message.Response.Status) |
| | 1543 | | { |
| | 1544 | | case 200: |
| | 1545 | | { |
| 0 | 1546 | | AutoApprovedPrivateLinkServicesResult value = default; |
| 0 | 1547 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1548 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1549 | | { |
| 0 | 1550 | | value = null; |
| | 1551 | | } |
| | 1552 | | else |
| | 1553 | | { |
| 0 | 1554 | | value = AutoApprovedPrivateLinkServicesResult.DeserializeAutoApprovedPrivateLinkServicesResu |
| | 1555 | | } |
| 0 | 1556 | | return Response.FromValue(value, message.Response); |
| | 1557 | | } |
| | 1558 | | default: |
| 0 | 1559 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1560 | | } |
| 0 | 1561 | | } |
| | 1562 | |
|
| | 1563 | | internal HttpMessage CreateListAutoApprovedPrivateLinkServicesByResourceGroupNextPageRequest(string nextLink, st |
| | 1564 | | { |
| 0 | 1565 | | var message = _pipeline.CreateMessage(); |
| 0 | 1566 | | var request = message.Request; |
| 0 | 1567 | | request.Method = RequestMethod.Get; |
| 0 | 1568 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1569 | | uri.Reset(endpoint); |
| 0 | 1570 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 1571 | | request.Uri = uri; |
| 0 | 1572 | | return message; |
| | 1573 | | } |
| | 1574 | |
|
| | 1575 | | /// <summary> Returns all of the private link service ids that can be linked to a Private Endpoint with auto app |
| | 1576 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1577 | | /// <param name="location"> The location of the domain name. </param> |
| | 1578 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1579 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1580 | | public async Task<Response<AutoApprovedPrivateLinkServicesResult>> ListAutoApprovedPrivateLinkServicesByResource |
| | 1581 | | { |
| 0 | 1582 | | if (nextLink == null) |
| | 1583 | | { |
| 0 | 1584 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1585 | | } |
| 0 | 1586 | | if (location == null) |
| | 1587 | | { |
| 0 | 1588 | | throw new ArgumentNullException(nameof(location)); |
| | 1589 | | } |
| 0 | 1590 | | if (resourceGroupName == null) |
| | 1591 | | { |
| 0 | 1592 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1593 | | } |
| | 1594 | |
|
| 0 | 1595 | | using var message = CreateListAutoApprovedPrivateLinkServicesByResourceGroupNextPageRequest(nextLink, locati |
| 0 | 1596 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1597 | | switch (message.Response.Status) |
| | 1598 | | { |
| | 1599 | | case 200: |
| | 1600 | | { |
| 0 | 1601 | | AutoApprovedPrivateLinkServicesResult value = default; |
| 0 | 1602 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1603 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1604 | | { |
| 0 | 1605 | | value = null; |
| | 1606 | | } |
| | 1607 | | else |
| | 1608 | | { |
| 0 | 1609 | | value = AutoApprovedPrivateLinkServicesResult.DeserializeAutoApprovedPrivateLinkServicesResu |
| | 1610 | | } |
| 0 | 1611 | | return Response.FromValue(value, message.Response); |
| | 1612 | | } |
| | 1613 | | default: |
| 0 | 1614 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1615 | | } |
| 0 | 1616 | | } |
| | 1617 | |
|
| | 1618 | | /// <summary> Returns all of the private link service ids that can be linked to a Private Endpoint with auto app |
| | 1619 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1620 | | /// <param name="location"> The location of the domain name. </param> |
| | 1621 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1622 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1623 | | public Response<AutoApprovedPrivateLinkServicesResult> ListAutoApprovedPrivateLinkServicesByResourceGroupNextPag |
| | 1624 | | { |
| 0 | 1625 | | if (nextLink == null) |
| | 1626 | | { |
| 0 | 1627 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1628 | | } |
| 0 | 1629 | | if (location == null) |
| | 1630 | | { |
| 0 | 1631 | | throw new ArgumentNullException(nameof(location)); |
| | 1632 | | } |
| 0 | 1633 | | if (resourceGroupName == null) |
| | 1634 | | { |
| 0 | 1635 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1636 | | } |
| | 1637 | |
|
| 0 | 1638 | | using var message = CreateListAutoApprovedPrivateLinkServicesByResourceGroupNextPageRequest(nextLink, locati |
| 0 | 1639 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1640 | | switch (message.Response.Status) |
| | 1641 | | { |
| | 1642 | | case 200: |
| | 1643 | | { |
| 0 | 1644 | | AutoApprovedPrivateLinkServicesResult value = default; |
| 0 | 1645 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1646 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1647 | | { |
| 0 | 1648 | | value = null; |
| | 1649 | | } |
| | 1650 | | else |
| | 1651 | | { |
| 0 | 1652 | | value = AutoApprovedPrivateLinkServicesResult.DeserializeAutoApprovedPrivateLinkServicesResu |
| | 1653 | | } |
| 0 | 1654 | | return Response.FromValue(value, message.Response); |
| | 1655 | | } |
| | 1656 | | default: |
| 0 | 1657 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1658 | | } |
| 0 | 1659 | | } |
| | 1660 | | } |
| | 1661 | | } |