< Summary

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

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%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\PeerExpressRouteCircuitConnectionsOperations.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 PeerExpressRouteCircuitConnections service client. </summary>
 19    public partial class PeerExpressRouteCircuitConnectionsOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 023        internal PeerExpressRouteCircuitConnectionsRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of PeerExpressRouteCircuitConnectionsOperations for mocking. </summary>
 025        protected PeerExpressRouteCircuitConnectionsOperations()
 26        {
 027        }
 28        /// <summary> Initializes a new instance of PeerExpressRouteCircuitConnectionsOperations. </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 PeerExpressRouteCircuitConnectionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline
 34        {
 035            RestClient = new PeerExpressRouteCircuitConnectionsRestOperations(clientDiagnostics, pipeline, subscriptionI
 036            _clientDiagnostics = clientDiagnostics;
 037            _pipeline = pipeline;
 038        }
 39
 40        /// <summary> Gets the specified Peer Express Route Circuit Connection from the specified express route circuit.
 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 peer express route circuit connection. </param>
 45        /// <param name="cancellationToken"> The cancellation token to use. </param>
 46        public virtual async Task<Response<PeerExpressRouteCircuitConnection>> GetAsync(string resourceGroupName, string
 47        {
 048            using var scope = _clientDiagnostics.CreateScope("PeerExpressRouteCircuitConnectionsOperations.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 Peer Express Route Circuit Connection from the specified express route circuit.
 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 peer express route circuit connection. </param>
 66        /// <param name="cancellationToken"> The cancellation token to use. </param>
 67        public virtual Response<PeerExpressRouteCircuitConnection> Get(string resourceGroupName, string circuitName, str
 68        {
 069            using var scope = _clientDiagnostics.CreateScope("PeerExpressRouteCircuitConnectionsOperations.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 peer connections associated with a private peering in an express route circu
 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<PeerExpressRouteCircuitConnection> ListAsync(string resourceGroupName, string circu
 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<PeerExpressRouteCircuitConnection>> FirstPageFunc(int? pageSizeHint)
 103            {
 0104                using var scope = _clientDiagnostics.CreateScope("PeerExpressRouteCircuitConnectionsOperations.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<PeerExpressRouteCircuitConnection>> NextPageFunc(string nextLink, int? pageSizeHint)
 118            {
 0119                using var scope = _clientDiagnostics.CreateScope("PeerExpressRouteCircuitConnectionsOperations.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 peer connections associated with a private peering in an express route circu
 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<PeerExpressRouteCircuitConnection> List(string resourceGroupName, string circuitName, st
 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<PeerExpressRouteCircuitConnection> FirstPageFunc(int? pageSizeHint)
 156            {
 0157                using var scope = _clientDiagnostics.CreateScope("PeerExpressRouteCircuitConnectionsOperations.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<PeerExpressRouteCircuitConnection> NextPageFunc(string nextLink, int? pageSizeHint)
 171            {
 0172                using var scope = _clientDiagnostics.CreateScope("PeerExpressRouteCircuitConnectionsOperations.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}