< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
CreateDeleteRequest(...)-0%100%
DeleteAsync()-0%0%
Delete(...)-0%0%
CreateGetRequest(...)-0%100%
GetAsync()-0%0%
Get(...)-0%0%
CreateCreateOrUpdateRequest(...)-0%100%
CreateOrUpdateAsync()-0%0%
CreateOrUpdate(...)-0%0%
CreateUpdateTagsRequest(...)-0%100%
UpdateTagsAsync()-0%0%
UpdateTags(...)-0%0%
CreateListAllRequest()-0%100%
ListAllAsync()-0%0%
ListAll(...)-0%0%
CreateListRequest(...)-0%100%
ListAsync()-0%0%
List(...)-0%0%
CreateListAllNextPageRequest(...)-0%100%
ListAllNextPageAsync()-0%0%
ListAllNextPage(...)-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\ApplicationSecurityGroupsRestOperations.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 ApplicationSecurityGroupsRestOperations
 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 ApplicationSecurityGroupsRestOperations. </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 ApplicationSecurityGroupsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, strin
 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 CreateDeleteRequest(string resourceGroupName, string applicationSecurityGroupName)
 47        {
 048            var message = _pipeline.CreateMessage();
 049            var request = message.Request;
 050            request.Method = RequestMethod.Delete;
 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/applicationSecurityGroups/", false);
 058            uri.AppendPath(applicationSecurityGroupName, true);
 059            uri.AppendQuery("api-version", "2020-04-01", true);
 060            request.Uri = uri;
 061            return message;
 62        }
 63
 64        /// <summary> Deletes the specified application security group. </summary>
 65        /// <param name="resourceGroupName"> The name of the resource group. </param>
 66        /// <param name="applicationSecurityGroupName"> The name of the application security group. </param>
 67        /// <param name="cancellationToken"> The cancellation token to use. </param>
 68        public async Task<Response> DeleteAsync(string resourceGroupName, string applicationSecurityGroupName, Cancellat
 69        {
 070            if (resourceGroupName == null)
 71            {
 072                throw new ArgumentNullException(nameof(resourceGroupName));
 73            }
 074            if (applicationSecurityGroupName == null)
 75            {
 076                throw new ArgumentNullException(nameof(applicationSecurityGroupName));
 77            }
 78
 079            using var message = CreateDeleteRequest(resourceGroupName, applicationSecurityGroupName);
 080            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 081            switch (message.Response.Status)
 82            {
 83                case 200:
 84                case 202:
 85                case 204:
 086                    return message.Response;
 87                default:
 088                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 89            }
 090        }
 91
 92        /// <summary> Deletes the specified application security group. </summary>
 93        /// <param name="resourceGroupName"> The name of the resource group. </param>
 94        /// <param name="applicationSecurityGroupName"> The name of the application security group. </param>
 95        /// <param name="cancellationToken"> The cancellation token to use. </param>
 96        public Response Delete(string resourceGroupName, string applicationSecurityGroupName, CancellationToken cancella
 97        {
 098            if (resourceGroupName == null)
 99            {
 0100                throw new ArgumentNullException(nameof(resourceGroupName));
 101            }
 0102            if (applicationSecurityGroupName == null)
 103            {
 0104                throw new ArgumentNullException(nameof(applicationSecurityGroupName));
 105            }
 106
 0107            using var message = CreateDeleteRequest(resourceGroupName, applicationSecurityGroupName);
 0108            _pipeline.Send(message, cancellationToken);
 0109            switch (message.Response.Status)
 110            {
 111                case 200:
 112                case 202:
 113                case 204:
 0114                    return message.Response;
 115                default:
 0116                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 117            }
 0118        }
 119
 120        internal HttpMessage CreateGetRequest(string resourceGroupName, string applicationSecurityGroupName)
 121        {
 0122            var message = _pipeline.CreateMessage();
 0123            var request = message.Request;
 0124            request.Method = RequestMethod.Get;
 0125            var uri = new RawRequestUriBuilder();
 0126            uri.Reset(endpoint);
 0127            uri.AppendPath("/subscriptions/", false);
 0128            uri.AppendPath(subscriptionId, true);
 0129            uri.AppendPath("/resourceGroups/", false);
 0130            uri.AppendPath(resourceGroupName, true);
 0131            uri.AppendPath("/providers/Microsoft.Network/applicationSecurityGroups/", false);
 0132            uri.AppendPath(applicationSecurityGroupName, true);
 0133            uri.AppendQuery("api-version", "2020-04-01", true);
 0134            request.Uri = uri;
 0135            return message;
 136        }
 137
 138        /// <summary> Gets information about the specified application security group. </summary>
 139        /// <param name="resourceGroupName"> The name of the resource group. </param>
 140        /// <param name="applicationSecurityGroupName"> The name of the application security group. </param>
 141        /// <param name="cancellationToken"> The cancellation token to use. </param>
 142        public async Task<Response<ApplicationSecurityGroup>> GetAsync(string resourceGroupName, string applicationSecur
 143        {
 0144            if (resourceGroupName == null)
 145            {
 0146                throw new ArgumentNullException(nameof(resourceGroupName));
 147            }
 0148            if (applicationSecurityGroupName == null)
 149            {
 0150                throw new ArgumentNullException(nameof(applicationSecurityGroupName));
 151            }
 152
 0153            using var message = CreateGetRequest(resourceGroupName, applicationSecurityGroupName);
 0154            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0155            switch (message.Response.Status)
 156            {
 157                case 200:
 158                    {
 0159                        ApplicationSecurityGroup value = default;
 0160                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0161                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 162                        {
 0163                            value = null;
 164                        }
 165                        else
 166                        {
 0167                            value = ApplicationSecurityGroup.DeserializeApplicationSecurityGroup(document.RootElement);
 168                        }
 0169                        return Response.FromValue(value, message.Response);
 170                    }
 171                default:
 0172                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 173            }
 0174        }
 175
 176        /// <summary> Gets information about the specified application security group. </summary>
 177        /// <param name="resourceGroupName"> The name of the resource group. </param>
 178        /// <param name="applicationSecurityGroupName"> The name of the application security group. </param>
 179        /// <param name="cancellationToken"> The cancellation token to use. </param>
 180        public Response<ApplicationSecurityGroup> Get(string resourceGroupName, string applicationSecurityGroupName, Can
 181        {
 0182            if (resourceGroupName == null)
 183            {
 0184                throw new ArgumentNullException(nameof(resourceGroupName));
 185            }
 0186            if (applicationSecurityGroupName == null)
 187            {
 0188                throw new ArgumentNullException(nameof(applicationSecurityGroupName));
 189            }
 190
 0191            using var message = CreateGetRequest(resourceGroupName, applicationSecurityGroupName);
 0192            _pipeline.Send(message, cancellationToken);
 0193            switch (message.Response.Status)
 194            {
 195                case 200:
 196                    {
 0197                        ApplicationSecurityGroup value = default;
 0198                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0199                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 200                        {
 0201                            value = null;
 202                        }
 203                        else
 204                        {
 0205                            value = ApplicationSecurityGroup.DeserializeApplicationSecurityGroup(document.RootElement);
 206                        }
 0207                        return Response.FromValue(value, message.Response);
 208                    }
 209                default:
 0210                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 211            }
 0212        }
 213
 214        internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string applicationSecurityGroupName, 
 215        {
 0216            var message = _pipeline.CreateMessage();
 0217            var request = message.Request;
 0218            request.Method = RequestMethod.Put;
 0219            var uri = new RawRequestUriBuilder();
 0220            uri.Reset(endpoint);
 0221            uri.AppendPath("/subscriptions/", false);
 0222            uri.AppendPath(subscriptionId, true);
 0223            uri.AppendPath("/resourceGroups/", false);
 0224            uri.AppendPath(resourceGroupName, true);
 0225            uri.AppendPath("/providers/Microsoft.Network/applicationSecurityGroups/", false);
 0226            uri.AppendPath(applicationSecurityGroupName, true);
 0227            uri.AppendQuery("api-version", "2020-04-01", true);
 0228            request.Uri = uri;
 0229            request.Headers.Add("Content-Type", "application/json");
 0230            var content = new Utf8JsonRequestContent();
 0231            content.JsonWriter.WriteObjectValue(parameters);
 0232            request.Content = content;
 0233            return message;
 234        }
 235
 236        /// <summary> Creates or updates an application security group. </summary>
 237        /// <param name="resourceGroupName"> The name of the resource group. </param>
 238        /// <param name="applicationSecurityGroupName"> The name of the application security group. </param>
 239        /// <param name="parameters"> Parameters supplied to the create or update ApplicationSecurityGroup operation. </
 240        /// <param name="cancellationToken"> The cancellation token to use. </param>
 241        public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string applicationSecurityGroupName, A
 242        {
 0243            if (resourceGroupName == null)
 244            {
 0245                throw new ArgumentNullException(nameof(resourceGroupName));
 246            }
 0247            if (applicationSecurityGroupName == null)
 248            {
 0249                throw new ArgumentNullException(nameof(applicationSecurityGroupName));
 250            }
 0251            if (parameters == null)
 252            {
 0253                throw new ArgumentNullException(nameof(parameters));
 254            }
 255
 0256            using var message = CreateCreateOrUpdateRequest(resourceGroupName, applicationSecurityGroupName, parameters)
 0257            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0258            switch (message.Response.Status)
 259            {
 260                case 200:
 261                case 201:
 0262                    return message.Response;
 263                default:
 0264                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 265            }
 0266        }
 267
 268        /// <summary> Creates or updates an application security group. </summary>
 269        /// <param name="resourceGroupName"> The name of the resource group. </param>
 270        /// <param name="applicationSecurityGroupName"> The name of the application security group. </param>
 271        /// <param name="parameters"> Parameters supplied to the create or update ApplicationSecurityGroup operation. </
 272        /// <param name="cancellationToken"> The cancellation token to use. </param>
 273        public Response CreateOrUpdate(string resourceGroupName, string applicationSecurityGroupName, ApplicationSecurit
 274        {
 0275            if (resourceGroupName == null)
 276            {
 0277                throw new ArgumentNullException(nameof(resourceGroupName));
 278            }
 0279            if (applicationSecurityGroupName == null)
 280            {
 0281                throw new ArgumentNullException(nameof(applicationSecurityGroupName));
 282            }
 0283            if (parameters == null)
 284            {
 0285                throw new ArgumentNullException(nameof(parameters));
 286            }
 287
 0288            using var message = CreateCreateOrUpdateRequest(resourceGroupName, applicationSecurityGroupName, parameters)
 0289            _pipeline.Send(message, cancellationToken);
 0290            switch (message.Response.Status)
 291            {
 292                case 200:
 293                case 201:
 0294                    return message.Response;
 295                default:
 0296                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 297            }
 0298        }
 299
 300        internal HttpMessage CreateUpdateTagsRequest(string resourceGroupName, string applicationSecurityGroupName, Tags
 301        {
 0302            var message = _pipeline.CreateMessage();
 0303            var request = message.Request;
 0304            request.Method = RequestMethod.Patch;
 0305            var uri = new RawRequestUriBuilder();
 0306            uri.Reset(endpoint);
 0307            uri.AppendPath("/subscriptions/", false);
 0308            uri.AppendPath(subscriptionId, true);
 0309            uri.AppendPath("/resourceGroups/", false);
 0310            uri.AppendPath(resourceGroupName, true);
 0311            uri.AppendPath("/providers/Microsoft.Network/applicationSecurityGroups/", false);
 0312            uri.AppendPath(applicationSecurityGroupName, true);
 0313            uri.AppendQuery("api-version", "2020-04-01", true);
 0314            request.Uri = uri;
 0315            request.Headers.Add("Content-Type", "application/json");
 0316            var content = new Utf8JsonRequestContent();
 0317            content.JsonWriter.WriteObjectValue(parameters);
 0318            request.Content = content;
 0319            return message;
 320        }
 321
 322        /// <summary> Updates an application security group&apos;s tags. </summary>
 323        /// <param name="resourceGroupName"> The name of the resource group. </param>
 324        /// <param name="applicationSecurityGroupName"> The name of the application security group. </param>
 325        /// <param name="parameters"> Parameters supplied to update application security group tags. </param>
 326        /// <param name="cancellationToken"> The cancellation token to use. </param>
 327        public async Task<Response<ApplicationSecurityGroup>> UpdateTagsAsync(string resourceGroupName, string applicati
 328        {
 0329            if (resourceGroupName == null)
 330            {
 0331                throw new ArgumentNullException(nameof(resourceGroupName));
 332            }
 0333            if (applicationSecurityGroupName == null)
 334            {
 0335                throw new ArgumentNullException(nameof(applicationSecurityGroupName));
 336            }
 0337            if (parameters == null)
 338            {
 0339                throw new ArgumentNullException(nameof(parameters));
 340            }
 341
 0342            using var message = CreateUpdateTagsRequest(resourceGroupName, applicationSecurityGroupName, parameters);
 0343            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0344            switch (message.Response.Status)
 345            {
 346                case 200:
 347                    {
 0348                        ApplicationSecurityGroup value = default;
 0349                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0350                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 351                        {
 0352                            value = null;
 353                        }
 354                        else
 355                        {
 0356                            value = ApplicationSecurityGroup.DeserializeApplicationSecurityGroup(document.RootElement);
 357                        }
 0358                        return Response.FromValue(value, message.Response);
 359                    }
 360                default:
 0361                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 362            }
 0363        }
 364
 365        /// <summary> Updates an application security group&apos;s tags. </summary>
 366        /// <param name="resourceGroupName"> The name of the resource group. </param>
 367        /// <param name="applicationSecurityGroupName"> The name of the application security group. </param>
 368        /// <param name="parameters"> Parameters supplied to update application security group tags. </param>
 369        /// <param name="cancellationToken"> The cancellation token to use. </param>
 370        public Response<ApplicationSecurityGroup> UpdateTags(string resourceGroupName, string applicationSecurityGroupNa
 371        {
 0372            if (resourceGroupName == null)
 373            {
 0374                throw new ArgumentNullException(nameof(resourceGroupName));
 375            }
 0376            if (applicationSecurityGroupName == null)
 377            {
 0378                throw new ArgumentNullException(nameof(applicationSecurityGroupName));
 379            }
 0380            if (parameters == null)
 381            {
 0382                throw new ArgumentNullException(nameof(parameters));
 383            }
 384
 0385            using var message = CreateUpdateTagsRequest(resourceGroupName, applicationSecurityGroupName, parameters);
 0386            _pipeline.Send(message, cancellationToken);
 0387            switch (message.Response.Status)
 388            {
 389                case 200:
 390                    {
 0391                        ApplicationSecurityGroup value = default;
 0392                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0393                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 394                        {
 0395                            value = null;
 396                        }
 397                        else
 398                        {
 0399                            value = ApplicationSecurityGroup.DeserializeApplicationSecurityGroup(document.RootElement);
 400                        }
 0401                        return Response.FromValue(value, message.Response);
 402                    }
 403                default:
 0404                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 405            }
 0406        }
 407
 408        internal HttpMessage CreateListAllRequest()
 409        {
 0410            var message = _pipeline.CreateMessage();
 0411            var request = message.Request;
 0412            request.Method = RequestMethod.Get;
 0413            var uri = new RawRequestUriBuilder();
 0414            uri.Reset(endpoint);
 0415            uri.AppendPath("/subscriptions/", false);
 0416            uri.AppendPath(subscriptionId, true);
 0417            uri.AppendPath("/providers/Microsoft.Network/applicationSecurityGroups", false);
 0418            uri.AppendQuery("api-version", "2020-04-01", true);
 0419            request.Uri = uri;
 0420            return message;
 421        }
 422
 423        /// <summary> Gets all application security groups in a subscription. </summary>
 424        /// <param name="cancellationToken"> The cancellation token to use. </param>
 425        public async Task<Response<ApplicationSecurityGroupListResult>> ListAllAsync(CancellationToken cancellationToken
 426        {
 0427            using var message = CreateListAllRequest();
 0428            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0429            switch (message.Response.Status)
 430            {
 431                case 200:
 432                    {
 0433                        ApplicationSecurityGroupListResult value = default;
 0434                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0435                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 436                        {
 0437                            value = null;
 438                        }
 439                        else
 440                        {
 0441                            value = ApplicationSecurityGroupListResult.DeserializeApplicationSecurityGroupListResult(doc
 442                        }
 0443                        return Response.FromValue(value, message.Response);
 444                    }
 445                default:
 0446                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 447            }
 0448        }
 449
 450        /// <summary> Gets all application security groups in a subscription. </summary>
 451        /// <param name="cancellationToken"> The cancellation token to use. </param>
 452        public Response<ApplicationSecurityGroupListResult> ListAll(CancellationToken cancellationToken = default)
 453        {
 0454            using var message = CreateListAllRequest();
 0455            _pipeline.Send(message, cancellationToken);
 0456            switch (message.Response.Status)
 457            {
 458                case 200:
 459                    {
 0460                        ApplicationSecurityGroupListResult value = default;
 0461                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0462                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 463                        {
 0464                            value = null;
 465                        }
 466                        else
 467                        {
 0468                            value = ApplicationSecurityGroupListResult.DeserializeApplicationSecurityGroupListResult(doc
 469                        }
 0470                        return Response.FromValue(value, message.Response);
 471                    }
 472                default:
 0473                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 474            }
 0475        }
 476
 477        internal HttpMessage CreateListRequest(string resourceGroupName)
 478        {
 0479            var message = _pipeline.CreateMessage();
 0480            var request = message.Request;
 0481            request.Method = RequestMethod.Get;
 0482            var uri = new RawRequestUriBuilder();
 0483            uri.Reset(endpoint);
 0484            uri.AppendPath("/subscriptions/", false);
 0485            uri.AppendPath(subscriptionId, true);
 0486            uri.AppendPath("/resourceGroups/", false);
 0487            uri.AppendPath(resourceGroupName, true);
 0488            uri.AppendPath("/providers/Microsoft.Network/applicationSecurityGroups", false);
 0489            uri.AppendQuery("api-version", "2020-04-01", true);
 0490            request.Uri = uri;
 0491            return message;
 492        }
 493
 494        /// <summary> Gets all the application security groups in a resource group. </summary>
 495        /// <param name="resourceGroupName"> The name of the resource group. </param>
 496        /// <param name="cancellationToken"> The cancellation token to use. </param>
 497        public async Task<Response<ApplicationSecurityGroupListResult>> ListAsync(string resourceGroupName, Cancellation
 498        {
 0499            if (resourceGroupName == null)
 500            {
 0501                throw new ArgumentNullException(nameof(resourceGroupName));
 502            }
 503
 0504            using var message = CreateListRequest(resourceGroupName);
 0505            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0506            switch (message.Response.Status)
 507            {
 508                case 200:
 509                    {
 0510                        ApplicationSecurityGroupListResult value = default;
 0511                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0512                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 513                        {
 0514                            value = null;
 515                        }
 516                        else
 517                        {
 0518                            value = ApplicationSecurityGroupListResult.DeserializeApplicationSecurityGroupListResult(doc
 519                        }
 0520                        return Response.FromValue(value, message.Response);
 521                    }
 522                default:
 0523                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 524            }
 0525        }
 526
 527        /// <summary> Gets all the application security groups in a resource group. </summary>
 528        /// <param name="resourceGroupName"> The name of the resource group. </param>
 529        /// <param name="cancellationToken"> The cancellation token to use. </param>
 530        public Response<ApplicationSecurityGroupListResult> List(string resourceGroupName, CancellationToken cancellatio
 531        {
 0532            if (resourceGroupName == null)
 533            {
 0534                throw new ArgumentNullException(nameof(resourceGroupName));
 535            }
 536
 0537            using var message = CreateListRequest(resourceGroupName);
 0538            _pipeline.Send(message, cancellationToken);
 0539            switch (message.Response.Status)
 540            {
 541                case 200:
 542                    {
 0543                        ApplicationSecurityGroupListResult value = default;
 0544                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0545                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 546                        {
 0547                            value = null;
 548                        }
 549                        else
 550                        {
 0551                            value = ApplicationSecurityGroupListResult.DeserializeApplicationSecurityGroupListResult(doc
 552                        }
 0553                        return Response.FromValue(value, message.Response);
 554                    }
 555                default:
 0556                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 557            }
 0558        }
 559
 560        internal HttpMessage CreateListAllNextPageRequest(string nextLink)
 561        {
 0562            var message = _pipeline.CreateMessage();
 0563            var request = message.Request;
 0564            request.Method = RequestMethod.Get;
 0565            var uri = new RawRequestUriBuilder();
 0566            uri.Reset(endpoint);
 0567            uri.AppendRawNextLink(nextLink, false);
 0568            request.Uri = uri;
 0569            return message;
 570        }
 571
 572        /// <summary> Gets all application security groups in a subscription. </summary>
 573        /// <param name="nextLink"> The URL to the next page of results. </param>
 574        /// <param name="cancellationToken"> The cancellation token to use. </param>
 575        public async Task<Response<ApplicationSecurityGroupListResult>> ListAllNextPageAsync(string nextLink, Cancellati
 576        {
 0577            if (nextLink == null)
 578            {
 0579                throw new ArgumentNullException(nameof(nextLink));
 580            }
 581
 0582            using var message = CreateListAllNextPageRequest(nextLink);
 0583            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0584            switch (message.Response.Status)
 585            {
 586                case 200:
 587                    {
 0588                        ApplicationSecurityGroupListResult value = default;
 0589                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0590                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 591                        {
 0592                            value = null;
 593                        }
 594                        else
 595                        {
 0596                            value = ApplicationSecurityGroupListResult.DeserializeApplicationSecurityGroupListResult(doc
 597                        }
 0598                        return Response.FromValue(value, message.Response);
 599                    }
 600                default:
 0601                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 602            }
 0603        }
 604
 605        /// <summary> Gets all application security groups in a subscription. </summary>
 606        /// <param name="nextLink"> The URL to the next page of results. </param>
 607        /// <param name="cancellationToken"> The cancellation token to use. </param>
 608        public Response<ApplicationSecurityGroupListResult> ListAllNextPage(string nextLink, CancellationToken cancellat
 609        {
 0610            if (nextLink == null)
 611            {
 0612                throw new ArgumentNullException(nameof(nextLink));
 613            }
 614
 0615            using var message = CreateListAllNextPageRequest(nextLink);
 0616            _pipeline.Send(message, cancellationToken);
 0617            switch (message.Response.Status)
 618            {
 619                case 200:
 620                    {
 0621                        ApplicationSecurityGroupListResult value = default;
 0622                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0623                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 624                        {
 0625                            value = null;
 626                        }
 627                        else
 628                        {
 0629                            value = ApplicationSecurityGroupListResult.DeserializeApplicationSecurityGroupListResult(doc
 630                        }
 0631                        return Response.FromValue(value, message.Response);
 632                    }
 633                default:
 0634                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 635            }
 0636        }
 637
 638        internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName)
 639        {
 0640            var message = _pipeline.CreateMessage();
 0641            var request = message.Request;
 0642            request.Method = RequestMethod.Get;
 0643            var uri = new RawRequestUriBuilder();
 0644            uri.Reset(endpoint);
 0645            uri.AppendRawNextLink(nextLink, false);
 0646            request.Uri = uri;
 0647            return message;
 648        }
 649
 650        /// <summary> Gets all the application security groups in a resource group. </summary>
 651        /// <param name="nextLink"> The URL to the next page of results. </param>
 652        /// <param name="resourceGroupName"> The name of the resource group. </param>
 653        /// <param name="cancellationToken"> The cancellation token to use. </param>
 654        public async Task<Response<ApplicationSecurityGroupListResult>> ListNextPageAsync(string nextLink, string resour
 655        {
 0656            if (nextLink == null)
 657            {
 0658                throw new ArgumentNullException(nameof(nextLink));
 659            }
 0660            if (resourceGroupName == null)
 661            {
 0662                throw new ArgumentNullException(nameof(resourceGroupName));
 663            }
 664
 0665            using var message = CreateListNextPageRequest(nextLink, resourceGroupName);
 0666            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0667            switch (message.Response.Status)
 668            {
 669                case 200:
 670                    {
 0671                        ApplicationSecurityGroupListResult value = default;
 0672                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0673                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 674                        {
 0675                            value = null;
 676                        }
 677                        else
 678                        {
 0679                            value = ApplicationSecurityGroupListResult.DeserializeApplicationSecurityGroupListResult(doc
 680                        }
 0681                        return Response.FromValue(value, message.Response);
 682                    }
 683                default:
 0684                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 685            }
 0686        }
 687
 688        /// <summary> Gets all the application security groups in a resource group. </summary>
 689        /// <param name="nextLink"> The URL to the next page of results. </param>
 690        /// <param name="resourceGroupName"> The name of the resource group. </param>
 691        /// <param name="cancellationToken"> The cancellation token to use. </param>
 692        public Response<ApplicationSecurityGroupListResult> ListNextPage(string nextLink, string resourceGroupName, Canc
 693        {
 0694            if (nextLink == null)
 695            {
 0696                throw new ArgumentNullException(nameof(nextLink));
 697            }
 0698            if (resourceGroupName == null)
 699            {
 0700                throw new ArgumentNullException(nameof(resourceGroupName));
 701            }
 702
 0703            using var message = CreateListNextPageRequest(nextLink, resourceGroupName);
 0704            _pipeline.Send(message, cancellationToken);
 0705            switch (message.Response.Status)
 706            {
 707                case 200:
 708                    {
 0709                        ApplicationSecurityGroupListResult value = default;
 0710                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0711                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 712                        {
 0713                            value = null;
 714                        }
 715                        else
 716                        {
 0717                            value = ApplicationSecurityGroupListResult.DeserializeApplicationSecurityGroupListResult(doc
 718                        }
 0719                        return Response.FromValue(value, message.Response);
 720                    }
 721                default:
 0722                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 723            }
 0724        }
 725    }
 726}