< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Etag()-0%100%
get_ProvisioningState()-0%100%
get_IpAddresses()-0%100%
get_Firewalls()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeIpGroup(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\IpGroup.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> The IpGroups resource information. </summary>
 13    public partial class IpGroup : Resource
 14    {
 15        /// <summary> Initializes a new instance of IpGroup. </summary>
 016        public IpGroup()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of IpGroup. </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="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 27        /// <param name="provisioningState"> The provisioning state of the IpGroups resource. </param>
 28        /// <param name="ipAddresses"> IpAddresses/IpAddressPrefixes in the IpGroups resource. </param>
 29        /// <param name="firewalls"> List of references to Azure resources that this IpGroups is associated with. </para
 030        internal IpGroup(string id, string name, string type, string location, IDictionary<string, string> tags, string 
 31        {
 032            Etag = etag;
 033            ProvisioningState = provisioningState;
 034            IpAddresses = ipAddresses;
 035            Firewalls = firewalls;
 036        }
 37
 38        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 039        public string Etag { get; }
 40        /// <summary> The provisioning state of the IpGroups resource. </summary>
 041        public ProvisioningState? ProvisioningState { get; }
 42        /// <summary> IpAddresses/IpAddressPrefixes in the IpGroups resource. </summary>
 043        public IList<string> IpAddresses { get; set; }
 44        /// <summary> List of references to Azure resources that this IpGroups is associated with. </summary>
 045        public IList<SubResource> Firewalls { get; }
 46    }
 47}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\IpGroup.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 IpGroup : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Etag != null)
 20            {
 021                writer.WritePropertyName("etag");
 022                writer.WriteStringValue(Etag);
 23            }
 024            if (Id != null)
 25            {
 026                writer.WritePropertyName("id");
 027                writer.WriteStringValue(Id);
 28            }
 029            if (Name != null)
 30            {
 031                writer.WritePropertyName("name");
 032                writer.WriteStringValue(Name);
 33            }
 034            if (Type != null)
 35            {
 036                writer.WritePropertyName("type");
 037                writer.WriteStringValue(Type);
 38            }
 039            if (Location != null)
 40            {
 041                writer.WritePropertyName("location");
 042                writer.WriteStringValue(Location);
 43            }
 044            if (Tags != null)
 45            {
 046                writer.WritePropertyName("tags");
 047                writer.WriteStartObject();
 048                foreach (var item in Tags)
 49                {
 050                    writer.WritePropertyName(item.Key);
 051                    writer.WriteStringValue(item.Value);
 52                }
 053                writer.WriteEndObject();
 54            }
 055            writer.WritePropertyName("properties");
 056            writer.WriteStartObject();
 057            if (ProvisioningState != null)
 58            {
 059                writer.WritePropertyName("provisioningState");
 060                writer.WriteStringValue(ProvisioningState.Value.ToString());
 61            }
 062            if (IpAddresses != null)
 63            {
 064                writer.WritePropertyName("ipAddresses");
 065                writer.WriteStartArray();
 066                foreach (var item in IpAddresses)
 67                {
 068                    writer.WriteStringValue(item);
 69                }
 070                writer.WriteEndArray();
 71            }
 072            if (Firewalls != null)
 73            {
 074                writer.WritePropertyName("firewalls");
 075                writer.WriteStartArray();
 076                foreach (var item in Firewalls)
 77                {
 078                    writer.WriteObjectValue(item);
 79                }
 080                writer.WriteEndArray();
 81            }
 082            writer.WriteEndObject();
 083            writer.WriteEndObject();
 084        }
 85
 86        internal static IpGroup DeserializeIpGroup(JsonElement element)
 87        {
 088            string etag = default;
 089            string id = default;
 090            string name = default;
 091            string type = default;
 092            string location = default;
 093            IDictionary<string, string> tags = default;
 094            ProvisioningState? provisioningState = default;
 095            IList<string> ipAddresses = default;
 096            IList<SubResource> firewalls = default;
 097            foreach (var property in element.EnumerateObject())
 98            {
 099                if (property.NameEquals("etag"))
 100                {
 0101                    if (property.Value.ValueKind == JsonValueKind.Null)
 102                    {
 103                        continue;
 104                    }
 0105                    etag = property.Value.GetString();
 0106                    continue;
 107                }
 0108                if (property.NameEquals("id"))
 109                {
 0110                    if (property.Value.ValueKind == JsonValueKind.Null)
 111                    {
 112                        continue;
 113                    }
 0114                    id = property.Value.GetString();
 0115                    continue;
 116                }
 0117                if (property.NameEquals("name"))
 118                {
 0119                    if (property.Value.ValueKind == JsonValueKind.Null)
 120                    {
 121                        continue;
 122                    }
 0123                    name = property.Value.GetString();
 0124                    continue;
 125                }
 0126                if (property.NameEquals("type"))
 127                {
 0128                    if (property.Value.ValueKind == JsonValueKind.Null)
 129                    {
 130                        continue;
 131                    }
 0132                    type = property.Value.GetString();
 0133                    continue;
 134                }
 0135                if (property.NameEquals("location"))
 136                {
 0137                    if (property.Value.ValueKind == JsonValueKind.Null)
 138                    {
 139                        continue;
 140                    }
 0141                    location = property.Value.GetString();
 0142                    continue;
 143                }
 0144                if (property.NameEquals("tags"))
 145                {
 0146                    if (property.Value.ValueKind == JsonValueKind.Null)
 147                    {
 148                        continue;
 149                    }
 0150                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0151                    foreach (var property0 in property.Value.EnumerateObject())
 152                    {
 0153                        if (property0.Value.ValueKind == JsonValueKind.Null)
 154                        {
 0155                            dictionary.Add(property0.Name, null);
 156                        }
 157                        else
 158                        {
 0159                            dictionary.Add(property0.Name, property0.Value.GetString());
 160                        }
 161                    }
 0162                    tags = dictionary;
 0163                    continue;
 164                }
 0165                if (property.NameEquals("properties"))
 166                {
 0167                    foreach (var property0 in property.Value.EnumerateObject())
 168                    {
 0169                        if (property0.NameEquals("provisioningState"))
 170                        {
 0171                            if (property0.Value.ValueKind == JsonValueKind.Null)
 172                            {
 173                                continue;
 174                            }
 0175                            provisioningState = new ProvisioningState(property0.Value.GetString());
 0176                            continue;
 177                        }
 0178                        if (property0.NameEquals("ipAddresses"))
 179                        {
 0180                            if (property0.Value.ValueKind == JsonValueKind.Null)
 181                            {
 182                                continue;
 183                            }
 0184                            List<string> array = new List<string>();
 0185                            foreach (var item in property0.Value.EnumerateArray())
 186                            {
 0187                                if (item.ValueKind == JsonValueKind.Null)
 188                                {
 0189                                    array.Add(null);
 190                                }
 191                                else
 192                                {
 0193                                    array.Add(item.GetString());
 194                                }
 195                            }
 0196                            ipAddresses = array;
 0197                            continue;
 198                        }
 0199                        if (property0.NameEquals("firewalls"))
 200                        {
 0201                            if (property0.Value.ValueKind == JsonValueKind.Null)
 202                            {
 203                                continue;
 204                            }
 0205                            List<SubResource> array = new List<SubResource>();
 0206                            foreach (var item in property0.Value.EnumerateArray())
 207                            {
 0208                                if (item.ValueKind == JsonValueKind.Null)
 209                                {
 0210                                    array.Add(null);
 211                                }
 212                                else
 213                                {
 0214                                    array.Add(SubResource.DeserializeSubResource(item));
 215                                }
 216                            }
 0217                            firewalls = array;
 218                            continue;
 219                        }
 220                    }
 221                    continue;
 222                }
 223            }
 0224            return new IpGroup(id, name, type, location, tags, etag, provisioningState, ipAddresses, firewalls);
 225        }
 226    }
 227}