< Summary

Class:Azure.ResourceManager.Network.Models.Probe
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\Probe.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\Probe.Serialization.cs
Covered lines:115
Uncovered lines:14
Coverable lines:129
Total lines:289
Line coverage:89.1% (115 of 129)
Covered branches:70
Total branches:78
Branch coverage:89.7% (70 of 78)

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_LoadBalancingRules()-100%100%
get_Protocol()-100%100%
get_Port()-100%100%
get_IntervalInSeconds()-100%100%
get_NumberOfProbes()-100%100%
get_RequestPath()-100%100%
get_ProvisioningState()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-69.05%70.83%
DeserializeProbe(...)-98.41%98.15%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\Probe.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> A load balancer probe. </summary>
 13    public partial class Probe : SubResource
 14    {
 15        /// <summary> Initializes a new instance of Probe. </summary>
 2816        public Probe()
 17        {
 2818        }
 19
 20        /// <summary> Initializes a new instance of Probe. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> The name of the resource that is unique within the set of probes used by the load balanc
 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="loadBalancingRules"> The load balancer rules that use this probe. </param>
 26        /// <param name="protocol"> The protocol of the end point. If &apos;Tcp&apos; is specified, a received ACK is re
 27        /// <param name="port"> The port for communicating the probe. Possible values range from 1 to 65535, inclusive. 
 28        /// <param name="intervalInSeconds"> The interval, in seconds, for how frequently to probe the endpoint for heal
 29        /// <param name="numberOfProbes"> The number of probes where if no response, will result in stopping further tra
 30        /// <param name="requestPath"> The URI used for requesting health status from the VM. Path is required if a prot
 31        /// <param name="provisioningState"> The provisioning state of the probe resource. </param>
 11232        internal Probe(string id, string name, string etag, string type, IList<SubResource> loadBalancingRules, ProbePro
 33        {
 11234            Name = name;
 11235            Etag = etag;
 11236            Type = type;
 11237            LoadBalancingRules = loadBalancingRules;
 11238            Protocol = protocol;
 11239            Port = port;
 11240            IntervalInSeconds = intervalInSeconds;
 11241            NumberOfProbes = numberOfProbes;
 11242            RequestPath = requestPath;
 11243            ProvisioningState = provisioningState;
 11244        }
 45
 46        /// <summary> The name of the resource that is unique within the set of probes used by the load balancer. This n
 30847        public string Name { get; set; }
 48        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 8049        public string Etag { get; }
 50        /// <summary> Type of the resource. </summary>
 7251        public string Type { get; }
 52        /// <summary> The load balancer rules that use this probe. </summary>
 7253        public IList<SubResource> LoadBalancingRules { get; }
 54        /// <summary> The protocol of the end point. If &apos;Tcp&apos; is specified, a received ACK is required for the
 28455        public ProbeProtocol? Protocol { get; set; }
 56        /// <summary> The port for communicating the probe. Possible values range from 1 to 65535, inclusive. </summary>
 28457        public int? Port { get; set; }
 58        /// <summary> The interval, in seconds, for how frequently to probe the endpoint for health status. Typically, t
 28459        public int? IntervalInSeconds { get; set; }
 60        /// <summary> The number of probes where if no response, will result in stopping further traffic from being deli
 28461        public int? NumberOfProbes { get; set; }
 62        /// <summary> The URI used for requesting health status from the VM. Path is required if a protocol is set to ht
 28463        public string RequestPath { get; set; }
 64        /// <summary> The provisioning state of the probe resource. </summary>
 8865        public ProvisioningState? ProvisioningState { get; }
 66    }
 67}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\Probe.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 Probe : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 7218            writer.WriteStartObject();
 7219            if (Name != null)
 20            {
 7221                writer.WritePropertyName("name");
 7222                writer.WriteStringValue(Name);
 23            }
 7224            if (Etag != null)
 25            {
 026                writer.WritePropertyName("etag");
 027                writer.WriteStringValue(Etag);
 28            }
 7229            if (Type != null)
 30            {
 031                writer.WritePropertyName("type");
 032                writer.WriteStringValue(Type);
 33            }
 7234            if (Id != null)
 35            {
 036                writer.WritePropertyName("id");
 037                writer.WriteStringValue(Id);
 38            }
 7239            writer.WritePropertyName("properties");
 7240            writer.WriteStartObject();
 7241            if (LoadBalancingRules != null)
 42            {
 043                writer.WritePropertyName("loadBalancingRules");
 044                writer.WriteStartArray();
 045                foreach (var item in LoadBalancingRules)
 46                {
 047                    writer.WriteObjectValue(item);
 48                }
 049                writer.WriteEndArray();
 50            }
 7251            if (Protocol != null)
 52            {
 7253                writer.WritePropertyName("protocol");
 7254                writer.WriteStringValue(Protocol.Value.ToString());
 55            }
 7256            if (Port != null)
 57            {
 7258                writer.WritePropertyName("port");
 7259                writer.WriteNumberValue(Port.Value);
 60            }
 7261            if (IntervalInSeconds != null)
 62            {
 7263                writer.WritePropertyName("intervalInSeconds");
 7264                writer.WriteNumberValue(IntervalInSeconds.Value);
 65            }
 7266            if (NumberOfProbes != null)
 67            {
 7268                writer.WritePropertyName("numberOfProbes");
 7269                writer.WriteNumberValue(NumberOfProbes.Value);
 70            }
 7271            if (RequestPath != null)
 72            {
 7273                writer.WritePropertyName("requestPath");
 7274                writer.WriteStringValue(RequestPath);
 75            }
 7276            if (ProvisioningState != null)
 77            {
 078                writer.WritePropertyName("provisioningState");
 079                writer.WriteStringValue(ProvisioningState.Value.ToString());
 80            }
 7281            writer.WriteEndObject();
 7282            writer.WriteEndObject();
 7283        }
 84
 85        internal static Probe DeserializeProbe(JsonElement element)
 86        {
 11287            string name = default;
 11288            string etag = default;
 11289            string type = default;
 11290            string id = default;
 11291            IList<SubResource> loadBalancingRules = default;
 11292            ProbeProtocol? protocol = default;
 11293            int? port = default;
 11294            int? intervalInSeconds = default;
 11295            int? numberOfProbes = default;
 11296            string requestPath = default;
 11297            ProvisioningState? provisioningState = default;
 134498            foreach (var property in element.EnumerateObject())
 99            {
 560100                if (property.NameEquals("name"))
 101                {
 112102                    if (property.Value.ValueKind == JsonValueKind.Null)
 103                    {
 104                        continue;
 105                    }
 112106                    name = property.Value.GetString();
 112107                    continue;
 108                }
 448109                if (property.NameEquals("etag"))
 110                {
 112111                    if (property.Value.ValueKind == JsonValueKind.Null)
 112                    {
 113                        continue;
 114                    }
 112115                    etag = property.Value.GetString();
 112116                    continue;
 117                }
 336118                if (property.NameEquals("type"))
 119                {
 112120                    if (property.Value.ValueKind == JsonValueKind.Null)
 121                    {
 122                        continue;
 123                    }
 112124                    type = property.Value.GetString();
 112125                    continue;
 126                }
 224127                if (property.NameEquals("id"))
 128                {
 112129                    if (property.Value.ValueKind == JsonValueKind.Null)
 130                    {
 131                        continue;
 132                    }
 112133                    id = property.Value.GetString();
 112134                    continue;
 135                }
 112136                if (property.NameEquals("properties"))
 137                {
 1792138                    foreach (var property0 in property.Value.EnumerateObject())
 139                    {
 784140                        if (property0.NameEquals("loadBalancingRules"))
 141                        {
 112142                            if (property0.Value.ValueKind == JsonValueKind.Null)
 143                            {
 144                                continue;
 145                            }
 112146                            List<SubResource> array = new List<SubResource>();
 448147                            foreach (var item in property0.Value.EnumerateArray())
 148                            {
 112149                                if (item.ValueKind == JsonValueKind.Null)
 150                                {
 0151                                    array.Add(null);
 152                                }
 153                                else
 154                                {
 112155                                    array.Add(DeserializeSubResource(item));
 156                                }
 157                            }
 112158                            loadBalancingRules = array;
 112159                            continue;
 160                        }
 672161                        if (property0.NameEquals("protocol"))
 162                        {
 112163                            if (property0.Value.ValueKind == JsonValueKind.Null)
 164                            {
 165                                continue;
 166                            }
 112167                            protocol = new ProbeProtocol(property0.Value.GetString());
 112168                            continue;
 169                        }
 560170                        if (property0.NameEquals("port"))
 171                        {
 112172                            if (property0.Value.ValueKind == JsonValueKind.Null)
 173                            {
 174                                continue;
 175                            }
 112176                            port = property0.Value.GetInt32();
 112177                            continue;
 178                        }
 448179                        if (property0.NameEquals("intervalInSeconds"))
 180                        {
 112181                            if (property0.Value.ValueKind == JsonValueKind.Null)
 182                            {
 183                                continue;
 184                            }
 112185                            intervalInSeconds = property0.Value.GetInt32();
 112186                            continue;
 187                        }
 336188                        if (property0.NameEquals("numberOfProbes"))
 189                        {
 112190                            if (property0.Value.ValueKind == JsonValueKind.Null)
 191                            {
 192                                continue;
 193                            }
 112194                            numberOfProbes = property0.Value.GetInt32();
 112195                            continue;
 196                        }
 224197                        if (property0.NameEquals("requestPath"))
 198                        {
 112199                            if (property0.Value.ValueKind == JsonValueKind.Null)
 200                            {
 201                                continue;
 202                            }
 112203                            requestPath = property0.Value.GetString();
 112204                            continue;
 205                        }
 112206                        if (property0.NameEquals("provisioningState"))
 207                        {
 112208                            if (property0.Value.ValueKind == JsonValueKind.Null)
 209                            {
 210                                continue;
 211                            }
 112212                            provisioningState = new ProvisioningState(property0.Value.GetString());
 213                            continue;
 214                        }
 215                    }
 216                    continue;
 217                }
 218            }
 112219            return new Probe(id, name, etag, type, loadBalancingRules, protocol, port, intervalInSeconds, numberOfProbes
 220        }
 221    }
 222}