< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-0%100%
.ctor()-0%100%
.ctor(...)-0%100%
GetAsync()-0%100%
Get(...)-0%100%
ListAsync(...)-0%0%
<ListAsync()-0%100%
<ListAsync()-0%100%
List(...)-0%0%
<ListAllAsync()-0%100%
<ListAllAsync()-0%100%
ListAllAsync(...)-0%100%
ListAll(...)-0%100%
StartDeleteAsync()-0%0%
StartDelete(...)-0%0%
StartCreateOrUpdateAsync()-0%0%
StartCreateOrUpdate(...)-0%0%
StartUpdateTagsAsync()-0%0%
StartUpdateTags(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\AzureFirewallsOperations.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.Threading;
 10using System.Threading.Tasks;
 11using Azure;
 12using Azure.Core;
 13using Azure.Core.Pipeline;
 14using Azure.ResourceManager.Network.Models;
 15
 16namespace Azure.ResourceManager.Network
 17{
 18    /// <summary> The AzureFirewalls service client. </summary>
 19    public partial class AzureFirewallsOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 023        internal AzureFirewallsRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of AzureFirewallsOperations for mocking. </summary>
 025        protected AzureFirewallsOperations()
 26        {
 027        }
 28        /// <summary> Initializes a new instance of AzureFirewallsOperations. </summary>
 29        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
 30        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
 31        /// <param name="subscriptionId"> The subscription credentials which uniquely identify the Microsoft Azure subsc
 32        /// <param name="endpoint"> server parameter. </param>
 033        internal AzureFirewallsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptio
 34        {
 035            RestClient = new AzureFirewallsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
 036            _clientDiagnostics = clientDiagnostics;
 037            _pipeline = pipeline;
 038        }
 39
 40        /// <summary> Gets the specified Azure Firewall. </summary>
 41        /// <param name="resourceGroupName"> The name of the resource group. </param>
 42        /// <param name="azureFirewallName"> The name of the Azure Firewall. </param>
 43        /// <param name="cancellationToken"> The cancellation token to use. </param>
 44        public virtual async Task<Response<AzureFirewall>> GetAsync(string resourceGroupName, string azureFirewallName, 
 45        {
 046            using var scope = _clientDiagnostics.CreateScope("AzureFirewallsOperations.Get");
 047            scope.Start();
 48            try
 49            {
 050                return await RestClient.GetAsync(resourceGroupName, azureFirewallName, cancellationToken).ConfigureAwait
 51            }
 052            catch (Exception e)
 53            {
 054                scope.Failed(e);
 055                throw;
 56            }
 057        }
 58
 59        /// <summary> Gets the specified Azure Firewall. </summary>
 60        /// <param name="resourceGroupName"> The name of the resource group. </param>
 61        /// <param name="azureFirewallName"> The name of the Azure Firewall. </param>
 62        /// <param name="cancellationToken"> The cancellation token to use. </param>
 63        public virtual Response<AzureFirewall> Get(string resourceGroupName, string azureFirewallName, CancellationToken
 64        {
 065            using var scope = _clientDiagnostics.CreateScope("AzureFirewallsOperations.Get");
 066            scope.Start();
 67            try
 68            {
 069                return RestClient.Get(resourceGroupName, azureFirewallName, cancellationToken);
 70            }
 071            catch (Exception e)
 72            {
 073                scope.Failed(e);
 074                throw;
 75            }
 076        }
 77
 78        /// <summary> Lists all Azure Firewalls in a resource group. </summary>
 79        /// <param name="resourceGroupName"> The name of the resource group. </param>
 80        /// <param name="cancellationToken"> The cancellation token to use. </param>
 81        public virtual AsyncPageable<AzureFirewall> ListAsync(string resourceGroupName, CancellationToken cancellationTo
 82        {
 083            if (resourceGroupName == null)
 84            {
 085                throw new ArgumentNullException(nameof(resourceGroupName));
 86            }
 87
 88            async Task<Page<AzureFirewall>> FirstPageFunc(int? pageSizeHint)
 89            {
 090                using var scope = _clientDiagnostics.CreateScope("AzureFirewallsOperations.List");
 091                scope.Start();
 92                try
 93                {
 094                    var response = await RestClient.ListAsync(resourceGroupName, cancellationToken).ConfigureAwait(false
 095                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 96                }
 097                catch (Exception e)
 98                {
 099                    scope.Failed(e);
 0100                    throw;
 101                }
 0102            }
 103            async Task<Page<AzureFirewall>> NextPageFunc(string nextLink, int? pageSizeHint)
 104            {
 0105                using var scope = _clientDiagnostics.CreateScope("AzureFirewallsOperations.List");
 0106                scope.Start();
 107                try
 108                {
 0109                    var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, cancellationToken).Co
 0110                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 111                }
 0112                catch (Exception e)
 113                {
 0114                    scope.Failed(e);
 0115                    throw;
 116                }
 0117            }
 0118            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 119        }
 120
 121        /// <summary> Lists all Azure Firewalls in a resource group. </summary>
 122        /// <param name="resourceGroupName"> The name of the resource group. </param>
 123        /// <param name="cancellationToken"> The cancellation token to use. </param>
 124        public virtual Pageable<AzureFirewall> List(string resourceGroupName, CancellationToken cancellationToken = defa
 125        {
 0126            if (resourceGroupName == null)
 127            {
 0128                throw new ArgumentNullException(nameof(resourceGroupName));
 129            }
 130
 131            Page<AzureFirewall> FirstPageFunc(int? pageSizeHint)
 132            {
 0133                using var scope = _clientDiagnostics.CreateScope("AzureFirewallsOperations.List");
 0134                scope.Start();
 135                try
 136                {
 0137                    var response = RestClient.List(resourceGroupName, cancellationToken);
 0138                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 139                }
 0140                catch (Exception e)
 141                {
 0142                    scope.Failed(e);
 0143                    throw;
 144                }
 0145            }
 146            Page<AzureFirewall> NextPageFunc(string nextLink, int? pageSizeHint)
 147            {
 0148                using var scope = _clientDiagnostics.CreateScope("AzureFirewallsOperations.List");
 0149                scope.Start();
 150                try
 151                {
 0152                    var response = RestClient.ListNextPage(nextLink, resourceGroupName, cancellationToken);
 0153                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 154                }
 0155                catch (Exception e)
 156                {
 0157                    scope.Failed(e);
 0158                    throw;
 159                }
 0160            }
 0161            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 162        }
 163
 164        /// <summary> Gets all the Azure Firewalls in a subscription. </summary>
 165        /// <param name="cancellationToken"> The cancellation token to use. </param>
 166        public virtual AsyncPageable<AzureFirewall> ListAllAsync(CancellationToken cancellationToken = default)
 167        {
 168            async Task<Page<AzureFirewall>> FirstPageFunc(int? pageSizeHint)
 169            {
 0170                using var scope = _clientDiagnostics.CreateScope("AzureFirewallsOperations.ListAll");
 0171                scope.Start();
 172                try
 173                {
 0174                    var response = await RestClient.ListAllAsync(cancellationToken).ConfigureAwait(false);
 0175                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 176                }
 0177                catch (Exception e)
 178                {
 0179                    scope.Failed(e);
 0180                    throw;
 181                }
 0182            }
 183            async Task<Page<AzureFirewall>> NextPageFunc(string nextLink, int? pageSizeHint)
 184            {
 0185                using var scope = _clientDiagnostics.CreateScope("AzureFirewallsOperations.ListAll");
 0186                scope.Start();
 187                try
 188                {
 0189                    var response = await RestClient.ListAllNextPageAsync(nextLink, cancellationToken).ConfigureAwait(fal
 0190                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 191                }
 0192                catch (Exception e)
 193                {
 0194                    scope.Failed(e);
 0195                    throw;
 196                }
 0197            }
 0198            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 199        }
 200
 201        /// <summary> Gets all the Azure Firewalls in a subscription. </summary>
 202        /// <param name="cancellationToken"> The cancellation token to use. </param>
 203        public virtual Pageable<AzureFirewall> ListAll(CancellationToken cancellationToken = default)
 204        {
 205            Page<AzureFirewall> FirstPageFunc(int? pageSizeHint)
 206            {
 0207                using var scope = _clientDiagnostics.CreateScope("AzureFirewallsOperations.ListAll");
 0208                scope.Start();
 209                try
 210                {
 0211                    var response = RestClient.ListAll(cancellationToken);
 0212                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 213                }
 0214                catch (Exception e)
 215                {
 0216                    scope.Failed(e);
 0217                    throw;
 218                }
 0219            }
 220            Page<AzureFirewall> NextPageFunc(string nextLink, int? pageSizeHint)
 221            {
 0222                using var scope = _clientDiagnostics.CreateScope("AzureFirewallsOperations.ListAll");
 0223                scope.Start();
 224                try
 225                {
 0226                    var response = RestClient.ListAllNextPage(nextLink, cancellationToken);
 0227                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 228                }
 0229                catch (Exception e)
 230                {
 0231                    scope.Failed(e);
 0232                    throw;
 233                }
 0234            }
 0235            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 236        }
 237
 238        /// <summary> Deletes the specified Azure Firewall. </summary>
 239        /// <param name="resourceGroupName"> The name of the resource group. </param>
 240        /// <param name="azureFirewallName"> The name of the Azure Firewall. </param>
 241        /// <param name="cancellationToken"> The cancellation token to use. </param>
 242        public virtual async Task<AzureFirewallsDeleteOperation> StartDeleteAsync(string resourceGroupName, string azure
 243        {
 0244            if (resourceGroupName == null)
 245            {
 0246                throw new ArgumentNullException(nameof(resourceGroupName));
 247            }
 0248            if (azureFirewallName == null)
 249            {
 0250                throw new ArgumentNullException(nameof(azureFirewallName));
 251            }
 252
 0253            using var scope = _clientDiagnostics.CreateScope("AzureFirewallsOperations.StartDelete");
 0254            scope.Start();
 255            try
 256            {
 0257                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, azureFirewallName, cancellationTo
 0258                return new AzureFirewallsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(r
 259            }
 0260            catch (Exception e)
 261            {
 0262                scope.Failed(e);
 0263                throw;
 264            }
 0265        }
 266
 267        /// <summary> Deletes the specified Azure Firewall. </summary>
 268        /// <param name="resourceGroupName"> The name of the resource group. </param>
 269        /// <param name="azureFirewallName"> The name of the Azure Firewall. </param>
 270        /// <param name="cancellationToken"> The cancellation token to use. </param>
 271        public virtual AzureFirewallsDeleteOperation StartDelete(string resourceGroupName, string azureFirewallName, Can
 272        {
 0273            if (resourceGroupName == null)
 274            {
 0275                throw new ArgumentNullException(nameof(resourceGroupName));
 276            }
 0277            if (azureFirewallName == null)
 278            {
 0279                throw new ArgumentNullException(nameof(azureFirewallName));
 280            }
 281
 0282            using var scope = _clientDiagnostics.CreateScope("AzureFirewallsOperations.StartDelete");
 0283            scope.Start();
 284            try
 285            {
 0286                var originalResponse = RestClient.Delete(resourceGroupName, azureFirewallName, cancellationToken);
 0287                return new AzureFirewallsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(r
 288            }
 0289            catch (Exception e)
 290            {
 0291                scope.Failed(e);
 0292                throw;
 293            }
 0294        }
 295
 296        /// <summary> Creates or updates the specified Azure Firewall. </summary>
 297        /// <param name="resourceGroupName"> The name of the resource group. </param>
 298        /// <param name="azureFirewallName"> The name of the Azure Firewall. </param>
 299        /// <param name="parameters"> Parameters supplied to the create or update Azure Firewall operation. </param>
 300        /// <param name="cancellationToken"> The cancellation token to use. </param>
 301        public virtual async Task<AzureFirewallsCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resourceGroupNa
 302        {
 0303            if (resourceGroupName == null)
 304            {
 0305                throw new ArgumentNullException(nameof(resourceGroupName));
 306            }
 0307            if (azureFirewallName == null)
 308            {
 0309                throw new ArgumentNullException(nameof(azureFirewallName));
 310            }
 0311            if (parameters == null)
 312            {
 0313                throw new ArgumentNullException(nameof(parameters));
 314            }
 315
 0316            using var scope = _clientDiagnostics.CreateScope("AzureFirewallsOperations.StartCreateOrUpdate");
 0317            scope.Start();
 318            try
 319            {
 0320                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, azureFirewallName, parame
 0321                return new AzureFirewallsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateO
 322            }
 0323            catch (Exception e)
 324            {
 0325                scope.Failed(e);
 0326                throw;
 327            }
 0328        }
 329
 330        /// <summary> Creates or updates the specified Azure Firewall. </summary>
 331        /// <param name="resourceGroupName"> The name of the resource group. </param>
 332        /// <param name="azureFirewallName"> The name of the Azure Firewall. </param>
 333        /// <param name="parameters"> Parameters supplied to the create or update Azure Firewall operation. </param>
 334        /// <param name="cancellationToken"> The cancellation token to use. </param>
 335        public virtual AzureFirewallsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string azureF
 336        {
 0337            if (resourceGroupName == null)
 338            {
 0339                throw new ArgumentNullException(nameof(resourceGroupName));
 340            }
 0341            if (azureFirewallName == null)
 342            {
 0343                throw new ArgumentNullException(nameof(azureFirewallName));
 344            }
 0345            if (parameters == null)
 346            {
 0347                throw new ArgumentNullException(nameof(parameters));
 348            }
 349
 0350            using var scope = _clientDiagnostics.CreateScope("AzureFirewallsOperations.StartCreateOrUpdate");
 0351            scope.Start();
 352            try
 353            {
 0354                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, azureFirewallName, parameters, cance
 0355                return new AzureFirewallsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateO
 356            }
 0357            catch (Exception e)
 358            {
 0359                scope.Failed(e);
 0360                throw;
 361            }
 0362        }
 363
 364        /// <summary> Updates tags of an Azure Firewall resource. </summary>
 365        /// <param name="resourceGroupName"> The name of the resource group. </param>
 366        /// <param name="azureFirewallName"> The name of the Azure Firewall. </param>
 367        /// <param name="parameters"> Parameters supplied to update azure firewall tags. </param>
 368        /// <param name="cancellationToken"> The cancellation token to use. </param>
 369        public virtual async Task<AzureFirewallsUpdateTagsOperation> StartUpdateTagsAsync(string resourceGroupName, stri
 370        {
 0371            if (resourceGroupName == null)
 372            {
 0373                throw new ArgumentNullException(nameof(resourceGroupName));
 374            }
 0375            if (azureFirewallName == null)
 376            {
 0377                throw new ArgumentNullException(nameof(azureFirewallName));
 378            }
 0379            if (parameters == null)
 380            {
 0381                throw new ArgumentNullException(nameof(parameters));
 382            }
 383
 0384            using var scope = _clientDiagnostics.CreateScope("AzureFirewallsOperations.StartUpdateTags");
 0385            scope.Start();
 386            try
 387            {
 0388                var originalResponse = await RestClient.UpdateTagsAsync(resourceGroupName, azureFirewallName, parameters
 0389                return new AzureFirewallsUpdateTagsOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateTagsR
 390            }
 0391            catch (Exception e)
 392            {
 0393                scope.Failed(e);
 0394                throw;
 395            }
 0396        }
 397
 398        /// <summary> Updates tags of an Azure Firewall resource. </summary>
 399        /// <param name="resourceGroupName"> The name of the resource group. </param>
 400        /// <param name="azureFirewallName"> The name of the Azure Firewall. </param>
 401        /// <param name="parameters"> Parameters supplied to update azure firewall tags. </param>
 402        /// <param name="cancellationToken"> The cancellation token to use. </param>
 403        public virtual AzureFirewallsUpdateTagsOperation StartUpdateTags(string resourceGroupName, string azureFirewallN
 404        {
 0405            if (resourceGroupName == null)
 406            {
 0407                throw new ArgumentNullException(nameof(resourceGroupName));
 408            }
 0409            if (azureFirewallName == null)
 410            {
 0411                throw new ArgumentNullException(nameof(azureFirewallName));
 412            }
 0413            if (parameters == null)
 414            {
 0415                throw new ArgumentNullException(nameof(parameters));
 416            }
 417
 0418            using var scope = _clientDiagnostics.CreateScope("AzureFirewallsOperations.StartUpdateTags");
 0419            scope.Start();
 420            try
 421            {
 0422                var originalResponse = RestClient.UpdateTags(resourceGroupName, azureFirewallName, parameters, cancellat
 0423                return new AzureFirewallsUpdateTagsOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateTagsR
 424            }
 0425            catch (Exception e)
 426            {
 0427                scope.Failed(e);
 0428                throw;
 429            }
 0430        }
 431    }
 432}