< Summary

Class:Azure.ResourceManager.Compute.ContainerServicesRestOperations
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\ContainerServicesRestOperations.cs
Covered lines:8
Uncovered lines:265
Coverable lines:273
Total lines:618
Line coverage:2.9% (8 of 273)
Covered branches:2
Total branches:100
Branch coverage:2% (2 of 100)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-88.89%50%
CreateListRequest()-0%100%
ListAsync()-0%0%
List(...)-0%0%
CreateCreateOrUpdateRequest(...)-0%100%
CreateOrUpdateAsync()-0%0%
CreateOrUpdate(...)-0%0%
CreateGetRequest(...)-0%100%
GetAsync()-0%0%
Get(...)-0%0%
CreateDeleteRequest(...)-0%100%
DeleteAsync()-0%0%
Delete(...)-0%0%
CreateListByResourceGroupRequest(...)-0%100%
ListByResourceGroupAsync()-0%0%
ListByResourceGroup(...)-0%0%
CreateListNextPageRequest(...)-0%100%
ListNextPageAsync()-0%0%
ListNextPage(...)-0%0%
CreateListByResourceGroupNextPageRequest(...)-0%100%
ListByResourceGroupNextPageAsync()-0%0%
ListByResourceGroupNextPage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\ContainerServicesRestOperations.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 ContainerServicesRestOperations
 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 ContainerServicesRestOperations. </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 ContainerServicesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscr
 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 CreateListRequest()
 47        {
 048            var message = _pipeline.CreateMessage();
 049            var request = message.Request;
 050            request.Method = RequestMethod.Get;
 051            var uri = new RawRequestUriBuilder();
 052            uri.Reset(endpoint);
 053            uri.AppendPath("/subscriptions/", false);
 054            uri.AppendPath(subscriptionId, true);
 055            uri.AppendPath("/providers/Microsoft.ContainerService/containerServices", false);
 056            uri.AppendQuery("api-version", "2017-01-31", true);
 057            request.Uri = uri;
 058            return message;
 59        }
 60
 61        /// <summary> Gets a list of container services in the specified subscription. The operation returns properties 
 62        /// <param name="cancellationToken"> The cancellation token to use. </param>
 63        public async Task<Response<ContainerServiceListResult>> ListAsync(CancellationToken cancellationToken = default)
 64        {
 065            using var message = CreateListRequest();
 066            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 067            switch (message.Response.Status)
 68            {
 69                case 200:
 70                    {
 071                        ContainerServiceListResult value = default;
 072                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 073                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 74                        {
 075                            value = null;
 76                        }
 77                        else
 78                        {
 079                            value = ContainerServiceListResult.DeserializeContainerServiceListResult(document.RootElemen
 80                        }
 081                        return Response.FromValue(value, message.Response);
 82                    }
 83                default:
 084                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 85            }
 086        }
 87
 88        /// <summary> Gets a list of container services in the specified subscription. The operation returns properties 
 89        /// <param name="cancellationToken"> The cancellation token to use. </param>
 90        public Response<ContainerServiceListResult> List(CancellationToken cancellationToken = default)
 91        {
 092            using var message = CreateListRequest();
 093            _pipeline.Send(message, cancellationToken);
 094            switch (message.Response.Status)
 95            {
 96                case 200:
 97                    {
 098                        ContainerServiceListResult value = default;
 099                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0100                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 101                        {
 0102                            value = null;
 103                        }
 104                        else
 105                        {
 0106                            value = ContainerServiceListResult.DeserializeContainerServiceListResult(document.RootElemen
 107                        }
 0108                        return Response.FromValue(value, message.Response);
 109                    }
 110                default:
 0111                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 112            }
 0113        }
 114
 115        internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string containerServiceName, Containe
 116        {
 0117            var message = _pipeline.CreateMessage();
 0118            var request = message.Request;
 0119            request.Method = RequestMethod.Put;
 0120            var uri = new RawRequestUriBuilder();
 0121            uri.Reset(endpoint);
 0122            uri.AppendPath("/subscriptions/", false);
 0123            uri.AppendPath(subscriptionId, true);
 0124            uri.AppendPath("/resourceGroups/", false);
 0125            uri.AppendPath(resourceGroupName, true);
 0126            uri.AppendPath("/providers/Microsoft.ContainerService/containerServices/", false);
 0127            uri.AppendPath(containerServiceName, true);
 0128            uri.AppendQuery("api-version", "2017-01-31", true);
 0129            request.Uri = uri;
 0130            request.Headers.Add("Content-Type", "application/json");
 0131            var content = new Utf8JsonRequestContent();
 0132            content.JsonWriter.WriteObjectValue(parameters);
 0133            request.Content = content;
 0134            return message;
 135        }
 136
 137        /// <summary> Creates or updates a container service with the specified configuration of orchestrator, masters, 
 138        /// <param name="resourceGroupName"> The name of the resource group. </param>
 139        /// <param name="containerServiceName"> The name of the container service in the specified subscription and reso
 140        /// <param name="parameters"> Parameters supplied to the Create or Update a Container Service operation. </param
 141        /// <param name="cancellationToken"> The cancellation token to use. </param>
 142        public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string containerServiceName, Container
 143        {
 0144            if (resourceGroupName == null)
 145            {
 0146                throw new ArgumentNullException(nameof(resourceGroupName));
 147            }
 0148            if (containerServiceName == null)
 149            {
 0150                throw new ArgumentNullException(nameof(containerServiceName));
 151            }
 0152            if (parameters == null)
 153            {
 0154                throw new ArgumentNullException(nameof(parameters));
 155            }
 156
 0157            using var message = CreateCreateOrUpdateRequest(resourceGroupName, containerServiceName, parameters);
 0158            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0159            switch (message.Response.Status)
 160            {
 161                case 200:
 162                case 201:
 163                case 202:
 0164                    return message.Response;
 165                default:
 0166                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 167            }
 0168        }
 169
 170        /// <summary> Creates or updates a container service with the specified configuration of orchestrator, masters, 
 171        /// <param name="resourceGroupName"> The name of the resource group. </param>
 172        /// <param name="containerServiceName"> The name of the container service in the specified subscription and reso
 173        /// <param name="parameters"> Parameters supplied to the Create or Update a Container Service operation. </param
 174        /// <param name="cancellationToken"> The cancellation token to use. </param>
 175        public Response CreateOrUpdate(string resourceGroupName, string containerServiceName, ContainerService parameter
 176        {
 0177            if (resourceGroupName == null)
 178            {
 0179                throw new ArgumentNullException(nameof(resourceGroupName));
 180            }
 0181            if (containerServiceName == null)
 182            {
 0183                throw new ArgumentNullException(nameof(containerServiceName));
 184            }
 0185            if (parameters == null)
 186            {
 0187                throw new ArgumentNullException(nameof(parameters));
 188            }
 189
 0190            using var message = CreateCreateOrUpdateRequest(resourceGroupName, containerServiceName, parameters);
 0191            _pipeline.Send(message, cancellationToken);
 0192            switch (message.Response.Status)
 193            {
 194                case 200:
 195                case 201:
 196                case 202:
 0197                    return message.Response;
 198                default:
 0199                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 200            }
 0201        }
 202
 203        internal HttpMessage CreateGetRequest(string resourceGroupName, string containerServiceName)
 204        {
 0205            var message = _pipeline.CreateMessage();
 0206            var request = message.Request;
 0207            request.Method = RequestMethod.Get;
 0208            var uri = new RawRequestUriBuilder();
 0209            uri.Reset(endpoint);
 0210            uri.AppendPath("/subscriptions/", false);
 0211            uri.AppendPath(subscriptionId, true);
 0212            uri.AppendPath("/resourceGroups/", false);
 0213            uri.AppendPath(resourceGroupName, true);
 0214            uri.AppendPath("/providers/Microsoft.ContainerService/containerServices/", false);
 0215            uri.AppendPath(containerServiceName, true);
 0216            uri.AppendQuery("api-version", "2017-01-31", true);
 0217            request.Uri = uri;
 0218            return message;
 219        }
 220
 221        /// <summary> Gets the properties of the specified container service in the specified subscription and resource 
 222        /// <param name="resourceGroupName"> The name of the resource group. </param>
 223        /// <param name="containerServiceName"> The name of the container service in the specified subscription and reso
 224        /// <param name="cancellationToken"> The cancellation token to use. </param>
 225        public async Task<Response<ContainerService>> GetAsync(string resourceGroupName, string containerServiceName, Ca
 226        {
 0227            if (resourceGroupName == null)
 228            {
 0229                throw new ArgumentNullException(nameof(resourceGroupName));
 230            }
 0231            if (containerServiceName == null)
 232            {
 0233                throw new ArgumentNullException(nameof(containerServiceName));
 234            }
 235
 0236            using var message = CreateGetRequest(resourceGroupName, containerServiceName);
 0237            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0238            switch (message.Response.Status)
 239            {
 240                case 200:
 241                    {
 0242                        ContainerService value = default;
 0243                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0244                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 245                        {
 0246                            value = null;
 247                        }
 248                        else
 249                        {
 0250                            value = ContainerService.DeserializeContainerService(document.RootElement);
 251                        }
 0252                        return Response.FromValue(value, message.Response);
 253                    }
 254                default:
 0255                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 256            }
 0257        }
 258
 259        /// <summary> Gets the properties of the specified container service in the specified subscription and resource 
 260        /// <param name="resourceGroupName"> The name of the resource group. </param>
 261        /// <param name="containerServiceName"> The name of the container service in the specified subscription and reso
 262        /// <param name="cancellationToken"> The cancellation token to use. </param>
 263        public Response<ContainerService> Get(string resourceGroupName, string containerServiceName, CancellationToken c
 264        {
 0265            if (resourceGroupName == null)
 266            {
 0267                throw new ArgumentNullException(nameof(resourceGroupName));
 268            }
 0269            if (containerServiceName == null)
 270            {
 0271                throw new ArgumentNullException(nameof(containerServiceName));
 272            }
 273
 0274            using var message = CreateGetRequest(resourceGroupName, containerServiceName);
 0275            _pipeline.Send(message, cancellationToken);
 0276            switch (message.Response.Status)
 277            {
 278                case 200:
 279                    {
 0280                        ContainerService value = default;
 0281                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0282                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 283                        {
 0284                            value = null;
 285                        }
 286                        else
 287                        {
 0288                            value = ContainerService.DeserializeContainerService(document.RootElement);
 289                        }
 0290                        return Response.FromValue(value, message.Response);
 291                    }
 292                default:
 0293                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 294            }
 0295        }
 296
 297        internal HttpMessage CreateDeleteRequest(string resourceGroupName, string containerServiceName)
 298        {
 0299            var message = _pipeline.CreateMessage();
 0300            var request = message.Request;
 0301            request.Method = RequestMethod.Delete;
 0302            var uri = new RawRequestUriBuilder();
 0303            uri.Reset(endpoint);
 0304            uri.AppendPath("/subscriptions/", false);
 0305            uri.AppendPath(subscriptionId, true);
 0306            uri.AppendPath("/resourceGroups/", false);
 0307            uri.AppendPath(resourceGroupName, true);
 0308            uri.AppendPath("/providers/Microsoft.ContainerService/containerServices/", false);
 0309            uri.AppendPath(containerServiceName, true);
 0310            uri.AppendQuery("api-version", "2017-01-31", true);
 0311            request.Uri = uri;
 0312            return message;
 313        }
 314
 315        /// <summary> Deletes the specified container service in the specified subscription and resource group. The oper
 316        /// <param name="resourceGroupName"> The name of the resource group. </param>
 317        /// <param name="containerServiceName"> The name of the container service in the specified subscription and reso
 318        /// <param name="cancellationToken"> The cancellation token to use. </param>
 319        public async Task<Response> DeleteAsync(string resourceGroupName, string containerServiceName, CancellationToken
 320        {
 0321            if (resourceGroupName == null)
 322            {
 0323                throw new ArgumentNullException(nameof(resourceGroupName));
 324            }
 0325            if (containerServiceName == null)
 326            {
 0327                throw new ArgumentNullException(nameof(containerServiceName));
 328            }
 329
 0330            using var message = CreateDeleteRequest(resourceGroupName, containerServiceName);
 0331            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0332            switch (message.Response.Status)
 333            {
 334                case 202:
 335                case 204:
 0336                    return message.Response;
 337                default:
 0338                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 339            }
 0340        }
 341
 342        /// <summary> Deletes the specified container service in the specified subscription and resource group. The oper
 343        /// <param name="resourceGroupName"> The name of the resource group. </param>
 344        /// <param name="containerServiceName"> The name of the container service in the specified subscription and reso
 345        /// <param name="cancellationToken"> The cancellation token to use. </param>
 346        public Response Delete(string resourceGroupName, string containerServiceName, CancellationToken cancellationToke
 347        {
 0348            if (resourceGroupName == null)
 349            {
 0350                throw new ArgumentNullException(nameof(resourceGroupName));
 351            }
 0352            if (containerServiceName == null)
 353            {
 0354                throw new ArgumentNullException(nameof(containerServiceName));
 355            }
 356
 0357            using var message = CreateDeleteRequest(resourceGroupName, containerServiceName);
 0358            _pipeline.Send(message, cancellationToken);
 0359            switch (message.Response.Status)
 360            {
 361                case 202:
 362                case 204:
 0363                    return message.Response;
 364                default:
 0365                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 366            }
 0367        }
 368
 369        internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName)
 370        {
 0371            var message = _pipeline.CreateMessage();
 0372            var request = message.Request;
 0373            request.Method = RequestMethod.Get;
 0374            var uri = new RawRequestUriBuilder();
 0375            uri.Reset(endpoint);
 0376            uri.AppendPath("/subscriptions/", false);
 0377            uri.AppendPath(subscriptionId, true);
 0378            uri.AppendPath("/resourceGroups/", false);
 0379            uri.AppendPath(resourceGroupName, true);
 0380            uri.AppendPath("/providers/Microsoft.ContainerService/containerServices", false);
 0381            uri.AppendQuery("api-version", "2017-01-31", true);
 0382            request.Uri = uri;
 0383            return message;
 384        }
 385
 386        /// <summary> Gets a list of container services in the specified subscription and resource group. The operation 
 387        /// <param name="resourceGroupName"> The name of the resource group. </param>
 388        /// <param name="cancellationToken"> The cancellation token to use. </param>
 389        public async Task<Response<ContainerServiceListResult>> ListByResourceGroupAsync(string resourceGroupName, Cance
 390        {
 0391            if (resourceGroupName == null)
 392            {
 0393                throw new ArgumentNullException(nameof(resourceGroupName));
 394            }
 395
 0396            using var message = CreateListByResourceGroupRequest(resourceGroupName);
 0397            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0398            switch (message.Response.Status)
 399            {
 400                case 200:
 401                    {
 0402                        ContainerServiceListResult value = default;
 0403                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0404                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 405                        {
 0406                            value = null;
 407                        }
 408                        else
 409                        {
 0410                            value = ContainerServiceListResult.DeserializeContainerServiceListResult(document.RootElemen
 411                        }
 0412                        return Response.FromValue(value, message.Response);
 413                    }
 414                default:
 0415                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 416            }
 0417        }
 418
 419        /// <summary> Gets a list of container services in the specified subscription and resource group. The operation 
 420        /// <param name="resourceGroupName"> The name of the resource group. </param>
 421        /// <param name="cancellationToken"> The cancellation token to use. </param>
 422        public Response<ContainerServiceListResult> ListByResourceGroup(string resourceGroupName, CancellationToken canc
 423        {
 0424            if (resourceGroupName == null)
 425            {
 0426                throw new ArgumentNullException(nameof(resourceGroupName));
 427            }
 428
 0429            using var message = CreateListByResourceGroupRequest(resourceGroupName);
 0430            _pipeline.Send(message, cancellationToken);
 0431            switch (message.Response.Status)
 432            {
 433                case 200:
 434                    {
 0435                        ContainerServiceListResult value = default;
 0436                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0437                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 438                        {
 0439                            value = null;
 440                        }
 441                        else
 442                        {
 0443                            value = ContainerServiceListResult.DeserializeContainerServiceListResult(document.RootElemen
 444                        }
 0445                        return Response.FromValue(value, message.Response);
 446                    }
 447                default:
 0448                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 449            }
 0450        }
 451
 452        internal HttpMessage CreateListNextPageRequest(string nextLink)
 453        {
 0454            var message = _pipeline.CreateMessage();
 0455            var request = message.Request;
 0456            request.Method = RequestMethod.Get;
 0457            var uri = new RawRequestUriBuilder();
 0458            uri.Reset(endpoint);
 0459            uri.AppendRawNextLink(nextLink, false);
 0460            request.Uri = uri;
 0461            return message;
 462        }
 463
 464        /// <summary> Gets a list of container services in the specified subscription. The operation returns properties 
 465        /// <param name="nextLink"> The URL to the next page of results. </param>
 466        /// <param name="cancellationToken"> The cancellation token to use. </param>
 467        public async Task<Response<ContainerServiceListResult>> ListNextPageAsync(string nextLink, CancellationToken can
 468        {
 0469            if (nextLink == null)
 470            {
 0471                throw new ArgumentNullException(nameof(nextLink));
 472            }
 473
 0474            using var message = CreateListNextPageRequest(nextLink);
 0475            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0476            switch (message.Response.Status)
 477            {
 478                case 200:
 479                    {
 0480                        ContainerServiceListResult value = default;
 0481                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0482                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 483                        {
 0484                            value = null;
 485                        }
 486                        else
 487                        {
 0488                            value = ContainerServiceListResult.DeserializeContainerServiceListResult(document.RootElemen
 489                        }
 0490                        return Response.FromValue(value, message.Response);
 491                    }
 492                default:
 0493                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 494            }
 0495        }
 496
 497        /// <summary> Gets a list of container services in the specified subscription. The operation returns properties 
 498        /// <param name="nextLink"> The URL to the next page of results. </param>
 499        /// <param name="cancellationToken"> The cancellation token to use. </param>
 500        public Response<ContainerServiceListResult> ListNextPage(string nextLink, CancellationToken cancellationToken = 
 501        {
 0502            if (nextLink == null)
 503            {
 0504                throw new ArgumentNullException(nameof(nextLink));
 505            }
 506
 0507            using var message = CreateListNextPageRequest(nextLink);
 0508            _pipeline.Send(message, cancellationToken);
 0509            switch (message.Response.Status)
 510            {
 511                case 200:
 512                    {
 0513                        ContainerServiceListResult value = default;
 0514                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0515                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 516                        {
 0517                            value = null;
 518                        }
 519                        else
 520                        {
 0521                            value = ContainerServiceListResult.DeserializeContainerServiceListResult(document.RootElemen
 522                        }
 0523                        return Response.FromValue(value, message.Response);
 524                    }
 525                default:
 0526                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 527            }
 0528        }
 529
 530        internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string resourceGroupName)
 531        {
 0532            var message = _pipeline.CreateMessage();
 0533            var request = message.Request;
 0534            request.Method = RequestMethod.Get;
 0535            var uri = new RawRequestUriBuilder();
 0536            uri.Reset(endpoint);
 0537            uri.AppendRawNextLink(nextLink, false);
 0538            request.Uri = uri;
 0539            return message;
 540        }
 541
 542        /// <summary> Gets a list of container services in the specified subscription and resource group. The operation 
 543        /// <param name="nextLink"> The URL to the next page of results. </param>
 544        /// <param name="resourceGroupName"> The name of the resource group. </param>
 545        /// <param name="cancellationToken"> The cancellation token to use. </param>
 546        public async Task<Response<ContainerServiceListResult>> ListByResourceGroupNextPageAsync(string nextLink, string
 547        {
 0548            if (nextLink == null)
 549            {
 0550                throw new ArgumentNullException(nameof(nextLink));
 551            }
 0552            if (resourceGroupName == null)
 553            {
 0554                throw new ArgumentNullException(nameof(resourceGroupName));
 555            }
 556
 0557            using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName);
 0558            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0559            switch (message.Response.Status)
 560            {
 561                case 200:
 562                    {
 0563                        ContainerServiceListResult value = default;
 0564                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0565                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 566                        {
 0567                            value = null;
 568                        }
 569                        else
 570                        {
 0571                            value = ContainerServiceListResult.DeserializeContainerServiceListResult(document.RootElemen
 572                        }
 0573                        return Response.FromValue(value, message.Response);
 574                    }
 575                default:
 0576                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 577            }
 0578        }
 579
 580        /// <summary> Gets a list of container services in the specified subscription and resource group. The operation 
 581        /// <param name="nextLink"> The URL to the next page of results. </param>
 582        /// <param name="resourceGroupName"> The name of the resource group. </param>
 583        /// <param name="cancellationToken"> The cancellation token to use. </param>
 584        public Response<ContainerServiceListResult> ListByResourceGroupNextPage(string nextLink, string resourceGroupNam
 585        {
 0586            if (nextLink == null)
 587            {
 0588                throw new ArgumentNullException(nameof(nextLink));
 589            }
 0590            if (resourceGroupName == null)
 591            {
 0592                throw new ArgumentNullException(nameof(resourceGroupName));
 593            }
 594
 0595            using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName);
 0596            _pipeline.Send(message, cancellationToken);
 0597            switch (message.Response.Status)
 598            {
 599                case 200:
 600                    {
 0601                        ContainerServiceListResult value = default;
 0602                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0603                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 604                        {
 0605                            value = null;
 606                        }
 607                        else
 608                        {
 0609                            value = ContainerServiceListResult.DeserializeContainerServiceListResult(document.RootElemen
 610                        }
 0611                        return Response.FromValue(value, message.Response);
 612                    }
 613                default:
 0614                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 615            }
 0616        }
 617    }
 618}