< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Address()-0%100%
get_Contact()-0%100%
get_AvailableBandwidths()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeExpressRoutePortsLocation(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ExpressRoutePortsLocation.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> Definition of the ExpressRoutePorts peering location resource. </summary>
 13    public partial class ExpressRoutePortsLocation : Resource
 14    {
 15        /// <summary> Initializes a new instance of ExpressRoutePortsLocation. </summary>
 016        public ExpressRoutePortsLocation()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ExpressRoutePortsLocation. </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="address"> Address of peering location. </param>
 27        /// <param name="contact"> Contact details of peering locations. </param>
 28        /// <param name="availableBandwidths"> The inventory of available ExpressRoutePort bandwidths. </param>
 29        /// <param name="provisioningState"> The provisioning state of the express route port location resource. </param
 030        internal ExpressRoutePortsLocation(string id, string name, string type, string location, IDictionary<string, str
 31        {
 032            Address = address;
 033            Contact = contact;
 034            AvailableBandwidths = availableBandwidths;
 035            ProvisioningState = provisioningState;
 036        }
 37
 38        /// <summary> Address of peering location. </summary>
 039        public string Address { get; }
 40        /// <summary> Contact details of peering locations. </summary>
 041        public string Contact { get; }
 42        /// <summary> The inventory of available ExpressRoutePort bandwidths. </summary>
 043        public IList<ExpressRoutePortsLocationBandwidths> AvailableBandwidths { get; set; }
 44        /// <summary> The provisioning state of the express route port location resource. </summary>
 045        public ProvisioningState? ProvisioningState { get; }
 46    }
 47}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ExpressRoutePortsLocation.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 ExpressRoutePortsLocation : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Id != null)
 20            {
 021                writer.WritePropertyName("id");
 022                writer.WriteStringValue(Id);
 23            }
 024            if (Name != null)
 25            {
 026                writer.WritePropertyName("name");
 027                writer.WriteStringValue(Name);
 28            }
 029            if (Type != null)
 30            {
 031                writer.WritePropertyName("type");
 032                writer.WriteStringValue(Type);
 33            }
 034            if (Location != null)
 35            {
 036                writer.WritePropertyName("location");
 037                writer.WriteStringValue(Location);
 38            }
 039            if (Tags != null)
 40            {
 041                writer.WritePropertyName("tags");
 042                writer.WriteStartObject();
 043                foreach (var item in Tags)
 44                {
 045                    writer.WritePropertyName(item.Key);
 046                    writer.WriteStringValue(item.Value);
 47                }
 048                writer.WriteEndObject();
 49            }
 050            writer.WritePropertyName("properties");
 051            writer.WriteStartObject();
 052            if (Address != null)
 53            {
 054                writer.WritePropertyName("address");
 055                writer.WriteStringValue(Address);
 56            }
 057            if (Contact != null)
 58            {
 059                writer.WritePropertyName("contact");
 060                writer.WriteStringValue(Contact);
 61            }
 062            if (AvailableBandwidths != null)
 63            {
 064                writer.WritePropertyName("availableBandwidths");
 065                writer.WriteStartArray();
 066                foreach (var item in AvailableBandwidths)
 67                {
 068                    writer.WriteObjectValue(item);
 69                }
 070                writer.WriteEndArray();
 71            }
 072            if (ProvisioningState != null)
 73            {
 074                writer.WritePropertyName("provisioningState");
 075                writer.WriteStringValue(ProvisioningState.Value.ToString());
 76            }
 077            writer.WriteEndObject();
 078            writer.WriteEndObject();
 079        }
 80
 81        internal static ExpressRoutePortsLocation DeserializeExpressRoutePortsLocation(JsonElement element)
 82        {
 083            string id = default;
 084            string name = default;
 085            string type = default;
 086            string location = default;
 087            IDictionary<string, string> tags = default;
 088            string address = default;
 089            string contact = default;
 090            IList<ExpressRoutePortsLocationBandwidths> availableBandwidths = default;
 091            ProvisioningState? provisioningState = default;
 092            foreach (var property in element.EnumerateObject())
 93            {
 094                if (property.NameEquals("id"))
 95                {
 096                    if (property.Value.ValueKind == JsonValueKind.Null)
 97                    {
 98                        continue;
 99                    }
 0100                    id = property.Value.GetString();
 0101                    continue;
 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("type"))
 113                {
 0114                    if (property.Value.ValueKind == JsonValueKind.Null)
 115                    {
 116                        continue;
 117                    }
 0118                    type = property.Value.GetString();
 0119                    continue;
 120                }
 0121                if (property.NameEquals("location"))
 122                {
 0123                    if (property.Value.ValueKind == JsonValueKind.Null)
 124                    {
 125                        continue;
 126                    }
 0127                    location = property.Value.GetString();
 0128                    continue;
 129                }
 0130                if (property.NameEquals("tags"))
 131                {
 0132                    if (property.Value.ValueKind == JsonValueKind.Null)
 133                    {
 134                        continue;
 135                    }
 0136                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0137                    foreach (var property0 in property.Value.EnumerateObject())
 138                    {
 0139                        if (property0.Value.ValueKind == JsonValueKind.Null)
 140                        {
 0141                            dictionary.Add(property0.Name, null);
 142                        }
 143                        else
 144                        {
 0145                            dictionary.Add(property0.Name, property0.Value.GetString());
 146                        }
 147                    }
 0148                    tags = dictionary;
 0149                    continue;
 150                }
 0151                if (property.NameEquals("properties"))
 152                {
 0153                    foreach (var property0 in property.Value.EnumerateObject())
 154                    {
 0155                        if (property0.NameEquals("address"))
 156                        {
 0157                            if (property0.Value.ValueKind == JsonValueKind.Null)
 158                            {
 159                                continue;
 160                            }
 0161                            address = property0.Value.GetString();
 0162                            continue;
 163                        }
 0164                        if (property0.NameEquals("contact"))
 165                        {
 0166                            if (property0.Value.ValueKind == JsonValueKind.Null)
 167                            {
 168                                continue;
 169                            }
 0170                            contact = property0.Value.GetString();
 0171                            continue;
 172                        }
 0173                        if (property0.NameEquals("availableBandwidths"))
 174                        {
 0175                            if (property0.Value.ValueKind == JsonValueKind.Null)
 176                            {
 177                                continue;
 178                            }
 0179                            List<ExpressRoutePortsLocationBandwidths> array = new List<ExpressRoutePortsLocationBandwidt
 0180                            foreach (var item in property0.Value.EnumerateArray())
 181                            {
 0182                                if (item.ValueKind == JsonValueKind.Null)
 183                                {
 0184                                    array.Add(null);
 185                                }
 186                                else
 187                                {
 0188                                    array.Add(ExpressRoutePortsLocationBandwidths.DeserializeExpressRoutePortsLocationBa
 189                                }
 190                            }
 0191                            availableBandwidths = array;
 0192                            continue;
 193                        }
 0194                        if (property0.NameEquals("provisioningState"))
 195                        {
 0196                            if (property0.Value.ValueKind == JsonValueKind.Null)
 197                            {
 198                                continue;
 199                            }
 0200                            provisioningState = new ProvisioningState(property0.Value.GetString());
 201                            continue;
 202                        }
 203                    }
 204                    continue;
 205                }
 206            }
 0207            return new ExpressRoutePortsLocation(id, name, type, location, tags, address, contact, availableBandwidths, 
 208        }
 209    }
 210}