< Summary

Class:Azure.ResourceManager.Network.VpnLinkConnectionsOperations
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\VpnLinkConnectionsOperations.cs
Covered lines:0
Uncovered lines:54
Coverable lines:54
Total lines:146
Line coverage:0% (0 of 54)
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%
ListByVpnConnectionAsync(...)-0%0%
<ListByVpnConnectionAsync()-0%100%
<ListByVpnConnectionAsync()-0%100%
ListByVpnConnection(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\VpnLinkConnectionsOperations.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 VpnLinkConnections service client. </summary>
 19    public partial class VpnLinkConnectionsOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 023        internal VpnLinkConnectionsRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of VpnLinkConnectionsOperations for mocking. </summary>
 025        protected VpnLinkConnectionsOperations()
 26        {
 027        }
 28        /// <summary> Initializes a new instance of VpnLinkConnectionsOperations. </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 VpnLinkConnectionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscri
 34        {
 035            RestClient = new VpnLinkConnectionsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
 036            _clientDiagnostics = clientDiagnostics;
 037            _pipeline = pipeline;
 038        }
 39
 40        /// <summary> Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. <
 41        /// <param name="resourceGroupName"> The resource group name of the VpnGateway. </param>
 42        /// <param name="gatewayName"> The name of the gateway. </param>
 43        /// <param name="connectionName"> The name of the vpn connection. </param>
 44        /// <param name="cancellationToken"> The cancellation token to use. </param>
 45        public virtual AsyncPageable<VpnSiteLinkConnection> ListByVpnConnectionAsync(string resourceGroupName, string ga
 46        {
 047            if (resourceGroupName == null)
 48            {
 049                throw new ArgumentNullException(nameof(resourceGroupName));
 50            }
 051            if (gatewayName == null)
 52            {
 053                throw new ArgumentNullException(nameof(gatewayName));
 54            }
 055            if (connectionName == null)
 56            {
 057                throw new ArgumentNullException(nameof(connectionName));
 58            }
 59
 60            async Task<Page<VpnSiteLinkConnection>> FirstPageFunc(int? pageSizeHint)
 61            {
 062                using var scope = _clientDiagnostics.CreateScope("VpnLinkConnectionsOperations.ListByVpnConnection");
 063                scope.Start();
 64                try
 65                {
 066                    var response = await RestClient.ListByVpnConnectionAsync(resourceGroupName, gatewayName, connectionN
 067                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 68                }
 069                catch (Exception e)
 70                {
 071                    scope.Failed(e);
 072                    throw;
 73                }
 074            }
 75            async Task<Page<VpnSiteLinkConnection>> NextPageFunc(string nextLink, int? pageSizeHint)
 76            {
 077                using var scope = _clientDiagnostics.CreateScope("VpnLinkConnectionsOperations.ListByVpnConnection");
 078                scope.Start();
 79                try
 80                {
 081                    var response = await RestClient.ListByVpnConnectionNextPageAsync(nextLink, resourceGroupName, gatewa
 082                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 83                }
 084                catch (Exception e)
 85                {
 086                    scope.Failed(e);
 087                    throw;
 88                }
 089            }
 090            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 91        }
 92
 93        /// <summary> Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. <
 94        /// <param name="resourceGroupName"> The resource group name of the VpnGateway. </param>
 95        /// <param name="gatewayName"> The name of the gateway. </param>
 96        /// <param name="connectionName"> The name of the vpn connection. </param>
 97        /// <param name="cancellationToken"> The cancellation token to use. </param>
 98        public virtual Pageable<VpnSiteLinkConnection> ListByVpnConnection(string resourceGroupName, string gatewayName,
 99        {
 0100            if (resourceGroupName == null)
 101            {
 0102                throw new ArgumentNullException(nameof(resourceGroupName));
 103            }
 0104            if (gatewayName == null)
 105            {
 0106                throw new ArgumentNullException(nameof(gatewayName));
 107            }
 0108            if (connectionName == null)
 109            {
 0110                throw new ArgumentNullException(nameof(connectionName));
 111            }
 112
 113            Page<VpnSiteLinkConnection> FirstPageFunc(int? pageSizeHint)
 114            {
 0115                using var scope = _clientDiagnostics.CreateScope("VpnLinkConnectionsOperations.ListByVpnConnection");
 0116                scope.Start();
 117                try
 118                {
 0119                    var response = RestClient.ListByVpnConnection(resourceGroupName, gatewayName, connectionName, cancel
 0120                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 121                }
 0122                catch (Exception e)
 123                {
 0124                    scope.Failed(e);
 0125                    throw;
 126                }
 0127            }
 128            Page<VpnSiteLinkConnection> NextPageFunc(string nextLink, int? pageSizeHint)
 129            {
 0130                using var scope = _clientDiagnostics.CreateScope("VpnLinkConnectionsOperations.ListByVpnConnection");
 0131                scope.Start();
 132                try
 133                {
 0134                    var response = RestClient.ListByVpnConnectionNextPage(nextLink, resourceGroupName, gatewayName, conn
 0135                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 136                }
 0137                catch (Exception e)
 138                {
 0139                    scope.Failed(e);
 0140                    throw;
 141                }
 0142            }
 0143            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 144        }
 145    }
 146}