< Summary

Class:Azure.ResourceManager.Network.Models.BackendAddressPool
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\BackendAddressPool.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\BackendAddressPool.Serialization.cs
Covered lines:105
Uncovered lines:38
Coverable lines:143
Total lines:321
Line coverage:73.4% (105 of 143)
Covered branches:64
Total branches:90
Branch coverage:71.1% (64 of 90)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_Name()-100%100%
get_Etag()-100%100%
get_Type()-100%100%
get_BackendIPConfigurations()-100%100%
get_LoadBalancerBackendAddresses()-100%100%
get_LoadBalancingRules()-100%100%
get_OutboundRule()-100%100%
get_OutboundRules()-100%100%
get_ProvisioningState()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-64.58%64.29%
DeserializeBackendAddressPool(...)-71.23%74.19%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\BackendAddressPool.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> Pool of backend IP addresses. </summary>
 13    public partial class BackendAddressPool : SubResource
 14    {
 15        /// <summary> Initializes a new instance of BackendAddressPool. </summary>
 2816        public BackendAddressPool()
 17        {
 2818        }
 19
 20        /// <summary> Initializes a new instance of BackendAddressPool. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> The name of the resource that is unique within the set of backend address pools used by 
 23        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 24        /// <param name="type"> Type of the resource. </param>
 25        /// <param name="backendIPConfigurations"> An array of references to IP addresses defined in network interfaces.
 26        /// <param name="loadBalancerBackendAddresses"> An array of backend addresses. </param>
 27        /// <param name="loadBalancingRules"> An array of references to load balancing rules that use this backend addre
 28        /// <param name="outboundRule"> A reference to an outbound rule that uses this backend address pool. </param>
 29        /// <param name="outboundRules"> An array of references to outbound rules that use this backend address pool. </
 30        /// <param name="provisioningState"> The provisioning state of the backend address pool resource. </param>
 19631        internal BackendAddressPool(string id, string name, string etag, string type, IList<NetworkInterfaceIPConfigurat
 32        {
 19633            Name = name;
 19634            Etag = etag;
 19635            Type = type;
 19636            BackendIPConfigurations = backendIPConfigurations;
 19637            LoadBalancerBackendAddresses = loadBalancerBackendAddresses;
 19638            LoadBalancingRules = loadBalancingRules;
 19639            OutboundRule = outboundRule;
 19640            OutboundRules = outboundRules;
 19641            ProvisioningState = provisioningState;
 19642        }
 43
 44        /// <summary> The name of the resource that is unique within the set of backend address pools used by the load b
 47245        public string Name { get; set; }
 46        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 16047        public string Etag { get; }
 48        /// <summary> Type of the resource. </summary>
 15249        public string Type { get; }
 50        /// <summary> An array of references to IP addresses defined in network interfaces. </summary>
 12851        public IList<NetworkInterfaceIPConfiguration> BackendIPConfigurations { get; }
 52        /// <summary> An array of backend addresses. </summary>
 30853        public IList<LoadBalancerBackendAddress> LoadBalancerBackendAddresses { get; set; }
 54        /// <summary> An array of references to load balancing rules that use this backend address pool. </summary>
 16855        public IList<SubResource> LoadBalancingRules { get; }
 56        /// <summary> A reference to an outbound rule that uses this backend address pool. </summary>
 11257        public SubResource OutboundRule { get; }
 58        /// <summary> An array of references to outbound rules that use this backend address pool. </summary>
 11259        public IList<SubResource> OutboundRules { get; }
 60        /// <summary> The provisioning state of the backend address pool resource. </summary>
 16861        public ProvisioningState? ProvisioningState { get; }
 62    }
 63}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\BackendAddressPool.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 BackendAddressPool : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 11218            writer.WriteStartObject();
 11219            if (Name != null)
 20            {
 11221                writer.WritePropertyName("name");
 11222                writer.WriteStringValue(Name);
 23            }
 11224            if (Etag != null)
 25            {
 4026                writer.WritePropertyName("etag");
 4027                writer.WriteStringValue(Etag);
 28            }
 11229            if (Type != null)
 30            {
 4031                writer.WritePropertyName("type");
 4032                writer.WriteStringValue(Type);
 33            }
 11234            if (Id != null)
 35            {
 4036                writer.WritePropertyName("id");
 4037                writer.WriteStringValue(Id);
 38            }
 11239            writer.WritePropertyName("properties");
 11240            writer.WriteStartObject();
 11241            if (BackendIPConfigurations != null)
 42            {
 043                writer.WritePropertyName("backendIPConfigurations");
 044                writer.WriteStartArray();
 045                foreach (var item in BackendIPConfigurations)
 46                {
 047                    writer.WriteObjectValue(item);
 48                }
 049                writer.WriteEndArray();
 50            }
 11251            if (LoadBalancerBackendAddresses != null)
 52            {
 053                writer.WritePropertyName("loadBalancerBackendAddresses");
 054                writer.WriteStartArray();
 055                foreach (var item in LoadBalancerBackendAddresses)
 56                {
 057                    writer.WriteObjectValue(item);
 58                }
 059                writer.WriteEndArray();
 60            }
 11261            if (LoadBalancingRules != null)
 62            {
 4063                writer.WritePropertyName("loadBalancingRules");
 4064                writer.WriteStartArray();
 16065                foreach (var item in LoadBalancingRules)
 66                {
 4067                    writer.WriteObjectValue(item);
 68                }
 4069                writer.WriteEndArray();
 70            }
 11271            if (OutboundRule != null)
 72            {
 073                writer.WritePropertyName("outboundRule");
 074                writer.WriteObjectValue(OutboundRule);
 75            }
 11276            if (OutboundRules != null)
 77            {
 078                writer.WritePropertyName("outboundRules");
 079                writer.WriteStartArray();
 080                foreach (var item in OutboundRules)
 81                {
 082                    writer.WriteObjectValue(item);
 83                }
 084                writer.WriteEndArray();
 85            }
 11286            if (ProvisioningState != null)
 87            {
 4088                writer.WritePropertyName("provisioningState");
 4089                writer.WriteStringValue(ProvisioningState.Value.ToString());
 90            }
 11291            writer.WriteEndObject();
 11292            writer.WriteEndObject();
 11293        }
 94
 95        internal static BackendAddressPool DeserializeBackendAddressPool(JsonElement element)
 96        {
 19697            string name = default;
 19698            string etag = default;
 19699            string type = default;
 196100            string id = default;
 196101            IList<NetworkInterfaceIPConfiguration> backendIPConfigurations = default;
 196102            IList<LoadBalancerBackendAddress> loadBalancerBackendAddresses = default;
 196103            IList<SubResource> loadBalancingRules = default;
 196104            SubResource outboundRule = default;
 196105            IList<SubResource> outboundRules = default;
 196106            ProvisioningState? provisioningState = default;
 1712107            foreach (var property in element.EnumerateObject())
 108            {
 660109                if (property.NameEquals("name"))
 110                {
 116111                    if (property.Value.ValueKind == JsonValueKind.Null)
 112                    {
 113                        continue;
 114                    }
 116115                    name = property.Value.GetString();
 116116                    continue;
 117                }
 544118                if (property.NameEquals("etag"))
 119                {
 116120                    if (property.Value.ValueKind == JsonValueKind.Null)
 121                    {
 122                        continue;
 123                    }
 116124                    etag = property.Value.GetString();
 116125                    continue;
 126                }
 428127                if (property.NameEquals("type"))
 128                {
 116129                    if (property.Value.ValueKind == JsonValueKind.Null)
 130                    {
 131                        continue;
 132                    }
 116133                    type = property.Value.GetString();
 116134                    continue;
 135                }
 312136                if (property.NameEquals("id"))
 137                {
 196138                    if (property.Value.ValueKind == JsonValueKind.Null)
 139                    {
 140                        continue;
 141                    }
 196142                    id = property.Value.GetString();
 196143                    continue;
 144                }
 116145                if (property.NameEquals("properties"))
 146                {
 728147                    foreach (var property0 in property.Value.EnumerateObject())
 148                    {
 248149                        if (property0.NameEquals("backendIPConfigurations"))
 150                        {
 16151                            if (property0.Value.ValueKind == JsonValueKind.Null)
 152                            {
 153                                continue;
 154                            }
 16155                            List<NetworkInterfaceIPConfiguration> array = new List<NetworkInterfaceIPConfiguration>();
 96156                            foreach (var item in property0.Value.EnumerateArray())
 157                            {
 32158                                if (item.ValueKind == JsonValueKind.Null)
 159                                {
 0160                                    array.Add(null);
 161                                }
 162                                else
 163                                {
 32164                                    array.Add(NetworkInterfaceIPConfiguration.DeserializeNetworkInterfaceIPConfiguration
 165                                }
 166                            }
 16167                            backendIPConfigurations = array;
 16168                            continue;
 169                        }
 232170                        if (property0.NameEquals("loadBalancerBackendAddresses"))
 171                        {
 0172                            if (property0.Value.ValueKind == JsonValueKind.Null)
 173                            {
 174                                continue;
 175                            }
 0176                            List<LoadBalancerBackendAddress> array = new List<LoadBalancerBackendAddress>();
 0177                            foreach (var item in property0.Value.EnumerateArray())
 178                            {
 0179                                if (item.ValueKind == JsonValueKind.Null)
 180                                {
 0181                                    array.Add(null);
 182                                }
 183                                else
 184                                {
 0185                                    array.Add(LoadBalancerBackendAddress.DeserializeLoadBalancerBackendAddress(item));
 186                                }
 187                            }
 0188                            loadBalancerBackendAddresses = array;
 0189                            continue;
 190                        }
 232191                        if (property0.NameEquals("loadBalancingRules"))
 192                        {
 116193                            if (property0.Value.ValueKind == JsonValueKind.Null)
 194                            {
 195                                continue;
 196                            }
 116197                            List<SubResource> array = new List<SubResource>();
 464198                            foreach (var item in property0.Value.EnumerateArray())
 199                            {
 116200                                if (item.ValueKind == JsonValueKind.Null)
 201                                {
 0202                                    array.Add(null);
 203                                }
 204                                else
 205                                {
 116206                                    array.Add(DeserializeSubResource(item));
 207                                }
 208                            }
 116209                            loadBalancingRules = array;
 116210                            continue;
 211                        }
 116212                        if (property0.NameEquals("outboundRule"))
 213                        {
 0214                            if (property0.Value.ValueKind == JsonValueKind.Null)
 215                            {
 216                                continue;
 217                            }
 0218                            outboundRule = DeserializeSubResource(property0.Value);
 0219                            continue;
 220                        }
 116221                        if (property0.NameEquals("outboundRules"))
 222                        {
 0223                            if (property0.Value.ValueKind == JsonValueKind.Null)
 224                            {
 225                                continue;
 226                            }
 0227                            List<SubResource> array = new List<SubResource>();
 0228                            foreach (var item in property0.Value.EnumerateArray())
 229                            {
 0230                                if (item.ValueKind == JsonValueKind.Null)
 231                                {
 0232                                    array.Add(null);
 233                                }
 234                                else
 235                                {
 0236                                    array.Add(DeserializeSubResource(item));
 237                                }
 238                            }
 0239                            outboundRules = array;
 0240                            continue;
 241                        }
 116242                        if (property0.NameEquals("provisioningState"))
 243                        {
 116244                            if (property0.Value.ValueKind == JsonValueKind.Null)
 245                            {
 246                                continue;
 247                            }
 116248                            provisioningState = new ProvisioningState(property0.Value.GetString());
 249                            continue;
 250                        }
 251                    }
 252                    continue;
 253                }
 254            }
 196255            return new BackendAddressPool(id, name, etag, type, backendIPConfigurations, loadBalancerBackendAddresses, l
 256        }
 257    }
 258}