< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Etag()-0%100%
get_Subnet()-0%100%
get_VirtualNetwork()-0%100%
get_TypePropertiesType()-0%100%
get_Prefix()-0%100%
get_PrefixLength()-0%100%
get_PrefixType()-0%100%
get_IpamAllocationId()-0%100%
get_AllocationTags()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeIpAllocation(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\IpAllocation.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> IpAllocation resource. </summary>
 13    public partial class IpAllocation : Resource
 14    {
 15        /// <summary> Initializes a new instance of IpAllocation. </summary>
 016        public IpAllocation()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of IpAllocation. </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="subnet"> The Subnet that using the prefix of this IpAllocation resource. </param>
 28        /// <param name="virtualNetwork"> The VirtualNetwork that using the prefix of this IpAllocation resource. </para
 29        /// <param name="typePropertiesType"> The type for the IpAllocation. </param>
 30        /// <param name="prefix"> The address prefix for the IpAllocation. </param>
 31        /// <param name="prefixLength"> The address prefix length for the IpAllocation. </param>
 32        /// <param name="prefixType"> The address prefix Type for the IpAllocation. </param>
 33        /// <param name="ipamAllocationId"> The IPAM allocation ID. </param>
 34        /// <param name="allocationTags"> IpAllocation tags. </param>
 035        internal IpAllocation(string id, string name, string type, string location, IDictionary<string, string> tags, st
 36        {
 037            Etag = etag;
 038            Subnet = subnet;
 039            VirtualNetwork = virtualNetwork;
 040            TypePropertiesType = typePropertiesType;
 041            Prefix = prefix;
 042            PrefixLength = prefixLength;
 043            PrefixType = prefixType;
 044            IpamAllocationId = ipamAllocationId;
 045            AllocationTags = allocationTags;
 046        }
 47
 48        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 049        public string Etag { get; }
 50        /// <summary> The Subnet that using the prefix of this IpAllocation resource. </summary>
 051        public SubResource Subnet { get; }
 52        /// <summary> The VirtualNetwork that using the prefix of this IpAllocation resource. </summary>
 053        public SubResource VirtualNetwork { get; }
 54        /// <summary> The type for the IpAllocation. </summary>
 055        public IpAllocationType? TypePropertiesType { get; set; }
 56        /// <summary> The address prefix for the IpAllocation. </summary>
 057        public string Prefix { get; set; }
 58        /// <summary> The address prefix length for the IpAllocation. </summary>
 059        public int? PrefixLength { get; set; }
 60        /// <summary> The address prefix Type for the IpAllocation. </summary>
 061        public IPVersion? PrefixType { get; set; }
 62        /// <summary> The IPAM allocation ID. </summary>
 063        public string IpamAllocationId { get; set; }
 64        /// <summary> IpAllocation tags. </summary>
 065        public IDictionary<string, string> AllocationTags { get; set; }
 66    }
 67}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\IpAllocation.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 IpAllocation : 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 (Subnet != null)
 58            {
 059                writer.WritePropertyName("subnet");
 060                writer.WriteObjectValue(Subnet);
 61            }
 062            if (VirtualNetwork != null)
 63            {
 064                writer.WritePropertyName("virtualNetwork");
 065                writer.WriteObjectValue(VirtualNetwork);
 66            }
 067            if (TypePropertiesType != null)
 68            {
 069                writer.WritePropertyName("type");
 070                writer.WriteStringValue(TypePropertiesType.Value.ToString());
 71            }
 072            if (Prefix != null)
 73            {
 074                writer.WritePropertyName("prefix");
 075                writer.WriteStringValue(Prefix);
 76            }
 077            if (PrefixLength != null)
 78            {
 079                writer.WritePropertyName("prefixLength");
 080                writer.WriteNumberValue(PrefixLength.Value);
 81            }
 082            if (PrefixType != null)
 83            {
 084                writer.WritePropertyName("prefixType");
 085                writer.WriteStringValue(PrefixType.Value.ToString());
 86            }
 087            if (IpamAllocationId != null)
 88            {
 089                writer.WritePropertyName("ipamAllocationId");
 090                writer.WriteStringValue(IpamAllocationId);
 91            }
 092            if (AllocationTags != null)
 93            {
 094                writer.WritePropertyName("allocationTags");
 095                writer.WriteStartObject();
 096                foreach (var item in AllocationTags)
 97                {
 098                    writer.WritePropertyName(item.Key);
 099                    writer.WriteStringValue(item.Value);
 100                }
 0101                writer.WriteEndObject();
 102            }
 0103            writer.WriteEndObject();
 0104            writer.WriteEndObject();
 0105        }
 106
 107        internal static IpAllocation DeserializeIpAllocation(JsonElement element)
 108        {
 0109            string etag = default;
 0110            string id = default;
 0111            string name = default;
 0112            string type = default;
 0113            string location = default;
 0114            IDictionary<string, string> tags = default;
 0115            SubResource subnet = default;
 0116            SubResource virtualNetwork = default;
 0117            IpAllocationType? type0 = default;
 0118            string prefix = default;
 0119            int? prefixLength = default;
 0120            IPVersion? prefixType = default;
 0121            string ipamAllocationId = default;
 0122            IDictionary<string, string> allocationTags = default;
 0123            foreach (var property in element.EnumerateObject())
 124            {
 0125                if (property.NameEquals("etag"))
 126                {
 0127                    if (property.Value.ValueKind == JsonValueKind.Null)
 128                    {
 129                        continue;
 130                    }
 0131                    etag = property.Value.GetString();
 0132                    continue;
 133                }
 0134                if (property.NameEquals("id"))
 135                {
 0136                    if (property.Value.ValueKind == JsonValueKind.Null)
 137                    {
 138                        continue;
 139                    }
 0140                    id = property.Value.GetString();
 0141                    continue;
 142                }
 0143                if (property.NameEquals("name"))
 144                {
 0145                    if (property.Value.ValueKind == JsonValueKind.Null)
 146                    {
 147                        continue;
 148                    }
 0149                    name = property.Value.GetString();
 0150                    continue;
 151                }
 0152                if (property.NameEquals("type"))
 153                {
 0154                    if (property.Value.ValueKind == JsonValueKind.Null)
 155                    {
 156                        continue;
 157                    }
 0158                    type = property.Value.GetString();
 0159                    continue;
 160                }
 0161                if (property.NameEquals("location"))
 162                {
 0163                    if (property.Value.ValueKind == JsonValueKind.Null)
 164                    {
 165                        continue;
 166                    }
 0167                    location = property.Value.GetString();
 0168                    continue;
 169                }
 0170                if (property.NameEquals("tags"))
 171                {
 0172                    if (property.Value.ValueKind == JsonValueKind.Null)
 173                    {
 174                        continue;
 175                    }
 0176                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0177                    foreach (var property0 in property.Value.EnumerateObject())
 178                    {
 0179                        if (property0.Value.ValueKind == JsonValueKind.Null)
 180                        {
 0181                            dictionary.Add(property0.Name, null);
 182                        }
 183                        else
 184                        {
 0185                            dictionary.Add(property0.Name, property0.Value.GetString());
 186                        }
 187                    }
 0188                    tags = dictionary;
 0189                    continue;
 190                }
 0191                if (property.NameEquals("properties"))
 192                {
 0193                    foreach (var property0 in property.Value.EnumerateObject())
 194                    {
 0195                        if (property0.NameEquals("subnet"))
 196                        {
 0197                            if (property0.Value.ValueKind == JsonValueKind.Null)
 198                            {
 199                                continue;
 200                            }
 0201                            subnet = SubResource.DeserializeSubResource(property0.Value);
 0202                            continue;
 203                        }
 0204                        if (property0.NameEquals("virtualNetwork"))
 205                        {
 0206                            if (property0.Value.ValueKind == JsonValueKind.Null)
 207                            {
 208                                continue;
 209                            }
 0210                            virtualNetwork = SubResource.DeserializeSubResource(property0.Value);
 0211                            continue;
 212                        }
 0213                        if (property0.NameEquals("type"))
 214                        {
 0215                            if (property0.Value.ValueKind == JsonValueKind.Null)
 216                            {
 217                                continue;
 218                            }
 0219                            type0 = new IpAllocationType(property0.Value.GetString());
 0220                            continue;
 221                        }
 0222                        if (property0.NameEquals("prefix"))
 223                        {
 0224                            if (property0.Value.ValueKind == JsonValueKind.Null)
 225                            {
 226                                continue;
 227                            }
 0228                            prefix = property0.Value.GetString();
 0229                            continue;
 230                        }
 0231                        if (property0.NameEquals("prefixLength"))
 232                        {
 0233                            if (property0.Value.ValueKind == JsonValueKind.Null)
 234                            {
 235                                continue;
 236                            }
 0237                            prefixLength = property0.Value.GetInt32();
 0238                            continue;
 239                        }
 0240                        if (property0.NameEquals("prefixType"))
 241                        {
 0242                            if (property0.Value.ValueKind == JsonValueKind.Null)
 243                            {
 244                                continue;
 245                            }
 0246                            prefixType = new IPVersion(property0.Value.GetString());
 0247                            continue;
 248                        }
 0249                        if (property0.NameEquals("ipamAllocationId"))
 250                        {
 0251                            if (property0.Value.ValueKind == JsonValueKind.Null)
 252                            {
 253                                continue;
 254                            }
 0255                            ipamAllocationId = property0.Value.GetString();
 0256                            continue;
 257                        }
 0258                        if (property0.NameEquals("allocationTags"))
 259                        {
 0260                            if (property0.Value.ValueKind == JsonValueKind.Null)
 261                            {
 262                                continue;
 263                            }
 0264                            Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0265                            foreach (var property1 in property0.Value.EnumerateObject())
 266                            {
 0267                                if (property1.Value.ValueKind == JsonValueKind.Null)
 268                                {
 0269                                    dictionary.Add(property1.Name, null);
 270                                }
 271                                else
 272                                {
 0273                                    dictionary.Add(property1.Name, property1.Value.GetString());
 274                                }
 275                            }
 0276                            allocationTags = dictionary;
 277                            continue;
 278                        }
 279                    }
 280                    continue;
 281                }
 282            }
 0283            return new IpAllocation(id, name, type, location, tags, etag, subnet, virtualNetwork, type0, prefix, prefixL
 284        }
 285    }
 286}