< Summary

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

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_FrontendIPConfiguration()-100%100%
get_Protocol()-100%100%
get_FrontendPortRangeStart()-100%100%
get_FrontendPortRangeEnd()-100%100%
get_BackendPort()-100%100%
get_IdleTimeoutInMinutes()-100%100%
get_EnableFloatingIP()-100%100%
get_EnableTcpReset()-100%100%
get_ProvisioningState()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeInboundNatPool(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\InboundNatPool.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
 8namespace Azure.ResourceManager.Network.Models
 9{
 10    /// <summary> Inbound NAT pool of the load balancer. </summary>
 11    public partial class InboundNatPool : SubResource
 12    {
 13        /// <summary> Initializes a new instance of InboundNatPool. </summary>
 814        public InboundNatPool()
 15        {
 816        }
 17
 18        /// <summary> Initializes a new instance of InboundNatPool. </summary>
 19        /// <param name="id"> Resource ID. </param>
 20        /// <param name="name"> The name of the resource that is unique within the set of inbound NAT pools used by the 
 21        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 22        /// <param name="type"> Type of the resource. </param>
 23        /// <param name="frontendIPConfiguration"> A reference to frontend IP addresses. </param>
 24        /// <param name="protocol"> The reference to the transport protocol used by the inbound NAT pool. </param>
 25        /// <param name="frontendPortRangeStart"> The first port number in the range of external ports that will be used
 26        /// <param name="frontendPortRangeEnd"> The last port number in the range of external ports that will be used to
 27        /// <param name="backendPort"> The port used for internal connections on the endpoint. Acceptable values are bet
 28        /// <param name="idleTimeoutInMinutes"> The timeout for the TCP idle connection. The value can be set between 4 
 29        /// <param name="enableFloatingIP"> Configures a virtual machine&apos;s endpoint for the floating IP capability 
 30        /// <param name="enableTcpReset"> Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connect
 31        /// <param name="provisioningState"> The provisioning state of the inbound NAT pool resource. </param>
 432        internal InboundNatPool(string id, string name, string etag, string type, SubResource frontendIPConfiguration, T
 33        {
 434            Name = name;
 435            Etag = etag;
 436            Type = type;
 437            FrontendIPConfiguration = frontendIPConfiguration;
 438            Protocol = protocol;
 439            FrontendPortRangeStart = frontendPortRangeStart;
 440            FrontendPortRangeEnd = frontendPortRangeEnd;
 441            BackendPort = backendPort;
 442            IdleTimeoutInMinutes = idleTimeoutInMinutes;
 443            EnableFloatingIP = enableFloatingIP;
 444            EnableTcpReset = enableTcpReset;
 445            ProvisioningState = provisioningState;
 446        }
 47
 48        /// <summary> The name of the resource that is unique within the set of inbound NAT pools used by the load balan
 6449        public string Name { get; set; }
 50        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 3251        public string Etag { get; }
 52        /// <summary> Type of the resource. </summary>
 3253        public string Type { get; }
 54        /// <summary> A reference to frontend IP addresses. </summary>
 6455        public SubResource FrontendIPConfiguration { get; set; }
 56        /// <summary> The reference to the transport protocol used by the inbound NAT pool. </summary>
 6457        public TransportProtocol? Protocol { get; set; }
 58        /// <summary> The first port number in the range of external ports that will be used to provide Inbound Nat to N
 6459        public int? FrontendPortRangeStart { get; set; }
 60        /// <summary> The last port number in the range of external ports that will be used to provide Inbound Nat to NI
 6461        public int? FrontendPortRangeEnd { get; set; }
 62        /// <summary> The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535.
 6463        public int? BackendPort { get; set; }
 64        /// <summary> The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The defaul
 3665        public int? IdleTimeoutInMinutes { get; set; }
 66        /// <summary> Configures a virtual machine&apos;s endpoint for the floating IP capability required to configure 
 3667        public bool? EnableFloatingIP { get; set; }
 68        /// <summary> Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. Thi
 3669        public bool? EnableTcpReset { get; set; }
 70        /// <summary> The provisioning state of the inbound NAT pool resource. </summary>
 3271        public ProvisioningState? ProvisioningState { get; }
 72    }
 73}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\InboundNatPool.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.ResourceManager.Network.Models
 12{
 13    public partial class InboundNatPool : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 2417            writer.WriteStartObject();
 2418            if (Name != null)
 19            {
 2420                writer.WritePropertyName("name");
 2421                writer.WriteStringValue(Name);
 22            }
 2423            if (Etag != null)
 24            {
 825                writer.WritePropertyName("etag");
 826                writer.WriteStringValue(Etag);
 27            }
 2428            if (Type != null)
 29            {
 830                writer.WritePropertyName("type");
 831                writer.WriteStringValue(Type);
 32            }
 2433            if (Id != null)
 34            {
 835                writer.WritePropertyName("id");
 836                writer.WriteStringValue(Id);
 37            }
 2438            writer.WritePropertyName("properties");
 2439            writer.WriteStartObject();
 2440            if (FrontendIPConfiguration != null)
 41            {
 2442                writer.WritePropertyName("frontendIPConfiguration");
 2443                writer.WriteObjectValue(FrontendIPConfiguration);
 44            }
 2445            if (Protocol != null)
 46            {
 2447                writer.WritePropertyName("protocol");
 2448                writer.WriteStringValue(Protocol.Value.ToString());
 49            }
 2450            if (FrontendPortRangeStart != null)
 51            {
 2452                writer.WritePropertyName("frontendPortRangeStart");
 2453                writer.WriteNumberValue(FrontendPortRangeStart.Value);
 54            }
 2455            if (FrontendPortRangeEnd != null)
 56            {
 2457                writer.WritePropertyName("frontendPortRangeEnd");
 2458                writer.WriteNumberValue(FrontendPortRangeEnd.Value);
 59            }
 2460            if (BackendPort != null)
 61            {
 2462                writer.WritePropertyName("backendPort");
 2463                writer.WriteNumberValue(BackendPort.Value);
 64            }
 2465            if (IdleTimeoutInMinutes != null)
 66            {
 867                writer.WritePropertyName("idleTimeoutInMinutes");
 868                writer.WriteNumberValue(IdleTimeoutInMinutes.Value);
 69            }
 2470            if (EnableFloatingIP != null)
 71            {
 872                writer.WritePropertyName("enableFloatingIP");
 873                writer.WriteBooleanValue(EnableFloatingIP.Value);
 74            }
 2475            if (EnableTcpReset != null)
 76            {
 877                writer.WritePropertyName("enableTcpReset");
 878                writer.WriteBooleanValue(EnableTcpReset.Value);
 79            }
 2480            if (ProvisioningState != null)
 81            {
 882                writer.WritePropertyName("provisioningState");
 883                writer.WriteStringValue(ProvisioningState.Value.ToString());
 84            }
 2485            writer.WriteEndObject();
 2486            writer.WriteEndObject();
 2487        }
 88
 89        internal static InboundNatPool DeserializeInboundNatPool(JsonElement element)
 90        {
 491            string name = default;
 492            string etag = default;
 493            string type = default;
 494            string id = default;
 495            SubResource frontendIPConfiguration = default;
 496            TransportProtocol? protocol = default;
 497            int? frontendPortRangeStart = default;
 498            int? frontendPortRangeEnd = default;
 499            int? backendPort = default;
 4100            int? idleTimeoutInMinutes = default;
 4101            bool? enableFloatingIP = default;
 4102            bool? enableTcpReset = default;
 4103            ProvisioningState? provisioningState = default;
 48104            foreach (var property in element.EnumerateObject())
 105            {
 20106                if (property.NameEquals("name"))
 107                {
 4108                    if (property.Value.ValueKind == JsonValueKind.Null)
 109                    {
 110                        continue;
 111                    }
 4112                    name = property.Value.GetString();
 4113                    continue;
 114                }
 16115                if (property.NameEquals("etag"))
 116                {
 4117                    if (property.Value.ValueKind == JsonValueKind.Null)
 118                    {
 119                        continue;
 120                    }
 4121                    etag = property.Value.GetString();
 4122                    continue;
 123                }
 12124                if (property.NameEquals("type"))
 125                {
 4126                    if (property.Value.ValueKind == JsonValueKind.Null)
 127                    {
 128                        continue;
 129                    }
 4130                    type = property.Value.GetString();
 4131                    continue;
 132                }
 8133                if (property.NameEquals("id"))
 134                {
 4135                    if (property.Value.ValueKind == JsonValueKind.Null)
 136                    {
 137                        continue;
 138                    }
 4139                    id = property.Value.GetString();
 4140                    continue;
 141                }
 4142                if (property.NameEquals("properties"))
 143                {
 96144                    foreach (var property0 in property.Value.EnumerateObject())
 145                    {
 44146                        if (property0.NameEquals("frontendIPConfiguration"))
 147                        {
 4148                            if (property0.Value.ValueKind == JsonValueKind.Null)
 149                            {
 150                                continue;
 151                            }
 4152                            frontendIPConfiguration = DeserializeSubResource(property0.Value);
 4153                            continue;
 154                        }
 40155                        if (property0.NameEquals("protocol"))
 156                        {
 4157                            if (property0.Value.ValueKind == JsonValueKind.Null)
 158                            {
 159                                continue;
 160                            }
 4161                            protocol = new TransportProtocol(property0.Value.GetString());
 4162                            continue;
 163                        }
 36164                        if (property0.NameEquals("frontendPortRangeStart"))
 165                        {
 4166                            if (property0.Value.ValueKind == JsonValueKind.Null)
 167                            {
 168                                continue;
 169                            }
 4170                            frontendPortRangeStart = property0.Value.GetInt32();
 4171                            continue;
 172                        }
 32173                        if (property0.NameEquals("frontendPortRangeEnd"))
 174                        {
 4175                            if (property0.Value.ValueKind == JsonValueKind.Null)
 176                            {
 177                                continue;
 178                            }
 4179                            frontendPortRangeEnd = property0.Value.GetInt32();
 4180                            continue;
 181                        }
 28182                        if (property0.NameEquals("backendPort"))
 183                        {
 4184                            if (property0.Value.ValueKind == JsonValueKind.Null)
 185                            {
 186                                continue;
 187                            }
 4188                            backendPort = property0.Value.GetInt32();
 4189                            continue;
 190                        }
 24191                        if (property0.NameEquals("idleTimeoutInMinutes"))
 192                        {
 4193                            if (property0.Value.ValueKind == JsonValueKind.Null)
 194                            {
 195                                continue;
 196                            }
 4197                            idleTimeoutInMinutes = property0.Value.GetInt32();
 4198                            continue;
 199                        }
 20200                        if (property0.NameEquals("enableFloatingIP"))
 201                        {
 4202                            if (property0.Value.ValueKind == JsonValueKind.Null)
 203                            {
 204                                continue;
 205                            }
 4206                            enableFloatingIP = property0.Value.GetBoolean();
 4207                            continue;
 208                        }
 16209                        if (property0.NameEquals("enableTcpReset"))
 210                        {
 4211                            if (property0.Value.ValueKind == JsonValueKind.Null)
 212                            {
 213                                continue;
 214                            }
 4215                            enableTcpReset = property0.Value.GetBoolean();
 4216                            continue;
 217                        }
 12218                        if (property0.NameEquals("provisioningState"))
 219                        {
 4220                            if (property0.Value.ValueKind == JsonValueKind.Null)
 221                            {
 222                                continue;
 223                            }
 4224                            provisioningState = new ProvisioningState(property0.Value.GetString());
 225                            continue;
 226                        }
 227                    }
 228                    continue;
 229                }
 230            }
 4231            return new InboundNatPool(id, name, etag, type, frontendIPConfiguration, protocol, frontendPortRangeStart, f
 232        }
 233    }
 234}