< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Etag()-0%100%
get_VirtualWan()-0%100%
get_VpnGateway()-0%100%
get_P2SVpnGateway()-0%100%
get_ExpressRouteGateway()-0%100%
get_AzureFirewall()-0%100%
get_SecurityPartnerProvider()-0%100%
get_VirtualNetworkConnections()-0%100%
get_AddressPrefix()-0%100%
get_RouteTable()-0%100%
get_ProvisioningState()-0%100%
get_SecurityProviderName()-0%100%
get_VirtualHubRouteTableV2S()-0%100%
get_Sku()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeVirtualHub(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualHub.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> VirtualHub Resource. </summary>
 13    public partial class VirtualHub : Resource
 14    {
 15        /// <summary> Initializes a new instance of VirtualHub. </summary>
 016        public VirtualHub()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of VirtualHub. </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 VirtualHub belongs. </param>
 28        /// <param name="vpnGateway"> The VpnGateway associated with this VirtualHub. </param>
 29        /// <param name="p2SVpnGateway"> The P2SVpnGateway associated with this VirtualHub. </param>
 30        /// <param name="expressRouteGateway"> The expressRouteGateway associated with this VirtualHub. </param>
 31        /// <param name="azureFirewall"> The azureFirewall associated with this VirtualHub. </param>
 32        /// <param name="securityPartnerProvider"> The securityPartnerProvider associated with this VirtualHub. </param>
 33        /// <param name="virtualNetworkConnections"> List of all vnet connections with this VirtualHub. </param>
 34        /// <param name="addressPrefix"> Address-prefix for this VirtualHub. </param>
 35        /// <param name="routeTable"> The routeTable associated with this virtual hub. </param>
 36        /// <param name="provisioningState"> The provisioning state of the virtual hub resource. </param>
 37        /// <param name="securityProviderName"> The Security Provider name. </param>
 38        /// <param name="virtualHubRouteTableV2S"> List of all virtual hub route table v2s associated with this VirtualH
 39        /// <param name="sku"> The sku of this VirtualHub. </param>
 040        internal VirtualHub(string id, string name, string type, string location, IDictionary<string, string> tags, stri
 41        {
 042            Etag = etag;
 043            VirtualWan = virtualWan;
 044            VpnGateway = vpnGateway;
 045            P2SVpnGateway = p2SVpnGateway;
 046            ExpressRouteGateway = expressRouteGateway;
 047            AzureFirewall = azureFirewall;
 048            SecurityPartnerProvider = securityPartnerProvider;
 049            VirtualNetworkConnections = virtualNetworkConnections;
 050            AddressPrefix = addressPrefix;
 051            RouteTable = routeTable;
 052            ProvisioningState = provisioningState;
 053            SecurityProviderName = securityProviderName;
 054            VirtualHubRouteTableV2S = virtualHubRouteTableV2S;
 055            Sku = sku;
 056        }
 57
 58        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 059        public string Etag { get; }
 60        /// <summary> The VirtualWAN to which the VirtualHub belongs. </summary>
 061        public SubResource VirtualWan { get; set; }
 62        /// <summary> The VpnGateway associated with this VirtualHub. </summary>
 063        public SubResource VpnGateway { get; set; }
 64        /// <summary> The P2SVpnGateway associated with this VirtualHub. </summary>
 065        public SubResource P2SVpnGateway { get; set; }
 66        /// <summary> The expressRouteGateway associated with this VirtualHub. </summary>
 067        public SubResource ExpressRouteGateway { get; set; }
 68        /// <summary> The azureFirewall associated with this VirtualHub. </summary>
 069        public SubResource AzureFirewall { get; set; }
 70        /// <summary> The securityPartnerProvider associated with this VirtualHub. </summary>
 071        public SubResource SecurityPartnerProvider { get; set; }
 72        /// <summary> List of all vnet connections with this VirtualHub. </summary>
 073        public IList<HubVirtualNetworkConnection> VirtualNetworkConnections { get; set; }
 74        /// <summary> Address-prefix for this VirtualHub. </summary>
 075        public string AddressPrefix { get; set; }
 76        /// <summary> The routeTable associated with this virtual hub. </summary>
 077        public VirtualHubRouteTable RouteTable { get; set; }
 78        /// <summary> The provisioning state of the virtual hub resource. </summary>
 079        public ProvisioningState? ProvisioningState { get; }
 80        /// <summary> The Security Provider name. </summary>
 081        public string SecurityProviderName { get; set; }
 82        /// <summary> List of all virtual hub route table v2s associated with this VirtualHub. </summary>
 083        public IList<VirtualHubRouteTableV2> VirtualHubRouteTableV2S { get; set; }
 84        /// <summary> The sku of this VirtualHub. </summary>
 085        public string Sku { get; set; }
 86    }
 87}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualHub.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 VirtualHub : 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 (VpnGateway != null)
 63            {
 064                writer.WritePropertyName("vpnGateway");
 065                writer.WriteObjectValue(VpnGateway);
 66            }
 067            if (P2SVpnGateway != null)
 68            {
 069                writer.WritePropertyName("p2SVpnGateway");
 070                writer.WriteObjectValue(P2SVpnGateway);
 71            }
 072            if (ExpressRouteGateway != null)
 73            {
 074                writer.WritePropertyName("expressRouteGateway");
 075                writer.WriteObjectValue(ExpressRouteGateway);
 76            }
 077            if (AzureFirewall != null)
 78            {
 079                writer.WritePropertyName("azureFirewall");
 080                writer.WriteObjectValue(AzureFirewall);
 81            }
 082            if (SecurityPartnerProvider != null)
 83            {
 084                writer.WritePropertyName("securityPartnerProvider");
 085                writer.WriteObjectValue(SecurityPartnerProvider);
 86            }
 087            if (VirtualNetworkConnections != null)
 88            {
 089                writer.WritePropertyName("virtualNetworkConnections");
 090                writer.WriteStartArray();
 091                foreach (var item in VirtualNetworkConnections)
 92                {
 093                    writer.WriteObjectValue(item);
 94                }
 095                writer.WriteEndArray();
 96            }
 097            if (AddressPrefix != null)
 98            {
 099                writer.WritePropertyName("addressPrefix");
 0100                writer.WriteStringValue(AddressPrefix);
 101            }
 0102            if (RouteTable != null)
 103            {
 0104                writer.WritePropertyName("routeTable");
 0105                writer.WriteObjectValue(RouteTable);
 106            }
 0107            if (ProvisioningState != null)
 108            {
 0109                writer.WritePropertyName("provisioningState");
 0110                writer.WriteStringValue(ProvisioningState.Value.ToString());
 111            }
 0112            if (SecurityProviderName != null)
 113            {
 0114                writer.WritePropertyName("securityProviderName");
 0115                writer.WriteStringValue(SecurityProviderName);
 116            }
 0117            if (VirtualHubRouteTableV2S != null)
 118            {
 0119                writer.WritePropertyName("virtualHubRouteTableV2s");
 0120                writer.WriteStartArray();
 0121                foreach (var item in VirtualHubRouteTableV2S)
 122                {
 0123                    writer.WriteObjectValue(item);
 124                }
 0125                writer.WriteEndArray();
 126            }
 0127            if (Sku != null)
 128            {
 0129                writer.WritePropertyName("sku");
 0130                writer.WriteStringValue(Sku);
 131            }
 0132            writer.WriteEndObject();
 0133            writer.WriteEndObject();
 0134        }
 135
 136        internal static VirtualHub DeserializeVirtualHub(JsonElement element)
 137        {
 0138            string etag = default;
 0139            string id = default;
 0140            string name = default;
 0141            string type = default;
 0142            string location = default;
 0143            IDictionary<string, string> tags = default;
 0144            SubResource virtualWan = default;
 0145            SubResource vpnGateway = default;
 0146            SubResource p2SVpnGateway = default;
 0147            SubResource expressRouteGateway = default;
 0148            SubResource azureFirewall = default;
 0149            SubResource securityPartnerProvider = default;
 0150            IList<HubVirtualNetworkConnection> virtualNetworkConnections = default;
 0151            string addressPrefix = default;
 0152            VirtualHubRouteTable routeTable = default;
 0153            ProvisioningState? provisioningState = default;
 0154            string securityProviderName = default;
 0155            IList<VirtualHubRouteTableV2> virtualHubRouteTableV2s = default;
 0156            string sku = default;
 0157            foreach (var property in element.EnumerateObject())
 158            {
 0159                if (property.NameEquals("etag"))
 160                {
 0161                    if (property.Value.ValueKind == JsonValueKind.Null)
 162                    {
 163                        continue;
 164                    }
 0165                    etag = property.Value.GetString();
 0166                    continue;
 167                }
 0168                if (property.NameEquals("id"))
 169                {
 0170                    if (property.Value.ValueKind == JsonValueKind.Null)
 171                    {
 172                        continue;
 173                    }
 0174                    id = property.Value.GetString();
 0175                    continue;
 176                }
 0177                if (property.NameEquals("name"))
 178                {
 0179                    if (property.Value.ValueKind == JsonValueKind.Null)
 180                    {
 181                        continue;
 182                    }
 0183                    name = property.Value.GetString();
 0184                    continue;
 185                }
 0186                if (property.NameEquals("type"))
 187                {
 0188                    if (property.Value.ValueKind == JsonValueKind.Null)
 189                    {
 190                        continue;
 191                    }
 0192                    type = property.Value.GetString();
 0193                    continue;
 194                }
 0195                if (property.NameEquals("location"))
 196                {
 0197                    if (property.Value.ValueKind == JsonValueKind.Null)
 198                    {
 199                        continue;
 200                    }
 0201                    location = property.Value.GetString();
 0202                    continue;
 203                }
 0204                if (property.NameEquals("tags"))
 205                {
 0206                    if (property.Value.ValueKind == JsonValueKind.Null)
 207                    {
 208                        continue;
 209                    }
 0210                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0211                    foreach (var property0 in property.Value.EnumerateObject())
 212                    {
 0213                        if (property0.Value.ValueKind == JsonValueKind.Null)
 214                        {
 0215                            dictionary.Add(property0.Name, null);
 216                        }
 217                        else
 218                        {
 0219                            dictionary.Add(property0.Name, property0.Value.GetString());
 220                        }
 221                    }
 0222                    tags = dictionary;
 0223                    continue;
 224                }
 0225                if (property.NameEquals("properties"))
 226                {
 0227                    foreach (var property0 in property.Value.EnumerateObject())
 228                    {
 0229                        if (property0.NameEquals("virtualWan"))
 230                        {
 0231                            if (property0.Value.ValueKind == JsonValueKind.Null)
 232                            {
 233                                continue;
 234                            }
 0235                            virtualWan = SubResource.DeserializeSubResource(property0.Value);
 0236                            continue;
 237                        }
 0238                        if (property0.NameEquals("vpnGateway"))
 239                        {
 0240                            if (property0.Value.ValueKind == JsonValueKind.Null)
 241                            {
 242                                continue;
 243                            }
 0244                            vpnGateway = SubResource.DeserializeSubResource(property0.Value);
 0245                            continue;
 246                        }
 0247                        if (property0.NameEquals("p2SVpnGateway"))
 248                        {
 0249                            if (property0.Value.ValueKind == JsonValueKind.Null)
 250                            {
 251                                continue;
 252                            }
 0253                            p2SVpnGateway = SubResource.DeserializeSubResource(property0.Value);
 0254                            continue;
 255                        }
 0256                        if (property0.NameEquals("expressRouteGateway"))
 257                        {
 0258                            if (property0.Value.ValueKind == JsonValueKind.Null)
 259                            {
 260                                continue;
 261                            }
 0262                            expressRouteGateway = SubResource.DeserializeSubResource(property0.Value);
 0263                            continue;
 264                        }
 0265                        if (property0.NameEquals("azureFirewall"))
 266                        {
 0267                            if (property0.Value.ValueKind == JsonValueKind.Null)
 268                            {
 269                                continue;
 270                            }
 0271                            azureFirewall = SubResource.DeserializeSubResource(property0.Value);
 0272                            continue;
 273                        }
 0274                        if (property0.NameEquals("securityPartnerProvider"))
 275                        {
 0276                            if (property0.Value.ValueKind == JsonValueKind.Null)
 277                            {
 278                                continue;
 279                            }
 0280                            securityPartnerProvider = SubResource.DeserializeSubResource(property0.Value);
 0281                            continue;
 282                        }
 0283                        if (property0.NameEquals("virtualNetworkConnections"))
 284                        {
 0285                            if (property0.Value.ValueKind == JsonValueKind.Null)
 286                            {
 287                                continue;
 288                            }
 0289                            List<HubVirtualNetworkConnection> array = new List<HubVirtualNetworkConnection>();
 0290                            foreach (var item in property0.Value.EnumerateArray())
 291                            {
 0292                                if (item.ValueKind == JsonValueKind.Null)
 293                                {
 0294                                    array.Add(null);
 295                                }
 296                                else
 297                                {
 0298                                    array.Add(HubVirtualNetworkConnection.DeserializeHubVirtualNetworkConnection(item));
 299                                }
 300                            }
 0301                            virtualNetworkConnections = array;
 0302                            continue;
 303                        }
 0304                        if (property0.NameEquals("addressPrefix"))
 305                        {
 0306                            if (property0.Value.ValueKind == JsonValueKind.Null)
 307                            {
 308                                continue;
 309                            }
 0310                            addressPrefix = property0.Value.GetString();
 0311                            continue;
 312                        }
 0313                        if (property0.NameEquals("routeTable"))
 314                        {
 0315                            if (property0.Value.ValueKind == JsonValueKind.Null)
 316                            {
 317                                continue;
 318                            }
 0319                            routeTable = VirtualHubRouteTable.DeserializeVirtualHubRouteTable(property0.Value);
 0320                            continue;
 321                        }
 0322                        if (property0.NameEquals("provisioningState"))
 323                        {
 0324                            if (property0.Value.ValueKind == JsonValueKind.Null)
 325                            {
 326                                continue;
 327                            }
 0328                            provisioningState = new ProvisioningState(property0.Value.GetString());
 0329                            continue;
 330                        }
 0331                        if (property0.NameEquals("securityProviderName"))
 332                        {
 0333                            if (property0.Value.ValueKind == JsonValueKind.Null)
 334                            {
 335                                continue;
 336                            }
 0337                            securityProviderName = property0.Value.GetString();
 0338                            continue;
 339                        }
 0340                        if (property0.NameEquals("virtualHubRouteTableV2s"))
 341                        {
 0342                            if (property0.Value.ValueKind == JsonValueKind.Null)
 343                            {
 344                                continue;
 345                            }
 0346                            List<VirtualHubRouteTableV2> array = new List<VirtualHubRouteTableV2>();
 0347                            foreach (var item in property0.Value.EnumerateArray())
 348                            {
 0349                                if (item.ValueKind == JsonValueKind.Null)
 350                                {
 0351                                    array.Add(null);
 352                                }
 353                                else
 354                                {
 0355                                    array.Add(VirtualHubRouteTableV2.DeserializeVirtualHubRouteTableV2(item));
 356                                }
 357                            }
 0358                            virtualHubRouteTableV2s = array;
 0359                            continue;
 360                        }
 0361                        if (property0.NameEquals("sku"))
 362                        {
 0363                            if (property0.Value.ValueKind == JsonValueKind.Null)
 364                            {
 365                                continue;
 366                            }
 0367                            sku = property0.Value.GetString();
 368                            continue;
 369                        }
 370                    }
 371                    continue;
 372                }
 373            }
 0374            return new VirtualHub(id, name, type, location, tags, etag, virtualWan, vpnGateway, p2SVpnGateway, expressRo
 375        }
 376    }
 377}