< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-0%100%
.ctor()-0%100%
.ctor(...)-0%100%
ListBySubscriptionAsync()-0%100%
ListBySubscription(...)-0%100%
ListByResourceGroupAsync()-0%100%
ListByResourceGroup(...)-0%100%
GetAsync()-0%100%
Get(...)-0%100%
StartCreateOrUpdateAsync()-0%0%
StartCreateOrUpdate(...)-0%0%
StartDeleteAsync()-0%0%
StartDelete(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\ExpressRouteGatewaysOperations.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.Pipeline;
 13using Azure.ResourceManager.Network.Models;
 14
 15namespace Azure.ResourceManager.Network
 16{
 17    /// <summary> The ExpressRouteGateways service client. </summary>
 18    public partial class ExpressRouteGatewaysOperations
 19    {
 20        private readonly ClientDiagnostics _clientDiagnostics;
 21        private readonly HttpPipeline _pipeline;
 022        internal ExpressRouteGatewaysRestOperations RestClient { get; }
 23        /// <summary> Initializes a new instance of ExpressRouteGatewaysOperations for mocking. </summary>
 024        protected ExpressRouteGatewaysOperations()
 25        {
 026        }
 27        /// <summary> Initializes a new instance of ExpressRouteGatewaysOperations. </summary>
 28        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
 29        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
 30        /// <param name="subscriptionId"> The subscription credentials which uniquely identify the Microsoft Azure subsc
 31        /// <param name="endpoint"> server parameter. </param>
 032        internal ExpressRouteGatewaysOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subsc
 33        {
 034            RestClient = new ExpressRouteGatewaysRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
 035            _clientDiagnostics = clientDiagnostics;
 036            _pipeline = pipeline;
 037        }
 38
 39        /// <summary> Lists ExpressRoute gateways under a given subscription. </summary>
 40        /// <param name="cancellationToken"> The cancellation token to use. </param>
 41        public virtual async Task<Response<ExpressRouteGatewayList>> ListBySubscriptionAsync(CancellationToken cancellat
 42        {
 043            using var scope = _clientDiagnostics.CreateScope("ExpressRouteGatewaysOperations.ListBySubscription");
 044            scope.Start();
 45            try
 46            {
 047                return await RestClient.ListBySubscriptionAsync(cancellationToken).ConfigureAwait(false);
 48            }
 049            catch (Exception e)
 50            {
 051                scope.Failed(e);
 052                throw;
 53            }
 054        }
 55
 56        /// <summary> Lists ExpressRoute gateways under a given subscription. </summary>
 57        /// <param name="cancellationToken"> The cancellation token to use. </param>
 58        public virtual Response<ExpressRouteGatewayList> ListBySubscription(CancellationToken cancellationToken = defaul
 59        {
 060            using var scope = _clientDiagnostics.CreateScope("ExpressRouteGatewaysOperations.ListBySubscription");
 061            scope.Start();
 62            try
 63            {
 064                return RestClient.ListBySubscription(cancellationToken);
 65            }
 066            catch (Exception e)
 67            {
 068                scope.Failed(e);
 069                throw;
 70            }
 071        }
 72
 73        /// <summary> Lists ExpressRoute gateways in a given resource group. </summary>
 74        /// <param name="resourceGroupName"> The name of the resource group. </param>
 75        /// <param name="cancellationToken"> The cancellation token to use. </param>
 76        public virtual async Task<Response<ExpressRouteGatewayList>> ListByResourceGroupAsync(string resourceGroupName, 
 77        {
 078            using var scope = _clientDiagnostics.CreateScope("ExpressRouteGatewaysOperations.ListByResourceGroup");
 079            scope.Start();
 80            try
 81            {
 082                return await RestClient.ListByResourceGroupAsync(resourceGroupName, cancellationToken).ConfigureAwait(fa
 83            }
 084            catch (Exception e)
 85            {
 086                scope.Failed(e);
 087                throw;
 88            }
 089        }
 90
 91        /// <summary> Lists ExpressRoute gateways in a given resource group. </summary>
 92        /// <param name="resourceGroupName"> The name of the resource group. </param>
 93        /// <param name="cancellationToken"> The cancellation token to use. </param>
 94        public virtual Response<ExpressRouteGatewayList> ListByResourceGroup(string resourceGroupName, CancellationToken
 95        {
 096            using var scope = _clientDiagnostics.CreateScope("ExpressRouteGatewaysOperations.ListByResourceGroup");
 097            scope.Start();
 98            try
 99            {
 0100                return RestClient.ListByResourceGroup(resourceGroupName, cancellationToken);
 101            }
 0102            catch (Exception e)
 103            {
 0104                scope.Failed(e);
 0105                throw;
 106            }
 0107        }
 108
 109        /// <summary> Fetches the details of a ExpressRoute gateway in a resource group. </summary>
 110        /// <param name="resourceGroupName"> The name of the resource group. </param>
 111        /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param>
 112        /// <param name="cancellationToken"> The cancellation token to use. </param>
 113        public virtual async Task<Response<ExpressRouteGateway>> GetAsync(string resourceGroupName, string expressRouteG
 114        {
 0115            using var scope = _clientDiagnostics.CreateScope("ExpressRouteGatewaysOperations.Get");
 0116            scope.Start();
 117            try
 118            {
 0119                return await RestClient.GetAsync(resourceGroupName, expressRouteGatewayName, cancellationToken).Configur
 120            }
 0121            catch (Exception e)
 122            {
 0123                scope.Failed(e);
 0124                throw;
 125            }
 0126        }
 127
 128        /// <summary> Fetches the details of a ExpressRoute gateway in a resource group. </summary>
 129        /// <param name="resourceGroupName"> The name of the resource group. </param>
 130        /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param>
 131        /// <param name="cancellationToken"> The cancellation token to use. </param>
 132        public virtual Response<ExpressRouteGateway> Get(string resourceGroupName, string expressRouteGatewayName, Cance
 133        {
 0134            using var scope = _clientDiagnostics.CreateScope("ExpressRouteGatewaysOperations.Get");
 0135            scope.Start();
 136            try
 137            {
 0138                return RestClient.Get(resourceGroupName, expressRouteGatewayName, cancellationToken);
 139            }
 0140            catch (Exception e)
 141            {
 0142                scope.Failed(e);
 0143                throw;
 144            }
 0145        }
 146
 147        /// <summary> Creates or updates a ExpressRoute gateway in a specified resource group. </summary>
 148        /// <param name="resourceGroupName"> The name of the resource group. </param>
 149        /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param>
 150        /// <param name="putExpressRouteGatewayParameters"> Parameters required in an ExpressRoute gateway PUT operation
 151        /// <param name="cancellationToken"> The cancellation token to use. </param>
 152        public virtual async Task<ExpressRouteGatewaysCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resourceG
 153        {
 0154            if (resourceGroupName == null)
 155            {
 0156                throw new ArgumentNullException(nameof(resourceGroupName));
 157            }
 0158            if (expressRouteGatewayName == null)
 159            {
 0160                throw new ArgumentNullException(nameof(expressRouteGatewayName));
 161            }
 0162            if (putExpressRouteGatewayParameters == null)
 163            {
 0164                throw new ArgumentNullException(nameof(putExpressRouteGatewayParameters));
 165            }
 166
 0167            using var scope = _clientDiagnostics.CreateScope("ExpressRouteGatewaysOperations.StartCreateOrUpdate");
 0168            scope.Start();
 169            try
 170            {
 0171                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, expressRouteGatewayName, 
 0172                return new ExpressRouteGatewaysCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateC
 173            }
 0174            catch (Exception e)
 175            {
 0176                scope.Failed(e);
 0177                throw;
 178            }
 0179        }
 180
 181        /// <summary> Creates or updates a ExpressRoute gateway in a specified resource group. </summary>
 182        /// <param name="resourceGroupName"> The name of the resource group. </param>
 183        /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param>
 184        /// <param name="putExpressRouteGatewayParameters"> Parameters required in an ExpressRoute gateway PUT operation
 185        /// <param name="cancellationToken"> The cancellation token to use. </param>
 186        public virtual ExpressRouteGatewaysCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string 
 187        {
 0188            if (resourceGroupName == null)
 189            {
 0190                throw new ArgumentNullException(nameof(resourceGroupName));
 191            }
 0192            if (expressRouteGatewayName == null)
 193            {
 0194                throw new ArgumentNullException(nameof(expressRouteGatewayName));
 195            }
 0196            if (putExpressRouteGatewayParameters == null)
 197            {
 0198                throw new ArgumentNullException(nameof(putExpressRouteGatewayParameters));
 199            }
 200
 0201            using var scope = _clientDiagnostics.CreateScope("ExpressRouteGatewaysOperations.StartCreateOrUpdate");
 0202            scope.Start();
 203            try
 204            {
 0205                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, expressRouteGatewayName, putExpressR
 0206                return new ExpressRouteGatewaysCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateC
 207            }
 0208            catch (Exception e)
 209            {
 0210                scope.Failed(e);
 0211                throw;
 212            }
 0213        }
 214
 215        /// <summary> Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource c
 216        /// <param name="resourceGroupName"> The name of the resource group. </param>
 217        /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param>
 218        /// <param name="cancellationToken"> The cancellation token to use. </param>
 219        public virtual async Task<ExpressRouteGatewaysDeleteOperation> StartDeleteAsync(string resourceGroupName, string
 220        {
 0221            if (resourceGroupName == null)
 222            {
 0223                throw new ArgumentNullException(nameof(resourceGroupName));
 224            }
 0225            if (expressRouteGatewayName == null)
 226            {
 0227                throw new ArgumentNullException(nameof(expressRouteGatewayName));
 228            }
 229
 0230            using var scope = _clientDiagnostics.CreateScope("ExpressRouteGatewaysOperations.StartDelete");
 0231            scope.Start();
 232            try
 233            {
 0234                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, expressRouteGatewayName, cancella
 0235                return new ExpressRouteGatewaysDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteReq
 236            }
 0237            catch (Exception e)
 238            {
 0239                scope.Failed(e);
 0240                throw;
 241            }
 0242        }
 243
 244        /// <summary> Deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource c
 245        /// <param name="resourceGroupName"> The name of the resource group. </param>
 246        /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param>
 247        /// <param name="cancellationToken"> The cancellation token to use. </param>
 248        public virtual ExpressRouteGatewaysDeleteOperation StartDelete(string resourceGroupName, string expressRouteGate
 249        {
 0250            if (resourceGroupName == null)
 251            {
 0252                throw new ArgumentNullException(nameof(resourceGroupName));
 253            }
 0254            if (expressRouteGatewayName == null)
 255            {
 0256                throw new ArgumentNullException(nameof(expressRouteGatewayName));
 257            }
 258
 0259            using var scope = _clientDiagnostics.CreateScope("ExpressRouteGatewaysOperations.StartDelete");
 0260            scope.Start();
 261            try
 262            {
 0263                var originalResponse = RestClient.Delete(resourceGroupName, expressRouteGatewayName, cancellationToken);
 0264                return new ExpressRouteGatewaysDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteReq
 265            }
 0266            catch (Exception e)
 267            {
 0268                scope.Failed(e);
 0269                throw;
 270            }
 0271        }
 272    }
 273}