< Summary

Class:Azure.ResourceManager.Network.Models.OutboundRule
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\OutboundRule.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\OutboundRule.Serialization.cs
Covered lines:0
Uncovered lines:129
Coverable lines:129
Total lines:289
Line coverage:0% (0 of 129)
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_Name()-0%100%
get_Etag()-0%100%
get_Type()-0%100%
get_AllocatedOutboundPorts()-0%100%
get_FrontendIPConfigurations()-0%100%
get_BackendAddressPool()-0%100%
get_ProvisioningState()-0%100%
get_Protocol()-0%100%
get_EnableTcpReset()-0%100%
get_IdleTimeoutInMinutes()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeOutboundRule(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\OutboundRule.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> Outbound rule of the load balancer. </summary>
 13    public partial class OutboundRule : SubResource
 14    {
 15        /// <summary> Initializes a new instance of OutboundRule. </summary>
 016        public OutboundRule()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of OutboundRule. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> The name of the resource that is unique within the set of outbound rules used by the loa
 23        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 24        /// <param name="type"> Type of the resource. </param>
 25        /// <param name="allocatedOutboundPorts"> The number of outbound ports to be used for NAT. </param>
 26        /// <param name="frontendIPConfigurations"> The Frontend IP addresses of the load balancer. </param>
 27        /// <param name="backendAddressPool"> A reference to a pool of DIPs. Outbound traffic is randomly load balanced 
 28        /// <param name="provisioningState"> The provisioning state of the outbound rule resource. </param>
 29        /// <param name="protocol"> The protocol for the outbound rule in load balancer. </param>
 30        /// <param name="enableTcpReset"> Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connect
 31        /// <param name="idleTimeoutInMinutes"> The timeout for the TCP idle connection. </param>
 032        internal OutboundRule(string id, string name, string etag, string type, int? allocatedOutboundPorts, IList<SubRe
 33        {
 034            Name = name;
 035            Etag = etag;
 036            Type = type;
 037            AllocatedOutboundPorts = allocatedOutboundPorts;
 038            FrontendIPConfigurations = frontendIPConfigurations;
 039            BackendAddressPool = backendAddressPool;
 040            ProvisioningState = provisioningState;
 041            Protocol = protocol;
 042            EnableTcpReset = enableTcpReset;
 043            IdleTimeoutInMinutes = idleTimeoutInMinutes;
 044        }
 45
 46        /// <summary> The name of the resource that is unique within the set of outbound rules used by the load balancer
 047        public string Name { get; set; }
 48        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 049        public string Etag { get; }
 50        /// <summary> Type of the resource. </summary>
 051        public string Type { get; }
 52        /// <summary> The number of outbound ports to be used for NAT. </summary>
 053        public int? AllocatedOutboundPorts { get; set; }
 54        /// <summary> The Frontend IP addresses of the load balancer. </summary>
 055        public IList<SubResource> FrontendIPConfigurations { get; set; }
 56        /// <summary> A reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backen
 057        public SubResource BackendAddressPool { get; set; }
 58        /// <summary> The provisioning state of the outbound rule resource. </summary>
 059        public ProvisioningState? ProvisioningState { get; }
 60        /// <summary> The protocol for the outbound rule in load balancer. </summary>
 061        public LoadBalancerOutboundRuleProtocol? Protocol { get; set; }
 62        /// <summary> Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. Thi
 063        public bool? EnableTcpReset { get; set; }
 64        /// <summary> The timeout for the TCP idle connection. </summary>
 065        public int? IdleTimeoutInMinutes { get; set; }
 66    }
 67}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\OutboundRule.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 OutboundRule : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Name != null)
 20            {
 021                writer.WritePropertyName("name");
 022                writer.WriteStringValue(Name);
 23            }
 024            if (Etag != null)
 25            {
 026                writer.WritePropertyName("etag");
 027                writer.WriteStringValue(Etag);
 28            }
 029            if (Type != null)
 30            {
 031                writer.WritePropertyName("type");
 032                writer.WriteStringValue(Type);
 33            }
 034            if (Id != null)
 35            {
 036                writer.WritePropertyName("id");
 037                writer.WriteStringValue(Id);
 38            }
 039            writer.WritePropertyName("properties");
 040            writer.WriteStartObject();
 041            if (AllocatedOutboundPorts != null)
 42            {
 043                writer.WritePropertyName("allocatedOutboundPorts");
 044                writer.WriteNumberValue(AllocatedOutboundPorts.Value);
 45            }
 046            if (FrontendIPConfigurations != null)
 47            {
 048                writer.WritePropertyName("frontendIPConfigurations");
 049                writer.WriteStartArray();
 050                foreach (var item in FrontendIPConfigurations)
 51                {
 052                    writer.WriteObjectValue(item);
 53                }
 054                writer.WriteEndArray();
 55            }
 056            if (BackendAddressPool != null)
 57            {
 058                writer.WritePropertyName("backendAddressPool");
 059                writer.WriteObjectValue(BackendAddressPool);
 60            }
 061            if (ProvisioningState != null)
 62            {
 063                writer.WritePropertyName("provisioningState");
 064                writer.WriteStringValue(ProvisioningState.Value.ToString());
 65            }
 066            if (Protocol != null)
 67            {
 068                writer.WritePropertyName("protocol");
 069                writer.WriteStringValue(Protocol.Value.ToString());
 70            }
 071            if (EnableTcpReset != null)
 72            {
 073                writer.WritePropertyName("enableTcpReset");
 074                writer.WriteBooleanValue(EnableTcpReset.Value);
 75            }
 076            if (IdleTimeoutInMinutes != null)
 77            {
 078                writer.WritePropertyName("idleTimeoutInMinutes");
 079                writer.WriteNumberValue(IdleTimeoutInMinutes.Value);
 80            }
 081            writer.WriteEndObject();
 082            writer.WriteEndObject();
 083        }
 84
 85        internal static OutboundRule DeserializeOutboundRule(JsonElement element)
 86        {
 087            string name = default;
 088            string etag = default;
 089            string type = default;
 090            string id = default;
 091            int? allocatedOutboundPorts = default;
 092            IList<SubResource> frontendIPConfigurations = default;
 093            SubResource backendAddressPool = default;
 094            ProvisioningState? provisioningState = default;
 095            LoadBalancerOutboundRuleProtocol? protocol = default;
 096            bool? enableTcpReset = default;
 097            int? idleTimeoutInMinutes = default;
 098            foreach (var property in element.EnumerateObject())
 99            {
 0100                if (property.NameEquals("name"))
 101                {
 0102                    if (property.Value.ValueKind == JsonValueKind.Null)
 103                    {
 104                        continue;
 105                    }
 0106                    name = property.Value.GetString();
 0107                    continue;
 108                }
 0109                if (property.NameEquals("etag"))
 110                {
 0111                    if (property.Value.ValueKind == JsonValueKind.Null)
 112                    {
 113                        continue;
 114                    }
 0115                    etag = property.Value.GetString();
 0116                    continue;
 117                }
 0118                if (property.NameEquals("type"))
 119                {
 0120                    if (property.Value.ValueKind == JsonValueKind.Null)
 121                    {
 122                        continue;
 123                    }
 0124                    type = property.Value.GetString();
 0125                    continue;
 126                }
 0127                if (property.NameEquals("id"))
 128                {
 0129                    if (property.Value.ValueKind == JsonValueKind.Null)
 130                    {
 131                        continue;
 132                    }
 0133                    id = property.Value.GetString();
 0134                    continue;
 135                }
 0136                if (property.NameEquals("properties"))
 137                {
 0138                    foreach (var property0 in property.Value.EnumerateObject())
 139                    {
 0140                        if (property0.NameEquals("allocatedOutboundPorts"))
 141                        {
 0142                            if (property0.Value.ValueKind == JsonValueKind.Null)
 143                            {
 144                                continue;
 145                            }
 0146                            allocatedOutboundPorts = property0.Value.GetInt32();
 0147                            continue;
 148                        }
 0149                        if (property0.NameEquals("frontendIPConfigurations"))
 150                        {
 0151                            if (property0.Value.ValueKind == JsonValueKind.Null)
 152                            {
 153                                continue;
 154                            }
 0155                            List<SubResource> array = new List<SubResource>();
 0156                            foreach (var item in property0.Value.EnumerateArray())
 157                            {
 0158                                if (item.ValueKind == JsonValueKind.Null)
 159                                {
 0160                                    array.Add(null);
 161                                }
 162                                else
 163                                {
 0164                                    array.Add(DeserializeSubResource(item));
 165                                }
 166                            }
 0167                            frontendIPConfigurations = array;
 0168                            continue;
 169                        }
 0170                        if (property0.NameEquals("backendAddressPool"))
 171                        {
 0172                            if (property0.Value.ValueKind == JsonValueKind.Null)
 173                            {
 174                                continue;
 175                            }
 0176                            backendAddressPool = DeserializeSubResource(property0.Value);
 0177                            continue;
 178                        }
 0179                        if (property0.NameEquals("provisioningState"))
 180                        {
 0181                            if (property0.Value.ValueKind == JsonValueKind.Null)
 182                            {
 183                                continue;
 184                            }
 0185                            provisioningState = new ProvisioningState(property0.Value.GetString());
 0186                            continue;
 187                        }
 0188                        if (property0.NameEquals("protocol"))
 189                        {
 0190                            if (property0.Value.ValueKind == JsonValueKind.Null)
 191                            {
 192                                continue;
 193                            }
 0194                            protocol = new LoadBalancerOutboundRuleProtocol(property0.Value.GetString());
 0195                            continue;
 196                        }
 0197                        if (property0.NameEquals("enableTcpReset"))
 198                        {
 0199                            if (property0.Value.ValueKind == JsonValueKind.Null)
 200                            {
 201                                continue;
 202                            }
 0203                            enableTcpReset = property0.Value.GetBoolean();
 0204                            continue;
 205                        }
 0206                        if (property0.NameEquals("idleTimeoutInMinutes"))
 207                        {
 0208                            if (property0.Value.ValueKind == JsonValueKind.Null)
 209                            {
 210                                continue;
 211                            }
 0212                            idleTimeoutInMinutes = property0.Value.GetInt32();
 213                            continue;
 214                        }
 215                    }
 216                    continue;
 217                }
 218            }
 0219            return new OutboundRule(id, name, etag, type, allocatedOutboundPorts, frontendIPConfigurations, backendAddre
 220        }
 221    }
 222}