< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Etag()-0%100%
get_VirtualWan()-0%100%
get_DeviceProperties()-0%100%
get_IpAddress()-0%100%
get_SiteKey()-0%100%
get_AddressSpace()-0%100%
get_BgpProperties()-0%100%
get_ProvisioningState()-0%100%
get_IsSecuritySite()-0%100%
get_VpnSiteLinks()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeVpnSite(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VpnSite.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.Collections.Generic;
 9
 10namespace Azure.ResourceManager.Network.Models
 11{
 12    /// <summary> VpnSite Resource. </summary>
 13    public partial class VpnSite : Resource
 14    {
 15        /// <summary> Initializes a new instance of VpnSite. </summary>
 016        public VpnSite()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of VpnSite. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> Resource name. </param>
 23        /// <param name="type"> Resource type. </param>
 24        /// <param name="location"> Resource location. </param>
 25        /// <param name="tags"> Resource tags. </param>
 26        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 27        /// <param name="virtualWan"> The VirtualWAN to which the vpnSite belongs. </param>
 28        /// <param name="deviceProperties"> The device properties. </param>
 29        /// <param name="ipAddress"> The ip-address for the vpn-site. </param>
 30        /// <param name="siteKey"> The key for vpn-site that can be used for connections. </param>
 31        /// <param name="addressSpace"> The AddressSpace that contains an array of IP address ranges. </param>
 32        /// <param name="bgpProperties"> The set of bgp properties. </param>
 33        /// <param name="provisioningState"> The provisioning state of the VPN site resource. </param>
 34        /// <param name="isSecuritySite"> IsSecuritySite flag. </param>
 35        /// <param name="vpnSiteLinks"> List of all vpn site links. </param>
 036        internal VpnSite(string id, string name, string type, string location, IDictionary<string, string> tags, string 
 37        {
 038            Etag = etag;
 039            VirtualWan = virtualWan;
 040            DeviceProperties = deviceProperties;
 041            IpAddress = ipAddress;
 042            SiteKey = siteKey;
 043            AddressSpace = addressSpace;
 044            BgpProperties = bgpProperties;
 045            ProvisioningState = provisioningState;
 046            IsSecuritySite = isSecuritySite;
 047            VpnSiteLinks = vpnSiteLinks;
 048        }
 49
 50        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 051        public string Etag { get; }
 52        /// <summary> The VirtualWAN to which the vpnSite belongs. </summary>
 053        public SubResource VirtualWan { get; set; }
 54        /// <summary> The device properties. </summary>
 055        public DeviceProperties DeviceProperties { get; set; }
 56        /// <summary> The ip-address for the vpn-site. </summary>
 057        public string IpAddress { get; set; }
 58        /// <summary> The key for vpn-site that can be used for connections. </summary>
 059        public string SiteKey { get; set; }
 60        /// <summary> The AddressSpace that contains an array of IP address ranges. </summary>
 061        public AddressSpace AddressSpace { get; set; }
 62        /// <summary> The set of bgp properties. </summary>
 063        public BgpSettings BgpProperties { get; set; }
 64        /// <summary> The provisioning state of the VPN site resource. </summary>
 065        public ProvisioningState? ProvisioningState { get; }
 66        /// <summary> IsSecuritySite flag. </summary>
 067        public bool? IsSecuritySite { get; set; }
 68        /// <summary> List of all vpn site links. </summary>
 069        public IList<VpnSiteLink> VpnSiteLinks { get; set; }
 70    }
 71}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VpnSite.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.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.Network.Models
 13{
 14    public partial class VpnSite : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Etag != null)
 20            {
 021                writer.WritePropertyName("etag");
 022                writer.WriteStringValue(Etag);
 23            }
 024            if (Id != null)
 25            {
 026                writer.WritePropertyName("id");
 027                writer.WriteStringValue(Id);
 28            }
 029            if (Name != null)
 30            {
 031                writer.WritePropertyName("name");
 032                writer.WriteStringValue(Name);
 33            }
 034            if (Type != null)
 35            {
 036                writer.WritePropertyName("type");
 037                writer.WriteStringValue(Type);
 38            }
 039            if (Location != null)
 40            {
 041                writer.WritePropertyName("location");
 042                writer.WriteStringValue(Location);
 43            }
 044            if (Tags != null)
 45            {
 046                writer.WritePropertyName("tags");
 047                writer.WriteStartObject();
 048                foreach (var item in Tags)
 49                {
 050                    writer.WritePropertyName(item.Key);
 051                    writer.WriteStringValue(item.Value);
 52                }
 053                writer.WriteEndObject();
 54            }
 055            writer.WritePropertyName("properties");
 056            writer.WriteStartObject();
 057            if (VirtualWan != null)
 58            {
 059                writer.WritePropertyName("virtualWan");
 060                writer.WriteObjectValue(VirtualWan);
 61            }
 062            if (DeviceProperties != null)
 63            {
 064                writer.WritePropertyName("deviceProperties");
 065                writer.WriteObjectValue(DeviceProperties);
 66            }
 067            if (IpAddress != null)
 68            {
 069                writer.WritePropertyName("ipAddress");
 070                writer.WriteStringValue(IpAddress);
 71            }
 072            if (SiteKey != null)
 73            {
 074                writer.WritePropertyName("siteKey");
 075                writer.WriteStringValue(SiteKey);
 76            }
 077            if (AddressSpace != null)
 78            {
 079                writer.WritePropertyName("addressSpace");
 080                writer.WriteObjectValue(AddressSpace);
 81            }
 082            if (BgpProperties != null)
 83            {
 084                writer.WritePropertyName("bgpProperties");
 085                writer.WriteObjectValue(BgpProperties);
 86            }
 087            if (ProvisioningState != null)
 88            {
 089                writer.WritePropertyName("provisioningState");
 090                writer.WriteStringValue(ProvisioningState.Value.ToString());
 91            }
 092            if (IsSecuritySite != null)
 93            {
 094                writer.WritePropertyName("isSecuritySite");
 095                writer.WriteBooleanValue(IsSecuritySite.Value);
 96            }
 097            if (VpnSiteLinks != null)
 98            {
 099                writer.WritePropertyName("vpnSiteLinks");
 0100                writer.WriteStartArray();
 0101                foreach (var item in VpnSiteLinks)
 102                {
 0103                    writer.WriteObjectValue(item);
 104                }
 0105                writer.WriteEndArray();
 106            }
 0107            writer.WriteEndObject();
 0108            writer.WriteEndObject();
 0109        }
 110
 111        internal static VpnSite DeserializeVpnSite(JsonElement element)
 112        {
 0113            string etag = default;
 0114            string id = default;
 0115            string name = default;
 0116            string type = default;
 0117            string location = default;
 0118            IDictionary<string, string> tags = default;
 0119            SubResource virtualWan = default;
 0120            DeviceProperties deviceProperties = default;
 0121            string ipAddress = default;
 0122            string siteKey = default;
 0123            AddressSpace addressSpace = default;
 0124            BgpSettings bgpProperties = default;
 0125            ProvisioningState? provisioningState = default;
 0126            bool? isSecuritySite = default;
 0127            IList<VpnSiteLink> vpnSiteLinks = default;
 0128            foreach (var property in element.EnumerateObject())
 129            {
 0130                if (property.NameEquals("etag"))
 131                {
 0132                    if (property.Value.ValueKind == JsonValueKind.Null)
 133                    {
 134                        continue;
 135                    }
 0136                    etag = property.Value.GetString();
 0137                    continue;
 138                }
 0139                if (property.NameEquals("id"))
 140                {
 0141                    if (property.Value.ValueKind == JsonValueKind.Null)
 142                    {
 143                        continue;
 144                    }
 0145                    id = property.Value.GetString();
 0146                    continue;
 147                }
 0148                if (property.NameEquals("name"))
 149                {
 0150                    if (property.Value.ValueKind == JsonValueKind.Null)
 151                    {
 152                        continue;
 153                    }
 0154                    name = property.Value.GetString();
 0155                    continue;
 156                }
 0157                if (property.NameEquals("type"))
 158                {
 0159                    if (property.Value.ValueKind == JsonValueKind.Null)
 160                    {
 161                        continue;
 162                    }
 0163                    type = property.Value.GetString();
 0164                    continue;
 165                }
 0166                if (property.NameEquals("location"))
 167                {
 0168                    if (property.Value.ValueKind == JsonValueKind.Null)
 169                    {
 170                        continue;
 171                    }
 0172                    location = property.Value.GetString();
 0173                    continue;
 174                }
 0175                if (property.NameEquals("tags"))
 176                {
 0177                    if (property.Value.ValueKind == JsonValueKind.Null)
 178                    {
 179                        continue;
 180                    }
 0181                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0182                    foreach (var property0 in property.Value.EnumerateObject())
 183                    {
 0184                        if (property0.Value.ValueKind == JsonValueKind.Null)
 185                        {
 0186                            dictionary.Add(property0.Name, null);
 187                        }
 188                        else
 189                        {
 0190                            dictionary.Add(property0.Name, property0.Value.GetString());
 191                        }
 192                    }
 0193                    tags = dictionary;
 0194                    continue;
 195                }
 0196                if (property.NameEquals("properties"))
 197                {
 0198                    foreach (var property0 in property.Value.EnumerateObject())
 199                    {
 0200                        if (property0.NameEquals("virtualWan"))
 201                        {
 0202                            if (property0.Value.ValueKind == JsonValueKind.Null)
 203                            {
 204                                continue;
 205                            }
 0206                            virtualWan = SubResource.DeserializeSubResource(property0.Value);
 0207                            continue;
 208                        }
 0209                        if (property0.NameEquals("deviceProperties"))
 210                        {
 0211                            if (property0.Value.ValueKind == JsonValueKind.Null)
 212                            {
 213                                continue;
 214                            }
 0215                            deviceProperties = DeviceProperties.DeserializeDeviceProperties(property0.Value);
 0216                            continue;
 217                        }
 0218                        if (property0.NameEquals("ipAddress"))
 219                        {
 0220                            if (property0.Value.ValueKind == JsonValueKind.Null)
 221                            {
 222                                continue;
 223                            }
 0224                            ipAddress = property0.Value.GetString();
 0225                            continue;
 226                        }
 0227                        if (property0.NameEquals("siteKey"))
 228                        {
 0229                            if (property0.Value.ValueKind == JsonValueKind.Null)
 230                            {
 231                                continue;
 232                            }
 0233                            siteKey = property0.Value.GetString();
 0234                            continue;
 235                        }
 0236                        if (property0.NameEquals("addressSpace"))
 237                        {
 0238                            if (property0.Value.ValueKind == JsonValueKind.Null)
 239                            {
 240                                continue;
 241                            }
 0242                            addressSpace = AddressSpace.DeserializeAddressSpace(property0.Value);
 0243                            continue;
 244                        }
 0245                        if (property0.NameEquals("bgpProperties"))
 246                        {
 0247                            if (property0.Value.ValueKind == JsonValueKind.Null)
 248                            {
 249                                continue;
 250                            }
 0251                            bgpProperties = BgpSettings.DeserializeBgpSettings(property0.Value);
 0252                            continue;
 253                        }
 0254                        if (property0.NameEquals("provisioningState"))
 255                        {
 0256                            if (property0.Value.ValueKind == JsonValueKind.Null)
 257                            {
 258                                continue;
 259                            }
 0260                            provisioningState = new ProvisioningState(property0.Value.GetString());
 0261                            continue;
 262                        }
 0263                        if (property0.NameEquals("isSecuritySite"))
 264                        {
 0265                            if (property0.Value.ValueKind == JsonValueKind.Null)
 266                            {
 267                                continue;
 268                            }
 0269                            isSecuritySite = property0.Value.GetBoolean();
 0270                            continue;
 271                        }
 0272                        if (property0.NameEquals("vpnSiteLinks"))
 273                        {
 0274                            if (property0.Value.ValueKind == JsonValueKind.Null)
 275                            {
 276                                continue;
 277                            }
 0278                            List<VpnSiteLink> array = new List<VpnSiteLink>();
 0279                            foreach (var item in property0.Value.EnumerateArray())
 280                            {
 0281                                if (item.ValueKind == JsonValueKind.Null)
 282                                {
 0283                                    array.Add(null);
 284                                }
 285                                else
 286                                {
 0287                                    array.Add(VpnSiteLink.DeserializeVpnSiteLink(item));
 288                                }
 289                            }
 0290                            vpnSiteLinks = array;
 291                            continue;
 292                        }
 293                    }
 294                    continue;
 295                }
 296            }
 0297            return new VpnSite(id, name, type, location, tags, etag, virtualWan, deviceProperties, ipAddress, siteKey, a
 298        }
 299    }
 300}