< Summary

Class:Azure.ResourceManager.Network.Models.ExpressRouteServiceProvider
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ExpressRouteServiceProvider.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ExpressRouteServiceProvider.Serialization.cs
Covered lines:0
Uncovered lines:108
Coverable lines:108
Total lines:255
Line coverage:0% (0 of 108)
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_PeeringLocations()-0%100%
get_BandwidthsOffered()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeExpressRouteServiceProvider(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ExpressRouteServiceProvider.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> A ExpressRouteResourceProvider object. </summary>
 13    public partial class ExpressRouteServiceProvider : Resource
 14    {
 15        /// <summary> Initializes a new instance of ExpressRouteServiceProvider. </summary>
 016        public ExpressRouteServiceProvider()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ExpressRouteServiceProvider. </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="peeringLocations"> A list of peering locations. </param>
 27        /// <param name="bandwidthsOffered"> A list of bandwidths offered. </param>
 28        /// <param name="provisioningState"> The provisioning state of the express route service provider resource. </pa
 029        internal ExpressRouteServiceProvider(string id, string name, string type, string location, IDictionary<string, s
 30        {
 031            PeeringLocations = peeringLocations;
 032            BandwidthsOffered = bandwidthsOffered;
 033            ProvisioningState = provisioningState;
 034        }
 35
 36        /// <summary> A list of peering locations. </summary>
 037        public IList<string> PeeringLocations { get; set; }
 38        /// <summary> A list of bandwidths offered. </summary>
 039        public IList<ExpressRouteServiceProviderBandwidthsOffered> BandwidthsOffered { get; set; }
 40        /// <summary> The provisioning state of the express route service provider resource. </summary>
 041        public ProvisioningState? ProvisioningState { get; }
 42    }
 43}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ExpressRouteServiceProvider.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 ExpressRouteServiceProvider : 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 (PeeringLocations != null)
 53            {
 054                writer.WritePropertyName("peeringLocations");
 055                writer.WriteStartArray();
 056                foreach (var item in PeeringLocations)
 57                {
 058                    writer.WriteStringValue(item);
 59                }
 060                writer.WriteEndArray();
 61            }
 062            if (BandwidthsOffered != null)
 63            {
 064                writer.WritePropertyName("bandwidthsOffered");
 065                writer.WriteStartArray();
 066                foreach (var item in BandwidthsOffered)
 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 ExpressRouteServiceProvider DeserializeExpressRouteServiceProvider(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            IList<string> peeringLocations = default;
 089            IList<ExpressRouteServiceProviderBandwidthsOffered> bandwidthsOffered = default;
 090            ProvisioningState? provisioningState = default;
 091            foreach (var property in element.EnumerateObject())
 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("name"))
 103                {
 0104                    if (property.Value.ValueKind == JsonValueKind.Null)
 105                    {
 106                        continue;
 107                    }
 0108                    name = property.Value.GetString();
 0109                    continue;
 110                }
 0111                if (property.NameEquals("type"))
 112                {
 0113                    if (property.Value.ValueKind == JsonValueKind.Null)
 114                    {
 115                        continue;
 116                    }
 0117                    type = property.Value.GetString();
 0118                    continue;
 119                }
 0120                if (property.NameEquals("location"))
 121                {
 0122                    if (property.Value.ValueKind == JsonValueKind.Null)
 123                    {
 124                        continue;
 125                    }
 0126                    location = property.Value.GetString();
 0127                    continue;
 128                }
 0129                if (property.NameEquals("tags"))
 130                {
 0131                    if (property.Value.ValueKind == JsonValueKind.Null)
 132                    {
 133                        continue;
 134                    }
 0135                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0136                    foreach (var property0 in property.Value.EnumerateObject())
 137                    {
 0138                        if (property0.Value.ValueKind == JsonValueKind.Null)
 139                        {
 0140                            dictionary.Add(property0.Name, null);
 141                        }
 142                        else
 143                        {
 0144                            dictionary.Add(property0.Name, property0.Value.GetString());
 145                        }
 146                    }
 0147                    tags = dictionary;
 0148                    continue;
 149                }
 0150                if (property.NameEquals("properties"))
 151                {
 0152                    foreach (var property0 in property.Value.EnumerateObject())
 153                    {
 0154                        if (property0.NameEquals("peeringLocations"))
 155                        {
 0156                            if (property0.Value.ValueKind == JsonValueKind.Null)
 157                            {
 158                                continue;
 159                            }
 0160                            List<string> array = new List<string>();
 0161                            foreach (var item in property0.Value.EnumerateArray())
 162                            {
 0163                                if (item.ValueKind == JsonValueKind.Null)
 164                                {
 0165                                    array.Add(null);
 166                                }
 167                                else
 168                                {
 0169                                    array.Add(item.GetString());
 170                                }
 171                            }
 0172                            peeringLocations = array;
 0173                            continue;
 174                        }
 0175                        if (property0.NameEquals("bandwidthsOffered"))
 176                        {
 0177                            if (property0.Value.ValueKind == JsonValueKind.Null)
 178                            {
 179                                continue;
 180                            }
 0181                            List<ExpressRouteServiceProviderBandwidthsOffered> array = new List<ExpressRouteServiceProvi
 0182                            foreach (var item in property0.Value.EnumerateArray())
 183                            {
 0184                                if (item.ValueKind == JsonValueKind.Null)
 185                                {
 0186                                    array.Add(null);
 187                                }
 188                                else
 189                                {
 0190                                    array.Add(ExpressRouteServiceProviderBandwidthsOffered.DeserializeExpressRouteServic
 191                                }
 192                            }
 0193                            bandwidthsOffered = array;
 0194                            continue;
 195                        }
 0196                        if (property0.NameEquals("provisioningState"))
 197                        {
 0198                            if (property0.Value.ValueKind == JsonValueKind.Null)
 199                            {
 200                                continue;
 201                            }
 0202                            provisioningState = new ProvisioningState(property0.Value.GetString());
 203                            continue;
 204                        }
 205                    }
 206                    continue;
 207                }
 208            }
 0209            return new ExpressRouteServiceProvider(id, name, type, location, tags, peeringLocations, bandwidthsOffered, 
 210        }
 211    }
 212}