< Summary

Class:Azure.ResourceManager.Network.Models.ExpressRouteConnection
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ExpressRouteConnection.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ExpressRouteConnection.Serialization.cs
Covered lines:0
Uncovered lines:92
Coverable lines:92
Total lines:214
Line coverage:0% (0 of 92)
Covered branches:0
Total branches:52
Branch coverage:0% (0 of 52)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Name()-0%100%
get_ProvisioningState()-0%100%
get_ExpressRouteCircuitPeering()-0%100%
get_AuthorizationKey()-0%100%
get_RoutingWeight()-0%100%
get_EnableInternetSecurity()-0%100%
get_RoutingConfiguration()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeExpressRouteConnection(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ExpressRouteConnection.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;
 9
 10namespace Azure.ResourceManager.Network.Models
 11{
 12    /// <summary> ExpressRouteConnection resource. </summary>
 13    public partial class ExpressRouteConnection : SubResource
 14    {
 15        /// <summary> Initializes a new instance of ExpressRouteConnection. </summary>
 16        /// <param name="name"> The name of the resource. </param>
 017        public ExpressRouteConnection(string name)
 18        {
 019            if (name == null)
 20            {
 021                throw new ArgumentNullException(nameof(name));
 22            }
 23
 024            Name = name;
 025        }
 26
 27        /// <summary> Initializes a new instance of ExpressRouteConnection. </summary>
 28        /// <param name="id"> Resource ID. </param>
 29        /// <param name="name"> The name of the resource. </param>
 30        /// <param name="provisioningState"> The provisioning state of the express route connection resource. </param>
 31        /// <param name="expressRouteCircuitPeering"> The ExpressRoute circuit peering. </param>
 32        /// <param name="authorizationKey"> Authorization key to establish the connection. </param>
 33        /// <param name="routingWeight"> The routing weight associated to the connection. </param>
 34        /// <param name="enableInternetSecurity"> Enable internet security. </param>
 35        /// <param name="routingConfiguration"> The Routing Configuration indicating the associated and propagated route
 036        internal ExpressRouteConnection(string id, string name, ProvisioningState? provisioningState, ExpressRouteCircui
 37        {
 038            Name = name;
 039            ProvisioningState = provisioningState;
 040            ExpressRouteCircuitPeering = expressRouteCircuitPeering;
 041            AuthorizationKey = authorizationKey;
 042            RoutingWeight = routingWeight;
 043            EnableInternetSecurity = enableInternetSecurity;
 044            RoutingConfiguration = routingConfiguration;
 045        }
 46
 47        /// <summary> The name of the resource. </summary>
 048        public string Name { get; set; }
 49        /// <summary> The provisioning state of the express route connection resource. </summary>
 050        public ProvisioningState? ProvisioningState { get; }
 51        /// <summary> The ExpressRoute circuit peering. </summary>
 052        public ExpressRouteCircuitPeeringId ExpressRouteCircuitPeering { get; set; }
 53        /// <summary> Authorization key to establish the connection. </summary>
 054        public string AuthorizationKey { get; set; }
 55        /// <summary> The routing weight associated to the connection. </summary>
 056        public int? RoutingWeight { get; set; }
 57        /// <summary> Enable internet security. </summary>
 058        public bool? EnableInternetSecurity { get; set; }
 59        /// <summary> The Routing Configuration indicating the associated and propagated route tables on this connection
 060        public RoutingConfiguration RoutingConfiguration { get; set; }
 61    }
 62}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ExpressRouteConnection.Serialization.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.ResourceManager.Network.Models
 12{
 13    public partial class ExpressRouteConnection : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("name");
 019            writer.WriteStringValue(Name);
 020            if (Id != null)
 21            {
 022                writer.WritePropertyName("id");
 023                writer.WriteStringValue(Id);
 24            }
 025            writer.WritePropertyName("properties");
 026            writer.WriteStartObject();
 027            if (ProvisioningState != null)
 28            {
 029                writer.WritePropertyName("provisioningState");
 030                writer.WriteStringValue(ProvisioningState.Value.ToString());
 31            }
 032            if (ExpressRouteCircuitPeering != null)
 33            {
 034                writer.WritePropertyName("expressRouteCircuitPeering");
 035                writer.WriteObjectValue(ExpressRouteCircuitPeering);
 36            }
 037            if (AuthorizationKey != null)
 38            {
 039                writer.WritePropertyName("authorizationKey");
 040                writer.WriteStringValue(AuthorizationKey);
 41            }
 042            if (RoutingWeight != null)
 43            {
 044                writer.WritePropertyName("routingWeight");
 045                writer.WriteNumberValue(RoutingWeight.Value);
 46            }
 047            if (EnableInternetSecurity != null)
 48            {
 049                writer.WritePropertyName("enableInternetSecurity");
 050                writer.WriteBooleanValue(EnableInternetSecurity.Value);
 51            }
 052            if (RoutingConfiguration != null)
 53            {
 054                writer.WritePropertyName("routingConfiguration");
 055                writer.WriteObjectValue(RoutingConfiguration);
 56            }
 057            writer.WriteEndObject();
 058            writer.WriteEndObject();
 059        }
 60
 61        internal static ExpressRouteConnection DeserializeExpressRouteConnection(JsonElement element)
 62        {
 063            string name = default;
 064            string id = default;
 065            ProvisioningState? provisioningState = default;
 066            ExpressRouteCircuitPeeringId expressRouteCircuitPeering = default;
 067            string authorizationKey = default;
 068            int? routingWeight = default;
 069            bool? enableInternetSecurity = default;
 070            RoutingConfiguration routingConfiguration = default;
 071            foreach (var property in element.EnumerateObject())
 72            {
 073                if (property.NameEquals("name"))
 74                {
 075                    name = property.Value.GetString();
 076                    continue;
 77                }
 078                if (property.NameEquals("id"))
 79                {
 080                    if (property.Value.ValueKind == JsonValueKind.Null)
 81                    {
 82                        continue;
 83                    }
 084                    id = property.Value.GetString();
 085                    continue;
 86                }
 087                if (property.NameEquals("properties"))
 88                {
 089                    foreach (var property0 in property.Value.EnumerateObject())
 90                    {
 091                        if (property0.NameEquals("provisioningState"))
 92                        {
 093                            if (property0.Value.ValueKind == JsonValueKind.Null)
 94                            {
 95                                continue;
 96                            }
 097                            provisioningState = new ProvisioningState(property0.Value.GetString());
 098                            continue;
 99                        }
 0100                        if (property0.NameEquals("expressRouteCircuitPeering"))
 101                        {
 0102                            if (property0.Value.ValueKind == JsonValueKind.Null)
 103                            {
 104                                continue;
 105                            }
 0106                            expressRouteCircuitPeering = ExpressRouteCircuitPeeringId.DeserializeExpressRouteCircuitPeer
 0107                            continue;
 108                        }
 0109                        if (property0.NameEquals("authorizationKey"))
 110                        {
 0111                            if (property0.Value.ValueKind == JsonValueKind.Null)
 112                            {
 113                                continue;
 114                            }
 0115                            authorizationKey = property0.Value.GetString();
 0116                            continue;
 117                        }
 0118                        if (property0.NameEquals("routingWeight"))
 119                        {
 0120                            if (property0.Value.ValueKind == JsonValueKind.Null)
 121                            {
 122                                continue;
 123                            }
 0124                            routingWeight = property0.Value.GetInt32();
 0125                            continue;
 126                        }
 0127                        if (property0.NameEquals("enableInternetSecurity"))
 128                        {
 0129                            if (property0.Value.ValueKind == JsonValueKind.Null)
 130                            {
 131                                continue;
 132                            }
 0133                            enableInternetSecurity = property0.Value.GetBoolean();
 0134                            continue;
 135                        }
 0136                        if (property0.NameEquals("routingConfiguration"))
 137                        {
 0138                            if (property0.Value.ValueKind == JsonValueKind.Null)
 139                            {
 140                                continue;
 141                            }
 0142                            routingConfiguration = RoutingConfiguration.DeserializeRoutingConfiguration(property0.Value)
 143                            continue;
 144                        }
 145                    }
 146                    continue;
 147                }
 148            }
 0149            return new ExpressRouteConnection(id, name, provisioningState, expressRouteCircuitPeering, authorizationKey,
 150        }
 151    }
 152}