< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Sku()-0%100%
get_Etag()-0%100%
get_Zones()-0%100%
get_PublicIPAddressVersion()-0%100%
get_IpTags()-0%100%
get_PrefixLength()-0%100%
get_IpPrefix()-0%100%
get_PublicIPAddresses()-0%100%
get_LoadBalancerFrontendIpConfiguration()-0%100%
get_ResourceGuid()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializePublicIPPrefix(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PublicIPPrefix.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> Public IP prefix resource. </summary>
 13    public partial class PublicIPPrefix : Resource
 14    {
 15        /// <summary> Initializes a new instance of PublicIPPrefix. </summary>
 016        public PublicIPPrefix()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of PublicIPPrefix. </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="sku"> The public IP prefix SKU. </param>
 27        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 28        /// <param name="zones"> A list of availability zones denoting the IP allocated for the resource needs to come f
 29        /// <param name="publicIPAddressVersion"> The public IP address version. </param>
 30        /// <param name="ipTags"> The list of tags associated with the public IP prefix. </param>
 31        /// <param name="prefixLength"> The Length of the Public IP Prefix. </param>
 32        /// <param name="ipPrefix"> The allocated Prefix. </param>
 33        /// <param name="publicIPAddresses"> The list of all referenced PublicIPAddresses. </param>
 34        /// <param name="loadBalancerFrontendIpConfiguration"> The reference to load balancer frontend IP configuration 
 35        /// <param name="resourceGuid"> The resource GUID property of the public IP prefix resource. </param>
 36        /// <param name="provisioningState"> The provisioning state of the public IP prefix resource. </param>
 037        internal PublicIPPrefix(string id, string name, string type, string location, IDictionary<string, string> tags, 
 38        {
 039            Sku = sku;
 040            Etag = etag;
 041            Zones = zones;
 042            PublicIPAddressVersion = publicIPAddressVersion;
 043            IpTags = ipTags;
 044            PrefixLength = prefixLength;
 045            IpPrefix = ipPrefix;
 046            PublicIPAddresses = publicIPAddresses;
 047            LoadBalancerFrontendIpConfiguration = loadBalancerFrontendIpConfiguration;
 048            ResourceGuid = resourceGuid;
 049            ProvisioningState = provisioningState;
 050        }
 51
 52        /// <summary> The public IP prefix SKU. </summary>
 053        public PublicIPPrefixSku Sku { get; set; }
 54        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 055        public string Etag { get; }
 56        /// <summary> A list of availability zones denoting the IP allocated for the resource needs to come from. </summ
 057        public IList<string> Zones { get; set; }
 58        /// <summary> The public IP address version. </summary>
 059        public IPVersion? PublicIPAddressVersion { get; set; }
 60        /// <summary> The list of tags associated with the public IP prefix. </summary>
 061        public IList<IpTag> IpTags { get; set; }
 62        /// <summary> The Length of the Public IP Prefix. </summary>
 063        public int? PrefixLength { get; set; }
 64        /// <summary> The allocated Prefix. </summary>
 065        public string IpPrefix { get; }
 66        /// <summary> The list of all referenced PublicIPAddresses. </summary>
 067        public IList<ReferencedPublicIpAddress> PublicIPAddresses { get; }
 68        /// <summary> The reference to load balancer frontend IP configuration associated with the public IP prefix. </s
 069        public SubResource LoadBalancerFrontendIpConfiguration { get; }
 70        /// <summary> The resource GUID property of the public IP prefix resource. </summary>
 071        public string ResourceGuid { get; }
 72        /// <summary> The provisioning state of the public IP prefix resource. </summary>
 073        public ProvisioningState? ProvisioningState { get; }
 74    }
 75}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PublicIPPrefix.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 PublicIPPrefix : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Sku != null)
 20            {
 021                writer.WritePropertyName("sku");
 022                writer.WriteObjectValue(Sku);
 23            }
 024            if (Etag != null)
 25            {
 026                writer.WritePropertyName("etag");
 027                writer.WriteStringValue(Etag);
 28            }
 029            if (Zones != null)
 30            {
 031                writer.WritePropertyName("zones");
 032                writer.WriteStartArray();
 033                foreach (var item in Zones)
 34                {
 035                    writer.WriteStringValue(item);
 36                }
 037                writer.WriteEndArray();
 38            }
 039            if (Id != null)
 40            {
 041                writer.WritePropertyName("id");
 042                writer.WriteStringValue(Id);
 43            }
 044            if (Name != null)
 45            {
 046                writer.WritePropertyName("name");
 047                writer.WriteStringValue(Name);
 48            }
 049            if (Type != null)
 50            {
 051                writer.WritePropertyName("type");
 052                writer.WriteStringValue(Type);
 53            }
 054            if (Location != null)
 55            {
 056                writer.WritePropertyName("location");
 057                writer.WriteStringValue(Location);
 58            }
 059            if (Tags != null)
 60            {
 061                writer.WritePropertyName("tags");
 062                writer.WriteStartObject();
 063                foreach (var item in Tags)
 64                {
 065                    writer.WritePropertyName(item.Key);
 066                    writer.WriteStringValue(item.Value);
 67                }
 068                writer.WriteEndObject();
 69            }
 070            writer.WritePropertyName("properties");
 071            writer.WriteStartObject();
 072            if (PublicIPAddressVersion != null)
 73            {
 074                writer.WritePropertyName("publicIPAddressVersion");
 075                writer.WriteStringValue(PublicIPAddressVersion.Value.ToString());
 76            }
 077            if (IpTags != null)
 78            {
 079                writer.WritePropertyName("ipTags");
 080                writer.WriteStartArray();
 081                foreach (var item in IpTags)
 82                {
 083                    writer.WriteObjectValue(item);
 84                }
 085                writer.WriteEndArray();
 86            }
 087            if (PrefixLength != null)
 88            {
 089                writer.WritePropertyName("prefixLength");
 090                writer.WriteNumberValue(PrefixLength.Value);
 91            }
 092            if (IpPrefix != null)
 93            {
 094                writer.WritePropertyName("ipPrefix");
 095                writer.WriteStringValue(IpPrefix);
 96            }
 097            if (PublicIPAddresses != null)
 98            {
 099                writer.WritePropertyName("publicIPAddresses");
 0100                writer.WriteStartArray();
 0101                foreach (var item in PublicIPAddresses)
 102                {
 0103                    writer.WriteObjectValue(item);
 104                }
 0105                writer.WriteEndArray();
 106            }
 0107            if (LoadBalancerFrontendIpConfiguration != null)
 108            {
 0109                writer.WritePropertyName("loadBalancerFrontendIpConfiguration");
 0110                writer.WriteObjectValue(LoadBalancerFrontendIpConfiguration);
 111            }
 0112            if (ResourceGuid != null)
 113            {
 0114                writer.WritePropertyName("resourceGuid");
 0115                writer.WriteStringValue(ResourceGuid);
 116            }
 0117            if (ProvisioningState != null)
 118            {
 0119                writer.WritePropertyName("provisioningState");
 0120                writer.WriteStringValue(ProvisioningState.Value.ToString());
 121            }
 0122            writer.WriteEndObject();
 0123            writer.WriteEndObject();
 0124        }
 125
 126        internal static PublicIPPrefix DeserializePublicIPPrefix(JsonElement element)
 127        {
 0128            PublicIPPrefixSku sku = default;
 0129            string etag = default;
 0130            IList<string> zones = default;
 0131            string id = default;
 0132            string name = default;
 0133            string type = default;
 0134            string location = default;
 0135            IDictionary<string, string> tags = default;
 0136            IPVersion? publicIPAddressVersion = default;
 0137            IList<IpTag> ipTags = default;
 0138            int? prefixLength = default;
 0139            string ipPrefix = default;
 0140            IList<ReferencedPublicIpAddress> publicIPAddresses = default;
 0141            SubResource loadBalancerFrontendIpConfiguration = default;
 0142            string resourceGuid = default;
 0143            ProvisioningState? provisioningState = default;
 0144            foreach (var property in element.EnumerateObject())
 145            {
 0146                if (property.NameEquals("sku"))
 147                {
 0148                    if (property.Value.ValueKind == JsonValueKind.Null)
 149                    {
 150                        continue;
 151                    }
 0152                    sku = PublicIPPrefixSku.DeserializePublicIPPrefixSku(property.Value);
 0153                    continue;
 154                }
 0155                if (property.NameEquals("etag"))
 156                {
 0157                    if (property.Value.ValueKind == JsonValueKind.Null)
 158                    {
 159                        continue;
 160                    }
 0161                    etag = property.Value.GetString();
 0162                    continue;
 163                }
 0164                if (property.NameEquals("zones"))
 165                {
 0166                    if (property.Value.ValueKind == JsonValueKind.Null)
 167                    {
 168                        continue;
 169                    }
 0170                    List<string> array = new List<string>();
 0171                    foreach (var item in property.Value.EnumerateArray())
 172                    {
 0173                        if (item.ValueKind == JsonValueKind.Null)
 174                        {
 0175                            array.Add(null);
 176                        }
 177                        else
 178                        {
 0179                            array.Add(item.GetString());
 180                        }
 181                    }
 0182                    zones = array;
 0183                    continue;
 184                }
 0185                if (property.NameEquals("id"))
 186                {
 0187                    if (property.Value.ValueKind == JsonValueKind.Null)
 188                    {
 189                        continue;
 190                    }
 0191                    id = property.Value.GetString();
 0192                    continue;
 193                }
 0194                if (property.NameEquals("name"))
 195                {
 0196                    if (property.Value.ValueKind == JsonValueKind.Null)
 197                    {
 198                        continue;
 199                    }
 0200                    name = property.Value.GetString();
 0201                    continue;
 202                }
 0203                if (property.NameEquals("type"))
 204                {
 0205                    if (property.Value.ValueKind == JsonValueKind.Null)
 206                    {
 207                        continue;
 208                    }
 0209                    type = property.Value.GetString();
 0210                    continue;
 211                }
 0212                if (property.NameEquals("location"))
 213                {
 0214                    if (property.Value.ValueKind == JsonValueKind.Null)
 215                    {
 216                        continue;
 217                    }
 0218                    location = property.Value.GetString();
 0219                    continue;
 220                }
 0221                if (property.NameEquals("tags"))
 222                {
 0223                    if (property.Value.ValueKind == JsonValueKind.Null)
 224                    {
 225                        continue;
 226                    }
 0227                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0228                    foreach (var property0 in property.Value.EnumerateObject())
 229                    {
 0230                        if (property0.Value.ValueKind == JsonValueKind.Null)
 231                        {
 0232                            dictionary.Add(property0.Name, null);
 233                        }
 234                        else
 235                        {
 0236                            dictionary.Add(property0.Name, property0.Value.GetString());
 237                        }
 238                    }
 0239                    tags = dictionary;
 0240                    continue;
 241                }
 0242                if (property.NameEquals("properties"))
 243                {
 0244                    foreach (var property0 in property.Value.EnumerateObject())
 245                    {
 0246                        if (property0.NameEquals("publicIPAddressVersion"))
 247                        {
 0248                            if (property0.Value.ValueKind == JsonValueKind.Null)
 249                            {
 250                                continue;
 251                            }
 0252                            publicIPAddressVersion = new IPVersion(property0.Value.GetString());
 0253                            continue;
 254                        }
 0255                        if (property0.NameEquals("ipTags"))
 256                        {
 0257                            if (property0.Value.ValueKind == JsonValueKind.Null)
 258                            {
 259                                continue;
 260                            }
 0261                            List<IpTag> array = new List<IpTag>();
 0262                            foreach (var item in property0.Value.EnumerateArray())
 263                            {
 0264                                if (item.ValueKind == JsonValueKind.Null)
 265                                {
 0266                                    array.Add(null);
 267                                }
 268                                else
 269                                {
 0270                                    array.Add(IpTag.DeserializeIpTag(item));
 271                                }
 272                            }
 0273                            ipTags = array;
 0274                            continue;
 275                        }
 0276                        if (property0.NameEquals("prefixLength"))
 277                        {
 0278                            if (property0.Value.ValueKind == JsonValueKind.Null)
 279                            {
 280                                continue;
 281                            }
 0282                            prefixLength = property0.Value.GetInt32();
 0283                            continue;
 284                        }
 0285                        if (property0.NameEquals("ipPrefix"))
 286                        {
 0287                            if (property0.Value.ValueKind == JsonValueKind.Null)
 288                            {
 289                                continue;
 290                            }
 0291                            ipPrefix = property0.Value.GetString();
 0292                            continue;
 293                        }
 0294                        if (property0.NameEquals("publicIPAddresses"))
 295                        {
 0296                            if (property0.Value.ValueKind == JsonValueKind.Null)
 297                            {
 298                                continue;
 299                            }
 0300                            List<ReferencedPublicIpAddress> array = new List<ReferencedPublicIpAddress>();
 0301                            foreach (var item in property0.Value.EnumerateArray())
 302                            {
 0303                                if (item.ValueKind == JsonValueKind.Null)
 304                                {
 0305                                    array.Add(null);
 306                                }
 307                                else
 308                                {
 0309                                    array.Add(ReferencedPublicIpAddress.DeserializeReferencedPublicIpAddress(item));
 310                                }
 311                            }
 0312                            publicIPAddresses = array;
 0313                            continue;
 314                        }
 0315                        if (property0.NameEquals("loadBalancerFrontendIpConfiguration"))
 316                        {
 0317                            if (property0.Value.ValueKind == JsonValueKind.Null)
 318                            {
 319                                continue;
 320                            }
 0321                            loadBalancerFrontendIpConfiguration = SubResource.DeserializeSubResource(property0.Value);
 0322                            continue;
 323                        }
 0324                        if (property0.NameEquals("resourceGuid"))
 325                        {
 0326                            if (property0.Value.ValueKind == JsonValueKind.Null)
 327                            {
 328                                continue;
 329                            }
 0330                            resourceGuid = property0.Value.GetString();
 0331                            continue;
 332                        }
 0333                        if (property0.NameEquals("provisioningState"))
 334                        {
 0335                            if (property0.Value.ValueKind == JsonValueKind.Null)
 336                            {
 337                                continue;
 338                            }
 0339                            provisioningState = new ProvisioningState(property0.Value.GetString());
 340                            continue;
 341                        }
 342                    }
 343                    continue;
 344                }
 345            }
 0346            return new PublicIPPrefix(id, name, type, location, tags, sku, etag, zones, publicIPAddressVersion, ipTags, 
 347        }
 348    }
 349}