< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_Etag()-0%100%
get_Routes()-0%100%
get_AttachedConnections()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeVirtualHubRouteTableV2(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualHubRouteTableV2.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> VirtualHubRouteTableV2 Resource. </summary>
 13    public partial class VirtualHubRouteTableV2 : SubResource
 14    {
 15        /// <summary> Initializes a new instance of VirtualHubRouteTableV2. </summary>
 016        public VirtualHubRouteTableV2()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of VirtualHubRouteTableV2. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> The name of the resource that is unique within a resource group. This name can be used t
 23        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 24        /// <param name="routes"> List of all routes. </param>
 25        /// <param name="attachedConnections"> List of all connections attached to this route table v2. </param>
 26        /// <param name="provisioningState"> The provisioning state of the virtual hub route table v2 resource. </param>
 027        internal VirtualHubRouteTableV2(string id, string name, string etag, IList<VirtualHubRouteV2> routes, IList<stri
 28        {
 029            Name = name;
 030            Etag = etag;
 031            Routes = routes;
 032            AttachedConnections = attachedConnections;
 033            ProvisioningState = provisioningState;
 034        }
 35
 36        /// <summary> The name of the resource that is unique within a resource group. This name can be used to access t
 037        public string Name { get; set; }
 38        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 039        public string Etag { get; }
 40        /// <summary> List of all routes. </summary>
 041        public IList<VirtualHubRouteV2> Routes { get; set; }
 42        /// <summary> List of all connections attached to this route table v2. </summary>
 043        public IList<string> AttachedConnections { get; set; }
 44        /// <summary> The provisioning state of the virtual hub route table v2 resource. </summary>
 045        public ProvisioningState? ProvisioningState { get; }
 46    }
 47}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualHubRouteTableV2.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 VirtualHubRouteTableV2 : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Name != null)
 20            {
 021                writer.WritePropertyName("name");
 022                writer.WriteStringValue(Name);
 23            }
 024            if (Etag != null)
 25            {
 026                writer.WritePropertyName("etag");
 027                writer.WriteStringValue(Etag);
 28            }
 029            if (Id != null)
 30            {
 031                writer.WritePropertyName("id");
 032                writer.WriteStringValue(Id);
 33            }
 034            writer.WritePropertyName("properties");
 035            writer.WriteStartObject();
 036            if (Routes != null)
 37            {
 038                writer.WritePropertyName("routes");
 039                writer.WriteStartArray();
 040                foreach (var item in Routes)
 41                {
 042                    writer.WriteObjectValue(item);
 43                }
 044                writer.WriteEndArray();
 45            }
 046            if (AttachedConnections != null)
 47            {
 048                writer.WritePropertyName("attachedConnections");
 049                writer.WriteStartArray();
 050                foreach (var item in AttachedConnections)
 51                {
 052                    writer.WriteStringValue(item);
 53                }
 054                writer.WriteEndArray();
 55            }
 056            if (ProvisioningState != null)
 57            {
 058                writer.WritePropertyName("provisioningState");
 059                writer.WriteStringValue(ProvisioningState.Value.ToString());
 60            }
 061            writer.WriteEndObject();
 062            writer.WriteEndObject();
 063        }
 64
 65        internal static VirtualHubRouteTableV2 DeserializeVirtualHubRouteTableV2(JsonElement element)
 66        {
 067            string name = default;
 068            string etag = default;
 069            string id = default;
 070            IList<VirtualHubRouteV2> routes = default;
 071            IList<string> attachedConnections = default;
 072            ProvisioningState? provisioningState = default;
 073            foreach (var property in element.EnumerateObject())
 74            {
 075                if (property.NameEquals("name"))
 76                {
 077                    if (property.Value.ValueKind == JsonValueKind.Null)
 78                    {
 79                        continue;
 80                    }
 081                    name = property.Value.GetString();
 082                    continue;
 83                }
 084                if (property.NameEquals("etag"))
 85                {
 086                    if (property.Value.ValueKind == JsonValueKind.Null)
 87                    {
 88                        continue;
 89                    }
 090                    etag = property.Value.GetString();
 091                    continue;
 92                }
 093                if (property.NameEquals("id"))
 94                {
 095                    if (property.Value.ValueKind == JsonValueKind.Null)
 96                    {
 97                        continue;
 98                    }
 099                    id = property.Value.GetString();
 0100                    continue;
 101                }
 0102                if (property.NameEquals("properties"))
 103                {
 0104                    foreach (var property0 in property.Value.EnumerateObject())
 105                    {
 0106                        if (property0.NameEquals("routes"))
 107                        {
 0108                            if (property0.Value.ValueKind == JsonValueKind.Null)
 109                            {
 110                                continue;
 111                            }
 0112                            List<VirtualHubRouteV2> array = new List<VirtualHubRouteV2>();
 0113                            foreach (var item in property0.Value.EnumerateArray())
 114                            {
 0115                                if (item.ValueKind == JsonValueKind.Null)
 116                                {
 0117                                    array.Add(null);
 118                                }
 119                                else
 120                                {
 0121                                    array.Add(VirtualHubRouteV2.DeserializeVirtualHubRouteV2(item));
 122                                }
 123                            }
 0124                            routes = array;
 0125                            continue;
 126                        }
 0127                        if (property0.NameEquals("attachedConnections"))
 128                        {
 0129                            if (property0.Value.ValueKind == JsonValueKind.Null)
 130                            {
 131                                continue;
 132                            }
 0133                            List<string> array = new List<string>();
 0134                            foreach (var item in property0.Value.EnumerateArray())
 135                            {
 0136                                if (item.ValueKind == JsonValueKind.Null)
 137                                {
 0138                                    array.Add(null);
 139                                }
 140                                else
 141                                {
 0142                                    array.Add(item.GetString());
 143                                }
 144                            }
 0145                            attachedConnections = array;
 0146                            continue;
 147                        }
 0148                        if (property0.NameEquals("provisioningState"))
 149                        {
 0150                            if (property0.Value.ValueKind == JsonValueKind.Null)
 151                            {
 152                                continue;
 153                            }
 0154                            provisioningState = new ProvisioningState(property0.Value.GetString());
 155                            continue;
 156                        }
 157                    }
 158                    continue;
 159                }
 160            }
 0161            return new VirtualHubRouteTableV2(id, name, etag, routes, attachedConnections, provisioningState);
 162        }
 163    }
 164}