| | 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 PublicIPAddressesRestOperations |
| | 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 PublicIPAddressesRestOperations. </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 |
| 220 | 32 | | public PublicIPAddressesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscr |
| | 33 | | { |
| 220 | 34 | | if (subscriptionId == null) |
| | 35 | | { |
| 0 | 36 | | throw new ArgumentNullException(nameof(subscriptionId)); |
| | 37 | | } |
| 220 | 38 | | endpoint ??= new Uri("https://management.azure.com"); |
| | 39 | |
|
| 220 | 40 | | this.subscriptionId = subscriptionId; |
| 220 | 41 | | this.endpoint = endpoint; |
| 220 | 42 | | _clientDiagnostics = clientDiagnostics; |
| 220 | 43 | | _pipeline = pipeline; |
| 220 | 44 | | } |
| | 45 | |
|
| | 46 | | internal HttpMessage CreateDeleteRequest(string resourceGroupName, string publicIpAddressName) |
| | 47 | | { |
| 88 | 48 | | var message = _pipeline.CreateMessage(); |
| 88 | 49 | | var request = message.Request; |
| 88 | 50 | | request.Method = RequestMethod.Delete; |
| 88 | 51 | | var uri = new RawRequestUriBuilder(); |
| 88 | 52 | | uri.Reset(endpoint); |
| 88 | 53 | | uri.AppendPath("/subscriptions/", false); |
| 88 | 54 | | uri.AppendPath(subscriptionId, true); |
| 88 | 55 | | uri.AppendPath("/resourceGroups/", false); |
| 88 | 56 | | uri.AppendPath(resourceGroupName, true); |
| 88 | 57 | | uri.AppendPath("/providers/Microsoft.Network/publicIPAddresses/", false); |
| 88 | 58 | | uri.AppendPath(publicIpAddressName, true); |
| 88 | 59 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 88 | 60 | | request.Uri = uri; |
| 88 | 61 | | return message; |
| | 62 | | } |
| | 63 | |
|
| | 64 | | /// <summary> Deletes the specified public IP address. </summary> |
| | 65 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 66 | | /// <param name="publicIpAddressName"> The name of the subnet. </param> |
| | 67 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 68 | | public async Task<Response> DeleteAsync(string resourceGroupName, string publicIpAddressName, CancellationToken |
| | 69 | | { |
| 22 | 70 | | if (resourceGroupName == null) |
| | 71 | | { |
| 0 | 72 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 73 | | } |
| 22 | 74 | | if (publicIpAddressName == null) |
| | 75 | | { |
| 0 | 76 | | throw new ArgumentNullException(nameof(publicIpAddressName)); |
| | 77 | | } |
| | 78 | |
|
| 22 | 79 | | using var message = CreateDeleteRequest(resourceGroupName, publicIpAddressName); |
| 22 | 80 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 22 | 81 | | switch (message.Response.Status) |
| | 82 | | { |
| | 83 | | case 200: |
| | 84 | | case 202: |
| | 85 | | case 204: |
| 22 | 86 | | return message.Response; |
| | 87 | | default: |
| 0 | 88 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 89 | | } |
| 22 | 90 | | } |
| | 91 | |
|
| | 92 | | /// <summary> Deletes the specified public IP address. </summary> |
| | 93 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 94 | | /// <param name="publicIpAddressName"> The name of the subnet. </param> |
| | 95 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 96 | | public Response Delete(string resourceGroupName, string publicIpAddressName, CancellationToken cancellationToken |
| | 97 | | { |
| 22 | 98 | | if (resourceGroupName == null) |
| | 99 | | { |
| 0 | 100 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 101 | | } |
| 22 | 102 | | if (publicIpAddressName == null) |
| | 103 | | { |
| 0 | 104 | | throw new ArgumentNullException(nameof(publicIpAddressName)); |
| | 105 | | } |
| | 106 | |
|
| 22 | 107 | | using var message = CreateDeleteRequest(resourceGroupName, publicIpAddressName); |
| 22 | 108 | | _pipeline.Send(message, cancellationToken); |
| 22 | 109 | | switch (message.Response.Status) |
| | 110 | | { |
| | 111 | | case 200: |
| | 112 | | case 202: |
| | 113 | | case 204: |
| 22 | 114 | | return message.Response; |
| | 115 | | default: |
| 0 | 116 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 117 | | } |
| 22 | 118 | | } |
| | 119 | |
|
| | 120 | | internal HttpMessage CreateGetRequest(string resourceGroupName, string publicIpAddressName, string expand) |
| | 121 | | { |
| 64 | 122 | | var message = _pipeline.CreateMessage(); |
| 64 | 123 | | var request = message.Request; |
| 64 | 124 | | request.Method = RequestMethod.Get; |
| 64 | 125 | | var uri = new RawRequestUriBuilder(); |
| 64 | 126 | | uri.Reset(endpoint); |
| 64 | 127 | | uri.AppendPath("/subscriptions/", false); |
| 64 | 128 | | uri.AppendPath(subscriptionId, true); |
| 64 | 129 | | uri.AppendPath("/resourceGroups/", false); |
| 64 | 130 | | uri.AppendPath(resourceGroupName, true); |
| 64 | 131 | | uri.AppendPath("/providers/Microsoft.Network/publicIPAddresses/", false); |
| 64 | 132 | | uri.AppendPath(publicIpAddressName, true); |
| 64 | 133 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 64 | 134 | | if (expand != null) |
| | 135 | | { |
| 4 | 136 | | uri.AppendQuery("$expand", expand, true); |
| | 137 | | } |
| 64 | 138 | | request.Uri = uri; |
| 64 | 139 | | return message; |
| | 140 | | } |
| | 141 | |
|
| | 142 | | /// <summary> Gets the specified public IP address in a specified resource group. </summary> |
| | 143 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 144 | | /// <param name="publicIpAddressName"> The name of the subnet. </param> |
| | 145 | | /// <param name="expand"> Expands referenced resources. </param> |
| | 146 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 147 | | public async Task<Response<PublicIPAddress>> GetAsync(string resourceGroupName, string publicIpAddressName, stri |
| | 148 | | { |
| 32 | 149 | | if (resourceGroupName == null) |
| | 150 | | { |
| 0 | 151 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 152 | | } |
| 32 | 153 | | if (publicIpAddressName == null) |
| | 154 | | { |
| 0 | 155 | | throw new ArgumentNullException(nameof(publicIpAddressName)); |
| | 156 | | } |
| | 157 | |
|
| 32 | 158 | | using var message = CreateGetRequest(resourceGroupName, publicIpAddressName, expand); |
| 32 | 159 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 32 | 160 | | switch (message.Response.Status) |
| | 161 | | { |
| | 162 | | case 200: |
| | 163 | | { |
| 32 | 164 | | PublicIPAddress value = default; |
| 32 | 165 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 32 | 166 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 167 | | { |
| 0 | 168 | | value = null; |
| | 169 | | } |
| | 170 | | else |
| | 171 | | { |
| 32 | 172 | | value = PublicIPAddress.DeserializePublicIPAddress(document.RootElement); |
| | 173 | | } |
| 32 | 174 | | return Response.FromValue(value, message.Response); |
| | 175 | | } |
| | 176 | | default: |
| 0 | 177 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 178 | | } |
| 32 | 179 | | } |
| | 180 | |
|
| | 181 | | /// <summary> Gets the specified public IP address in a specified resource group. </summary> |
| | 182 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 183 | | /// <param name="publicIpAddressName"> The name of the subnet. </param> |
| | 184 | | /// <param name="expand"> Expands referenced resources. </param> |
| | 185 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 186 | | public Response<PublicIPAddress> Get(string resourceGroupName, string publicIpAddressName, string expand = null, |
| | 187 | | { |
| 32 | 188 | | if (resourceGroupName == null) |
| | 189 | | { |
| 0 | 190 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 191 | | } |
| 32 | 192 | | if (publicIpAddressName == null) |
| | 193 | | { |
| 0 | 194 | | throw new ArgumentNullException(nameof(publicIpAddressName)); |
| | 195 | | } |
| | 196 | |
|
| 32 | 197 | | using var message = CreateGetRequest(resourceGroupName, publicIpAddressName, expand); |
| 32 | 198 | | _pipeline.Send(message, cancellationToken); |
| 32 | 199 | | switch (message.Response.Status) |
| | 200 | | { |
| | 201 | | case 200: |
| | 202 | | { |
| 32 | 203 | | PublicIPAddress value = default; |
| 32 | 204 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 32 | 205 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 206 | | { |
| 0 | 207 | | value = null; |
| | 208 | | } |
| | 209 | | else |
| | 210 | | { |
| 32 | 211 | | value = PublicIPAddress.DeserializePublicIPAddress(document.RootElement); |
| | 212 | | } |
| 32 | 213 | | return Response.FromValue(value, message.Response); |
| | 214 | | } |
| | 215 | | default: |
| 0 | 216 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 217 | | } |
| 32 | 218 | | } |
| | 219 | |
|
| | 220 | | internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string publicIpAddressName, PublicIPA |
| | 221 | | { |
| 120 | 222 | | var message = _pipeline.CreateMessage(); |
| 120 | 223 | | var request = message.Request; |
| 120 | 224 | | request.Method = RequestMethod.Put; |
| 120 | 225 | | var uri = new RawRequestUriBuilder(); |
| 120 | 226 | | uri.Reset(endpoint); |
| 120 | 227 | | uri.AppendPath("/subscriptions/", false); |
| 120 | 228 | | uri.AppendPath(subscriptionId, true); |
| 120 | 229 | | uri.AppendPath("/resourceGroups/", false); |
| 120 | 230 | | uri.AppendPath(resourceGroupName, true); |
| 120 | 231 | | uri.AppendPath("/providers/Microsoft.Network/publicIPAddresses/", false); |
| 120 | 232 | | uri.AppendPath(publicIpAddressName, true); |
| 120 | 233 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 120 | 234 | | request.Uri = uri; |
| 120 | 235 | | request.Headers.Add("Content-Type", "application/json"); |
| 120 | 236 | | var content = new Utf8JsonRequestContent(); |
| 120 | 237 | | content.JsonWriter.WriteObjectValue(parameters); |
| 120 | 238 | | request.Content = content; |
| 120 | 239 | | return message; |
| | 240 | | } |
| | 241 | |
|
| | 242 | | /// <summary> Creates or updates a static or dynamic public IP address. </summary> |
| | 243 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 244 | | /// <param name="publicIpAddressName"> The name of the public IP address. </param> |
| | 245 | | /// <param name="parameters"> Parameters supplied to the create or update public IP address operation. </param> |
| | 246 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 247 | | public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string publicIpAddressName, PublicIPAd |
| | 248 | | { |
| 30 | 249 | | if (resourceGroupName == null) |
| | 250 | | { |
| 0 | 251 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 252 | | } |
| 30 | 253 | | if (publicIpAddressName == null) |
| | 254 | | { |
| 0 | 255 | | throw new ArgumentNullException(nameof(publicIpAddressName)); |
| | 256 | | } |
| 30 | 257 | | if (parameters == null) |
| | 258 | | { |
| 0 | 259 | | throw new ArgumentNullException(nameof(parameters)); |
| | 260 | | } |
| | 261 | |
|
| 30 | 262 | | using var message = CreateCreateOrUpdateRequest(resourceGroupName, publicIpAddressName, parameters); |
| 30 | 263 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 30 | 264 | | switch (message.Response.Status) |
| | 265 | | { |
| | 266 | | case 200: |
| | 267 | | case 201: |
| 30 | 268 | | return message.Response; |
| | 269 | | default: |
| 0 | 270 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 271 | | } |
| 30 | 272 | | } |
| | 273 | |
|
| | 274 | | /// <summary> Creates or updates a static or dynamic public IP address. </summary> |
| | 275 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 276 | | /// <param name="publicIpAddressName"> The name of the public IP address. </param> |
| | 277 | | /// <param name="parameters"> Parameters supplied to the create or update public IP address operation. </param> |
| | 278 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 279 | | public Response CreateOrUpdate(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, |
| | 280 | | { |
| 30 | 281 | | if (resourceGroupName == null) |
| | 282 | | { |
| 0 | 283 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 284 | | } |
| 30 | 285 | | if (publicIpAddressName == null) |
| | 286 | | { |
| 0 | 287 | | throw new ArgumentNullException(nameof(publicIpAddressName)); |
| | 288 | | } |
| 30 | 289 | | if (parameters == null) |
| | 290 | | { |
| 0 | 291 | | throw new ArgumentNullException(nameof(parameters)); |
| | 292 | | } |
| | 293 | |
|
| 30 | 294 | | using var message = CreateCreateOrUpdateRequest(resourceGroupName, publicIpAddressName, parameters); |
| 30 | 295 | | _pipeline.Send(message, cancellationToken); |
| 30 | 296 | | switch (message.Response.Status) |
| | 297 | | { |
| | 298 | | case 200: |
| | 299 | | case 201: |
| 30 | 300 | | return message.Response; |
| | 301 | | default: |
| 0 | 302 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 303 | | } |
| 30 | 304 | | } |
| | 305 | |
|
| | 306 | | internal HttpMessage CreateUpdateTagsRequest(string resourceGroupName, string publicIpAddressName, TagsObject pa |
| | 307 | | { |
| 0 | 308 | | var message = _pipeline.CreateMessage(); |
| 0 | 309 | | var request = message.Request; |
| 0 | 310 | | request.Method = RequestMethod.Patch; |
| 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/publicIPAddresses/", false); |
| 0 | 318 | | uri.AppendPath(publicIpAddressName, true); |
| 0 | 319 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 320 | | request.Uri = uri; |
| 0 | 321 | | request.Headers.Add("Content-Type", "application/json"); |
| 0 | 322 | | var content = new Utf8JsonRequestContent(); |
| 0 | 323 | | content.JsonWriter.WriteObjectValue(parameters); |
| 0 | 324 | | request.Content = content; |
| 0 | 325 | | return message; |
| | 326 | | } |
| | 327 | |
|
| | 328 | | /// <summary> Updates public IP address tags. </summary> |
| | 329 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 330 | | /// <param name="publicIpAddressName"> The name of the public IP address. </param> |
| | 331 | | /// <param name="parameters"> Parameters supplied to update public IP address tags. </param> |
| | 332 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 333 | | public async Task<Response<PublicIPAddress>> UpdateTagsAsync(string resourceGroupName, string publicIpAddressNam |
| | 334 | | { |
| 0 | 335 | | if (resourceGroupName == null) |
| | 336 | | { |
| 0 | 337 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 338 | | } |
| 0 | 339 | | if (publicIpAddressName == null) |
| | 340 | | { |
| 0 | 341 | | throw new ArgumentNullException(nameof(publicIpAddressName)); |
| | 342 | | } |
| 0 | 343 | | if (parameters == null) |
| | 344 | | { |
| 0 | 345 | | throw new ArgumentNullException(nameof(parameters)); |
| | 346 | | } |
| | 347 | |
|
| 0 | 348 | | using var message = CreateUpdateTagsRequest(resourceGroupName, publicIpAddressName, parameters); |
| 0 | 349 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 350 | | switch (message.Response.Status) |
| | 351 | | { |
| | 352 | | case 200: |
| | 353 | | { |
| 0 | 354 | | PublicIPAddress value = default; |
| 0 | 355 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 356 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 357 | | { |
| 0 | 358 | | value = null; |
| | 359 | | } |
| | 360 | | else |
| | 361 | | { |
| 0 | 362 | | value = PublicIPAddress.DeserializePublicIPAddress(document.RootElement); |
| | 363 | | } |
| 0 | 364 | | return Response.FromValue(value, message.Response); |
| | 365 | | } |
| | 366 | | default: |
| 0 | 367 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 368 | | } |
| 0 | 369 | | } |
| | 370 | |
|
| | 371 | | /// <summary> Updates public IP address tags. </summary> |
| | 372 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 373 | | /// <param name="publicIpAddressName"> The name of the public IP address. </param> |
| | 374 | | /// <param name="parameters"> Parameters supplied to update public IP address tags. </param> |
| | 375 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 376 | | public Response<PublicIPAddress> UpdateTags(string resourceGroupName, string publicIpAddressName, TagsObject par |
| | 377 | | { |
| 0 | 378 | | if (resourceGroupName == null) |
| | 379 | | { |
| 0 | 380 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 381 | | } |
| 0 | 382 | | if (publicIpAddressName == null) |
| | 383 | | { |
| 0 | 384 | | throw new ArgumentNullException(nameof(publicIpAddressName)); |
| | 385 | | } |
| 0 | 386 | | if (parameters == null) |
| | 387 | | { |
| 0 | 388 | | throw new ArgumentNullException(nameof(parameters)); |
| | 389 | | } |
| | 390 | |
|
| 0 | 391 | | using var message = CreateUpdateTagsRequest(resourceGroupName, publicIpAddressName, parameters); |
| 0 | 392 | | _pipeline.Send(message, cancellationToken); |
| 0 | 393 | | switch (message.Response.Status) |
| | 394 | | { |
| | 395 | | case 200: |
| | 396 | | { |
| 0 | 397 | | PublicIPAddress value = default; |
| 0 | 398 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 399 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 400 | | { |
| 0 | 401 | | value = null; |
| | 402 | | } |
| | 403 | | else |
| | 404 | | { |
| 0 | 405 | | value = PublicIPAddress.DeserializePublicIPAddress(document.RootElement); |
| | 406 | | } |
| 0 | 407 | | return Response.FromValue(value, message.Response); |
| | 408 | | } |
| | 409 | | default: |
| 0 | 410 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 411 | | } |
| 0 | 412 | | } |
| | 413 | |
|
| | 414 | | internal HttpMessage CreateListAllRequest() |
| | 415 | | { |
| 12 | 416 | | var message = _pipeline.CreateMessage(); |
| 12 | 417 | | var request = message.Request; |
| 12 | 418 | | request.Method = RequestMethod.Get; |
| 12 | 419 | | var uri = new RawRequestUriBuilder(); |
| 12 | 420 | | uri.Reset(endpoint); |
| 12 | 421 | | uri.AppendPath("/subscriptions/", false); |
| 12 | 422 | | uri.AppendPath(subscriptionId, true); |
| 12 | 423 | | uri.AppendPath("/providers/Microsoft.Network/publicIPAddresses", false); |
| 12 | 424 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 12 | 425 | | request.Uri = uri; |
| 12 | 426 | | return message; |
| | 427 | | } |
| | 428 | |
|
| | 429 | | /// <summary> Gets all the public IP addresses in a subscription. </summary> |
| | 430 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 431 | | public async Task<Response<PublicIPAddressListResult>> ListAllAsync(CancellationToken cancellationToken = defaul |
| | 432 | | { |
| 6 | 433 | | using var message = CreateListAllRequest(); |
| 6 | 434 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 6 | 435 | | switch (message.Response.Status) |
| | 436 | | { |
| | 437 | | case 200: |
| | 438 | | { |
| 6 | 439 | | PublicIPAddressListResult value = default; |
| 6 | 440 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 6 | 441 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 442 | | { |
| 0 | 443 | | value = null; |
| | 444 | | } |
| | 445 | | else |
| | 446 | | { |
| 6 | 447 | | value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement) |
| | 448 | | } |
| 6 | 449 | | return Response.FromValue(value, message.Response); |
| | 450 | | } |
| | 451 | | default: |
| 0 | 452 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 453 | | } |
| 6 | 454 | | } |
| | 455 | |
|
| | 456 | | /// <summary> Gets all the public IP addresses in a subscription. </summary> |
| | 457 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 458 | | public Response<PublicIPAddressListResult> ListAll(CancellationToken cancellationToken = default) |
| | 459 | | { |
| 6 | 460 | | using var message = CreateListAllRequest(); |
| 6 | 461 | | _pipeline.Send(message, cancellationToken); |
| 6 | 462 | | switch (message.Response.Status) |
| | 463 | | { |
| | 464 | | case 200: |
| | 465 | | { |
| 6 | 466 | | PublicIPAddressListResult value = default; |
| 6 | 467 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 6 | 468 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 469 | | { |
| 0 | 470 | | value = null; |
| | 471 | | } |
| | 472 | | else |
| | 473 | | { |
| 6 | 474 | | value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement) |
| | 475 | | } |
| 6 | 476 | | return Response.FromValue(value, message.Response); |
| | 477 | | } |
| | 478 | | default: |
| 0 | 479 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 480 | | } |
| 6 | 481 | | } |
| | 482 | |
|
| | 483 | | internal HttpMessage CreateListRequest(string resourceGroupName) |
| | 484 | | { |
| 24 | 485 | | var message = _pipeline.CreateMessage(); |
| 24 | 486 | | var request = message.Request; |
| 24 | 487 | | request.Method = RequestMethod.Get; |
| 24 | 488 | | var uri = new RawRequestUriBuilder(); |
| 24 | 489 | | uri.Reset(endpoint); |
| 24 | 490 | | uri.AppendPath("/subscriptions/", false); |
| 24 | 491 | | uri.AppendPath(subscriptionId, true); |
| 24 | 492 | | uri.AppendPath("/resourceGroups/", false); |
| 24 | 493 | | uri.AppendPath(resourceGroupName, true); |
| 24 | 494 | | uri.AppendPath("/providers/Microsoft.Network/publicIPAddresses", false); |
| 24 | 495 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 24 | 496 | | request.Uri = uri; |
| 24 | 497 | | return message; |
| | 498 | | } |
| | 499 | |
|
| | 500 | | /// <summary> Gets all public IP addresses in a resource group. </summary> |
| | 501 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 502 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 503 | | public async Task<Response<PublicIPAddressListResult>> ListAsync(string resourceGroupName, CancellationToken can |
| | 504 | | { |
| 12 | 505 | | if (resourceGroupName == null) |
| | 506 | | { |
| 0 | 507 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 508 | | } |
| | 509 | |
|
| 12 | 510 | | using var message = CreateListRequest(resourceGroupName); |
| 12 | 511 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 12 | 512 | | switch (message.Response.Status) |
| | 513 | | { |
| | 514 | | case 200: |
| | 515 | | { |
| 12 | 516 | | PublicIPAddressListResult value = default; |
| 12 | 517 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 12 | 518 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 519 | | { |
| 0 | 520 | | value = null; |
| | 521 | | } |
| | 522 | | else |
| | 523 | | { |
| 12 | 524 | | value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement) |
| | 525 | | } |
| 12 | 526 | | return Response.FromValue(value, message.Response); |
| | 527 | | } |
| | 528 | | default: |
| 0 | 529 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 530 | | } |
| 12 | 531 | | } |
| | 532 | |
|
| | 533 | | /// <summary> Gets all public IP addresses in a resource group. </summary> |
| | 534 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 535 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 536 | | public Response<PublicIPAddressListResult> List(string resourceGroupName, CancellationToken cancellationToken = |
| | 537 | | { |
| 12 | 538 | | if (resourceGroupName == null) |
| | 539 | | { |
| 0 | 540 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 541 | | } |
| | 542 | |
|
| 12 | 543 | | using var message = CreateListRequest(resourceGroupName); |
| 12 | 544 | | _pipeline.Send(message, cancellationToken); |
| 12 | 545 | | switch (message.Response.Status) |
| | 546 | | { |
| | 547 | | case 200: |
| | 548 | | { |
| 12 | 549 | | PublicIPAddressListResult value = default; |
| 12 | 550 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 12 | 551 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 552 | | { |
| 0 | 553 | | value = null; |
| | 554 | | } |
| | 555 | | else |
| | 556 | | { |
| 12 | 557 | | value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement) |
| | 558 | | } |
| 12 | 559 | | return Response.FromValue(value, message.Response); |
| | 560 | | } |
| | 561 | | default: |
| 0 | 562 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 563 | | } |
| 12 | 564 | | } |
| | 565 | |
|
| | 566 | | internal HttpMessage CreateListVirtualMachineScaleSetPublicIPAddressesRequest(string resourceGroupName, string v |
| | 567 | | { |
| 8 | 568 | | var message = _pipeline.CreateMessage(); |
| 8 | 569 | | var request = message.Request; |
| 8 | 570 | | request.Method = RequestMethod.Get; |
| 8 | 571 | | var uri = new RawRequestUriBuilder(); |
| 8 | 572 | | uri.Reset(endpoint); |
| 8 | 573 | | uri.AppendPath("/subscriptions/", false); |
| 8 | 574 | | uri.AppendPath(subscriptionId, true); |
| 8 | 575 | | uri.AppendPath("/resourceGroups/", false); |
| 8 | 576 | | uri.AppendPath(resourceGroupName, true); |
| 8 | 577 | | uri.AppendPath("/providers/Microsoft.Compute/virtualMachineScaleSets/", false); |
| 8 | 578 | | uri.AppendPath(virtualMachineScaleSetName, true); |
| 8 | 579 | | uri.AppendPath("/publicipaddresses", false); |
| 8 | 580 | | uri.AppendQuery("api-version", "2018-10-01", true); |
| 8 | 581 | | request.Uri = uri; |
| 8 | 582 | | return message; |
| | 583 | | } |
| | 584 | |
|
| | 585 | | /// <summary> Gets information about all public IP addresses on a virtual machine scale set level. </summary> |
| | 586 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 587 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 588 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 589 | | public async Task<Response<PublicIPAddressListResult>> ListVirtualMachineScaleSetPublicIPAddressesAsync(string r |
| | 590 | | { |
| 4 | 591 | | if (resourceGroupName == null) |
| | 592 | | { |
| 0 | 593 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 594 | | } |
| 4 | 595 | | if (virtualMachineScaleSetName == null) |
| | 596 | | { |
| 0 | 597 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 598 | | } |
| | 599 | |
|
| 4 | 600 | | using var message = CreateListVirtualMachineScaleSetPublicIPAddressesRequest(resourceGroupName, virtualMachi |
| 4 | 601 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 4 | 602 | | switch (message.Response.Status) |
| | 603 | | { |
| | 604 | | case 200: |
| | 605 | | { |
| 4 | 606 | | PublicIPAddressListResult value = default; |
| 4 | 607 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 4 | 608 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 609 | | { |
| 0 | 610 | | value = null; |
| | 611 | | } |
| | 612 | | else |
| | 613 | | { |
| 4 | 614 | | value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement) |
| | 615 | | } |
| 4 | 616 | | return Response.FromValue(value, message.Response); |
| | 617 | | } |
| | 618 | | default: |
| 0 | 619 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 620 | | } |
| 4 | 621 | | } |
| | 622 | |
|
| | 623 | | /// <summary> Gets information about all public IP addresses on a virtual machine scale set level. </summary> |
| | 624 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 625 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 626 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 627 | | public Response<PublicIPAddressListResult> ListVirtualMachineScaleSetPublicIPAddresses(string resourceGroupName, |
| | 628 | | { |
| 4 | 629 | | if (resourceGroupName == null) |
| | 630 | | { |
| 0 | 631 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 632 | | } |
| 4 | 633 | | if (virtualMachineScaleSetName == null) |
| | 634 | | { |
| 0 | 635 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 636 | | } |
| | 637 | |
|
| 4 | 638 | | using var message = CreateListVirtualMachineScaleSetPublicIPAddressesRequest(resourceGroupName, virtualMachi |
| 4 | 639 | | _pipeline.Send(message, cancellationToken); |
| 4 | 640 | | switch (message.Response.Status) |
| | 641 | | { |
| | 642 | | case 200: |
| | 643 | | { |
| 4 | 644 | | PublicIPAddressListResult value = default; |
| 4 | 645 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 4 | 646 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 647 | | { |
| 0 | 648 | | value = null; |
| | 649 | | } |
| | 650 | | else |
| | 651 | | { |
| 4 | 652 | | value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement) |
| | 653 | | } |
| 4 | 654 | | return Response.FromValue(value, message.Response); |
| | 655 | | } |
| | 656 | | default: |
| 0 | 657 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 658 | | } |
| 4 | 659 | | } |
| | 660 | |
|
| | 661 | | internal HttpMessage CreateListVirtualMachineScaleSetVMPublicIPAddressesRequest(string resourceGroupName, string |
| | 662 | | { |
| 4 | 663 | | var message = _pipeline.CreateMessage(); |
| 4 | 664 | | var request = message.Request; |
| 4 | 665 | | request.Method = RequestMethod.Get; |
| 4 | 666 | | var uri = new RawRequestUriBuilder(); |
| 4 | 667 | | uri.Reset(endpoint); |
| 4 | 668 | | uri.AppendPath("/subscriptions/", false); |
| 4 | 669 | | uri.AppendPath(subscriptionId, true); |
| 4 | 670 | | uri.AppendPath("/resourceGroups/", false); |
| 4 | 671 | | uri.AppendPath(resourceGroupName, true); |
| 4 | 672 | | uri.AppendPath("/providers/Microsoft.Compute/virtualMachineScaleSets/", false); |
| 4 | 673 | | uri.AppendPath(virtualMachineScaleSetName, true); |
| 4 | 674 | | uri.AppendPath("/virtualMachines/", false); |
| 4 | 675 | | uri.AppendPath(virtualmachineIndex, true); |
| 4 | 676 | | uri.AppendPath("/networkInterfaces/", false); |
| 4 | 677 | | uri.AppendPath(networkInterfaceName, true); |
| 4 | 678 | | uri.AppendPath("/ipconfigurations/", false); |
| 4 | 679 | | uri.AppendPath(ipConfigurationName, true); |
| 4 | 680 | | uri.AppendPath("/publicipaddresses", false); |
| 4 | 681 | | uri.AppendQuery("api-version", "2018-10-01", true); |
| 4 | 682 | | request.Uri = uri; |
| 4 | 683 | | return message; |
| | 684 | | } |
| | 685 | |
|
| | 686 | | /// <summary> Gets information about all public IP addresses in a virtual machine IP configuration in a virtual |
| | 687 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 688 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 689 | | /// <param name="virtualmachineIndex"> The virtual machine index. </param> |
| | 690 | | /// <param name="networkInterfaceName"> The network interface name. </param> |
| | 691 | | /// <param name="ipConfigurationName"> The IP configuration name. </param> |
| | 692 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 693 | | public async Task<Response<PublicIPAddressListResult>> ListVirtualMachineScaleSetVMPublicIPAddressesAsync(string |
| | 694 | | { |
| 2 | 695 | | if (resourceGroupName == null) |
| | 696 | | { |
| 0 | 697 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 698 | | } |
| 2 | 699 | | if (virtualMachineScaleSetName == null) |
| | 700 | | { |
| 0 | 701 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 702 | | } |
| 2 | 703 | | if (virtualmachineIndex == null) |
| | 704 | | { |
| 0 | 705 | | throw new ArgumentNullException(nameof(virtualmachineIndex)); |
| | 706 | | } |
| 2 | 707 | | if (networkInterfaceName == null) |
| | 708 | | { |
| 0 | 709 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 710 | | } |
| 2 | 711 | | if (ipConfigurationName == null) |
| | 712 | | { |
| 0 | 713 | | throw new ArgumentNullException(nameof(ipConfigurationName)); |
| | 714 | | } |
| | 715 | |
|
| 2 | 716 | | using var message = CreateListVirtualMachineScaleSetVMPublicIPAddressesRequest(resourceGroupName, virtualMac |
| 2 | 717 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 2 | 718 | | switch (message.Response.Status) |
| | 719 | | { |
| | 720 | | case 200: |
| | 721 | | { |
| 2 | 722 | | PublicIPAddressListResult value = default; |
| 2 | 723 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 2 | 724 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 725 | | { |
| 0 | 726 | | value = null; |
| | 727 | | } |
| | 728 | | else |
| | 729 | | { |
| 2 | 730 | | value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement) |
| | 731 | | } |
| 2 | 732 | | return Response.FromValue(value, message.Response); |
| | 733 | | } |
| | 734 | | default: |
| 0 | 735 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 736 | | } |
| 2 | 737 | | } |
| | 738 | |
|
| | 739 | | /// <summary> Gets information about all public IP addresses in a virtual machine IP configuration in a virtual |
| | 740 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 741 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 742 | | /// <param name="virtualmachineIndex"> The virtual machine index. </param> |
| | 743 | | /// <param name="networkInterfaceName"> The network interface name. </param> |
| | 744 | | /// <param name="ipConfigurationName"> The IP configuration name. </param> |
| | 745 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 746 | | public Response<PublicIPAddressListResult> ListVirtualMachineScaleSetVMPublicIPAddresses(string resourceGroupNam |
| | 747 | | { |
| 2 | 748 | | if (resourceGroupName == null) |
| | 749 | | { |
| 0 | 750 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 751 | | } |
| 2 | 752 | | if (virtualMachineScaleSetName == null) |
| | 753 | | { |
| 0 | 754 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 755 | | } |
| 2 | 756 | | if (virtualmachineIndex == null) |
| | 757 | | { |
| 0 | 758 | | throw new ArgumentNullException(nameof(virtualmachineIndex)); |
| | 759 | | } |
| 2 | 760 | | if (networkInterfaceName == null) |
| | 761 | | { |
| 0 | 762 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 763 | | } |
| 2 | 764 | | if (ipConfigurationName == null) |
| | 765 | | { |
| 0 | 766 | | throw new ArgumentNullException(nameof(ipConfigurationName)); |
| | 767 | | } |
| | 768 | |
|
| 2 | 769 | | using var message = CreateListVirtualMachineScaleSetVMPublicIPAddressesRequest(resourceGroupName, virtualMac |
| 2 | 770 | | _pipeline.Send(message, cancellationToken); |
| 2 | 771 | | switch (message.Response.Status) |
| | 772 | | { |
| | 773 | | case 200: |
| | 774 | | { |
| 2 | 775 | | PublicIPAddressListResult value = default; |
| 2 | 776 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 2 | 777 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 778 | | { |
| 0 | 779 | | value = null; |
| | 780 | | } |
| | 781 | | else |
| | 782 | | { |
| 2 | 783 | | value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement) |
| | 784 | | } |
| 2 | 785 | | return Response.FromValue(value, message.Response); |
| | 786 | | } |
| | 787 | | default: |
| 0 | 788 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 789 | | } |
| 2 | 790 | | } |
| | 791 | |
|
| | 792 | | internal HttpMessage CreateGetVirtualMachineScaleSetPublicIPAddressRequest(string resourceGroupName, string virt |
| | 793 | | { |
| 4 | 794 | | var message = _pipeline.CreateMessage(); |
| 4 | 795 | | var request = message.Request; |
| 4 | 796 | | request.Method = RequestMethod.Get; |
| 4 | 797 | | var uri = new RawRequestUriBuilder(); |
| 4 | 798 | | uri.Reset(endpoint); |
| 4 | 799 | | uri.AppendPath("/subscriptions/", false); |
| 4 | 800 | | uri.AppendPath(subscriptionId, true); |
| 4 | 801 | | uri.AppendPath("/resourceGroups/", false); |
| 4 | 802 | | uri.AppendPath(resourceGroupName, true); |
| 4 | 803 | | uri.AppendPath("/providers/Microsoft.Compute/virtualMachineScaleSets/", false); |
| 4 | 804 | | uri.AppendPath(virtualMachineScaleSetName, true); |
| 4 | 805 | | uri.AppendPath("/virtualMachines/", false); |
| 4 | 806 | | uri.AppendPath(virtualmachineIndex, true); |
| 4 | 807 | | uri.AppendPath("/networkInterfaces/", false); |
| 4 | 808 | | uri.AppendPath(networkInterfaceName, true); |
| 4 | 809 | | uri.AppendPath("/ipconfigurations/", false); |
| 4 | 810 | | uri.AppendPath(ipConfigurationName, true); |
| 4 | 811 | | uri.AppendPath("/publicipaddresses/", false); |
| 4 | 812 | | uri.AppendPath(publicIpAddressName, true); |
| 4 | 813 | | uri.AppendQuery("api-version", "2018-10-01", true); |
| 4 | 814 | | if (expand != null) |
| | 815 | | { |
| 0 | 816 | | uri.AppendQuery("$expand", expand, true); |
| | 817 | | } |
| 4 | 818 | | request.Uri = uri; |
| 4 | 819 | | return message; |
| | 820 | | } |
| | 821 | |
|
| | 822 | | /// <summary> Get the specified public IP address in a virtual machine scale set. </summary> |
| | 823 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 824 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 825 | | /// <param name="virtualmachineIndex"> The virtual machine index. </param> |
| | 826 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | 827 | | /// <param name="ipConfigurationName"> The name of the IP configuration. </param> |
| | 828 | | /// <param name="publicIpAddressName"> The name of the public IP Address. </param> |
| | 829 | | /// <param name="expand"> Expands referenced resources. </param> |
| | 830 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 831 | | public async Task<Response<PublicIPAddress>> GetVirtualMachineScaleSetPublicIPAddressAsync(string resourceGroupN |
| | 832 | | { |
| 2 | 833 | | if (resourceGroupName == null) |
| | 834 | | { |
| 0 | 835 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 836 | | } |
| 2 | 837 | | if (virtualMachineScaleSetName == null) |
| | 838 | | { |
| 0 | 839 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 840 | | } |
| 2 | 841 | | if (virtualmachineIndex == null) |
| | 842 | | { |
| 0 | 843 | | throw new ArgumentNullException(nameof(virtualmachineIndex)); |
| | 844 | | } |
| 2 | 845 | | if (networkInterfaceName == null) |
| | 846 | | { |
| 0 | 847 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 848 | | } |
| 2 | 849 | | if (ipConfigurationName == null) |
| | 850 | | { |
| 0 | 851 | | throw new ArgumentNullException(nameof(ipConfigurationName)); |
| | 852 | | } |
| 2 | 853 | | if (publicIpAddressName == null) |
| | 854 | | { |
| 0 | 855 | | throw new ArgumentNullException(nameof(publicIpAddressName)); |
| | 856 | | } |
| | 857 | |
|
| 2 | 858 | | using var message = CreateGetVirtualMachineScaleSetPublicIPAddressRequest(resourceGroupName, virtualMachineS |
| 2 | 859 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 2 | 860 | | switch (message.Response.Status) |
| | 861 | | { |
| | 862 | | case 200: |
| | 863 | | { |
| 2 | 864 | | PublicIPAddress value = default; |
| 2 | 865 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 2 | 866 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 867 | | { |
| 0 | 868 | | value = null; |
| | 869 | | } |
| | 870 | | else |
| | 871 | | { |
| 2 | 872 | | value = PublicIPAddress.DeserializePublicIPAddress(document.RootElement); |
| | 873 | | } |
| 2 | 874 | | return Response.FromValue(value, message.Response); |
| | 875 | | } |
| | 876 | | default: |
| 0 | 877 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 878 | | } |
| 2 | 879 | | } |
| | 880 | |
|
| | 881 | | /// <summary> Get the specified public IP address in a virtual machine scale set. </summary> |
| | 882 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 883 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 884 | | /// <param name="virtualmachineIndex"> The virtual machine index. </param> |
| | 885 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | 886 | | /// <param name="ipConfigurationName"> The name of the IP configuration. </param> |
| | 887 | | /// <param name="publicIpAddressName"> The name of the public IP Address. </param> |
| | 888 | | /// <param name="expand"> Expands referenced resources. </param> |
| | 889 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 890 | | public Response<PublicIPAddress> GetVirtualMachineScaleSetPublicIPAddress(string resourceGroupName, string virtu |
| | 891 | | { |
| 2 | 892 | | if (resourceGroupName == null) |
| | 893 | | { |
| 0 | 894 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 895 | | } |
| 2 | 896 | | if (virtualMachineScaleSetName == null) |
| | 897 | | { |
| 0 | 898 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 899 | | } |
| 2 | 900 | | if (virtualmachineIndex == null) |
| | 901 | | { |
| 0 | 902 | | throw new ArgumentNullException(nameof(virtualmachineIndex)); |
| | 903 | | } |
| 2 | 904 | | if (networkInterfaceName == null) |
| | 905 | | { |
| 0 | 906 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 907 | | } |
| 2 | 908 | | if (ipConfigurationName == null) |
| | 909 | | { |
| 0 | 910 | | throw new ArgumentNullException(nameof(ipConfigurationName)); |
| | 911 | | } |
| 2 | 912 | | if (publicIpAddressName == null) |
| | 913 | | { |
| 0 | 914 | | throw new ArgumentNullException(nameof(publicIpAddressName)); |
| | 915 | | } |
| | 916 | |
|
| 2 | 917 | | using var message = CreateGetVirtualMachineScaleSetPublicIPAddressRequest(resourceGroupName, virtualMachineS |
| 2 | 918 | | _pipeline.Send(message, cancellationToken); |
| 2 | 919 | | switch (message.Response.Status) |
| | 920 | | { |
| | 921 | | case 200: |
| | 922 | | { |
| 2 | 923 | | PublicIPAddress value = default; |
| 2 | 924 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 2 | 925 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 926 | | { |
| 0 | 927 | | value = null; |
| | 928 | | } |
| | 929 | | else |
| | 930 | | { |
| 2 | 931 | | value = PublicIPAddress.DeserializePublicIPAddress(document.RootElement); |
| | 932 | | } |
| 2 | 933 | | return Response.FromValue(value, message.Response); |
| | 934 | | } |
| | 935 | | default: |
| 0 | 936 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 937 | | } |
| 2 | 938 | | } |
| | 939 | |
|
| | 940 | | internal HttpMessage CreateListAllNextPageRequest(string nextLink) |
| | 941 | | { |
| 0 | 942 | | var message = _pipeline.CreateMessage(); |
| 0 | 943 | | var request = message.Request; |
| 0 | 944 | | request.Method = RequestMethod.Get; |
| 0 | 945 | | var uri = new RawRequestUriBuilder(); |
| 0 | 946 | | uri.Reset(endpoint); |
| 0 | 947 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 948 | | request.Uri = uri; |
| 0 | 949 | | return message; |
| | 950 | | } |
| | 951 | |
|
| | 952 | | /// <summary> Gets all the public IP addresses in a subscription. </summary> |
| | 953 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 954 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 955 | | public async Task<Response<PublicIPAddressListResult>> ListAllNextPageAsync(string nextLink, CancellationToken c |
| | 956 | | { |
| 0 | 957 | | if (nextLink == null) |
| | 958 | | { |
| 0 | 959 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 960 | | } |
| | 961 | |
|
| 0 | 962 | | using var message = CreateListAllNextPageRequest(nextLink); |
| 0 | 963 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 964 | | switch (message.Response.Status) |
| | 965 | | { |
| | 966 | | case 200: |
| | 967 | | { |
| 0 | 968 | | PublicIPAddressListResult value = default; |
| 0 | 969 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 970 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 971 | | { |
| 0 | 972 | | value = null; |
| | 973 | | } |
| | 974 | | else |
| | 975 | | { |
| 0 | 976 | | value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement) |
| | 977 | | } |
| 0 | 978 | | return Response.FromValue(value, message.Response); |
| | 979 | | } |
| | 980 | | default: |
| 0 | 981 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 982 | | } |
| 0 | 983 | | } |
| | 984 | |
|
| | 985 | | /// <summary> Gets all the public IP addresses in a subscription. </summary> |
| | 986 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 987 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 988 | | public Response<PublicIPAddressListResult> ListAllNextPage(string nextLink, CancellationToken cancellationToken |
| | 989 | | { |
| 0 | 990 | | if (nextLink == null) |
| | 991 | | { |
| 0 | 992 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 993 | | } |
| | 994 | |
|
| 0 | 995 | | using var message = CreateListAllNextPageRequest(nextLink); |
| 0 | 996 | | _pipeline.Send(message, cancellationToken); |
| 0 | 997 | | switch (message.Response.Status) |
| | 998 | | { |
| | 999 | | case 200: |
| | 1000 | | { |
| 0 | 1001 | | PublicIPAddressListResult value = default; |
| 0 | 1002 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1003 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1004 | | { |
| 0 | 1005 | | value = null; |
| | 1006 | | } |
| | 1007 | | else |
| | 1008 | | { |
| 0 | 1009 | | value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement) |
| | 1010 | | } |
| 0 | 1011 | | return Response.FromValue(value, message.Response); |
| | 1012 | | } |
| | 1013 | | default: |
| 0 | 1014 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1015 | | } |
| 0 | 1016 | | } |
| | 1017 | |
|
| | 1018 | | internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName) |
| | 1019 | | { |
| 0 | 1020 | | var message = _pipeline.CreateMessage(); |
| 0 | 1021 | | var request = message.Request; |
| 0 | 1022 | | request.Method = RequestMethod.Get; |
| 0 | 1023 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1024 | | uri.Reset(endpoint); |
| 0 | 1025 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 1026 | | request.Uri = uri; |
| 0 | 1027 | | return message; |
| | 1028 | | } |
| | 1029 | |
|
| | 1030 | | /// <summary> Gets all public IP addresses in a resource group. </summary> |
| | 1031 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1032 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1033 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1034 | | public async Task<Response<PublicIPAddressListResult>> ListNextPageAsync(string nextLink, string resourceGroupNa |
| | 1035 | | { |
| 0 | 1036 | | if (nextLink == null) |
| | 1037 | | { |
| 0 | 1038 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1039 | | } |
| 0 | 1040 | | if (resourceGroupName == null) |
| | 1041 | | { |
| 0 | 1042 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1043 | | } |
| | 1044 | |
|
| 0 | 1045 | | using var message = CreateListNextPageRequest(nextLink, resourceGroupName); |
| 0 | 1046 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1047 | | switch (message.Response.Status) |
| | 1048 | | { |
| | 1049 | | case 200: |
| | 1050 | | { |
| 0 | 1051 | | PublicIPAddressListResult value = default; |
| 0 | 1052 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1053 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1054 | | { |
| 0 | 1055 | | value = null; |
| | 1056 | | } |
| | 1057 | | else |
| | 1058 | | { |
| 0 | 1059 | | value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement) |
| | 1060 | | } |
| 0 | 1061 | | return Response.FromValue(value, message.Response); |
| | 1062 | | } |
| | 1063 | | default: |
| 0 | 1064 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1065 | | } |
| 0 | 1066 | | } |
| | 1067 | |
|
| | 1068 | | /// <summary> Gets all public IP addresses in a resource group. </summary> |
| | 1069 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1070 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1071 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1072 | | public Response<PublicIPAddressListResult> ListNextPage(string nextLink, string resourceGroupName, CancellationT |
| | 1073 | | { |
| 0 | 1074 | | if (nextLink == null) |
| | 1075 | | { |
| 0 | 1076 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1077 | | } |
| 0 | 1078 | | if (resourceGroupName == null) |
| | 1079 | | { |
| 0 | 1080 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1081 | | } |
| | 1082 | |
|
| 0 | 1083 | | using var message = CreateListNextPageRequest(nextLink, resourceGroupName); |
| 0 | 1084 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1085 | | switch (message.Response.Status) |
| | 1086 | | { |
| | 1087 | | case 200: |
| | 1088 | | { |
| 0 | 1089 | | PublicIPAddressListResult value = default; |
| 0 | 1090 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1091 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1092 | | { |
| 0 | 1093 | | value = null; |
| | 1094 | | } |
| | 1095 | | else |
| | 1096 | | { |
| 0 | 1097 | | value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement) |
| | 1098 | | } |
| 0 | 1099 | | return Response.FromValue(value, message.Response); |
| | 1100 | | } |
| | 1101 | | default: |
| 0 | 1102 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1103 | | } |
| 0 | 1104 | | } |
| | 1105 | |
|
| | 1106 | | internal HttpMessage CreateListVirtualMachineScaleSetPublicIPAddressesNextPageRequest(string nextLink, string re |
| | 1107 | | { |
| 0 | 1108 | | var message = _pipeline.CreateMessage(); |
| 0 | 1109 | | var request = message.Request; |
| 0 | 1110 | | request.Method = RequestMethod.Get; |
| 0 | 1111 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1112 | | uri.Reset(endpoint); |
| 0 | 1113 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 1114 | | request.Uri = uri; |
| 0 | 1115 | | return message; |
| | 1116 | | } |
| | 1117 | |
|
| | 1118 | | /// <summary> Gets information about all public IP addresses on a virtual machine scale set level. </summary> |
| | 1119 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1120 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1121 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 1122 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1123 | | public async Task<Response<PublicIPAddressListResult>> ListVirtualMachineScaleSetPublicIPAddressesNextPageAsync( |
| | 1124 | | { |
| 0 | 1125 | | if (nextLink == null) |
| | 1126 | | { |
| 0 | 1127 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1128 | | } |
| 0 | 1129 | | if (resourceGroupName == null) |
| | 1130 | | { |
| 0 | 1131 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1132 | | } |
| 0 | 1133 | | if (virtualMachineScaleSetName == null) |
| | 1134 | | { |
| 0 | 1135 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 1136 | | } |
| | 1137 | |
|
| 0 | 1138 | | using var message = CreateListVirtualMachineScaleSetPublicIPAddressesNextPageRequest(nextLink, resourceGroup |
| 0 | 1139 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1140 | | switch (message.Response.Status) |
| | 1141 | | { |
| | 1142 | | case 200: |
| | 1143 | | { |
| 0 | 1144 | | PublicIPAddressListResult value = default; |
| 0 | 1145 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1146 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1147 | | { |
| 0 | 1148 | | value = null; |
| | 1149 | | } |
| | 1150 | | else |
| | 1151 | | { |
| 0 | 1152 | | value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement) |
| | 1153 | | } |
| 0 | 1154 | | return Response.FromValue(value, message.Response); |
| | 1155 | | } |
| | 1156 | | default: |
| 0 | 1157 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1158 | | } |
| 0 | 1159 | | } |
| | 1160 | |
|
| | 1161 | | /// <summary> Gets information about all public IP addresses on a virtual machine scale set level. </summary> |
| | 1162 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1163 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1164 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 1165 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1166 | | public Response<PublicIPAddressListResult> ListVirtualMachineScaleSetPublicIPAddressesNextPage(string nextLink, |
| | 1167 | | { |
| 0 | 1168 | | if (nextLink == null) |
| | 1169 | | { |
| 0 | 1170 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1171 | | } |
| 0 | 1172 | | if (resourceGroupName == null) |
| | 1173 | | { |
| 0 | 1174 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1175 | | } |
| 0 | 1176 | | if (virtualMachineScaleSetName == null) |
| | 1177 | | { |
| 0 | 1178 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 1179 | | } |
| | 1180 | |
|
| 0 | 1181 | | using var message = CreateListVirtualMachineScaleSetPublicIPAddressesNextPageRequest(nextLink, resourceGroup |
| 0 | 1182 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1183 | | switch (message.Response.Status) |
| | 1184 | | { |
| | 1185 | | case 200: |
| | 1186 | | { |
| 0 | 1187 | | PublicIPAddressListResult value = default; |
| 0 | 1188 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1189 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1190 | | { |
| 0 | 1191 | | value = null; |
| | 1192 | | } |
| | 1193 | | else |
| | 1194 | | { |
| 0 | 1195 | | value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement) |
| | 1196 | | } |
| 0 | 1197 | | return Response.FromValue(value, message.Response); |
| | 1198 | | } |
| | 1199 | | default: |
| 0 | 1200 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1201 | | } |
| 0 | 1202 | | } |
| | 1203 | |
|
| | 1204 | | internal HttpMessage CreateListVirtualMachineScaleSetVMPublicIPAddressesNextPageRequest(string nextLink, string |
| | 1205 | | { |
| 0 | 1206 | | var message = _pipeline.CreateMessage(); |
| 0 | 1207 | | var request = message.Request; |
| 0 | 1208 | | request.Method = RequestMethod.Get; |
| 0 | 1209 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1210 | | uri.Reset(endpoint); |
| 0 | 1211 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 1212 | | request.Uri = uri; |
| 0 | 1213 | | return message; |
| | 1214 | | } |
| | 1215 | |
|
| | 1216 | | /// <summary> Gets information about all public IP addresses in a virtual machine IP configuration in a virtual |
| | 1217 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1218 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1219 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 1220 | | /// <param name="virtualmachineIndex"> The virtual machine index. </param> |
| | 1221 | | /// <param name="networkInterfaceName"> The network interface name. </param> |
| | 1222 | | /// <param name="ipConfigurationName"> The IP configuration name. </param> |
| | 1223 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1224 | | public async Task<Response<PublicIPAddressListResult>> ListVirtualMachineScaleSetVMPublicIPAddressesNextPageAsyn |
| | 1225 | | { |
| 0 | 1226 | | if (nextLink == null) |
| | 1227 | | { |
| 0 | 1228 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1229 | | } |
| 0 | 1230 | | if (resourceGroupName == null) |
| | 1231 | | { |
| 0 | 1232 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1233 | | } |
| 0 | 1234 | | if (virtualMachineScaleSetName == null) |
| | 1235 | | { |
| 0 | 1236 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 1237 | | } |
| 0 | 1238 | | if (virtualmachineIndex == null) |
| | 1239 | | { |
| 0 | 1240 | | throw new ArgumentNullException(nameof(virtualmachineIndex)); |
| | 1241 | | } |
| 0 | 1242 | | if (networkInterfaceName == null) |
| | 1243 | | { |
| 0 | 1244 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 1245 | | } |
| 0 | 1246 | | if (ipConfigurationName == null) |
| | 1247 | | { |
| 0 | 1248 | | throw new ArgumentNullException(nameof(ipConfigurationName)); |
| | 1249 | | } |
| | 1250 | |
|
| 0 | 1251 | | using var message = CreateListVirtualMachineScaleSetVMPublicIPAddressesNextPageRequest(nextLink, resourceGro |
| 0 | 1252 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1253 | | switch (message.Response.Status) |
| | 1254 | | { |
| | 1255 | | case 200: |
| | 1256 | | { |
| 0 | 1257 | | PublicIPAddressListResult value = default; |
| 0 | 1258 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1259 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1260 | | { |
| 0 | 1261 | | value = null; |
| | 1262 | | } |
| | 1263 | | else |
| | 1264 | | { |
| 0 | 1265 | | value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement) |
| | 1266 | | } |
| 0 | 1267 | | return Response.FromValue(value, message.Response); |
| | 1268 | | } |
| | 1269 | | default: |
| 0 | 1270 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1271 | | } |
| 0 | 1272 | | } |
| | 1273 | |
|
| | 1274 | | /// <summary> Gets information about all public IP addresses in a virtual machine IP configuration in a virtual |
| | 1275 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1276 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1277 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 1278 | | /// <param name="virtualmachineIndex"> The virtual machine index. </param> |
| | 1279 | | /// <param name="networkInterfaceName"> The network interface name. </param> |
| | 1280 | | /// <param name="ipConfigurationName"> The IP configuration name. </param> |
| | 1281 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1282 | | public Response<PublicIPAddressListResult> ListVirtualMachineScaleSetVMPublicIPAddressesNextPage(string nextLink |
| | 1283 | | { |
| 0 | 1284 | | if (nextLink == null) |
| | 1285 | | { |
| 0 | 1286 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1287 | | } |
| 0 | 1288 | | if (resourceGroupName == null) |
| | 1289 | | { |
| 0 | 1290 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1291 | | } |
| 0 | 1292 | | if (virtualMachineScaleSetName == null) |
| | 1293 | | { |
| 0 | 1294 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 1295 | | } |
| 0 | 1296 | | if (virtualmachineIndex == null) |
| | 1297 | | { |
| 0 | 1298 | | throw new ArgumentNullException(nameof(virtualmachineIndex)); |
| | 1299 | | } |
| 0 | 1300 | | if (networkInterfaceName == null) |
| | 1301 | | { |
| 0 | 1302 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 1303 | | } |
| 0 | 1304 | | if (ipConfigurationName == null) |
| | 1305 | | { |
| 0 | 1306 | | throw new ArgumentNullException(nameof(ipConfigurationName)); |
| | 1307 | | } |
| | 1308 | |
|
| 0 | 1309 | | using var message = CreateListVirtualMachineScaleSetVMPublicIPAddressesNextPageRequest(nextLink, resourceGro |
| 0 | 1310 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1311 | | switch (message.Response.Status) |
| | 1312 | | { |
| | 1313 | | case 200: |
| | 1314 | | { |
| 0 | 1315 | | PublicIPAddressListResult value = default; |
| 0 | 1316 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1317 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1318 | | { |
| 0 | 1319 | | value = null; |
| | 1320 | | } |
| | 1321 | | else |
| | 1322 | | { |
| 0 | 1323 | | value = PublicIPAddressListResult.DeserializePublicIPAddressListResult(document.RootElement) |
| | 1324 | | } |
| 0 | 1325 | | return Response.FromValue(value, message.Response); |
| | 1326 | | } |
| | 1327 | | default: |
| 0 | 1328 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1329 | | } |
| 0 | 1330 | | } |
| | 1331 | | } |
| | 1332 | | } |