< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_Etag()-0%100%
get_Type()-0%100%
get_Routes()-0%100%
get_Labels()-0%100%
get_AssociatedConnections()-0%100%
get_PropagatingConnections()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeHubRouteTable(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\HubRouteTable.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> RouteTable resource in a virtual hub. </summary>
 13    public partial class HubRouteTable : SubResource
 14    {
 15        /// <summary> Initializes a new instance of HubRouteTable. </summary>
 016        public HubRouteTable()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of HubRouteTable. </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="type"> Resource type. </param>
 25        /// <param name="routes"> List of all routes. </param>
 26        /// <param name="labels"> List of labels associated with this route table. </param>
 27        /// <param name="associatedConnections"> List of all connections associated with this route table. </param>
 28        /// <param name="propagatingConnections"> List of all connections that advertise to this route table. </param>
 29        /// <param name="provisioningState"> The provisioning state of the RouteTable resource. </param>
 030        internal HubRouteTable(string id, string name, string etag, string type, IList<HubRoute> routes, IList<string> l
 31        {
 032            Name = name;
 033            Etag = etag;
 034            Type = type;
 035            Routes = routes;
 036            Labels = labels;
 037            AssociatedConnections = associatedConnections;
 038            PropagatingConnections = propagatingConnections;
 039            ProvisioningState = provisioningState;
 040        }
 41
 42        /// <summary> The name of the resource that is unique within a resource group. This name can be used to access t
 043        public string Name { get; set; }
 44        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 045        public string Etag { get; }
 46        /// <summary> Resource type. </summary>
 047        public string Type { get; }
 48        /// <summary> List of all routes. </summary>
 049        public IList<HubRoute> Routes { get; set; }
 50        /// <summary> List of labels associated with this route table. </summary>
 051        public IList<string> Labels { get; set; }
 52        /// <summary> List of all connections associated with this route table. </summary>
 053        public IList<SubResource> AssociatedConnections { get; }
 54        /// <summary> List of all connections that advertise to this route table. </summary>
 055        public IList<SubResource> PropagatingConnections { get; }
 56        /// <summary> The provisioning state of the RouteTable resource. </summary>
 057        public ProvisioningState? ProvisioningState { get; }
 58    }
 59}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\HubRouteTable.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 HubRouteTable : 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 (Type != null)
 30            {
 031                writer.WritePropertyName("type");
 032                writer.WriteStringValue(Type);
 33            }
 034            if (Id != null)
 35            {
 036                writer.WritePropertyName("id");
 037                writer.WriteStringValue(Id);
 38            }
 039            writer.WritePropertyName("properties");
 040            writer.WriteStartObject();
 041            if (Routes != null)
 42            {
 043                writer.WritePropertyName("routes");
 044                writer.WriteStartArray();
 045                foreach (var item in Routes)
 46                {
 047                    writer.WriteObjectValue(item);
 48                }
 049                writer.WriteEndArray();
 50            }
 051            if (Labels != null)
 52            {
 053                writer.WritePropertyName("labels");
 054                writer.WriteStartArray();
 055                foreach (var item in Labels)
 56                {
 057                    writer.WriteStringValue(item);
 58                }
 059                writer.WriteEndArray();
 60            }
 061            if (AssociatedConnections != null)
 62            {
 063                writer.WritePropertyName("associatedConnections");
 064                writer.WriteStartArray();
 065                foreach (var item in AssociatedConnections)
 66                {
 067                    writer.WriteObjectValue(item);
 68                }
 069                writer.WriteEndArray();
 70            }
 071            if (PropagatingConnections != null)
 72            {
 073                writer.WritePropertyName("propagatingConnections");
 074                writer.WriteStartArray();
 075                foreach (var item in PropagatingConnections)
 76                {
 077                    writer.WriteObjectValue(item);
 78                }
 079                writer.WriteEndArray();
 80            }
 081            if (ProvisioningState != null)
 82            {
 083                writer.WritePropertyName("provisioningState");
 084                writer.WriteStringValue(ProvisioningState.Value.ToString());
 85            }
 086            writer.WriteEndObject();
 087            writer.WriteEndObject();
 088        }
 89
 90        internal static HubRouteTable DeserializeHubRouteTable(JsonElement element)
 91        {
 092            string name = default;
 093            string etag = default;
 094            string type = default;
 095            string id = default;
 096            IList<HubRoute> routes = default;
 097            IList<string> labels = default;
 098            IList<SubResource> associatedConnections = default;
 099            IList<SubResource> propagatingConnections = default;
 0100            ProvisioningState? provisioningState = default;
 0101            foreach (var property in element.EnumerateObject())
 102            {
 0103                if (property.NameEquals("name"))
 104                {
 0105                    if (property.Value.ValueKind == JsonValueKind.Null)
 106                    {
 107                        continue;
 108                    }
 0109                    name = property.Value.GetString();
 0110                    continue;
 111                }
 0112                if (property.NameEquals("etag"))
 113                {
 0114                    if (property.Value.ValueKind == JsonValueKind.Null)
 115                    {
 116                        continue;
 117                    }
 0118                    etag = property.Value.GetString();
 0119                    continue;
 120                }
 0121                if (property.NameEquals("type"))
 122                {
 0123                    if (property.Value.ValueKind == JsonValueKind.Null)
 124                    {
 125                        continue;
 126                    }
 0127                    type = property.Value.GetString();
 0128                    continue;
 129                }
 0130                if (property.NameEquals("id"))
 131                {
 0132                    if (property.Value.ValueKind == JsonValueKind.Null)
 133                    {
 134                        continue;
 135                    }
 0136                    id = property.Value.GetString();
 0137                    continue;
 138                }
 0139                if (property.NameEquals("properties"))
 140                {
 0141                    foreach (var property0 in property.Value.EnumerateObject())
 142                    {
 0143                        if (property0.NameEquals("routes"))
 144                        {
 0145                            if (property0.Value.ValueKind == JsonValueKind.Null)
 146                            {
 147                                continue;
 148                            }
 0149                            List<HubRoute> array = new List<HubRoute>();
 0150                            foreach (var item in property0.Value.EnumerateArray())
 151                            {
 0152                                if (item.ValueKind == JsonValueKind.Null)
 153                                {
 0154                                    array.Add(null);
 155                                }
 156                                else
 157                                {
 0158                                    array.Add(HubRoute.DeserializeHubRoute(item));
 159                                }
 160                            }
 0161                            routes = array;
 0162                            continue;
 163                        }
 0164                        if (property0.NameEquals("labels"))
 165                        {
 0166                            if (property0.Value.ValueKind == JsonValueKind.Null)
 167                            {
 168                                continue;
 169                            }
 0170                            List<string> array = new List<string>();
 0171                            foreach (var item in property0.Value.EnumerateArray())
 172                            {
 0173                                if (item.ValueKind == JsonValueKind.Null)
 174                                {
 0175                                    array.Add(null);
 176                                }
 177                                else
 178                                {
 0179                                    array.Add(item.GetString());
 180                                }
 181                            }
 0182                            labels = array;
 0183                            continue;
 184                        }
 0185                        if (property0.NameEquals("associatedConnections"))
 186                        {
 0187                            if (property0.Value.ValueKind == JsonValueKind.Null)
 188                            {
 189                                continue;
 190                            }
 0191                            List<SubResource> array = new List<SubResource>();
 0192                            foreach (var item in property0.Value.EnumerateArray())
 193                            {
 0194                                if (item.ValueKind == JsonValueKind.Null)
 195                                {
 0196                                    array.Add(null);
 197                                }
 198                                else
 199                                {
 0200                                    array.Add(DeserializeSubResource(item));
 201                                }
 202                            }
 0203                            associatedConnections = array;
 0204                            continue;
 205                        }
 0206                        if (property0.NameEquals("propagatingConnections"))
 207                        {
 0208                            if (property0.Value.ValueKind == JsonValueKind.Null)
 209                            {
 210                                continue;
 211                            }
 0212                            List<SubResource> array = new List<SubResource>();
 0213                            foreach (var item in property0.Value.EnumerateArray())
 214                            {
 0215                                if (item.ValueKind == JsonValueKind.Null)
 216                                {
 0217                                    array.Add(null);
 218                                }
 219                                else
 220                                {
 0221                                    array.Add(DeserializeSubResource(item));
 222                                }
 223                            }
 0224                            propagatingConnections = array;
 0225                            continue;
 226                        }
 0227                        if (property0.NameEquals("provisioningState"))
 228                        {
 0229                            if (property0.Value.ValueKind == JsonValueKind.Null)
 230                            {
 231                                continue;
 232                            }
 0233                            provisioningState = new ProvisioningState(property0.Value.GetString());
 234                            continue;
 235                        }
 236                    }
 237                    continue;
 238                }
 239            }
 0240            return new HubRouteTable(id, name, etag, type, routes, labels, associatedConnections, propagatingConnections
 241        }
 242    }
 243}