< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
CreateListAllRequest()-0%100%
ListAllAsync()-0%0%
ListAll(...)-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\AzureFirewallFqdnTagsRestOperations.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 AzureFirewallFqdnTagsRestOperations
 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 AzureFirewallFqdnTagsRestOperations. </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 AzureFirewallFqdnTagsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string su
 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 CreateListAllRequest()
 47        {
 048            var message = _pipeline.CreateMessage();
 049            var request = message.Request;
 050            request.Method = RequestMethod.Get;
 051            var uri = new RawRequestUriBuilder();
 052            uri.Reset(endpoint);
 053            uri.AppendPath("/subscriptions/", false);
 054            uri.AppendPath(subscriptionId, true);
 055            uri.AppendPath("/providers/Microsoft.Network/azureFirewallFqdnTags", false);
 056            uri.AppendQuery("api-version", "2020-04-01", true);
 057            request.Uri = uri;
 058            return message;
 59        }
 60
 61        /// <summary> Gets all the Azure Firewall FQDN Tags in a subscription. </summary>
 62        /// <param name="cancellationToken"> The cancellation token to use. </param>
 63        public async Task<Response<AzureFirewallFqdnTagListResult>> ListAllAsync(CancellationToken cancellationToken = d
 64        {
 065            using var message = CreateListAllRequest();
 066            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 067            switch (message.Response.Status)
 68            {
 69                case 200:
 70                    {
 071                        AzureFirewallFqdnTagListResult value = default;
 072                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 073                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 74                        {
 075                            value = null;
 76                        }
 77                        else
 78                        {
 079                            value = AzureFirewallFqdnTagListResult.DeserializeAzureFirewallFqdnTagListResult(document.Ro
 80                        }
 081                        return Response.FromValue(value, message.Response);
 82                    }
 83                default:
 084                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 85            }
 086        }
 87
 88        /// <summary> Gets all the Azure Firewall FQDN Tags in a subscription. </summary>
 89        /// <param name="cancellationToken"> The cancellation token to use. </param>
 90        public Response<AzureFirewallFqdnTagListResult> ListAll(CancellationToken cancellationToken = default)
 91        {
 092            using var message = CreateListAllRequest();
 093            _pipeline.Send(message, cancellationToken);
 094            switch (message.Response.Status)
 95            {
 96                case 200:
 97                    {
 098                        AzureFirewallFqdnTagListResult value = default;
 099                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0100                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 101                        {
 0102                            value = null;
 103                        }
 104                        else
 105                        {
 0106                            value = AzureFirewallFqdnTagListResult.DeserializeAzureFirewallFqdnTagListResult(document.Ro
 107                        }
 0108                        return Response.FromValue(value, message.Response);
 109                    }
 110                default:
 0111                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 112            }
 0113        }
 114
 115        internal HttpMessage CreateListAllNextPageRequest(string nextLink)
 116        {
 0117            var message = _pipeline.CreateMessage();
 0118            var request = message.Request;
 0119            request.Method = RequestMethod.Get;
 0120            var uri = new RawRequestUriBuilder();
 0121            uri.Reset(endpoint);
 0122            uri.AppendRawNextLink(nextLink, false);
 0123            request.Uri = uri;
 0124            return message;
 125        }
 126
 127        /// <summary> Gets all the Azure Firewall FQDN Tags in a subscription. </summary>
 128        /// <param name="nextLink"> The URL to the next page of results. </param>
 129        /// <param name="cancellationToken"> The cancellation token to use. </param>
 130        public async Task<Response<AzureFirewallFqdnTagListResult>> ListAllNextPageAsync(string nextLink, CancellationTo
 131        {
 0132            if (nextLink == null)
 133            {
 0134                throw new ArgumentNullException(nameof(nextLink));
 135            }
 136
 0137            using var message = CreateListAllNextPageRequest(nextLink);
 0138            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0139            switch (message.Response.Status)
 140            {
 141                case 200:
 142                    {
 0143                        AzureFirewallFqdnTagListResult value = default;
 0144                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0145                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 146                        {
 0147                            value = null;
 148                        }
 149                        else
 150                        {
 0151                            value = AzureFirewallFqdnTagListResult.DeserializeAzureFirewallFqdnTagListResult(document.Ro
 152                        }
 0153                        return Response.FromValue(value, message.Response);
 154                    }
 155                default:
 0156                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 157            }
 0158        }
 159
 160        /// <summary> Gets all the Azure Firewall FQDN Tags in a subscription. </summary>
 161        /// <param name="nextLink"> The URL to the next page of results. </param>
 162        /// <param name="cancellationToken"> The cancellation token to use. </param>
 163        public Response<AzureFirewallFqdnTagListResult> ListAllNextPage(string nextLink, CancellationToken cancellationT
 164        {
 0165            if (nextLink == null)
 166            {
 0167                throw new ArgumentNullException(nameof(nextLink));
 168            }
 169
 0170            using var message = CreateListAllNextPageRequest(nextLink);
 0171            _pipeline.Send(message, cancellationToken);
 0172            switch (message.Response.Status)
 173            {
 174                case 200:
 175                    {
 0176                        AzureFirewallFqdnTagListResult value = default;
 0177                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0178                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 179                        {
 0180                            value = null;
 181                        }
 182                        else
 183                        {
 0184                            value = AzureFirewallFqdnTagListResult.DeserializeAzureFirewallFqdnTagListResult(document.Ro
 185                        }
 0186                        return Response.FromValue(value, message.Response);
 187                    }
 188                default:
 0189                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 190            }
 0191        }
 192    }
 193}