< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Sku()-0%100%
get_Zones()-0%100%
get_Etag()-0%100%
get_IdleTimeoutInMinutes()-0%100%
get_PublicIpAddresses()-0%100%
get_PublicIpPrefixes()-0%100%
get_Subnets()-0%100%
get_ResourceGuid()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeNatGateway(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NatGateway.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> Nat Gateway resource. </summary>
 13    public partial class NatGateway : Resource
 14    {
 15        /// <summary> Initializes a new instance of NatGateway. </summary>
 016        public NatGateway()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of NatGateway. </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 nat gateway SKU. </param>
 27        /// <param name="zones"> A list of availability zones denoting the zone in which Nat Gateway should be deployed.
 28        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 29        /// <param name="idleTimeoutInMinutes"> The idle timeout of the nat gateway. </param>
 30        /// <param name="publicIpAddresses"> An array of public ip addresses associated with the nat gateway resource. <
 31        /// <param name="publicIpPrefixes"> An array of public ip prefixes associated with the nat gateway resource. </p
 32        /// <param name="subnets"> An array of references to the subnets using this nat gateway resource. </param>
 33        /// <param name="resourceGuid"> The resource GUID property of the NAT gateway resource. </param>
 34        /// <param name="provisioningState"> The provisioning state of the NAT gateway resource. </param>
 035        internal NatGateway(string id, string name, string type, string location, IDictionary<string, string> tags, NatG
 36        {
 037            Sku = sku;
 038            Zones = zones;
 039            Etag = etag;
 040            IdleTimeoutInMinutes = idleTimeoutInMinutes;
 041            PublicIpAddresses = publicIpAddresses;
 042            PublicIpPrefixes = publicIpPrefixes;
 043            Subnets = subnets;
 044            ResourceGuid = resourceGuid;
 045            ProvisioningState = provisioningState;
 046        }
 47
 48        /// <summary> The nat gateway SKU. </summary>
 049        public NatGatewaySku Sku { get; set; }
 50        /// <summary> A list of availability zones denoting the zone in which Nat Gateway should be deployed. </summary>
 051        public IList<string> Zones { get; set; }
 52        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 053        public string Etag { get; }
 54        /// <summary> The idle timeout of the nat gateway. </summary>
 055        public int? IdleTimeoutInMinutes { get; set; }
 56        /// <summary> An array of public ip addresses associated with the nat gateway resource. </summary>
 057        public IList<SubResource> PublicIpAddresses { get; set; }
 58        /// <summary> An array of public ip prefixes associated with the nat gateway resource. </summary>
 059        public IList<SubResource> PublicIpPrefixes { get; set; }
 60        /// <summary> An array of references to the subnets using this nat gateway resource. </summary>
 061        public IList<SubResource> Subnets { get; }
 62        /// <summary> The resource GUID property of the NAT gateway resource. </summary>
 063        public string ResourceGuid { get; }
 64        /// <summary> The provisioning state of the NAT gateway resource. </summary>
 065        public ProvisioningState? ProvisioningState { get; }
 66    }
 67}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NatGateway.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 NatGateway : 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 (Zones != null)
 25            {
 026                writer.WritePropertyName("zones");
 027                writer.WriteStartArray();
 028                foreach (var item in Zones)
 29                {
 030                    writer.WriteStringValue(item);
 31                }
 032                writer.WriteEndArray();
 33            }
 034            if (Etag != null)
 35            {
 036                writer.WritePropertyName("etag");
 037                writer.WriteStringValue(Etag);
 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 (IdleTimeoutInMinutes != null)
 73            {
 074                writer.WritePropertyName("idleTimeoutInMinutes");
 075                writer.WriteNumberValue(IdleTimeoutInMinutes.Value);
 76            }
 077            if (PublicIpAddresses != null)
 78            {
 079                writer.WritePropertyName("publicIpAddresses");
 080                writer.WriteStartArray();
 081                foreach (var item in PublicIpAddresses)
 82                {
 083                    writer.WriteObjectValue(item);
 84                }
 085                writer.WriteEndArray();
 86            }
 087            if (PublicIpPrefixes != null)
 88            {
 089                writer.WritePropertyName("publicIpPrefixes");
 090                writer.WriteStartArray();
 091                foreach (var item in PublicIpPrefixes)
 92                {
 093                    writer.WriteObjectValue(item);
 94                }
 095                writer.WriteEndArray();
 96            }
 097            if (Subnets != null)
 98            {
 099                writer.WritePropertyName("subnets");
 0100                writer.WriteStartArray();
 0101                foreach (var item in Subnets)
 102                {
 0103                    writer.WriteObjectValue(item);
 104                }
 0105                writer.WriteEndArray();
 106            }
 0107            if (ResourceGuid != null)
 108            {
 0109                writer.WritePropertyName("resourceGuid");
 0110                writer.WriteStringValue(ResourceGuid);
 111            }
 0112            if (ProvisioningState != null)
 113            {
 0114                writer.WritePropertyName("provisioningState");
 0115                writer.WriteStringValue(ProvisioningState.Value.ToString());
 116            }
 0117            writer.WriteEndObject();
 0118            writer.WriteEndObject();
 0119        }
 120
 121        internal static NatGateway DeserializeNatGateway(JsonElement element)
 122        {
 0123            NatGatewaySku sku = default;
 0124            IList<string> zones = default;
 0125            string etag = default;
 0126            string id = default;
 0127            string name = default;
 0128            string type = default;
 0129            string location = default;
 0130            IDictionary<string, string> tags = default;
 0131            int? idleTimeoutInMinutes = default;
 0132            IList<SubResource> publicIpAddresses = default;
 0133            IList<SubResource> publicIpPrefixes = default;
 0134            IList<SubResource> subnets = default;
 0135            string resourceGuid = default;
 0136            ProvisioningState? provisioningState = default;
 0137            foreach (var property in element.EnumerateObject())
 138            {
 0139                if (property.NameEquals("sku"))
 140                {
 0141                    if (property.Value.ValueKind == JsonValueKind.Null)
 142                    {
 143                        continue;
 144                    }
 0145                    sku = NatGatewaySku.DeserializeNatGatewaySku(property.Value);
 0146                    continue;
 147                }
 0148                if (property.NameEquals("zones"))
 149                {
 0150                    if (property.Value.ValueKind == JsonValueKind.Null)
 151                    {
 152                        continue;
 153                    }
 0154                    List<string> array = new List<string>();
 0155                    foreach (var item in property.Value.EnumerateArray())
 156                    {
 0157                        if (item.ValueKind == JsonValueKind.Null)
 158                        {
 0159                            array.Add(null);
 160                        }
 161                        else
 162                        {
 0163                            array.Add(item.GetString());
 164                        }
 165                    }
 0166                    zones = array;
 0167                    continue;
 168                }
 0169                if (property.NameEquals("etag"))
 170                {
 0171                    if (property.Value.ValueKind == JsonValueKind.Null)
 172                    {
 173                        continue;
 174                    }
 0175                    etag = property.Value.GetString();
 0176                    continue;
 177                }
 0178                if (property.NameEquals("id"))
 179                {
 0180                    if (property.Value.ValueKind == JsonValueKind.Null)
 181                    {
 182                        continue;
 183                    }
 0184                    id = property.Value.GetString();
 0185                    continue;
 186                }
 0187                if (property.NameEquals("name"))
 188                {
 0189                    if (property.Value.ValueKind == JsonValueKind.Null)
 190                    {
 191                        continue;
 192                    }
 0193                    name = property.Value.GetString();
 0194                    continue;
 195                }
 0196                if (property.NameEquals("type"))
 197                {
 0198                    if (property.Value.ValueKind == JsonValueKind.Null)
 199                    {
 200                        continue;
 201                    }
 0202                    type = property.Value.GetString();
 0203                    continue;
 204                }
 0205                if (property.NameEquals("location"))
 206                {
 0207                    if (property.Value.ValueKind == JsonValueKind.Null)
 208                    {
 209                        continue;
 210                    }
 0211                    location = property.Value.GetString();
 0212                    continue;
 213                }
 0214                if (property.NameEquals("tags"))
 215                {
 0216                    if (property.Value.ValueKind == JsonValueKind.Null)
 217                    {
 218                        continue;
 219                    }
 0220                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0221                    foreach (var property0 in property.Value.EnumerateObject())
 222                    {
 0223                        if (property0.Value.ValueKind == JsonValueKind.Null)
 224                        {
 0225                            dictionary.Add(property0.Name, null);
 226                        }
 227                        else
 228                        {
 0229                            dictionary.Add(property0.Name, property0.Value.GetString());
 230                        }
 231                    }
 0232                    tags = dictionary;
 0233                    continue;
 234                }
 0235                if (property.NameEquals("properties"))
 236                {
 0237                    foreach (var property0 in property.Value.EnumerateObject())
 238                    {
 0239                        if (property0.NameEquals("idleTimeoutInMinutes"))
 240                        {
 0241                            if (property0.Value.ValueKind == JsonValueKind.Null)
 242                            {
 243                                continue;
 244                            }
 0245                            idleTimeoutInMinutes = property0.Value.GetInt32();
 0246                            continue;
 247                        }
 0248                        if (property0.NameEquals("publicIpAddresses"))
 249                        {
 0250                            if (property0.Value.ValueKind == JsonValueKind.Null)
 251                            {
 252                                continue;
 253                            }
 0254                            List<SubResource> array = new List<SubResource>();
 0255                            foreach (var item in property0.Value.EnumerateArray())
 256                            {
 0257                                if (item.ValueKind == JsonValueKind.Null)
 258                                {
 0259                                    array.Add(null);
 260                                }
 261                                else
 262                                {
 0263                                    array.Add(SubResource.DeserializeSubResource(item));
 264                                }
 265                            }
 0266                            publicIpAddresses = array;
 0267                            continue;
 268                        }
 0269                        if (property0.NameEquals("publicIpPrefixes"))
 270                        {
 0271                            if (property0.Value.ValueKind == JsonValueKind.Null)
 272                            {
 273                                continue;
 274                            }
 0275                            List<SubResource> array = new List<SubResource>();
 0276                            foreach (var item in property0.Value.EnumerateArray())
 277                            {
 0278                                if (item.ValueKind == JsonValueKind.Null)
 279                                {
 0280                                    array.Add(null);
 281                                }
 282                                else
 283                                {
 0284                                    array.Add(SubResource.DeserializeSubResource(item));
 285                                }
 286                            }
 0287                            publicIpPrefixes = array;
 0288                            continue;
 289                        }
 0290                        if (property0.NameEquals("subnets"))
 291                        {
 0292                            if (property0.Value.ValueKind == JsonValueKind.Null)
 293                            {
 294                                continue;
 295                            }
 0296                            List<SubResource> array = new List<SubResource>();
 0297                            foreach (var item in property0.Value.EnumerateArray())
 298                            {
 0299                                if (item.ValueKind == JsonValueKind.Null)
 300                                {
 0301                                    array.Add(null);
 302                                }
 303                                else
 304                                {
 0305                                    array.Add(SubResource.DeserializeSubResource(item));
 306                                }
 307                            }
 0308                            subnets = array;
 0309                            continue;
 310                        }
 0311                        if (property0.NameEquals("resourceGuid"))
 312                        {
 0313                            if (property0.Value.ValueKind == JsonValueKind.Null)
 314                            {
 315                                continue;
 316                            }
 0317                            resourceGuid = property0.Value.GetString();
 0318                            continue;
 319                        }
 0320                        if (property0.NameEquals("provisioningState"))
 321                        {
 0322                            if (property0.Value.ValueKind == JsonValueKind.Null)
 323                            {
 324                                continue;
 325                            }
 0326                            provisioningState = new ProvisioningState(property0.Value.GetString());
 327                            continue;
 328                        }
 329                    }
 330                    continue;
 331                }
 332            }
 0333            return new NatGateway(id, name, type, location, tags, sku, zones, etag, idleTimeoutInMinutes, publicIpAddres
 334        }
 335    }
 336}