< Summary

Class:Azure.ResourceManager.Network.AzureFirewallsRestOperations
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\AzureFirewallsRestOperations.cs
Covered lines:0
Uncovered lines:315
Coverable lines:315
Total lines:704
Line coverage:0% (0 of 315)
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%
CreateListRequest(...)-0%100%
ListAsync()-0%0%
List(...)-0%0%
CreateListAllRequest()-0%100%
ListAllAsync()-0%0%
ListAll(...)-0%0%
CreateListNextPageRequest(...)-0%100%
ListNextPageAsync()-0%0%
ListNextPage(...)-0%0%
CreateListAllNextPageRequest(...)-0%100%
ListAllNextPageAsync()-0%0%
ListAllNextPage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\AzureFirewallsRestOperations.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 AzureFirewallsRestOperations
 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 AzureFirewallsRestOperations. </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 AzureFirewallsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscript
 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 azureFirewallName)
 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/azureFirewalls/", false);
 058            uri.AppendPath(azureFirewallName, true);
 059            uri.AppendQuery("api-version", "2020-04-01", true);
 060            request.Uri = uri;
 061            return message;
 62        }
 63
 64        /// <summary> Deletes the specified Azure Firewall. </summary>
 65        /// <param name="resourceGroupName"> The name of the resource group. </param>
 66        /// <param name="azureFirewallName"> The name of the Azure Firewall. </param>
 67        /// <param name="cancellationToken"> The cancellation token to use. </param>
 68        public async Task<Response> DeleteAsync(string resourceGroupName, string azureFirewallName, CancellationToken ca
 69        {
 070            if (resourceGroupName == null)
 71            {
 072                throw new ArgumentNullException(nameof(resourceGroupName));
 73            }
 074            if (azureFirewallName == null)
 75            {
 076                throw new ArgumentNullException(nameof(azureFirewallName));
 77            }
 78
 079            using var message = CreateDeleteRequest(resourceGroupName, azureFirewallName);
 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 Azure Firewall. </summary>
 93        /// <param name="resourceGroupName"> The name of the resource group. </param>
 94        /// <param name="azureFirewallName"> The name of the Azure Firewall. </param>
 95        /// <param name="cancellationToken"> The cancellation token to use. </param>
 96        public Response Delete(string resourceGroupName, string azureFirewallName, CancellationToken cancellationToken =
 97        {
 098            if (resourceGroupName == null)
 99            {
 0100                throw new ArgumentNullException(nameof(resourceGroupName));
 101            }
 0102            if (azureFirewallName == null)
 103            {
 0104                throw new ArgumentNullException(nameof(azureFirewallName));
 105            }
 106
 0107            using var message = CreateDeleteRequest(resourceGroupName, azureFirewallName);
 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 azureFirewallName)
 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/azureFirewalls/", false);
 0132            uri.AppendPath(azureFirewallName, true);
 0133            uri.AppendQuery("api-version", "2020-04-01", true);
 0134            request.Uri = uri;
 0135            return message;
 136        }
 137
 138        /// <summary> Gets the specified Azure Firewall. </summary>
 139        /// <param name="resourceGroupName"> The name of the resource group. </param>
 140        /// <param name="azureFirewallName"> The name of the Azure Firewall. </param>
 141        /// <param name="cancellationToken"> The cancellation token to use. </param>
 142        public async Task<Response<AzureFirewall>> GetAsync(string resourceGroupName, string azureFirewallName, Cancella
 143        {
 0144            if (resourceGroupName == null)
 145            {
 0146                throw new ArgumentNullException(nameof(resourceGroupName));
 147            }
 0148            if (azureFirewallName == null)
 149            {
 0150                throw new ArgumentNullException(nameof(azureFirewallName));
 151            }
 152
 0153            using var message = CreateGetRequest(resourceGroupName, azureFirewallName);
 0154            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0155            switch (message.Response.Status)
 156            {
 157                case 200:
 158                    {
 0159                        AzureFirewall 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 = AzureFirewall.DeserializeAzureFirewall(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 the specified Azure Firewall. </summary>
 177        /// <param name="resourceGroupName"> The name of the resource group. </param>
 178        /// <param name="azureFirewallName"> The name of the Azure Firewall. </param>
 179        /// <param name="cancellationToken"> The cancellation token to use. </param>
 180        public Response<AzureFirewall> Get(string resourceGroupName, string azureFirewallName, CancellationToken cancell
 181        {
 0182            if (resourceGroupName == null)
 183            {
 0184                throw new ArgumentNullException(nameof(resourceGroupName));
 185            }
 0186            if (azureFirewallName == null)
 187            {
 0188                throw new ArgumentNullException(nameof(azureFirewallName));
 189            }
 190
 0191            using var message = CreateGetRequest(resourceGroupName, azureFirewallName);
 0192            _pipeline.Send(message, cancellationToken);
 0193            switch (message.Response.Status)
 194            {
 195                case 200:
 196                    {
 0197                        AzureFirewall 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 = AzureFirewall.DeserializeAzureFirewall(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 azureFirewallName, AzureFirewa
 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/azureFirewalls/", false);
 0226            uri.AppendPath(azureFirewallName, 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 the specified Azure Firewall. </summary>
 237        /// <param name="resourceGroupName"> The name of the resource group. </param>
 238        /// <param name="azureFirewallName"> The name of the Azure Firewall. </param>
 239        /// <param name="parameters"> Parameters supplied to the create or update Azure Firewall operation. </param>
 240        /// <param name="cancellationToken"> The cancellation token to use. </param>
 241        public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string azureFirewallName, AzureFirewal
 242        {
 0243            if (resourceGroupName == null)
 244            {
 0245                throw new ArgumentNullException(nameof(resourceGroupName));
 246            }
 0247            if (azureFirewallName == null)
 248            {
 0249                throw new ArgumentNullException(nameof(azureFirewallName));
 250            }
 0251            if (parameters == null)
 252            {
 0253                throw new ArgumentNullException(nameof(parameters));
 254            }
 255
 0256            using var message = CreateCreateOrUpdateRequest(resourceGroupName, azureFirewallName, 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 the specified Azure Firewall. </summary>
 269        /// <param name="resourceGroupName"> The name of the resource group. </param>
 270        /// <param name="azureFirewallName"> The name of the Azure Firewall. </param>
 271        /// <param name="parameters"> Parameters supplied to the create or update Azure Firewall operation. </param>
 272        /// <param name="cancellationToken"> The cancellation token to use. </param>
 273        public Response CreateOrUpdate(string resourceGroupName, string azureFirewallName, AzureFirewall parameters, Can
 274        {
 0275            if (resourceGroupName == null)
 276            {
 0277                throw new ArgumentNullException(nameof(resourceGroupName));
 278            }
 0279            if (azureFirewallName == null)
 280            {
 0281                throw new ArgumentNullException(nameof(azureFirewallName));
 282            }
 0283            if (parameters == null)
 284            {
 0285                throw new ArgumentNullException(nameof(parameters));
 286            }
 287
 0288            using var message = CreateCreateOrUpdateRequest(resourceGroupName, azureFirewallName, 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 azureFirewallName, TagsObject para
 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/azureFirewalls/", false);
 0312            uri.AppendPath(azureFirewallName, 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 tags of an Azure Firewall resource. </summary>
 323        /// <param name="resourceGroupName"> The name of the resource group. </param>
 324        /// <param name="azureFirewallName"> The name of the Azure Firewall. </param>
 325        /// <param name="parameters"> Parameters supplied to update azure firewall tags. </param>
 326        /// <param name="cancellationToken"> The cancellation token to use. </param>
 327        public async Task<Response> UpdateTagsAsync(string resourceGroupName, string azureFirewallName, TagsObject param
 328        {
 0329            if (resourceGroupName == null)
 330            {
 0331                throw new ArgumentNullException(nameof(resourceGroupName));
 332            }
 0333            if (azureFirewallName == null)
 334            {
 0335                throw new ArgumentNullException(nameof(azureFirewallName));
 336            }
 0337            if (parameters == null)
 338            {
 0339                throw new ArgumentNullException(nameof(parameters));
 340            }
 341
 0342            using var message = CreateUpdateTagsRequest(resourceGroupName, azureFirewallName, parameters);
 0343            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0344            switch (message.Response.Status)
 345            {
 346                case 200:
 347                case 202:
 0348                    return message.Response;
 349                default:
 0350                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 351            }
 0352        }
 353
 354        /// <summary> Updates tags of an Azure Firewall resource. </summary>
 355        /// <param name="resourceGroupName"> The name of the resource group. </param>
 356        /// <param name="azureFirewallName"> The name of the Azure Firewall. </param>
 357        /// <param name="parameters"> Parameters supplied to update azure firewall tags. </param>
 358        /// <param name="cancellationToken"> The cancellation token to use. </param>
 359        public Response UpdateTags(string resourceGroupName, string azureFirewallName, TagsObject parameters, Cancellati
 360        {
 0361            if (resourceGroupName == null)
 362            {
 0363                throw new ArgumentNullException(nameof(resourceGroupName));
 364            }
 0365            if (azureFirewallName == null)
 366            {
 0367                throw new ArgumentNullException(nameof(azureFirewallName));
 368            }
 0369            if (parameters == null)
 370            {
 0371                throw new ArgumentNullException(nameof(parameters));
 372            }
 373
 0374            using var message = CreateUpdateTagsRequest(resourceGroupName, azureFirewallName, parameters);
 0375            _pipeline.Send(message, cancellationToken);
 0376            switch (message.Response.Status)
 377            {
 378                case 200:
 379                case 202:
 0380                    return message.Response;
 381                default:
 0382                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 383            }
 0384        }
 385
 386        internal HttpMessage CreateListRequest(string resourceGroupName)
 387        {
 0388            var message = _pipeline.CreateMessage();
 0389            var request = message.Request;
 0390            request.Method = RequestMethod.Get;
 0391            var uri = new RawRequestUriBuilder();
 0392            uri.Reset(endpoint);
 0393            uri.AppendPath("/subscriptions/", false);
 0394            uri.AppendPath(subscriptionId, true);
 0395            uri.AppendPath("/resourceGroups/", false);
 0396            uri.AppendPath(resourceGroupName, true);
 0397            uri.AppendPath("/providers/Microsoft.Network/azureFirewalls", false);
 0398            uri.AppendQuery("api-version", "2020-04-01", true);
 0399            request.Uri = uri;
 0400            return message;
 401        }
 402
 403        /// <summary> Lists all Azure Firewalls in a resource group. </summary>
 404        /// <param name="resourceGroupName"> The name of the resource group. </param>
 405        /// <param name="cancellationToken"> The cancellation token to use. </param>
 406        public async Task<Response<AzureFirewallListResult>> ListAsync(string resourceGroupName, CancellationToken cance
 407        {
 0408            if (resourceGroupName == null)
 409            {
 0410                throw new ArgumentNullException(nameof(resourceGroupName));
 411            }
 412
 0413            using var message = CreateListRequest(resourceGroupName);
 0414            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0415            switch (message.Response.Status)
 416            {
 417                case 200:
 418                    {
 0419                        AzureFirewallListResult value = default;
 0420                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0421                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 422                        {
 0423                            value = null;
 424                        }
 425                        else
 426                        {
 0427                            value = AzureFirewallListResult.DeserializeAzureFirewallListResult(document.RootElement);
 428                        }
 0429                        return Response.FromValue(value, message.Response);
 430                    }
 431                default:
 0432                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 433            }
 0434        }
 435
 436        /// <summary> Lists all Azure Firewalls in a resource group. </summary>
 437        /// <param name="resourceGroupName"> The name of the resource group. </param>
 438        /// <param name="cancellationToken"> The cancellation token to use. </param>
 439        public Response<AzureFirewallListResult> List(string resourceGroupName, CancellationToken cancellationToken = de
 440        {
 0441            if (resourceGroupName == null)
 442            {
 0443                throw new ArgumentNullException(nameof(resourceGroupName));
 444            }
 445
 0446            using var message = CreateListRequest(resourceGroupName);
 0447            _pipeline.Send(message, cancellationToken);
 0448            switch (message.Response.Status)
 449            {
 450                case 200:
 451                    {
 0452                        AzureFirewallListResult value = default;
 0453                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0454                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 455                        {
 0456                            value = null;
 457                        }
 458                        else
 459                        {
 0460                            value = AzureFirewallListResult.DeserializeAzureFirewallListResult(document.RootElement);
 461                        }
 0462                        return Response.FromValue(value, message.Response);
 463                    }
 464                default:
 0465                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 466            }
 0467        }
 468
 469        internal HttpMessage CreateListAllRequest()
 470        {
 0471            var message = _pipeline.CreateMessage();
 0472            var request = message.Request;
 0473            request.Method = RequestMethod.Get;
 0474            var uri = new RawRequestUriBuilder();
 0475            uri.Reset(endpoint);
 0476            uri.AppendPath("/subscriptions/", false);
 0477            uri.AppendPath(subscriptionId, true);
 0478            uri.AppendPath("/providers/Microsoft.Network/azureFirewalls", false);
 0479            uri.AppendQuery("api-version", "2020-04-01", true);
 0480            request.Uri = uri;
 0481            return message;
 482        }
 483
 484        /// <summary> Gets all the Azure Firewalls in a subscription. </summary>
 485        /// <param name="cancellationToken"> The cancellation token to use. </param>
 486        public async Task<Response<AzureFirewallListResult>> ListAllAsync(CancellationToken cancellationToken = default)
 487        {
 0488            using var message = CreateListAllRequest();
 0489            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0490            switch (message.Response.Status)
 491            {
 492                case 200:
 493                    {
 0494                        AzureFirewallListResult value = default;
 0495                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0496                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 497                        {
 0498                            value = null;
 499                        }
 500                        else
 501                        {
 0502                            value = AzureFirewallListResult.DeserializeAzureFirewallListResult(document.RootElement);
 503                        }
 0504                        return Response.FromValue(value, message.Response);
 505                    }
 506                default:
 0507                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 508            }
 0509        }
 510
 511        /// <summary> Gets all the Azure Firewalls in a subscription. </summary>
 512        /// <param name="cancellationToken"> The cancellation token to use. </param>
 513        public Response<AzureFirewallListResult> ListAll(CancellationToken cancellationToken = default)
 514        {
 0515            using var message = CreateListAllRequest();
 0516            _pipeline.Send(message, cancellationToken);
 0517            switch (message.Response.Status)
 518            {
 519                case 200:
 520                    {
 0521                        AzureFirewallListResult value = default;
 0522                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0523                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 524                        {
 0525                            value = null;
 526                        }
 527                        else
 528                        {
 0529                            value = AzureFirewallListResult.DeserializeAzureFirewallListResult(document.RootElement);
 530                        }
 0531                        return Response.FromValue(value, message.Response);
 532                    }
 533                default:
 0534                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 535            }
 0536        }
 537
 538        internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName)
 539        {
 0540            var message = _pipeline.CreateMessage();
 0541            var request = message.Request;
 0542            request.Method = RequestMethod.Get;
 0543            var uri = new RawRequestUriBuilder();
 0544            uri.Reset(endpoint);
 0545            uri.AppendRawNextLink(nextLink, false);
 0546            request.Uri = uri;
 0547            return message;
 548        }
 549
 550        /// <summary> Lists all Azure Firewalls in a resource group. </summary>
 551        /// <param name="nextLink"> The URL to the next page of results. </param>
 552        /// <param name="resourceGroupName"> The name of the resource group. </param>
 553        /// <param name="cancellationToken"> The cancellation token to use. </param>
 554        public async Task<Response<AzureFirewallListResult>> ListNextPageAsync(string nextLink, string resourceGroupName
 555        {
 0556            if (nextLink == null)
 557            {
 0558                throw new ArgumentNullException(nameof(nextLink));
 559            }
 0560            if (resourceGroupName == null)
 561            {
 0562                throw new ArgumentNullException(nameof(resourceGroupName));
 563            }
 564
 0565            using var message = CreateListNextPageRequest(nextLink, resourceGroupName);
 0566            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0567            switch (message.Response.Status)
 568            {
 569                case 200:
 570                    {
 0571                        AzureFirewallListResult value = default;
 0572                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0573                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 574                        {
 0575                            value = null;
 576                        }
 577                        else
 578                        {
 0579                            value = AzureFirewallListResult.DeserializeAzureFirewallListResult(document.RootElement);
 580                        }
 0581                        return Response.FromValue(value, message.Response);
 582                    }
 583                default:
 0584                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 585            }
 0586        }
 587
 588        /// <summary> Lists all Azure Firewalls in a resource group. </summary>
 589        /// <param name="nextLink"> The URL to the next page of results. </param>
 590        /// <param name="resourceGroupName"> The name of the resource group. </param>
 591        /// <param name="cancellationToken"> The cancellation token to use. </param>
 592        public Response<AzureFirewallListResult> ListNextPage(string nextLink, string resourceGroupName, CancellationTok
 593        {
 0594            if (nextLink == null)
 595            {
 0596                throw new ArgumentNullException(nameof(nextLink));
 597            }
 0598            if (resourceGroupName == null)
 599            {
 0600                throw new ArgumentNullException(nameof(resourceGroupName));
 601            }
 602
 0603            using var message = CreateListNextPageRequest(nextLink, resourceGroupName);
 0604            _pipeline.Send(message, cancellationToken);
 0605            switch (message.Response.Status)
 606            {
 607                case 200:
 608                    {
 0609                        AzureFirewallListResult value = default;
 0610                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0611                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 612                        {
 0613                            value = null;
 614                        }
 615                        else
 616                        {
 0617                            value = AzureFirewallListResult.DeserializeAzureFirewallListResult(document.RootElement);
 618                        }
 0619                        return Response.FromValue(value, message.Response);
 620                    }
 621                default:
 0622                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 623            }
 0624        }
 625
 626        internal HttpMessage CreateListAllNextPageRequest(string nextLink)
 627        {
 0628            var message = _pipeline.CreateMessage();
 0629            var request = message.Request;
 0630            request.Method = RequestMethod.Get;
 0631            var uri = new RawRequestUriBuilder();
 0632            uri.Reset(endpoint);
 0633            uri.AppendRawNextLink(nextLink, false);
 0634            request.Uri = uri;
 0635            return message;
 636        }
 637
 638        /// <summary> Gets all the Azure Firewalls in a subscription. </summary>
 639        /// <param name="nextLink"> The URL to the next page of results. </param>
 640        /// <param name="cancellationToken"> The cancellation token to use. </param>
 641        public async Task<Response<AzureFirewallListResult>> ListAllNextPageAsync(string nextLink, CancellationToken can
 642        {
 0643            if (nextLink == null)
 644            {
 0645                throw new ArgumentNullException(nameof(nextLink));
 646            }
 647
 0648            using var message = CreateListAllNextPageRequest(nextLink);
 0649            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0650            switch (message.Response.Status)
 651            {
 652                case 200:
 653                    {
 0654                        AzureFirewallListResult value = default;
 0655                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0656                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 657                        {
 0658                            value = null;
 659                        }
 660                        else
 661                        {
 0662                            value = AzureFirewallListResult.DeserializeAzureFirewallListResult(document.RootElement);
 663                        }
 0664                        return Response.FromValue(value, message.Response);
 665                    }
 666                default:
 0667                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 668            }
 0669        }
 670
 671        /// <summary> Gets all the Azure Firewalls in a subscription. </summary>
 672        /// <param name="nextLink"> The URL to the next page of results. </param>
 673        /// <param name="cancellationToken"> The cancellation token to use. </param>
 674        public Response<AzureFirewallListResult> ListAllNextPage(string nextLink, CancellationToken cancellationToken = 
 675        {
 0676            if (nextLink == null)
 677            {
 0678                throw new ArgumentNullException(nameof(nextLink));
 679            }
 680
 0681            using var message = CreateListAllNextPageRequest(nextLink);
 0682            _pipeline.Send(message, cancellationToken);
 0683            switch (message.Response.Status)
 684            {
 685                case 200:
 686                    {
 0687                        AzureFirewallListResult value = default;
 0688                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0689                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 690                        {
 0691                            value = null;
 692                        }
 693                        else
 694                        {
 0695                            value = AzureFirewallListResult.DeserializeAzureFirewallListResult(document.RootElement);
 696                        }
 0697                        return Response.FromValue(value, message.Response);
 698                    }
 699                default:
 0700                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 701            }
 0702        }
 703    }
 704}