< Summary

Class:Azure.ResourceManager.Network.IpGroupsRestOperations
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\IpGroupsRestOperations.cs
Covered lines:0
Uncovered lines:327
Coverable lines:327
Total lines:732
Line coverage:0% (0 of 327)
Covered branches:0
Total branches:126
Branch coverage:0% (0 of 126)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\IpGroupsRestOperations.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.Network.Models;
 16
 17namespace Azure.ResourceManager.Network
 18{
 19    internal partial class IpGroupsRestOperations
 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 IpGroupsRestOperations. </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
 032        public IpGroupsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId,
 33        {
 034            if (subscriptionId == null)
 35            {
 036                throw new ArgumentNullException(nameof(subscriptionId));
 37            }
 038            endpoint ??= new Uri("https://management.azure.com");
 39
 040            this.subscriptionId = subscriptionId;
 041            this.endpoint = endpoint;
 042            _clientDiagnostics = clientDiagnostics;
 043            _pipeline = pipeline;
 044        }
 45
 46        internal HttpMessage CreateGetRequest(string resourceGroupName, string ipGroupsName, string expand)
 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("/resourceGroups/", false);
 056            uri.AppendPath(resourceGroupName, true);
 057            uri.AppendPath("/providers/Microsoft.Network/ipGroups/", false);
 058            uri.AppendPath(ipGroupsName, true);
 059            uri.AppendQuery("api-version", "2020-04-01", true);
 060            if (expand != null)
 61            {
 062                uri.AppendQuery("$expand", expand, true);
 63            }
 064            request.Uri = uri;
 065            return message;
 66        }
 67
 68        /// <summary> Gets the specified ipGroups. </summary>
 69        /// <param name="resourceGroupName"> The name of the resource group. </param>
 70        /// <param name="ipGroupsName"> The name of the ipGroups. </param>
 71        /// <param name="expand"> Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the
 72        /// <param name="cancellationToken"> The cancellation token to use. </param>
 73        public async Task<Response<IpGroup>> GetAsync(string resourceGroupName, string ipGroupsName, string expand = nul
 74        {
 075            if (resourceGroupName == null)
 76            {
 077                throw new ArgumentNullException(nameof(resourceGroupName));
 78            }
 079            if (ipGroupsName == null)
 80            {
 081                throw new ArgumentNullException(nameof(ipGroupsName));
 82            }
 83
 084            using var message = CreateGetRequest(resourceGroupName, ipGroupsName, expand);
 085            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 086            switch (message.Response.Status)
 87            {
 88                case 200:
 89                    {
 090                        IpGroup value = default;
 091                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 092                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 93                        {
 094                            value = null;
 95                        }
 96                        else
 97                        {
 098                            value = IpGroup.DeserializeIpGroup(document.RootElement);
 99                        }
 0100                        return Response.FromValue(value, message.Response);
 101                    }
 102                default:
 0103                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 104            }
 0105        }
 106
 107        /// <summary> Gets the specified ipGroups. </summary>
 108        /// <param name="resourceGroupName"> The name of the resource group. </param>
 109        /// <param name="ipGroupsName"> The name of the ipGroups. </param>
 110        /// <param name="expand"> Expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the
 111        /// <param name="cancellationToken"> The cancellation token to use. </param>
 112        public Response<IpGroup> Get(string resourceGroupName, string ipGroupsName, string expand = null, CancellationTo
 113        {
 0114            if (resourceGroupName == null)
 115            {
 0116                throw new ArgumentNullException(nameof(resourceGroupName));
 117            }
 0118            if (ipGroupsName == null)
 119            {
 0120                throw new ArgumentNullException(nameof(ipGroupsName));
 121            }
 122
 0123            using var message = CreateGetRequest(resourceGroupName, ipGroupsName, expand);
 0124            _pipeline.Send(message, cancellationToken);
 0125            switch (message.Response.Status)
 126            {
 127                case 200:
 128                    {
 0129                        IpGroup value = default;
 0130                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0131                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 132                        {
 0133                            value = null;
 134                        }
 135                        else
 136                        {
 0137                            value = IpGroup.DeserializeIpGroup(document.RootElement);
 138                        }
 0139                        return Response.FromValue(value, message.Response);
 140                    }
 141                default:
 0142                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 143            }
 0144        }
 145
 146        internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string ipGroupsName, IpGroup paramete
 147        {
 0148            var message = _pipeline.CreateMessage();
 0149            var request = message.Request;
 0150            request.Method = RequestMethod.Put;
 0151            var uri = new RawRequestUriBuilder();
 0152            uri.Reset(endpoint);
 0153            uri.AppendPath("/subscriptions/", false);
 0154            uri.AppendPath(subscriptionId, true);
 0155            uri.AppendPath("/resourceGroups/", false);
 0156            uri.AppendPath(resourceGroupName, true);
 0157            uri.AppendPath("/providers/Microsoft.Network/ipGroups/", false);
 0158            uri.AppendPath(ipGroupsName, true);
 0159            uri.AppendQuery("api-version", "2020-04-01", true);
 0160            request.Uri = uri;
 0161            request.Headers.Add("Content-Type", "application/json");
 0162            var content = new Utf8JsonRequestContent();
 0163            content.JsonWriter.WriteObjectValue(parameters);
 0164            request.Content = content;
 0165            return message;
 166        }
 167
 168        /// <summary> Creates or updates an ipGroups in a specified resource group. </summary>
 169        /// <param name="resourceGroupName"> The name of the resource group. </param>
 170        /// <param name="ipGroupsName"> The name of the ipGroups. </param>
 171        /// <param name="parameters"> Parameters supplied to the create or update IpGroups operation. </param>
 172        /// <param name="cancellationToken"> The cancellation token to use. </param>
 173        public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string ipGroupsName, IpGroup parameter
 174        {
 0175            if (resourceGroupName == null)
 176            {
 0177                throw new ArgumentNullException(nameof(resourceGroupName));
 178            }
 0179            if (ipGroupsName == null)
 180            {
 0181                throw new ArgumentNullException(nameof(ipGroupsName));
 182            }
 0183            if (parameters == null)
 184            {
 0185                throw new ArgumentNullException(nameof(parameters));
 186            }
 187
 0188            using var message = CreateCreateOrUpdateRequest(resourceGroupName, ipGroupsName, parameters);
 0189            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0190            switch (message.Response.Status)
 191            {
 192                case 200:
 193                case 201:
 0194                    return message.Response;
 195                default:
 0196                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 197            }
 0198        }
 199
 200        /// <summary> Creates or updates an ipGroups in a specified resource group. </summary>
 201        /// <param name="resourceGroupName"> The name of the resource group. </param>
 202        /// <param name="ipGroupsName"> The name of the ipGroups. </param>
 203        /// <param name="parameters"> Parameters supplied to the create or update IpGroups operation. </param>
 204        /// <param name="cancellationToken"> The cancellation token to use. </param>
 205        public Response CreateOrUpdate(string resourceGroupName, string ipGroupsName, IpGroup parameters, CancellationTo
 206        {
 0207            if (resourceGroupName == null)
 208            {
 0209                throw new ArgumentNullException(nameof(resourceGroupName));
 210            }
 0211            if (ipGroupsName == null)
 212            {
 0213                throw new ArgumentNullException(nameof(ipGroupsName));
 214            }
 0215            if (parameters == null)
 216            {
 0217                throw new ArgumentNullException(nameof(parameters));
 218            }
 219
 0220            using var message = CreateCreateOrUpdateRequest(resourceGroupName, ipGroupsName, parameters);
 0221            _pipeline.Send(message, cancellationToken);
 0222            switch (message.Response.Status)
 223            {
 224                case 200:
 225                case 201:
 0226                    return message.Response;
 227                default:
 0228                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 229            }
 0230        }
 231
 232        internal HttpMessage CreateUpdateGroupsRequest(string resourceGroupName, string ipGroupsName, TagsObject paramet
 233        {
 0234            var message = _pipeline.CreateMessage();
 0235            var request = message.Request;
 0236            request.Method = RequestMethod.Patch;
 0237            var uri = new RawRequestUriBuilder();
 0238            uri.Reset(endpoint);
 0239            uri.AppendPath("/subscriptions/", false);
 0240            uri.AppendPath(subscriptionId, true);
 0241            uri.AppendPath("/resourceGroups/", false);
 0242            uri.AppendPath(resourceGroupName, true);
 0243            uri.AppendPath("/providers/Microsoft.Network/ipGroups/", false);
 0244            uri.AppendPath(ipGroupsName, true);
 0245            uri.AppendQuery("api-version", "2020-04-01", true);
 0246            request.Uri = uri;
 0247            request.Headers.Add("Content-Type", "application/json");
 0248            var content = new Utf8JsonRequestContent();
 0249            content.JsonWriter.WriteObjectValue(parameters);
 0250            request.Content = content;
 0251            return message;
 252        }
 253
 254        /// <summary> Updates tags of an IpGroups resource. </summary>
 255        /// <param name="resourceGroupName"> The name of the resource group. </param>
 256        /// <param name="ipGroupsName"> The name of the ipGroups. </param>
 257        /// <param name="parameters"> Parameters supplied to the update ipGroups operation. </param>
 258        /// <param name="cancellationToken"> The cancellation token to use. </param>
 259        public async Task<Response<IpGroup>> UpdateGroupsAsync(string resourceGroupName, string ipGroupsName, TagsObject
 260        {
 0261            if (resourceGroupName == null)
 262            {
 0263                throw new ArgumentNullException(nameof(resourceGroupName));
 264            }
 0265            if (ipGroupsName == null)
 266            {
 0267                throw new ArgumentNullException(nameof(ipGroupsName));
 268            }
 0269            if (parameters == null)
 270            {
 0271                throw new ArgumentNullException(nameof(parameters));
 272            }
 273
 0274            using var message = CreateUpdateGroupsRequest(resourceGroupName, ipGroupsName, parameters);
 0275            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0276            switch (message.Response.Status)
 277            {
 278                case 200:
 279                    {
 0280                        IpGroup value = default;
 0281                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0282                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 283                        {
 0284                            value = null;
 285                        }
 286                        else
 287                        {
 0288                            value = IpGroup.DeserializeIpGroup(document.RootElement);
 289                        }
 0290                        return Response.FromValue(value, message.Response);
 291                    }
 292                default:
 0293                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 294            }
 0295        }
 296
 297        /// <summary> Updates tags of an IpGroups resource. </summary>
 298        /// <param name="resourceGroupName"> The name of the resource group. </param>
 299        /// <param name="ipGroupsName"> The name of the ipGroups. </param>
 300        /// <param name="parameters"> Parameters supplied to the update ipGroups operation. </param>
 301        /// <param name="cancellationToken"> The cancellation token to use. </param>
 302        public Response<IpGroup> UpdateGroups(string resourceGroupName, string ipGroupsName, TagsObject parameters, Canc
 303        {
 0304            if (resourceGroupName == null)
 305            {
 0306                throw new ArgumentNullException(nameof(resourceGroupName));
 307            }
 0308            if (ipGroupsName == null)
 309            {
 0310                throw new ArgumentNullException(nameof(ipGroupsName));
 311            }
 0312            if (parameters == null)
 313            {
 0314                throw new ArgumentNullException(nameof(parameters));
 315            }
 316
 0317            using var message = CreateUpdateGroupsRequest(resourceGroupName, ipGroupsName, parameters);
 0318            _pipeline.Send(message, cancellationToken);
 0319            switch (message.Response.Status)
 320            {
 321                case 200:
 322                    {
 0323                        IpGroup value = default;
 0324                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0325                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 326                        {
 0327                            value = null;
 328                        }
 329                        else
 330                        {
 0331                            value = IpGroup.DeserializeIpGroup(document.RootElement);
 332                        }
 0333                        return Response.FromValue(value, message.Response);
 334                    }
 335                default:
 0336                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 337            }
 0338        }
 339
 340        internal HttpMessage CreateDeleteRequest(string resourceGroupName, string ipGroupsName)
 341        {
 0342            var message = _pipeline.CreateMessage();
 0343            var request = message.Request;
 0344            request.Method = RequestMethod.Delete;
 0345            var uri = new RawRequestUriBuilder();
 0346            uri.Reset(endpoint);
 0347            uri.AppendPath("/subscriptions/", false);
 0348            uri.AppendPath(subscriptionId, true);
 0349            uri.AppendPath("/resourceGroups/", false);
 0350            uri.AppendPath(resourceGroupName, true);
 0351            uri.AppendPath("/providers/Microsoft.Network/ipGroups/", false);
 0352            uri.AppendPath(ipGroupsName, true);
 0353            uri.AppendQuery("api-version", "2020-04-01", true);
 0354            request.Uri = uri;
 0355            return message;
 356        }
 357
 358        /// <summary> Deletes the specified ipGroups. </summary>
 359        /// <param name="resourceGroupName"> The name of the resource group. </param>
 360        /// <param name="ipGroupsName"> The name of the ipGroups. </param>
 361        /// <param name="cancellationToken"> The cancellation token to use. </param>
 362        public async Task<Response> DeleteAsync(string resourceGroupName, string ipGroupsName, CancellationToken cancell
 363        {
 0364            if (resourceGroupName == null)
 365            {
 0366                throw new ArgumentNullException(nameof(resourceGroupName));
 367            }
 0368            if (ipGroupsName == null)
 369            {
 0370                throw new ArgumentNullException(nameof(ipGroupsName));
 371            }
 372
 0373            using var message = CreateDeleteRequest(resourceGroupName, ipGroupsName);
 0374            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0375            switch (message.Response.Status)
 376            {
 377                case 200:
 378                case 202:
 379                case 204:
 0380                    return message.Response;
 381                default:
 0382                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 383            }
 0384        }
 385
 386        /// <summary> Deletes the specified ipGroups. </summary>
 387        /// <param name="resourceGroupName"> The name of the resource group. </param>
 388        /// <param name="ipGroupsName"> The name of the ipGroups. </param>
 389        /// <param name="cancellationToken"> The cancellation token to use. </param>
 390        public Response Delete(string resourceGroupName, string ipGroupsName, CancellationToken cancellationToken = defa
 391        {
 0392            if (resourceGroupName == null)
 393            {
 0394                throw new ArgumentNullException(nameof(resourceGroupName));
 395            }
 0396            if (ipGroupsName == null)
 397            {
 0398                throw new ArgumentNullException(nameof(ipGroupsName));
 399            }
 400
 0401            using var message = CreateDeleteRequest(resourceGroupName, ipGroupsName);
 0402            _pipeline.Send(message, cancellationToken);
 0403            switch (message.Response.Status)
 404            {
 405                case 200:
 406                case 202:
 407                case 204:
 0408                    return message.Response;
 409                default:
 0410                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 411            }
 0412        }
 413
 414        internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName)
 415        {
 0416            var message = _pipeline.CreateMessage();
 0417            var request = message.Request;
 0418            request.Method = RequestMethod.Get;
 0419            var uri = new RawRequestUriBuilder();
 0420            uri.Reset(endpoint);
 0421            uri.AppendPath("/subscriptions/", false);
 0422            uri.AppendPath(subscriptionId, true);
 0423            uri.AppendPath("/resourceGroups/", false);
 0424            uri.AppendPath(resourceGroupName, true);
 0425            uri.AppendPath("/providers/Microsoft.Network/ipGroups", false);
 0426            uri.AppendQuery("api-version", "2020-04-01", true);
 0427            request.Uri = uri;
 0428            return message;
 429        }
 430
 431        /// <summary> Gets all IpGroups in a resource group. </summary>
 432        /// <param name="resourceGroupName"> The name of the resource group. </param>
 433        /// <param name="cancellationToken"> The cancellation token to use. </param>
 434        public async Task<Response<IpGroupListResult>> ListByResourceGroupAsync(string resourceGroupName, CancellationTo
 435        {
 0436            if (resourceGroupName == null)
 437            {
 0438                throw new ArgumentNullException(nameof(resourceGroupName));
 439            }
 440
 0441            using var message = CreateListByResourceGroupRequest(resourceGroupName);
 0442            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0443            switch (message.Response.Status)
 444            {
 445                case 200:
 446                    {
 0447                        IpGroupListResult value = default;
 0448                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0449                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 450                        {
 0451                            value = null;
 452                        }
 453                        else
 454                        {
 0455                            value = IpGroupListResult.DeserializeIpGroupListResult(document.RootElement);
 456                        }
 0457                        return Response.FromValue(value, message.Response);
 458                    }
 459                default:
 0460                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 461            }
 0462        }
 463
 464        /// <summary> Gets all IpGroups in a resource group. </summary>
 465        /// <param name="resourceGroupName"> The name of the resource group. </param>
 466        /// <param name="cancellationToken"> The cancellation token to use. </param>
 467        public Response<IpGroupListResult> ListByResourceGroup(string resourceGroupName, CancellationToken cancellationT
 468        {
 0469            if (resourceGroupName == null)
 470            {
 0471                throw new ArgumentNullException(nameof(resourceGroupName));
 472            }
 473
 0474            using var message = CreateListByResourceGroupRequest(resourceGroupName);
 0475            _pipeline.Send(message, cancellationToken);
 0476            switch (message.Response.Status)
 477            {
 478                case 200:
 479                    {
 0480                        IpGroupListResult value = default;
 0481                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0482                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 483                        {
 0484                            value = null;
 485                        }
 486                        else
 487                        {
 0488                            value = IpGroupListResult.DeserializeIpGroupListResult(document.RootElement);
 489                        }
 0490                        return Response.FromValue(value, message.Response);
 491                    }
 492                default:
 0493                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 494            }
 0495        }
 496
 497        internal HttpMessage CreateListRequest()
 498        {
 0499            var message = _pipeline.CreateMessage();
 0500            var request = message.Request;
 0501            request.Method = RequestMethod.Get;
 0502            var uri = new RawRequestUriBuilder();
 0503            uri.Reset(endpoint);
 0504            uri.AppendPath("/subscriptions/", false);
 0505            uri.AppendPath(subscriptionId, true);
 0506            uri.AppendPath("/providers/Microsoft.Network/ipGroups", false);
 0507            uri.AppendQuery("api-version", "2020-04-01", true);
 0508            request.Uri = uri;
 0509            return message;
 510        }
 511
 512        /// <summary> Gets all IpGroups in a subscription. </summary>
 513        /// <param name="cancellationToken"> The cancellation token to use. </param>
 514        public async Task<Response<IpGroupListResult>> ListAsync(CancellationToken cancellationToken = default)
 515        {
 0516            using var message = CreateListRequest();
 0517            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0518            switch (message.Response.Status)
 519            {
 520                case 200:
 521                    {
 0522                        IpGroupListResult value = default;
 0523                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0524                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 525                        {
 0526                            value = null;
 527                        }
 528                        else
 529                        {
 0530                            value = IpGroupListResult.DeserializeIpGroupListResult(document.RootElement);
 531                        }
 0532                        return Response.FromValue(value, message.Response);
 533                    }
 534                default:
 0535                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 536            }
 0537        }
 538
 539        /// <summary> Gets all IpGroups in a subscription. </summary>
 540        /// <param name="cancellationToken"> The cancellation token to use. </param>
 541        public Response<IpGroupListResult> List(CancellationToken cancellationToken = default)
 542        {
 0543            using var message = CreateListRequest();
 0544            _pipeline.Send(message, cancellationToken);
 0545            switch (message.Response.Status)
 546            {
 547                case 200:
 548                    {
 0549                        IpGroupListResult value = default;
 0550                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0551                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 552                        {
 0553                            value = null;
 554                        }
 555                        else
 556                        {
 0557                            value = IpGroupListResult.DeserializeIpGroupListResult(document.RootElement);
 558                        }
 0559                        return Response.FromValue(value, message.Response);
 560                    }
 561                default:
 0562                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 563            }
 0564        }
 565
 566        internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string resourceGroupName)
 567        {
 0568            var message = _pipeline.CreateMessage();
 0569            var request = message.Request;
 0570            request.Method = RequestMethod.Get;
 0571            var uri = new RawRequestUriBuilder();
 0572            uri.Reset(endpoint);
 0573            uri.AppendRawNextLink(nextLink, false);
 0574            request.Uri = uri;
 0575            return message;
 576        }
 577
 578        /// <summary> Gets all IpGroups in a resource group. </summary>
 579        /// <param name="nextLink"> The URL to the next page of results. </param>
 580        /// <param name="resourceGroupName"> The name of the resource group. </param>
 581        /// <param name="cancellationToken"> The cancellation token to use. </param>
 582        public async Task<Response<IpGroupListResult>> ListByResourceGroupNextPageAsync(string nextLink, string resource
 583        {
 0584            if (nextLink == null)
 585            {
 0586                throw new ArgumentNullException(nameof(nextLink));
 587            }
 0588            if (resourceGroupName == null)
 589            {
 0590                throw new ArgumentNullException(nameof(resourceGroupName));
 591            }
 592
 0593            using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName);
 0594            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0595            switch (message.Response.Status)
 596            {
 597                case 200:
 598                    {
 0599                        IpGroupListResult value = default;
 0600                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0601                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 602                        {
 0603                            value = null;
 604                        }
 605                        else
 606                        {
 0607                            value = IpGroupListResult.DeserializeIpGroupListResult(document.RootElement);
 608                        }
 0609                        return Response.FromValue(value, message.Response);
 610                    }
 611                default:
 0612                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 613            }
 0614        }
 615
 616        /// <summary> Gets all IpGroups in a resource group. </summary>
 617        /// <param name="nextLink"> The URL to the next page of results. </param>
 618        /// <param name="resourceGroupName"> The name of the resource group. </param>
 619        /// <param name="cancellationToken"> The cancellation token to use. </param>
 620        public Response<IpGroupListResult> ListByResourceGroupNextPage(string nextLink, string resourceGroupName, Cancel
 621        {
 0622            if (nextLink == null)
 623            {
 0624                throw new ArgumentNullException(nameof(nextLink));
 625            }
 0626            if (resourceGroupName == null)
 627            {
 0628                throw new ArgumentNullException(nameof(resourceGroupName));
 629            }
 630
 0631            using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName);
 0632            _pipeline.Send(message, cancellationToken);
 0633            switch (message.Response.Status)
 634            {
 635                case 200:
 636                    {
 0637                        IpGroupListResult value = default;
 0638                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0639                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 640                        {
 0641                            value = null;
 642                        }
 643                        else
 644                        {
 0645                            value = IpGroupListResult.DeserializeIpGroupListResult(document.RootElement);
 646                        }
 0647                        return Response.FromValue(value, message.Response);
 648                    }
 649                default:
 0650                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 651            }
 0652        }
 653
 654        internal HttpMessage CreateListNextPageRequest(string nextLink)
 655        {
 0656            var message = _pipeline.CreateMessage();
 0657            var request = message.Request;
 0658            request.Method = RequestMethod.Get;
 0659            var uri = new RawRequestUriBuilder();
 0660            uri.Reset(endpoint);
 0661            uri.AppendRawNextLink(nextLink, false);
 0662            request.Uri = uri;
 0663            return message;
 664        }
 665
 666        /// <summary> Gets all IpGroups in a subscription. </summary>
 667        /// <param name="nextLink"> The URL to the next page of results. </param>
 668        /// <param name="cancellationToken"> The cancellation token to use. </param>
 669        public async Task<Response<IpGroupListResult>> ListNextPageAsync(string nextLink, CancellationToken cancellation
 670        {
 0671            if (nextLink == null)
 672            {
 0673                throw new ArgumentNullException(nameof(nextLink));
 674            }
 675
 0676            using var message = CreateListNextPageRequest(nextLink);
 0677            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0678            switch (message.Response.Status)
 679            {
 680                case 200:
 681                    {
 0682                        IpGroupListResult value = default;
 0683                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0684                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 685                        {
 0686                            value = null;
 687                        }
 688                        else
 689                        {
 0690                            value = IpGroupListResult.DeserializeIpGroupListResult(document.RootElement);
 691                        }
 0692                        return Response.FromValue(value, message.Response);
 693                    }
 694                default:
 0695                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 696            }
 0697        }
 698
 699        /// <summary> Gets all IpGroups in a subscription. </summary>
 700        /// <param name="nextLink"> The URL to the next page of results. </param>
 701        /// <param name="cancellationToken"> The cancellation token to use. </param>
 702        public Response<IpGroupListResult> ListNextPage(string nextLink, CancellationToken cancellationToken = default)
 703        {
 0704            if (nextLink == null)
 705            {
 0706                throw new ArgumentNullException(nameof(nextLink));
 707            }
 708
 0709            using var message = CreateListNextPageRequest(nextLink);
 0710            _pipeline.Send(message, cancellationToken);
 0711            switch (message.Response.Status)
 712            {
 713                case 200:
 714                    {
 0715                        IpGroupListResult value = default;
 0716                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0717                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 718                        {
 0719                            value = null;
 720                        }
 721                        else
 722                        {
 0723                            value = IpGroupListResult.DeserializeIpGroupListResult(document.RootElement);
 724                        }
 0725                        return Response.FromValue(value, message.Response);
 726                    }
 727                default:
 0728                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 729            }
 0730        }
 731    }
 732}