< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-0%100%
.ctor()-0%100%
.ctor(...)-0%100%
GetAsync()-0%100%
Get(...)-0%100%
UpdateTagsAsync()-0%100%
UpdateTags(...)-0%100%
<ListAllAsync()-0%100%
<ListAllAsync()-0%100%
ListAllAsync(...)-0%100%
ListAll(...)-0%100%
ListByResourceGroupAsync(...)-0%0%
<ListByResourceGroupAsync()-0%100%
<ListByResourceGroupAsync()-0%100%
ListByResourceGroup(...)-0%0%
StartDeleteAsync()-0%0%
StartDelete(...)-0%0%
StartCreateOrUpdateAsync()-0%0%
StartCreateOrUpdate(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\VirtualNetworkTapsOperations.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 VirtualNetworkTaps service client. </summary>
 19    public partial class VirtualNetworkTapsOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 023        internal VirtualNetworkTapsRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of VirtualNetworkTapsOperations for mocking. </summary>
 025        protected VirtualNetworkTapsOperations()
 26        {
 027        }
 28        /// <summary> Initializes a new instance of VirtualNetworkTapsOperations. </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 VirtualNetworkTapsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscri
 34        {
 035            RestClient = new VirtualNetworkTapsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
 036            _clientDiagnostics = clientDiagnostics;
 037            _pipeline = pipeline;
 038        }
 39
 40        /// <summary> Gets information about the specified virtual network tap. </summary>
 41        /// <param name="resourceGroupName"> The name of the resource group. </param>
 42        /// <param name="tapName"> The name of virtual network tap. </param>
 43        /// <param name="cancellationToken"> The cancellation token to use. </param>
 44        public virtual async Task<Response<VirtualNetworkTap>> GetAsync(string resourceGroupName, string tapName, Cancel
 45        {
 046            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkTapsOperations.Get");
 047            scope.Start();
 48            try
 49            {
 050                return await RestClient.GetAsync(resourceGroupName, tapName, cancellationToken).ConfigureAwait(false);
 51            }
 052            catch (Exception e)
 53            {
 054                scope.Failed(e);
 055                throw;
 56            }
 057        }
 58
 59        /// <summary> Gets information about the specified virtual network tap. </summary>
 60        /// <param name="resourceGroupName"> The name of the resource group. </param>
 61        /// <param name="tapName"> The name of virtual network tap. </param>
 62        /// <param name="cancellationToken"> The cancellation token to use. </param>
 63        public virtual Response<VirtualNetworkTap> Get(string resourceGroupName, string tapName, CancellationToken cance
 64        {
 065            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkTapsOperations.Get");
 066            scope.Start();
 67            try
 68            {
 069                return RestClient.Get(resourceGroupName, tapName, cancellationToken);
 70            }
 071            catch (Exception e)
 72            {
 073                scope.Failed(e);
 074                throw;
 75            }
 076        }
 77
 78        /// <summary> Updates an VirtualNetworkTap tags. </summary>
 79        /// <param name="resourceGroupName"> The name of the resource group. </param>
 80        /// <param name="tapName"> The name of the tap. </param>
 81        /// <param name="tapParameters"> Parameters supplied to update VirtualNetworkTap tags. </param>
 82        /// <param name="cancellationToken"> The cancellation token to use. </param>
 83        public virtual async Task<Response<VirtualNetworkTap>> UpdateTagsAsync(string resourceGroupName, string tapName,
 84        {
 085            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkTapsOperations.UpdateTags");
 086            scope.Start();
 87            try
 88            {
 089                return await RestClient.UpdateTagsAsync(resourceGroupName, tapName, tapParameters, cancellationToken).Co
 90            }
 091            catch (Exception e)
 92            {
 093                scope.Failed(e);
 094                throw;
 95            }
 096        }
 97
 98        /// <summary> Updates an VirtualNetworkTap tags. </summary>
 99        /// <param name="resourceGroupName"> The name of the resource group. </param>
 100        /// <param name="tapName"> The name of the tap. </param>
 101        /// <param name="tapParameters"> Parameters supplied to update VirtualNetworkTap tags. </param>
 102        /// <param name="cancellationToken"> The cancellation token to use. </param>
 103        public virtual Response<VirtualNetworkTap> UpdateTags(string resourceGroupName, string tapName, TagsObject tapPa
 104        {
 0105            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkTapsOperations.UpdateTags");
 0106            scope.Start();
 107            try
 108            {
 0109                return RestClient.UpdateTags(resourceGroupName, tapName, tapParameters, cancellationToken);
 110            }
 0111            catch (Exception e)
 112            {
 0113                scope.Failed(e);
 0114                throw;
 115            }
 0116        }
 117
 118        /// <summary> Gets all the VirtualNetworkTaps in a subscription. </summary>
 119        /// <param name="cancellationToken"> The cancellation token to use. </param>
 120        public virtual AsyncPageable<VirtualNetworkTap> ListAllAsync(CancellationToken cancellationToken = default)
 121        {
 122            async Task<Page<VirtualNetworkTap>> FirstPageFunc(int? pageSizeHint)
 123            {
 0124                using var scope = _clientDiagnostics.CreateScope("VirtualNetworkTapsOperations.ListAll");
 0125                scope.Start();
 126                try
 127                {
 0128                    var response = await RestClient.ListAllAsync(cancellationToken).ConfigureAwait(false);
 0129                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 130                }
 0131                catch (Exception e)
 132                {
 0133                    scope.Failed(e);
 0134                    throw;
 135                }
 0136            }
 137            async Task<Page<VirtualNetworkTap>> NextPageFunc(string nextLink, int? pageSizeHint)
 138            {
 0139                using var scope = _clientDiagnostics.CreateScope("VirtualNetworkTapsOperations.ListAll");
 0140                scope.Start();
 141                try
 142                {
 0143                    var response = await RestClient.ListAllNextPageAsync(nextLink, cancellationToken).ConfigureAwait(fal
 0144                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 145                }
 0146                catch (Exception e)
 147                {
 0148                    scope.Failed(e);
 0149                    throw;
 150                }
 0151            }
 0152            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 153        }
 154
 155        /// <summary> Gets all the VirtualNetworkTaps in a subscription. </summary>
 156        /// <param name="cancellationToken"> The cancellation token to use. </param>
 157        public virtual Pageable<VirtualNetworkTap> ListAll(CancellationToken cancellationToken = default)
 158        {
 159            Page<VirtualNetworkTap> FirstPageFunc(int? pageSizeHint)
 160            {
 0161                using var scope = _clientDiagnostics.CreateScope("VirtualNetworkTapsOperations.ListAll");
 0162                scope.Start();
 163                try
 164                {
 0165                    var response = RestClient.ListAll(cancellationToken);
 0166                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 167                }
 0168                catch (Exception e)
 169                {
 0170                    scope.Failed(e);
 0171                    throw;
 172                }
 0173            }
 174            Page<VirtualNetworkTap> NextPageFunc(string nextLink, int? pageSizeHint)
 175            {
 0176                using var scope = _clientDiagnostics.CreateScope("VirtualNetworkTapsOperations.ListAll");
 0177                scope.Start();
 178                try
 179                {
 0180                    var response = RestClient.ListAllNextPage(nextLink, cancellationToken);
 0181                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 182                }
 0183                catch (Exception e)
 184                {
 0185                    scope.Failed(e);
 0186                    throw;
 187                }
 0188            }
 0189            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 190        }
 191
 192        /// <summary> Gets all the VirtualNetworkTaps in a subscription. </summary>
 193        /// <param name="resourceGroupName"> The name of the resource group. </param>
 194        /// <param name="cancellationToken"> The cancellation token to use. </param>
 195        public virtual AsyncPageable<VirtualNetworkTap> ListByResourceGroupAsync(string resourceGroupName, CancellationT
 196        {
 0197            if (resourceGroupName == null)
 198            {
 0199                throw new ArgumentNullException(nameof(resourceGroupName));
 200            }
 201
 202            async Task<Page<VirtualNetworkTap>> FirstPageFunc(int? pageSizeHint)
 203            {
 0204                using var scope = _clientDiagnostics.CreateScope("VirtualNetworkTapsOperations.ListByResourceGroup");
 0205                scope.Start();
 206                try
 207                {
 0208                    var response = await RestClient.ListByResourceGroupAsync(resourceGroupName, cancellationToken).Confi
 0209                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 210                }
 0211                catch (Exception e)
 212                {
 0213                    scope.Failed(e);
 0214                    throw;
 215                }
 0216            }
 217            async Task<Page<VirtualNetworkTap>> NextPageFunc(string nextLink, int? pageSizeHint)
 218            {
 0219                using var scope = _clientDiagnostics.CreateScope("VirtualNetworkTapsOperations.ListByResourceGroup");
 0220                scope.Start();
 221                try
 222                {
 0223                    var response = await RestClient.ListByResourceGroupNextPageAsync(nextLink, resourceGroupName, cancel
 0224                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 225                }
 0226                catch (Exception e)
 227                {
 0228                    scope.Failed(e);
 0229                    throw;
 230                }
 0231            }
 0232            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 233        }
 234
 235        /// <summary> Gets all the VirtualNetworkTaps in a subscription. </summary>
 236        /// <param name="resourceGroupName"> The name of the resource group. </param>
 237        /// <param name="cancellationToken"> The cancellation token to use. </param>
 238        public virtual Pageable<VirtualNetworkTap> ListByResourceGroup(string resourceGroupName, CancellationToken cance
 239        {
 0240            if (resourceGroupName == null)
 241            {
 0242                throw new ArgumentNullException(nameof(resourceGroupName));
 243            }
 244
 245            Page<VirtualNetworkTap> FirstPageFunc(int? pageSizeHint)
 246            {
 0247                using var scope = _clientDiagnostics.CreateScope("VirtualNetworkTapsOperations.ListByResourceGroup");
 0248                scope.Start();
 249                try
 250                {
 0251                    var response = RestClient.ListByResourceGroup(resourceGroupName, cancellationToken);
 0252                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 253                }
 0254                catch (Exception e)
 255                {
 0256                    scope.Failed(e);
 0257                    throw;
 258                }
 0259            }
 260            Page<VirtualNetworkTap> NextPageFunc(string nextLink, int? pageSizeHint)
 261            {
 0262                using var scope = _clientDiagnostics.CreateScope("VirtualNetworkTapsOperations.ListByResourceGroup");
 0263                scope.Start();
 264                try
 265                {
 0266                    var response = RestClient.ListByResourceGroupNextPage(nextLink, resourceGroupName, cancellationToken
 0267                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 268                }
 0269                catch (Exception e)
 270                {
 0271                    scope.Failed(e);
 0272                    throw;
 273                }
 0274            }
 0275            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 276        }
 277
 278        /// <summary> Deletes the specified virtual network tap. </summary>
 279        /// <param name="resourceGroupName"> The name of the resource group. </param>
 280        /// <param name="tapName"> The name of the virtual network tap. </param>
 281        /// <param name="cancellationToken"> The cancellation token to use. </param>
 282        public virtual async Task<VirtualNetworkTapsDeleteOperation> StartDeleteAsync(string resourceGroupName, string t
 283        {
 0284            if (resourceGroupName == null)
 285            {
 0286                throw new ArgumentNullException(nameof(resourceGroupName));
 287            }
 0288            if (tapName == null)
 289            {
 0290                throw new ArgumentNullException(nameof(tapName));
 291            }
 292
 0293            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkTapsOperations.StartDelete");
 0294            scope.Start();
 295            try
 296            {
 0297                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, tapName, cancellationToken).Confi
 0298                return new VirtualNetworkTapsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteReque
 299            }
 0300            catch (Exception e)
 301            {
 0302                scope.Failed(e);
 0303                throw;
 304            }
 0305        }
 306
 307        /// <summary> Deletes the specified virtual network tap. </summary>
 308        /// <param name="resourceGroupName"> The name of the resource group. </param>
 309        /// <param name="tapName"> The name of the virtual network tap. </param>
 310        /// <param name="cancellationToken"> The cancellation token to use. </param>
 311        public virtual VirtualNetworkTapsDeleteOperation StartDelete(string resourceGroupName, string tapName, Cancellat
 312        {
 0313            if (resourceGroupName == null)
 314            {
 0315                throw new ArgumentNullException(nameof(resourceGroupName));
 316            }
 0317            if (tapName == null)
 318            {
 0319                throw new ArgumentNullException(nameof(tapName));
 320            }
 321
 0322            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkTapsOperations.StartDelete");
 0323            scope.Start();
 324            try
 325            {
 0326                var originalResponse = RestClient.Delete(resourceGroupName, tapName, cancellationToken);
 0327                return new VirtualNetworkTapsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteReque
 328            }
 0329            catch (Exception e)
 330            {
 0331                scope.Failed(e);
 0332                throw;
 333            }
 0334        }
 335
 336        /// <summary> Creates or updates a Virtual Network Tap. </summary>
 337        /// <param name="resourceGroupName"> The name of the resource group. </param>
 338        /// <param name="tapName"> The name of the virtual network tap. </param>
 339        /// <param name="parameters"> Parameters supplied to the create or update virtual network tap operation. </param
 340        /// <param name="cancellationToken"> The cancellation token to use. </param>
 341        public virtual async Task<VirtualNetworkTapsCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resourceGro
 342        {
 0343            if (resourceGroupName == null)
 344            {
 0345                throw new ArgumentNullException(nameof(resourceGroupName));
 346            }
 0347            if (tapName == null)
 348            {
 0349                throw new ArgumentNullException(nameof(tapName));
 350            }
 0351            if (parameters == null)
 352            {
 0353                throw new ArgumentNullException(nameof(parameters));
 354            }
 355
 0356            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkTapsOperations.StartCreateOrUpdate");
 0357            scope.Start();
 358            try
 359            {
 0360                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, tapName, parameters, canc
 0361                return new VirtualNetworkTapsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCre
 362            }
 0363            catch (Exception e)
 364            {
 0365                scope.Failed(e);
 0366                throw;
 367            }
 0368        }
 369
 370        /// <summary> Creates or updates a Virtual Network Tap. </summary>
 371        /// <param name="resourceGroupName"> The name of the resource group. </param>
 372        /// <param name="tapName"> The name of the virtual network tap. </param>
 373        /// <param name="parameters"> Parameters supplied to the create or update virtual network tap operation. </param
 374        /// <param name="cancellationToken"> The cancellation token to use. </param>
 375        public virtual VirtualNetworkTapsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string ta
 376        {
 0377            if (resourceGroupName == null)
 378            {
 0379                throw new ArgumentNullException(nameof(resourceGroupName));
 380            }
 0381            if (tapName == null)
 382            {
 0383                throw new ArgumentNullException(nameof(tapName));
 384            }
 0385            if (parameters == null)
 386            {
 0387                throw new ArgumentNullException(nameof(parameters));
 388            }
 389
 0390            using var scope = _clientDiagnostics.CreateScope("VirtualNetworkTapsOperations.StartCreateOrUpdate");
 0391            scope.Start();
 392            try
 393            {
 0394                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, tapName, parameters, cancellationTok
 0395                return new VirtualNetworkTapsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCre
 396            }
 0397            catch (Exception e)
 398            {
 0399                scope.Failed(e);
 0400                throw;
 401            }
 0402        }
 403    }
 404}