< Summary

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

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%
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\ExpressRouteCircuitConnectionsOperations.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 ExpressRouteCircuitConnections service client. </summary>
 19    public partial class ExpressRouteCircuitConnectionsOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 023        internal ExpressRouteCircuitConnectionsRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of ExpressRouteCircuitConnectionsOperations for mocking. </summary>
 025        protected ExpressRouteCircuitConnectionsOperations()
 26        {
 027        }
 28        /// <summary> Initializes a new instance of ExpressRouteCircuitConnectionsOperations. </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 ExpressRouteCircuitConnectionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, st
 34        {
 035            RestClient = new ExpressRouteCircuitConnectionsRestOperations(clientDiagnostics, pipeline, subscriptionId, e
 036            _clientDiagnostics = clientDiagnostics;
 037            _pipeline = pipeline;
 038        }
 39
 40        /// <summary> Gets the specified Express Route Circuit Connection from the specified express route circuit. </su
 41        /// <param name="resourceGroupName"> The name of the resource group. </param>
 42        /// <param name="circuitName"> The name of the express route circuit. </param>
 43        /// <param name="peeringName"> The name of the peering. </param>
 44        /// <param name="connectionName"> The name of the express route circuit connection. </param>
 45        /// <param name="cancellationToken"> The cancellation token to use. </param>
 46        public virtual async Task<Response<ExpressRouteCircuitConnection>> GetAsync(string resourceGroupName, string cir
 47        {
 048            using var scope = _clientDiagnostics.CreateScope("ExpressRouteCircuitConnectionsOperations.Get");
 049            scope.Start();
 50            try
 51            {
 052                return await RestClient.GetAsync(resourceGroupName, circuitName, peeringName, connectionName, cancellati
 53            }
 054            catch (Exception e)
 55            {
 056                scope.Failed(e);
 057                throw;
 58            }
 059        }
 60
 61        /// <summary> Gets the specified Express Route Circuit Connection from the specified express route circuit. </su
 62        /// <param name="resourceGroupName"> The name of the resource group. </param>
 63        /// <param name="circuitName"> The name of the express route circuit. </param>
 64        /// <param name="peeringName"> The name of the peering. </param>
 65        /// <param name="connectionName"> The name of the express route circuit connection. </param>
 66        /// <param name="cancellationToken"> The cancellation token to use. </param>
 67        public virtual Response<ExpressRouteCircuitConnection> Get(string resourceGroupName, string circuitName, string 
 68        {
 069            using var scope = _clientDiagnostics.CreateScope("ExpressRouteCircuitConnectionsOperations.Get");
 070            scope.Start();
 71            try
 72            {
 073                return RestClient.Get(resourceGroupName, circuitName, peeringName, connectionName, cancellationToken);
 74            }
 075            catch (Exception e)
 76            {
 077                scope.Failed(e);
 078                throw;
 79            }
 080        }
 81
 82        /// <summary> Gets all global reach connections associated with a private peering in an express route circuit. <
 83        /// <param name="resourceGroupName"> The name of the resource group. </param>
 84        /// <param name="circuitName"> The name of the circuit. </param>
 85        /// <param name="peeringName"> The name of the peering. </param>
 86        /// <param name="cancellationToken"> The cancellation token to use. </param>
 87        public virtual AsyncPageable<ExpressRouteCircuitConnection> ListAsync(string resourceGroupName, string circuitNa
 88        {
 089            if (resourceGroupName == null)
 90            {
 091                throw new ArgumentNullException(nameof(resourceGroupName));
 92            }
 093            if (circuitName == null)
 94            {
 095                throw new ArgumentNullException(nameof(circuitName));
 96            }
 097            if (peeringName == null)
 98            {
 099                throw new ArgumentNullException(nameof(peeringName));
 100            }
 101
 102            async Task<Page<ExpressRouteCircuitConnection>> FirstPageFunc(int? pageSizeHint)
 103            {
 0104                using var scope = _clientDiagnostics.CreateScope("ExpressRouteCircuitConnectionsOperations.List");
 0105                scope.Start();
 106                try
 107                {
 0108                    var response = await RestClient.ListAsync(resourceGroupName, circuitName, peeringName, cancellationT
 0109                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 110                }
 0111                catch (Exception e)
 112                {
 0113                    scope.Failed(e);
 0114                    throw;
 115                }
 0116            }
 117            async Task<Page<ExpressRouteCircuitConnection>> NextPageFunc(string nextLink, int? pageSizeHint)
 118            {
 0119                using var scope = _clientDiagnostics.CreateScope("ExpressRouteCircuitConnectionsOperations.List");
 0120                scope.Start();
 121                try
 122                {
 0123                    var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, circuitName, peeringN
 0124                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 125                }
 0126                catch (Exception e)
 127                {
 0128                    scope.Failed(e);
 0129                    throw;
 130                }
 0131            }
 0132            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 133        }
 134
 135        /// <summary> Gets all global reach connections associated with a private peering in an express route circuit. <
 136        /// <param name="resourceGroupName"> The name of the resource group. </param>
 137        /// <param name="circuitName"> The name of the circuit. </param>
 138        /// <param name="peeringName"> The name of the peering. </param>
 139        /// <param name="cancellationToken"> The cancellation token to use. </param>
 140        public virtual Pageable<ExpressRouteCircuitConnection> List(string resourceGroupName, string circuitName, string
 141        {
 0142            if (resourceGroupName == null)
 143            {
 0144                throw new ArgumentNullException(nameof(resourceGroupName));
 145            }
 0146            if (circuitName == null)
 147            {
 0148                throw new ArgumentNullException(nameof(circuitName));
 149            }
 0150            if (peeringName == null)
 151            {
 0152                throw new ArgumentNullException(nameof(peeringName));
 153            }
 154
 155            Page<ExpressRouteCircuitConnection> FirstPageFunc(int? pageSizeHint)
 156            {
 0157                using var scope = _clientDiagnostics.CreateScope("ExpressRouteCircuitConnectionsOperations.List");
 0158                scope.Start();
 159                try
 160                {
 0161                    var response = RestClient.List(resourceGroupName, circuitName, peeringName, cancellationToken);
 0162                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 163                }
 0164                catch (Exception e)
 165                {
 0166                    scope.Failed(e);
 0167                    throw;
 168                }
 0169            }
 170            Page<ExpressRouteCircuitConnection> NextPageFunc(string nextLink, int? pageSizeHint)
 171            {
 0172                using var scope = _clientDiagnostics.CreateScope("ExpressRouteCircuitConnectionsOperations.List");
 0173                scope.Start();
 174                try
 175                {
 0176                    var response = RestClient.ListNextPage(nextLink, resourceGroupName, circuitName, peeringName, cancel
 0177                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 178                }
 0179                catch (Exception e)
 180                {
 0181                    scope.Failed(e);
 0182                    throw;
 183                }
 0184            }
 0185            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 186        }
 187
 188        /// <summary> Deletes the specified Express Route Circuit Connection from the specified express route circuit. <
 189        /// <param name="resourceGroupName"> The name of the resource group. </param>
 190        /// <param name="circuitName"> The name of the express route circuit. </param>
 191        /// <param name="peeringName"> The name of the peering. </param>
 192        /// <param name="connectionName"> The name of the express route circuit connection. </param>
 193        /// <param name="cancellationToken"> The cancellation token to use. </param>
 194        public virtual async Task<ExpressRouteCircuitConnectionsDeleteOperation> StartDeleteAsync(string resourceGroupNa
 195        {
 0196            if (resourceGroupName == null)
 197            {
 0198                throw new ArgumentNullException(nameof(resourceGroupName));
 199            }
 0200            if (circuitName == null)
 201            {
 0202                throw new ArgumentNullException(nameof(circuitName));
 203            }
 0204            if (peeringName == null)
 205            {
 0206                throw new ArgumentNullException(nameof(peeringName));
 207            }
 0208            if (connectionName == null)
 209            {
 0210                throw new ArgumentNullException(nameof(connectionName));
 211            }
 212
 0213            using var scope = _clientDiagnostics.CreateScope("ExpressRouteCircuitConnectionsOperations.StartDelete");
 0214            scope.Start();
 215            try
 216            {
 0217                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, circuitName, peeringName, connect
 0218                return new ExpressRouteCircuitConnectionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.Creat
 219            }
 0220            catch (Exception e)
 221            {
 0222                scope.Failed(e);
 0223                throw;
 224            }
 0225        }
 226
 227        /// <summary> Deletes the specified Express Route Circuit Connection from the specified express route circuit. <
 228        /// <param name="resourceGroupName"> The name of the resource group. </param>
 229        /// <param name="circuitName"> The name of the express route circuit. </param>
 230        /// <param name="peeringName"> The name of the peering. </param>
 231        /// <param name="connectionName"> The name of the express route circuit connection. </param>
 232        /// <param name="cancellationToken"> The cancellation token to use. </param>
 233        public virtual ExpressRouteCircuitConnectionsDeleteOperation StartDelete(string resourceGroupName, string circui
 234        {
 0235            if (resourceGroupName == null)
 236            {
 0237                throw new ArgumentNullException(nameof(resourceGroupName));
 238            }
 0239            if (circuitName == null)
 240            {
 0241                throw new ArgumentNullException(nameof(circuitName));
 242            }
 0243            if (peeringName == null)
 244            {
 0245                throw new ArgumentNullException(nameof(peeringName));
 246            }
 0247            if (connectionName == null)
 248            {
 0249                throw new ArgumentNullException(nameof(connectionName));
 250            }
 251
 0252            using var scope = _clientDiagnostics.CreateScope("ExpressRouteCircuitConnectionsOperations.StartDelete");
 0253            scope.Start();
 254            try
 255            {
 0256                var originalResponse = RestClient.Delete(resourceGroupName, circuitName, peeringName, connectionName, ca
 0257                return new ExpressRouteCircuitConnectionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.Creat
 258            }
 0259            catch (Exception e)
 260            {
 0261                scope.Failed(e);
 0262                throw;
 263            }
 0264        }
 265
 266        /// <summary> Creates or updates a Express Route Circuit Connection in the specified express route circuits. </s
 267        /// <param name="resourceGroupName"> The name of the resource group. </param>
 268        /// <param name="circuitName"> The name of the express route circuit. </param>
 269        /// <param name="peeringName"> The name of the peering. </param>
 270        /// <param name="connectionName"> The name of the express route circuit connection. </param>
 271        /// <param name="expressRouteCircuitConnectionParameters"> Parameters supplied to the create or update express r
 272        /// <param name="cancellationToken"> The cancellation token to use. </param>
 273        public virtual async Task<ExpressRouteCircuitConnectionsCreateOrUpdateOperation> StartCreateOrUpdateAsync(string
 274        {
 0275            if (resourceGroupName == null)
 276            {
 0277                throw new ArgumentNullException(nameof(resourceGroupName));
 278            }
 0279            if (circuitName == null)
 280            {
 0281                throw new ArgumentNullException(nameof(circuitName));
 282            }
 0283            if (peeringName == null)
 284            {
 0285                throw new ArgumentNullException(nameof(peeringName));
 286            }
 0287            if (connectionName == null)
 288            {
 0289                throw new ArgumentNullException(nameof(connectionName));
 290            }
 0291            if (expressRouteCircuitConnectionParameters == null)
 292            {
 0293                throw new ArgumentNullException(nameof(expressRouteCircuitConnectionParameters));
 294            }
 295
 0296            using var scope = _clientDiagnostics.CreateScope("ExpressRouteCircuitConnectionsOperations.StartCreateOrUpda
 0297            scope.Start();
 298            try
 299            {
 0300                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, circuitName, peeringName,
 0301                return new ExpressRouteCircuitConnectionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClie
 302            }
 0303            catch (Exception e)
 304            {
 0305                scope.Failed(e);
 0306                throw;
 307            }
 0308        }
 309
 310        /// <summary> Creates or updates a Express Route Circuit Connection in the specified express route circuits. </s
 311        /// <param name="resourceGroupName"> The name of the resource group. </param>
 312        /// <param name="circuitName"> The name of the express route circuit. </param>
 313        /// <param name="peeringName"> The name of the peering. </param>
 314        /// <param name="connectionName"> The name of the express route circuit connection. </param>
 315        /// <param name="expressRouteCircuitConnectionParameters"> Parameters supplied to the create or update express r
 316        /// <param name="cancellationToken"> The cancellation token to use. </param>
 317        public virtual ExpressRouteCircuitConnectionsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupNam
 318        {
 0319            if (resourceGroupName == null)
 320            {
 0321                throw new ArgumentNullException(nameof(resourceGroupName));
 322            }
 0323            if (circuitName == null)
 324            {
 0325                throw new ArgumentNullException(nameof(circuitName));
 326            }
 0327            if (peeringName == null)
 328            {
 0329                throw new ArgumentNullException(nameof(peeringName));
 330            }
 0331            if (connectionName == null)
 332            {
 0333                throw new ArgumentNullException(nameof(connectionName));
 334            }
 0335            if (expressRouteCircuitConnectionParameters == null)
 336            {
 0337                throw new ArgumentNullException(nameof(expressRouteCircuitConnectionParameters));
 338            }
 339
 0340            using var scope = _clientDiagnostics.CreateScope("ExpressRouteCircuitConnectionsOperations.StartCreateOrUpda
 0341            scope.Start();
 342            try
 343            {
 0344                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, circuitName, peeringName, connection
 0345                return new ExpressRouteCircuitConnectionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClie
 346            }
 0347            catch (Exception e)
 348            {
 0349                scope.Failed(e);
 0350                throw;
 351            }
 0352        }
 353    }
 354}