< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
CreateListByVpnConnectionRequest(...)-0%100%
ListByVpnConnectionAsync()-0%0%
ListByVpnConnection(...)-0%0%
CreateListByVpnConnectionNextPageRequest(...)-0%100%
ListByVpnConnectionNextPageAsync()-0%0%
ListByVpnConnectionNextPage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\VpnLinkConnectionsRestOperations.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.Text.Json;
 10using System.Threading;
 11using System.Threading.Tasks;
 12using Azure;
 13using Azure.Core;
 14using Azure.Core.Pipeline;
 15using Azure.ResourceManager.Network.Models;
 16
 17namespace Azure.ResourceManager.Network
 18{
 19    internal partial class VpnLinkConnectionsRestOperations
 20    {
 21        private string subscriptionId;
 22        private Uri endpoint;
 23        private ClientDiagnostics _clientDiagnostics;
 24        private HttpPipeline _pipeline;
 25
 26        /// <summary> Initializes a new instance of VpnLinkConnectionsRestOperations. </summary>
 27        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
 28        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
 29        /// <param name="subscriptionId"> The subscription credentials which uniquely identify the Microsoft Azure subsc
 30        /// <param name="endpoint"> server parameter. </param>
 31        /// <exception cref="ArgumentNullException"> This occurs when one of the required arguments is null. </exception
 032        public VpnLinkConnectionsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subsc
 33        {
 034            if (subscriptionId == null)
 35            {
 036                throw new ArgumentNullException(nameof(subscriptionId));
 37            }
 038            endpoint ??= new Uri("https://management.azure.com");
 39
 040            this.subscriptionId = subscriptionId;
 041            this.endpoint = endpoint;
 042            _clientDiagnostics = clientDiagnostics;
 043            _pipeline = pipeline;
 044        }
 45
 46        internal HttpMessage CreateListByVpnConnectionRequest(string resourceGroupName, string gatewayName, string conne
 47        {
 048            var message = _pipeline.CreateMessage();
 049            var request = message.Request;
 050            request.Method = RequestMethod.Get;
 051            var uri = new RawRequestUriBuilder();
 052            uri.Reset(endpoint);
 053            uri.AppendPath("/subscriptions/", false);
 054            uri.AppendPath(subscriptionId, true);
 055            uri.AppendPath("/resourceGroups/", false);
 056            uri.AppendPath(resourceGroupName, true);
 057            uri.AppendPath("/providers/Microsoft.Network/vpnGateways/", false);
 058            uri.AppendPath(gatewayName, true);
 059            uri.AppendPath("/vpnConnections/", false);
 060            uri.AppendPath(connectionName, true);
 061            uri.AppendPath("/vpnLinkConnections", false);
 062            uri.AppendQuery("api-version", "2020-04-01", true);
 063            request.Uri = uri;
 064            return message;
 65        }
 66
 67        /// <summary> Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. <
 68        /// <param name="resourceGroupName"> The resource group name of the VpnGateway. </param>
 69        /// <param name="gatewayName"> The name of the gateway. </param>
 70        /// <param name="connectionName"> The name of the vpn connection. </param>
 71        /// <param name="cancellationToken"> The cancellation token to use. </param>
 72        public async Task<Response<ListVpnSiteLinkConnectionsResult>> ListByVpnConnectionAsync(string resourceGroupName,
 73        {
 074            if (resourceGroupName == null)
 75            {
 076                throw new ArgumentNullException(nameof(resourceGroupName));
 77            }
 078            if (gatewayName == null)
 79            {
 080                throw new ArgumentNullException(nameof(gatewayName));
 81            }
 082            if (connectionName == null)
 83            {
 084                throw new ArgumentNullException(nameof(connectionName));
 85            }
 86
 087            using var message = CreateListByVpnConnectionRequest(resourceGroupName, gatewayName, connectionName);
 088            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 089            switch (message.Response.Status)
 90            {
 91                case 200:
 92                    {
 093                        ListVpnSiteLinkConnectionsResult value = default;
 094                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 095                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 96                        {
 097                            value = null;
 98                        }
 99                        else
 100                        {
 0101                            value = ListVpnSiteLinkConnectionsResult.DeserializeListVpnSiteLinkConnectionsResult(documen
 102                        }
 0103                        return Response.FromValue(value, message.Response);
 104                    }
 105                default:
 0106                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 107            }
 0108        }
 109
 110        /// <summary> Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. <
 111        /// <param name="resourceGroupName"> The resource group name of the VpnGateway. </param>
 112        /// <param name="gatewayName"> The name of the gateway. </param>
 113        /// <param name="connectionName"> The name of the vpn connection. </param>
 114        /// <param name="cancellationToken"> The cancellation token to use. </param>
 115        public Response<ListVpnSiteLinkConnectionsResult> ListByVpnConnection(string resourceGroupName, string gatewayNa
 116        {
 0117            if (resourceGroupName == null)
 118            {
 0119                throw new ArgumentNullException(nameof(resourceGroupName));
 120            }
 0121            if (gatewayName == null)
 122            {
 0123                throw new ArgumentNullException(nameof(gatewayName));
 124            }
 0125            if (connectionName == null)
 126            {
 0127                throw new ArgumentNullException(nameof(connectionName));
 128            }
 129
 0130            using var message = CreateListByVpnConnectionRequest(resourceGroupName, gatewayName, connectionName);
 0131            _pipeline.Send(message, cancellationToken);
 0132            switch (message.Response.Status)
 133            {
 134                case 200:
 135                    {
 0136                        ListVpnSiteLinkConnectionsResult value = default;
 0137                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0138                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 139                        {
 0140                            value = null;
 141                        }
 142                        else
 143                        {
 0144                            value = ListVpnSiteLinkConnectionsResult.DeserializeListVpnSiteLinkConnectionsResult(documen
 145                        }
 0146                        return Response.FromValue(value, message.Response);
 147                    }
 148                default:
 0149                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 150            }
 0151        }
 152
 153        internal HttpMessage CreateListByVpnConnectionNextPageRequest(string nextLink, string resourceGroupName, string 
 154        {
 0155            var message = _pipeline.CreateMessage();
 0156            var request = message.Request;
 0157            request.Method = RequestMethod.Get;
 0158            var uri = new RawRequestUriBuilder();
 0159            uri.Reset(endpoint);
 0160            uri.AppendRawNextLink(nextLink, false);
 0161            request.Uri = uri;
 0162            return message;
 163        }
 164
 165        /// <summary> Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. <
 166        /// <param name="nextLink"> The URL to the next page of results. </param>
 167        /// <param name="resourceGroupName"> The resource group name of the VpnGateway. </param>
 168        /// <param name="gatewayName"> The name of the gateway. </param>
 169        /// <param name="connectionName"> The name of the vpn connection. </param>
 170        /// <param name="cancellationToken"> The cancellation token to use. </param>
 171        public async Task<Response<ListVpnSiteLinkConnectionsResult>> ListByVpnConnectionNextPageAsync(string nextLink, 
 172        {
 0173            if (nextLink == null)
 174            {
 0175                throw new ArgumentNullException(nameof(nextLink));
 176            }
 0177            if (resourceGroupName == null)
 178            {
 0179                throw new ArgumentNullException(nameof(resourceGroupName));
 180            }
 0181            if (gatewayName == null)
 182            {
 0183                throw new ArgumentNullException(nameof(gatewayName));
 184            }
 0185            if (connectionName == null)
 186            {
 0187                throw new ArgumentNullException(nameof(connectionName));
 188            }
 189
 0190            using var message = CreateListByVpnConnectionNextPageRequest(nextLink, resourceGroupName, gatewayName, conne
 0191            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0192            switch (message.Response.Status)
 193            {
 194                case 200:
 195                    {
 0196                        ListVpnSiteLinkConnectionsResult value = default;
 0197                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0198                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 199                        {
 0200                            value = null;
 201                        }
 202                        else
 203                        {
 0204                            value = ListVpnSiteLinkConnectionsResult.DeserializeListVpnSiteLinkConnectionsResult(documen
 205                        }
 0206                        return Response.FromValue(value, message.Response);
 207                    }
 208                default:
 0209                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 210            }
 0211        }
 212
 213        /// <summary> Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. <
 214        /// <param name="nextLink"> The URL to the next page of results. </param>
 215        /// <param name="resourceGroupName"> The resource group name of the VpnGateway. </param>
 216        /// <param name="gatewayName"> The name of the gateway. </param>
 217        /// <param name="connectionName"> The name of the vpn connection. </param>
 218        /// <param name="cancellationToken"> The cancellation token to use. </param>
 219        public Response<ListVpnSiteLinkConnectionsResult> ListByVpnConnectionNextPage(string nextLink, string resourceGr
 220        {
 0221            if (nextLink == null)
 222            {
 0223                throw new ArgumentNullException(nameof(nextLink));
 224            }
 0225            if (resourceGroupName == null)
 226            {
 0227                throw new ArgumentNullException(nameof(resourceGroupName));
 228            }
 0229            if (gatewayName == null)
 230            {
 0231                throw new ArgumentNullException(nameof(gatewayName));
 232            }
 0233            if (connectionName == null)
 234            {
 0235                throw new ArgumentNullException(nameof(connectionName));
 236            }
 237
 0238            using var message = CreateListByVpnConnectionNextPageRequest(nextLink, resourceGroupName, gatewayName, conne
 0239            _pipeline.Send(message, cancellationToken);
 0240            switch (message.Response.Status)
 241            {
 242                case 200:
 243                    {
 0244                        ListVpnSiteLinkConnectionsResult value = default;
 0245                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0246                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 247                        {
 0248                            value = null;
 249                        }
 250                        else
 251                        {
 0252                            value = ListVpnSiteLinkConnectionsResult.DeserializeListVpnSiteLinkConnectionsResult(documen
 253                        }
 0254                        return Response.FromValue(value, message.Response);
 255                    }
 256                default:
 0257                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 258            }
 0259        }
 260    }
 261}