< Summary

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

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%100%
List(...)-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\ExpressRouteConnectionsOperations.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 ExpressRouteConnections service client. </summary>
 18    public partial class ExpressRouteConnectionsOperations
 19    {
 20        private readonly ClientDiagnostics _clientDiagnostics;
 21        private readonly HttpPipeline _pipeline;
 022        internal ExpressRouteConnectionsRestOperations RestClient { get; }
 23        /// <summary> Initializes a new instance of ExpressRouteConnectionsOperations for mocking. </summary>
 024        protected ExpressRouteConnectionsOperations()
 25        {
 026        }
 27        /// <summary> Initializes a new instance of ExpressRouteConnectionsOperations. </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 ExpressRouteConnectionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string su
 33        {
 034            RestClient = new ExpressRouteConnectionsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint
 035            _clientDiagnostics = clientDiagnostics;
 036            _pipeline = pipeline;
 037        }
 38
 39        /// <summary> Gets the specified ExpressRouteConnection. </summary>
 40        /// <param name="resourceGroupName"> The name of the resource group. </param>
 41        /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param>
 42        /// <param name="connectionName"> The name of the ExpressRoute connection. </param>
 43        /// <param name="cancellationToken"> The cancellation token to use. </param>
 44        public virtual async Task<Response<ExpressRouteConnection>> GetAsync(string resourceGroupName, string expressRou
 45        {
 046            using var scope = _clientDiagnostics.CreateScope("ExpressRouteConnectionsOperations.Get");
 047            scope.Start();
 48            try
 49            {
 050                return await RestClient.GetAsync(resourceGroupName, expressRouteGatewayName, connectionName, cancellatio
 51            }
 052            catch (Exception e)
 53            {
 054                scope.Failed(e);
 055                throw;
 56            }
 057        }
 58
 59        /// <summary> Gets the specified ExpressRouteConnection. </summary>
 60        /// <param name="resourceGroupName"> The name of the resource group. </param>
 61        /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param>
 62        /// <param name="connectionName"> The name of the ExpressRoute connection. </param>
 63        /// <param name="cancellationToken"> The cancellation token to use. </param>
 64        public virtual Response<ExpressRouteConnection> Get(string resourceGroupName, string expressRouteGatewayName, st
 65        {
 066            using var scope = _clientDiagnostics.CreateScope("ExpressRouteConnectionsOperations.Get");
 067            scope.Start();
 68            try
 69            {
 070                return RestClient.Get(resourceGroupName, expressRouteGatewayName, connectionName, cancellationToken);
 71            }
 072            catch (Exception e)
 73            {
 074                scope.Failed(e);
 075                throw;
 76            }
 077        }
 78
 79        /// <summary> Lists ExpressRouteConnections. </summary>
 80        /// <param name="resourceGroupName"> The name of the resource group. </param>
 81        /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param>
 82        /// <param name="cancellationToken"> The cancellation token to use. </param>
 83        public virtual async Task<Response<ExpressRouteConnectionList>> ListAsync(string resourceGroupName, string expre
 84        {
 085            using var scope = _clientDiagnostics.CreateScope("ExpressRouteConnectionsOperations.List");
 086            scope.Start();
 87            try
 88            {
 089                return await RestClient.ListAsync(resourceGroupName, expressRouteGatewayName, cancellationToken).Configu
 90            }
 091            catch (Exception e)
 92            {
 093                scope.Failed(e);
 094                throw;
 95            }
 096        }
 97
 98        /// <summary> Lists ExpressRouteConnections. </summary>
 99        /// <param name="resourceGroupName"> The name of the resource group. </param>
 100        /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param>
 101        /// <param name="cancellationToken"> The cancellation token to use. </param>
 102        public virtual Response<ExpressRouteConnectionList> List(string resourceGroupName, string expressRouteGatewayNam
 103        {
 0104            using var scope = _clientDiagnostics.CreateScope("ExpressRouteConnectionsOperations.List");
 0105            scope.Start();
 106            try
 107            {
 0108                return RestClient.List(resourceGroupName, expressRouteGatewayName, cancellationToken);
 109            }
 0110            catch (Exception e)
 111            {
 0112                scope.Failed(e);
 0113                throw;
 114            }
 0115        }
 116
 117        /// <summary> Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. </summary>
 118        /// <param name="resourceGroupName"> The name of the resource group. </param>
 119        /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param>
 120        /// <param name="connectionName"> The name of the connection subresource. </param>
 121        /// <param name="putExpressRouteConnectionParameters"> Parameters required in an ExpressRouteConnection PUT oper
 122        /// <param name="cancellationToken"> The cancellation token to use. </param>
 123        public virtual async Task<ExpressRouteConnectionsCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resour
 124        {
 0125            if (resourceGroupName == null)
 126            {
 0127                throw new ArgumentNullException(nameof(resourceGroupName));
 128            }
 0129            if (expressRouteGatewayName == null)
 130            {
 0131                throw new ArgumentNullException(nameof(expressRouteGatewayName));
 132            }
 0133            if (connectionName == null)
 134            {
 0135                throw new ArgumentNullException(nameof(connectionName));
 136            }
 0137            if (putExpressRouteConnectionParameters == null)
 138            {
 0139                throw new ArgumentNullException(nameof(putExpressRouteConnectionParameters));
 140            }
 141
 0142            using var scope = _clientDiagnostics.CreateScope("ExpressRouteConnectionsOperations.StartCreateOrUpdate");
 0143            scope.Start();
 144            try
 145            {
 0146                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, expressRouteGatewayName, 
 0147                return new ExpressRouteConnectionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.Crea
 148            }
 0149            catch (Exception e)
 150            {
 0151                scope.Failed(e);
 0152                throw;
 153            }
 0154        }
 155
 156        /// <summary> Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. </summary>
 157        /// <param name="resourceGroupName"> The name of the resource group. </param>
 158        /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param>
 159        /// <param name="connectionName"> The name of the connection subresource. </param>
 160        /// <param name="putExpressRouteConnectionParameters"> Parameters required in an ExpressRouteConnection PUT oper
 161        /// <param name="cancellationToken"> The cancellation token to use. </param>
 162        public virtual ExpressRouteConnectionsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, stri
 163        {
 0164            if (resourceGroupName == null)
 165            {
 0166                throw new ArgumentNullException(nameof(resourceGroupName));
 167            }
 0168            if (expressRouteGatewayName == null)
 169            {
 0170                throw new ArgumentNullException(nameof(expressRouteGatewayName));
 171            }
 0172            if (connectionName == null)
 173            {
 0174                throw new ArgumentNullException(nameof(connectionName));
 175            }
 0176            if (putExpressRouteConnectionParameters == null)
 177            {
 0178                throw new ArgumentNullException(nameof(putExpressRouteConnectionParameters));
 179            }
 180
 0181            using var scope = _clientDiagnostics.CreateScope("ExpressRouteConnectionsOperations.StartCreateOrUpdate");
 0182            scope.Start();
 183            try
 184            {
 0185                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, expressRouteGatewayName, connectionN
 0186                return new ExpressRouteConnectionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.Crea
 187            }
 0188            catch (Exception e)
 189            {
 0190                scope.Failed(e);
 0191                throw;
 192            }
 0193        }
 194
 195        /// <summary> Deletes a connection to a ExpressRoute circuit. </summary>
 196        /// <param name="resourceGroupName"> The name of the resource group. </param>
 197        /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param>
 198        /// <param name="connectionName"> The name of the connection subresource. </param>
 199        /// <param name="cancellationToken"> The cancellation token to use. </param>
 200        public virtual async Task<ExpressRouteConnectionsDeleteOperation> StartDeleteAsync(string resourceGroupName, str
 201        {
 0202            if (resourceGroupName == null)
 203            {
 0204                throw new ArgumentNullException(nameof(resourceGroupName));
 205            }
 0206            if (expressRouteGatewayName == null)
 207            {
 0208                throw new ArgumentNullException(nameof(expressRouteGatewayName));
 209            }
 0210            if (connectionName == null)
 211            {
 0212                throw new ArgumentNullException(nameof(connectionName));
 213            }
 214
 0215            using var scope = _clientDiagnostics.CreateScope("ExpressRouteConnectionsOperations.StartDelete");
 0216            scope.Start();
 217            try
 218            {
 0219                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, expressRouteGatewayName, connecti
 0220                return new ExpressRouteConnectionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDelete
 221            }
 0222            catch (Exception e)
 223            {
 0224                scope.Failed(e);
 0225                throw;
 226            }
 0227        }
 228
 229        /// <summary> Deletes a connection to a ExpressRoute circuit. </summary>
 230        /// <param name="resourceGroupName"> The name of the resource group. </param>
 231        /// <param name="expressRouteGatewayName"> The name of the ExpressRoute gateway. </param>
 232        /// <param name="connectionName"> The name of the connection subresource. </param>
 233        /// <param name="cancellationToken"> The cancellation token to use. </param>
 234        public virtual ExpressRouteConnectionsDeleteOperation StartDelete(string resourceGroupName, string expressRouteG
 235        {
 0236            if (resourceGroupName == null)
 237            {
 0238                throw new ArgumentNullException(nameof(resourceGroupName));
 239            }
 0240            if (expressRouteGatewayName == null)
 241            {
 0242                throw new ArgumentNullException(nameof(expressRouteGatewayName));
 243            }
 0244            if (connectionName == null)
 245            {
 0246                throw new ArgumentNullException(nameof(connectionName));
 247            }
 248
 0249            using var scope = _clientDiagnostics.CreateScope("ExpressRouteConnectionsOperations.StartDelete");
 0250            scope.Start();
 251            try
 252            {
 0253                var originalResponse = RestClient.Delete(resourceGroupName, expressRouteGatewayName, connectionName, can
 0254                return new ExpressRouteConnectionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDelete
 255            }
 0256            catch (Exception e)
 257            {
 0258                scope.Failed(e);
 0259                throw;
 260            }
 0261        }
 262    }
 263}