< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Etag()-0%100%
get_VirtualRouterAsn()-0%100%
get_VirtualRouterIps()-0%100%
get_HostedSubnet()-0%100%
get_HostedGateway()-0%100%
get_Peerings()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeVirtualRouter(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualRouter.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> VirtualRouter Resource. </summary>
 13    public partial class VirtualRouter : Resource
 14    {
 15        /// <summary> Initializes a new instance of VirtualRouter. </summary>
 016        public VirtualRouter()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of VirtualRouter. </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="virtualRouterAsn"> VirtualRouter ASN. </param>
 28        /// <param name="virtualRouterIps"> VirtualRouter IPs. </param>
 29        /// <param name="hostedSubnet"> The Subnet on which VirtualRouter is hosted. </param>
 30        /// <param name="hostedGateway"> The Gateway on which VirtualRouter is hosted. </param>
 31        /// <param name="peerings"> List of references to VirtualRouterPeerings. </param>
 32        /// <param name="provisioningState"> The provisioning state of the resource. </param>
 033        internal VirtualRouter(string id, string name, string type, string location, IDictionary<string, string> tags, s
 34        {
 035            Etag = etag;
 036            VirtualRouterAsn = virtualRouterAsn;
 037            VirtualRouterIps = virtualRouterIps;
 038            HostedSubnet = hostedSubnet;
 039            HostedGateway = hostedGateway;
 040            Peerings = peerings;
 041            ProvisioningState = provisioningState;
 042        }
 43
 44        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 045        public string Etag { get; }
 46        /// <summary> VirtualRouter ASN. </summary>
 047        public long? VirtualRouterAsn { get; set; }
 48        /// <summary> VirtualRouter IPs. </summary>
 049        public IList<string> VirtualRouterIps { get; set; }
 50        /// <summary> The Subnet on which VirtualRouter is hosted. </summary>
 051        public SubResource HostedSubnet { get; set; }
 52        /// <summary> The Gateway on which VirtualRouter is hosted. </summary>
 053        public SubResource HostedGateway { get; set; }
 54        /// <summary> List of references to VirtualRouterPeerings. </summary>
 055        public IList<SubResource> Peerings { get; }
 56        /// <summary> The provisioning state of the resource. </summary>
 057        public ProvisioningState? ProvisioningState { get; }
 58    }
 59}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualRouter.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 VirtualRouter : 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 (VirtualRouterAsn != null)
 58            {
 059                writer.WritePropertyName("virtualRouterAsn");
 060                writer.WriteNumberValue(VirtualRouterAsn.Value);
 61            }
 062            if (VirtualRouterIps != null)
 63            {
 064                writer.WritePropertyName("virtualRouterIps");
 065                writer.WriteStartArray();
 066                foreach (var item in VirtualRouterIps)
 67                {
 068                    writer.WriteStringValue(item);
 69                }
 070                writer.WriteEndArray();
 71            }
 072            if (HostedSubnet != null)
 73            {
 074                writer.WritePropertyName("hostedSubnet");
 075                writer.WriteObjectValue(HostedSubnet);
 76            }
 077            if (HostedGateway != null)
 78            {
 079                writer.WritePropertyName("hostedGateway");
 080                writer.WriteObjectValue(HostedGateway);
 81            }
 082            if (Peerings != null)
 83            {
 084                writer.WritePropertyName("peerings");
 085                writer.WriteStartArray();
 086                foreach (var item in Peerings)
 87                {
 088                    writer.WriteObjectValue(item);
 89                }
 090                writer.WriteEndArray();
 91            }
 092            if (ProvisioningState != null)
 93            {
 094                writer.WritePropertyName("provisioningState");
 095                writer.WriteStringValue(ProvisioningState.Value.ToString());
 96            }
 097            writer.WriteEndObject();
 098            writer.WriteEndObject();
 099        }
 100
 101        internal static VirtualRouter DeserializeVirtualRouter(JsonElement element)
 102        {
 0103            string etag = default;
 0104            string id = default;
 0105            string name = default;
 0106            string type = default;
 0107            string location = default;
 0108            IDictionary<string, string> tags = default;
 0109            long? virtualRouterAsn = default;
 0110            IList<string> virtualRouterIps = default;
 0111            SubResource hostedSubnet = default;
 0112            SubResource hostedGateway = default;
 0113            IList<SubResource> peerings = default;
 0114            ProvisioningState? provisioningState = default;
 0115            foreach (var property in element.EnumerateObject())
 116            {
 0117                if (property.NameEquals("etag"))
 118                {
 0119                    if (property.Value.ValueKind == JsonValueKind.Null)
 120                    {
 121                        continue;
 122                    }
 0123                    etag = property.Value.GetString();
 0124                    continue;
 125                }
 0126                if (property.NameEquals("id"))
 127                {
 0128                    if (property.Value.ValueKind == JsonValueKind.Null)
 129                    {
 130                        continue;
 131                    }
 0132                    id = property.Value.GetString();
 0133                    continue;
 134                }
 0135                if (property.NameEquals("name"))
 136                {
 0137                    if (property.Value.ValueKind == JsonValueKind.Null)
 138                    {
 139                        continue;
 140                    }
 0141                    name = property.Value.GetString();
 0142                    continue;
 143                }
 0144                if (property.NameEquals("type"))
 145                {
 0146                    if (property.Value.ValueKind == JsonValueKind.Null)
 147                    {
 148                        continue;
 149                    }
 0150                    type = property.Value.GetString();
 0151                    continue;
 152                }
 0153                if (property.NameEquals("location"))
 154                {
 0155                    if (property.Value.ValueKind == JsonValueKind.Null)
 156                    {
 157                        continue;
 158                    }
 0159                    location = property.Value.GetString();
 0160                    continue;
 161                }
 0162                if (property.NameEquals("tags"))
 163                {
 0164                    if (property.Value.ValueKind == JsonValueKind.Null)
 165                    {
 166                        continue;
 167                    }
 0168                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0169                    foreach (var property0 in property.Value.EnumerateObject())
 170                    {
 0171                        if (property0.Value.ValueKind == JsonValueKind.Null)
 172                        {
 0173                            dictionary.Add(property0.Name, null);
 174                        }
 175                        else
 176                        {
 0177                            dictionary.Add(property0.Name, property0.Value.GetString());
 178                        }
 179                    }
 0180                    tags = dictionary;
 0181                    continue;
 182                }
 0183                if (property.NameEquals("properties"))
 184                {
 0185                    foreach (var property0 in property.Value.EnumerateObject())
 186                    {
 0187                        if (property0.NameEquals("virtualRouterAsn"))
 188                        {
 0189                            if (property0.Value.ValueKind == JsonValueKind.Null)
 190                            {
 191                                continue;
 192                            }
 0193                            virtualRouterAsn = property0.Value.GetInt64();
 0194                            continue;
 195                        }
 0196                        if (property0.NameEquals("virtualRouterIps"))
 197                        {
 0198                            if (property0.Value.ValueKind == JsonValueKind.Null)
 199                            {
 200                                continue;
 201                            }
 0202                            List<string> array = new List<string>();
 0203                            foreach (var item in property0.Value.EnumerateArray())
 204                            {
 0205                                if (item.ValueKind == JsonValueKind.Null)
 206                                {
 0207                                    array.Add(null);
 208                                }
 209                                else
 210                                {
 0211                                    array.Add(item.GetString());
 212                                }
 213                            }
 0214                            virtualRouterIps = array;
 0215                            continue;
 216                        }
 0217                        if (property0.NameEquals("hostedSubnet"))
 218                        {
 0219                            if (property0.Value.ValueKind == JsonValueKind.Null)
 220                            {
 221                                continue;
 222                            }
 0223                            hostedSubnet = SubResource.DeserializeSubResource(property0.Value);
 0224                            continue;
 225                        }
 0226                        if (property0.NameEquals("hostedGateway"))
 227                        {
 0228                            if (property0.Value.ValueKind == JsonValueKind.Null)
 229                            {
 230                                continue;
 231                            }
 0232                            hostedGateway = SubResource.DeserializeSubResource(property0.Value);
 0233                            continue;
 234                        }
 0235                        if (property0.NameEquals("peerings"))
 236                        {
 0237                            if (property0.Value.ValueKind == JsonValueKind.Null)
 238                            {
 239                                continue;
 240                            }
 0241                            List<SubResource> array = new List<SubResource>();
 0242                            foreach (var item in property0.Value.EnumerateArray())
 243                            {
 0244                                if (item.ValueKind == JsonValueKind.Null)
 245                                {
 0246                                    array.Add(null);
 247                                }
 248                                else
 249                                {
 0250                                    array.Add(SubResource.DeserializeSubResource(item));
 251                                }
 252                            }
 0253                            peerings = array;
 0254                            continue;
 255                        }
 0256                        if (property0.NameEquals("provisioningState"))
 257                        {
 0258                            if (property0.Value.ValueKind == JsonValueKind.Null)
 259                            {
 260                                continue;
 261                            }
 0262                            provisioningState = new ProvisioningState(property0.Value.GetString());
 263                            continue;
 264                        }
 265                    }
 266                    continue;
 267                }
 268            }
 0269            return new VirtualRouter(id, name, type, location, tags, etag, virtualRouterAsn, virtualRouterIps, hostedSub
 270        }
 271    }
 272}