< Summary

Class:Azure.ResourceManager.Compute.VirtualMachineScaleSetExtensionsRestOperations
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\VirtualMachineScaleSetExtensionsRestOperations.cs
Covered lines:124
Uncovered lines:160
Coverable lines:284
Total lines:633
Line coverage:43.6% (124 of 284)
Covered branches:31
Total branches:126
Branch coverage:24.6% (31 of 126)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-88.89%50%
CreateCreateOrUpdateRequest(...)-100%100%
CreateOrUpdateAsync()-64.29%50%
CreateOrUpdate(...)-64.29%50%
CreateUpdateRequest(...)-0%100%
UpdateAsync()-0%0%
Update(...)-0%0%
CreateDeleteRequest(...)-0%100%
DeleteAsync()-0%0%
Delete(...)-0%0%
CreateGetRequest(...)-94.44%50%
GetAsync()-70.59%50%
Get(...)-70.59%50%
CreateListRequest(...)-100%100%
ListAsync()-73.33%50%
List(...)-73.33%50%
CreateListNextPageRequest(...)-0%100%
ListNextPageAsync()-0%0%
ListNextPage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\VirtualMachineScaleSetExtensionsRestOperations.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9using System.Text.Json;
 10using System.Threading;
 11using System.Threading.Tasks;
 12using Azure;
 13using Azure.Core;
 14using Azure.Core.Pipeline;
 15using Azure.ResourceManager.Compute.Models;
 16
 17namespace Azure.ResourceManager.Compute
 18{
 19    internal partial class VirtualMachineScaleSetExtensionsRestOperations
 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 VirtualMachineScaleSetExtensionsRestOperations. </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"> Subscription credentials which uniquely identify Microsoft Azure subscription.
 30        /// <param name="endpoint"> server parameter. </param>
 31        /// <exception cref="ArgumentNullException"> This occurs when one of the required arguments is null. </exception
 39632        public VirtualMachineScaleSetExtensionsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline
 33        {
 39634            if (subscriptionId == null)
 35            {
 036                throw new ArgumentNullException(nameof(subscriptionId));
 37            }
 39638            endpoint ??= new Uri("https://management.azure.com");
 39
 39640            this.subscriptionId = subscriptionId;
 39641            this.endpoint = endpoint;
 39642            _clientDiagnostics = clientDiagnostics;
 39643            _pipeline = pipeline;
 39644        }
 45
 46        internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string vmScaleSetName, string vmssExt
 47        {
 1648            var message = _pipeline.CreateMessage();
 1649            var request = message.Request;
 1650            request.Method = RequestMethod.Put;
 1651            var uri = new RawRequestUriBuilder();
 1652            uri.Reset(endpoint);
 1653            uri.AppendPath("/subscriptions/", false);
 1654            uri.AppendPath(subscriptionId, true);
 1655            uri.AppendPath("/resourceGroups/", false);
 1656            uri.AppendPath(resourceGroupName, true);
 1657            uri.AppendPath("/providers/Microsoft.Compute/virtualMachineScaleSets/", false);
 1658            uri.AppendPath(vmScaleSetName, true);
 1659            uri.AppendPath("/extensions/", false);
 1660            uri.AppendPath(vmssExtensionName, true);
 1661            uri.AppendQuery("api-version", "2019-12-01", true);
 1662            request.Uri = uri;
 1663            request.Headers.Add("Content-Type", "application/json");
 1664            var content = new Utf8JsonRequestContent();
 1665            content.JsonWriter.WriteObjectValue(extensionParameters);
 1666            request.Content = content;
 1667            return message;
 68        }
 69
 70        /// <summary> The operation to create or update an extension. </summary>
 71        /// <param name="resourceGroupName"> The name of the resource group. </param>
 72        /// <param name="vmScaleSetName"> The name of the VM scale set where the extension should be create or updated. 
 73        /// <param name="vmssExtensionName"> The name of the VM scale set extension. </param>
 74        /// <param name="extensionParameters"> Parameters supplied to the Create VM scale set Extension operation. </par
 75        /// <param name="cancellationToken"> The cancellation token to use. </param>
 76        public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string vmScaleSetName, string vmssExte
 77        {
 478            if (resourceGroupName == null)
 79            {
 080                throw new ArgumentNullException(nameof(resourceGroupName));
 81            }
 482            if (vmScaleSetName == null)
 83            {
 084                throw new ArgumentNullException(nameof(vmScaleSetName));
 85            }
 486            if (vmssExtensionName == null)
 87            {
 088                throw new ArgumentNullException(nameof(vmssExtensionName));
 89            }
 490            if (extensionParameters == null)
 91            {
 092                throw new ArgumentNullException(nameof(extensionParameters));
 93            }
 94
 495            using var message = CreateCreateOrUpdateRequest(resourceGroupName, vmScaleSetName, vmssExtensionName, extens
 496            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 497            switch (message.Response.Status)
 98            {
 99                case 200:
 100                case 201:
 4101                    return message.Response;
 102                default:
 0103                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 104            }
 4105        }
 106
 107        /// <summary> The operation to create or update an extension. </summary>
 108        /// <param name="resourceGroupName"> The name of the resource group. </param>
 109        /// <param name="vmScaleSetName"> The name of the VM scale set where the extension should be create or updated. 
 110        /// <param name="vmssExtensionName"> The name of the VM scale set extension. </param>
 111        /// <param name="extensionParameters"> Parameters supplied to the Create VM scale set Extension operation. </par
 112        /// <param name="cancellationToken"> The cancellation token to use. </param>
 113        public Response CreateOrUpdate(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, Virtua
 114        {
 4115            if (resourceGroupName == null)
 116            {
 0117                throw new ArgumentNullException(nameof(resourceGroupName));
 118            }
 4119            if (vmScaleSetName == null)
 120            {
 0121                throw new ArgumentNullException(nameof(vmScaleSetName));
 122            }
 4123            if (vmssExtensionName == null)
 124            {
 0125                throw new ArgumentNullException(nameof(vmssExtensionName));
 126            }
 4127            if (extensionParameters == null)
 128            {
 0129                throw new ArgumentNullException(nameof(extensionParameters));
 130            }
 131
 4132            using var message = CreateCreateOrUpdateRequest(resourceGroupName, vmScaleSetName, vmssExtensionName, extens
 4133            _pipeline.Send(message, cancellationToken);
 4134            switch (message.Response.Status)
 135            {
 136                case 200:
 137                case 201:
 4138                    return message.Response;
 139                default:
 0140                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 141            }
 4142        }
 143
 144        internal HttpMessage CreateUpdateRequest(string resourceGroupName, string vmScaleSetName, string vmssExtensionNa
 145        {
 0146            var message = _pipeline.CreateMessage();
 0147            var request = message.Request;
 0148            request.Method = RequestMethod.Patch;
 0149            var uri = new RawRequestUriBuilder();
 0150            uri.Reset(endpoint);
 0151            uri.AppendPath("/subscriptions/", false);
 0152            uri.AppendPath(subscriptionId, true);
 0153            uri.AppendPath("/resourceGroups/", false);
 0154            uri.AppendPath(resourceGroupName, true);
 0155            uri.AppendPath("/providers/Microsoft.Compute/virtualMachineScaleSets/", false);
 0156            uri.AppendPath(vmScaleSetName, true);
 0157            uri.AppendPath("/extensions/", false);
 0158            uri.AppendPath(vmssExtensionName, true);
 0159            uri.AppendQuery("api-version", "2019-12-01", true);
 0160            request.Uri = uri;
 0161            request.Headers.Add("Content-Type", "application/json");
 0162            var content = new Utf8JsonRequestContent();
 0163            content.JsonWriter.WriteObjectValue(extensionParameters);
 0164            request.Content = content;
 0165            return message;
 166        }
 167
 168        /// <summary> The operation to update an extension. </summary>
 169        /// <param name="resourceGroupName"> The name of the resource group. </param>
 170        /// <param name="vmScaleSetName"> The name of the VM scale set where the extension should be updated. </param>
 171        /// <param name="vmssExtensionName"> The name of the VM scale set extension. </param>
 172        /// <param name="extensionParameters"> Parameters supplied to the Update VM scale set Extension operation. </par
 173        /// <param name="cancellationToken"> The cancellation token to use. </param>
 174        public async Task<Response> UpdateAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionNam
 175        {
 0176            if (resourceGroupName == null)
 177            {
 0178                throw new ArgumentNullException(nameof(resourceGroupName));
 179            }
 0180            if (vmScaleSetName == null)
 181            {
 0182                throw new ArgumentNullException(nameof(vmScaleSetName));
 183            }
 0184            if (vmssExtensionName == null)
 185            {
 0186                throw new ArgumentNullException(nameof(vmssExtensionName));
 187            }
 0188            if (extensionParameters == null)
 189            {
 0190                throw new ArgumentNullException(nameof(extensionParameters));
 191            }
 192
 0193            using var message = CreateUpdateRequest(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParam
 0194            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0195            switch (message.Response.Status)
 196            {
 197                case 200:
 198                case 201:
 0199                    return message.Response;
 200                default:
 0201                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 202            }
 0203        }
 204
 205        /// <summary> The operation to update an extension. </summary>
 206        /// <param name="resourceGroupName"> The name of the resource group. </param>
 207        /// <param name="vmScaleSetName"> The name of the VM scale set where the extension should be updated. </param>
 208        /// <param name="vmssExtensionName"> The name of the VM scale set extension. </param>
 209        /// <param name="extensionParameters"> Parameters supplied to the Update VM scale set Extension operation. </par
 210        /// <param name="cancellationToken"> The cancellation token to use. </param>
 211        public Response Update(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachine
 212        {
 0213            if (resourceGroupName == null)
 214            {
 0215                throw new ArgumentNullException(nameof(resourceGroupName));
 216            }
 0217            if (vmScaleSetName == null)
 218            {
 0219                throw new ArgumentNullException(nameof(vmScaleSetName));
 220            }
 0221            if (vmssExtensionName == null)
 222            {
 0223                throw new ArgumentNullException(nameof(vmssExtensionName));
 224            }
 0225            if (extensionParameters == null)
 226            {
 0227                throw new ArgumentNullException(nameof(extensionParameters));
 228            }
 229
 0230            using var message = CreateUpdateRequest(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParam
 0231            _pipeline.Send(message, cancellationToken);
 0232            switch (message.Response.Status)
 233            {
 234                case 200:
 235                case 201:
 0236                    return message.Response;
 237                default:
 0238                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 239            }
 0240        }
 241
 242        internal HttpMessage CreateDeleteRequest(string resourceGroupName, string vmScaleSetName, string vmssExtensionNa
 243        {
 0244            var message = _pipeline.CreateMessage();
 0245            var request = message.Request;
 0246            request.Method = RequestMethod.Delete;
 0247            var uri = new RawRequestUriBuilder();
 0248            uri.Reset(endpoint);
 0249            uri.AppendPath("/subscriptions/", false);
 0250            uri.AppendPath(subscriptionId, true);
 0251            uri.AppendPath("/resourceGroups/", false);
 0252            uri.AppendPath(resourceGroupName, true);
 0253            uri.AppendPath("/providers/Microsoft.Compute/virtualMachineScaleSets/", false);
 0254            uri.AppendPath(vmScaleSetName, true);
 0255            uri.AppendPath("/extensions/", false);
 0256            uri.AppendPath(vmssExtensionName, true);
 0257            uri.AppendQuery("api-version", "2019-12-01", true);
 0258            request.Uri = uri;
 0259            return message;
 260        }
 261
 262        /// <summary> The operation to delete the extension. </summary>
 263        /// <param name="resourceGroupName"> The name of the resource group. </param>
 264        /// <param name="vmScaleSetName"> The name of the VM scale set where the extension should be deleted. </param>
 265        /// <param name="vmssExtensionName"> The name of the VM scale set extension. </param>
 266        /// <param name="cancellationToken"> The cancellation token to use. </param>
 267        public async Task<Response> DeleteAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionNam
 268        {
 0269            if (resourceGroupName == null)
 270            {
 0271                throw new ArgumentNullException(nameof(resourceGroupName));
 272            }
 0273            if (vmScaleSetName == null)
 274            {
 0275                throw new ArgumentNullException(nameof(vmScaleSetName));
 276            }
 0277            if (vmssExtensionName == null)
 278            {
 0279                throw new ArgumentNullException(nameof(vmssExtensionName));
 280            }
 281
 0282            using var message = CreateDeleteRequest(resourceGroupName, vmScaleSetName, vmssExtensionName);
 0283            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0284            switch (message.Response.Status)
 285            {
 286                case 200:
 287                case 202:
 288                case 204:
 0289                    return message.Response;
 290                default:
 0291                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 292            }
 0293        }
 294
 295        /// <summary> The operation to delete the extension. </summary>
 296        /// <param name="resourceGroupName"> The name of the resource group. </param>
 297        /// <param name="vmScaleSetName"> The name of the VM scale set where the extension should be deleted. </param>
 298        /// <param name="vmssExtensionName"> The name of the VM scale set extension. </param>
 299        /// <param name="cancellationToken"> The cancellation token to use. </param>
 300        public Response Delete(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, CancellationTo
 301        {
 0302            if (resourceGroupName == null)
 303            {
 0304                throw new ArgumentNullException(nameof(resourceGroupName));
 305            }
 0306            if (vmScaleSetName == null)
 307            {
 0308                throw new ArgumentNullException(nameof(vmScaleSetName));
 309            }
 0310            if (vmssExtensionName == null)
 311            {
 0312                throw new ArgumentNullException(nameof(vmssExtensionName));
 313            }
 314
 0315            using var message = CreateDeleteRequest(resourceGroupName, vmScaleSetName, vmssExtensionName);
 0316            _pipeline.Send(message, cancellationToken);
 0317            switch (message.Response.Status)
 318            {
 319                case 200:
 320                case 202:
 321                case 204:
 0322                    return message.Response;
 323                default:
 0324                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 325            }
 0326        }
 327
 328        internal HttpMessage CreateGetRequest(string resourceGroupName, string vmScaleSetName, string vmssExtensionName,
 329        {
 12330            var message = _pipeline.CreateMessage();
 12331            var request = message.Request;
 12332            request.Method = RequestMethod.Get;
 12333            var uri = new RawRequestUriBuilder();
 12334            uri.Reset(endpoint);
 12335            uri.AppendPath("/subscriptions/", false);
 12336            uri.AppendPath(subscriptionId, true);
 12337            uri.AppendPath("/resourceGroups/", false);
 12338            uri.AppendPath(resourceGroupName, true);
 12339            uri.AppendPath("/providers/Microsoft.Compute/virtualMachineScaleSets/", false);
 12340            uri.AppendPath(vmScaleSetName, true);
 12341            uri.AppendPath("/extensions/", false);
 12342            uri.AppendPath(vmssExtensionName, true);
 12343            if (expand != null)
 344            {
 0345                uri.AppendQuery("$expand", expand, true);
 346            }
 12347            uri.AppendQuery("api-version", "2019-12-01", true);
 12348            request.Uri = uri;
 12349            return message;
 350        }
 351
 352        /// <summary> The operation to get the extension. </summary>
 353        /// <param name="resourceGroupName"> The name of the resource group. </param>
 354        /// <param name="vmScaleSetName"> The name of the VM scale set containing the extension. </param>
 355        /// <param name="vmssExtensionName"> The name of the VM scale set extension. </param>
 356        /// <param name="expand"> The expand expression to apply on the operation. </param>
 357        /// <param name="cancellationToken"> The cancellation token to use. </param>
 358        public async Task<Response<VirtualMachineScaleSetExtension>> GetAsync(string resourceGroupName, string vmScaleSe
 359        {
 6360            if (resourceGroupName == null)
 361            {
 0362                throw new ArgumentNullException(nameof(resourceGroupName));
 363            }
 6364            if (vmScaleSetName == null)
 365            {
 0366                throw new ArgumentNullException(nameof(vmScaleSetName));
 367            }
 6368            if (vmssExtensionName == null)
 369            {
 0370                throw new ArgumentNullException(nameof(vmssExtensionName));
 371            }
 372
 6373            using var message = CreateGetRequest(resourceGroupName, vmScaleSetName, vmssExtensionName, expand);
 6374            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 6375            switch (message.Response.Status)
 376            {
 377                case 200:
 378                    {
 6379                        VirtualMachineScaleSetExtension value = default;
 6380                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 6381                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 382                        {
 0383                            value = null;
 384                        }
 385                        else
 386                        {
 6387                            value = VirtualMachineScaleSetExtension.DeserializeVirtualMachineScaleSetExtension(document.
 388                        }
 6389                        return Response.FromValue(value, message.Response);
 390                    }
 391                default:
 0392                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 393            }
 6394        }
 395
 396        /// <summary> The operation to get the extension. </summary>
 397        /// <param name="resourceGroupName"> The name of the resource group. </param>
 398        /// <param name="vmScaleSetName"> The name of the VM scale set containing the extension. </param>
 399        /// <param name="vmssExtensionName"> The name of the VM scale set extension. </param>
 400        /// <param name="expand"> The expand expression to apply on the operation. </param>
 401        /// <param name="cancellationToken"> The cancellation token to use. </param>
 402        public Response<VirtualMachineScaleSetExtension> Get(string resourceGroupName, string vmScaleSetName, string vms
 403        {
 6404            if (resourceGroupName == null)
 405            {
 0406                throw new ArgumentNullException(nameof(resourceGroupName));
 407            }
 6408            if (vmScaleSetName == null)
 409            {
 0410                throw new ArgumentNullException(nameof(vmScaleSetName));
 411            }
 6412            if (vmssExtensionName == null)
 413            {
 0414                throw new ArgumentNullException(nameof(vmssExtensionName));
 415            }
 416
 6417            using var message = CreateGetRequest(resourceGroupName, vmScaleSetName, vmssExtensionName, expand);
 6418            _pipeline.Send(message, cancellationToken);
 6419            switch (message.Response.Status)
 420            {
 421                case 200:
 422                    {
 6423                        VirtualMachineScaleSetExtension value = default;
 6424                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 6425                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 426                        {
 0427                            value = null;
 428                        }
 429                        else
 430                        {
 6431                            value = VirtualMachineScaleSetExtension.DeserializeVirtualMachineScaleSetExtension(document.
 432                        }
 6433                        return Response.FromValue(value, message.Response);
 434                    }
 435                default:
 0436                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 437            }
 6438        }
 439
 440        internal HttpMessage CreateListRequest(string resourceGroupName, string vmScaleSetName)
 441        {
 4442            var message = _pipeline.CreateMessage();
 4443            var request = message.Request;
 4444            request.Method = RequestMethod.Get;
 4445            var uri = new RawRequestUriBuilder();
 4446            uri.Reset(endpoint);
 4447            uri.AppendPath("/subscriptions/", false);
 4448            uri.AppendPath(subscriptionId, true);
 4449            uri.AppendPath("/resourceGroups/", false);
 4450            uri.AppendPath(resourceGroupName, true);
 4451            uri.AppendPath("/providers/Microsoft.Compute/virtualMachineScaleSets/", false);
 4452            uri.AppendPath(vmScaleSetName, true);
 4453            uri.AppendPath("/extensions", false);
 4454            uri.AppendQuery("api-version", "2019-12-01", true);
 4455            request.Uri = uri;
 4456            return message;
 457        }
 458
 459        /// <summary> Gets a list of all extensions in a VM scale set. </summary>
 460        /// <param name="resourceGroupName"> The name of the resource group. </param>
 461        /// <param name="vmScaleSetName"> The name of the VM scale set containing the extension. </param>
 462        /// <param name="cancellationToken"> The cancellation token to use. </param>
 463        public async Task<Response<VirtualMachineScaleSetExtensionListResult>> ListAsync(string resourceGroupName, strin
 464        {
 2465            if (resourceGroupName == null)
 466            {
 0467                throw new ArgumentNullException(nameof(resourceGroupName));
 468            }
 2469            if (vmScaleSetName == null)
 470            {
 0471                throw new ArgumentNullException(nameof(vmScaleSetName));
 472            }
 473
 2474            using var message = CreateListRequest(resourceGroupName, vmScaleSetName);
 2475            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 2476            switch (message.Response.Status)
 477            {
 478                case 200:
 479                    {
 2480                        VirtualMachineScaleSetExtensionListResult value = default;
 2481                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 2482                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 483                        {
 0484                            value = null;
 485                        }
 486                        else
 487                        {
 2488                            value = VirtualMachineScaleSetExtensionListResult.DeserializeVirtualMachineScaleSetExtension
 489                        }
 2490                        return Response.FromValue(value, message.Response);
 491                    }
 492                default:
 0493                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 494            }
 2495        }
 496
 497        /// <summary> Gets a list of all extensions in a VM scale set. </summary>
 498        /// <param name="resourceGroupName"> The name of the resource group. </param>
 499        /// <param name="vmScaleSetName"> The name of the VM scale set containing the extension. </param>
 500        /// <param name="cancellationToken"> The cancellation token to use. </param>
 501        public Response<VirtualMachineScaleSetExtensionListResult> List(string resourceGroupName, string vmScaleSetName,
 502        {
 2503            if (resourceGroupName == null)
 504            {
 0505                throw new ArgumentNullException(nameof(resourceGroupName));
 506            }
 2507            if (vmScaleSetName == null)
 508            {
 0509                throw new ArgumentNullException(nameof(vmScaleSetName));
 510            }
 511
 2512            using var message = CreateListRequest(resourceGroupName, vmScaleSetName);
 2513            _pipeline.Send(message, cancellationToken);
 2514            switch (message.Response.Status)
 515            {
 516                case 200:
 517                    {
 2518                        VirtualMachineScaleSetExtensionListResult value = default;
 2519                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 2520                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 521                        {
 0522                            value = null;
 523                        }
 524                        else
 525                        {
 2526                            value = VirtualMachineScaleSetExtensionListResult.DeserializeVirtualMachineScaleSetExtension
 527                        }
 2528                        return Response.FromValue(value, message.Response);
 529                    }
 530                default:
 0531                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 532            }
 2533        }
 534
 535        internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName, string vmScaleSetName)
 536        {
 0537            var message = _pipeline.CreateMessage();
 0538            var request = message.Request;
 0539            request.Method = RequestMethod.Get;
 0540            var uri = new RawRequestUriBuilder();
 0541            uri.Reset(endpoint);
 0542            uri.AppendRawNextLink(nextLink, false);
 0543            request.Uri = uri;
 0544            return message;
 545        }
 546
 547        /// <summary> Gets a list of all extensions in a VM scale set. </summary>
 548        /// <param name="nextLink"> The URL to the next page of results. </param>
 549        /// <param name="resourceGroupName"> The name of the resource group. </param>
 550        /// <param name="vmScaleSetName"> The name of the VM scale set containing the extension. </param>
 551        /// <param name="cancellationToken"> The cancellation token to use. </param>
 552        public async Task<Response<VirtualMachineScaleSetExtensionListResult>> ListNextPageAsync(string nextLink, string
 553        {
 0554            if (nextLink == null)
 555            {
 0556                throw new ArgumentNullException(nameof(nextLink));
 557            }
 0558            if (resourceGroupName == null)
 559            {
 0560                throw new ArgumentNullException(nameof(resourceGroupName));
 561            }
 0562            if (vmScaleSetName == null)
 563            {
 0564                throw new ArgumentNullException(nameof(vmScaleSetName));
 565            }
 566
 0567            using var message = CreateListNextPageRequest(nextLink, resourceGroupName, vmScaleSetName);
 0568            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0569            switch (message.Response.Status)
 570            {
 571                case 200:
 572                    {
 0573                        VirtualMachineScaleSetExtensionListResult value = default;
 0574                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0575                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 576                        {
 0577                            value = null;
 578                        }
 579                        else
 580                        {
 0581                            value = VirtualMachineScaleSetExtensionListResult.DeserializeVirtualMachineScaleSetExtension
 582                        }
 0583                        return Response.FromValue(value, message.Response);
 584                    }
 585                default:
 0586                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 587            }
 0588        }
 589
 590        /// <summary> Gets a list of all extensions in a VM scale set. </summary>
 591        /// <param name="nextLink"> The URL to the next page of results. </param>
 592        /// <param name="resourceGroupName"> The name of the resource group. </param>
 593        /// <param name="vmScaleSetName"> The name of the VM scale set containing the extension. </param>
 594        /// <param name="cancellationToken"> The cancellation token to use. </param>
 595        public Response<VirtualMachineScaleSetExtensionListResult> ListNextPage(string nextLink, string resourceGroupNam
 596        {
 0597            if (nextLink == null)
 598            {
 0599                throw new ArgumentNullException(nameof(nextLink));
 600            }
 0601            if (resourceGroupName == null)
 602            {
 0603                throw new ArgumentNullException(nameof(resourceGroupName));
 604            }
 0605            if (vmScaleSetName == null)
 606            {
 0607                throw new ArgumentNullException(nameof(vmScaleSetName));
 608            }
 609
 0610            using var message = CreateListNextPageRequest(nextLink, resourceGroupName, vmScaleSetName);
 0611            _pipeline.Send(message, cancellationToken);
 0612            switch (message.Response.Status)
 613            {
 614                case 200:
 615                    {
 0616                        VirtualMachineScaleSetExtensionListResult value = default;
 0617                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0618                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 619                        {
 0620                            value = null;
 621                        }
 622                        else
 623                        {
 0624                            value = VirtualMachineScaleSetExtensionListResult.DeserializeVirtualMachineScaleSetExtension
 625                        }
 0626                        return Response.FromValue(value, message.Response);
 627                    }
 628                default:
 0629                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 630            }
 0631        }
 632    }
 633}