< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Source()-0%100%
get_Destination()-0%100%
get_AutoStart()-0%100%
get_MonitoringIntervalInSeconds()-0%100%
get_Endpoints()-0%100%
get_TestConfigurations()-0%100%
get_TestGroups()-0%100%
get_Outputs()-0%100%
get_Notes()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeConnectionMonitorParameters(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectionMonitorParameters.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> Parameters that define the operation to create a connection monitor. </summary>
 13    public partial class ConnectionMonitorParameters
 14    {
 15        /// <summary> Initializes a new instance of ConnectionMonitorParameters. </summary>
 016        public ConnectionMonitorParameters()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ConnectionMonitorParameters. </summary>
 21        /// <param name="source"> Describes the source of connection monitor. </param>
 22        /// <param name="destination"> Describes the destination of connection monitor. </param>
 23        /// <param name="autoStart"> Determines if the connection monitor will start automatically once created. </param
 24        /// <param name="monitoringIntervalInSeconds"> Monitoring interval in seconds. </param>
 25        /// <param name="endpoints"> List of connection monitor endpoints. </param>
 26        /// <param name="testConfigurations"> List of connection monitor test configurations. </param>
 27        /// <param name="testGroups"> List of connection monitor test groups. </param>
 28        /// <param name="outputs"> List of connection monitor outputs. </param>
 29        /// <param name="notes"> Optional notes to be associated with the connection monitor. </param>
 030        internal ConnectionMonitorParameters(ConnectionMonitorSource source, ConnectionMonitorDestination destination, b
 31        {
 032            Source = source;
 033            Destination = destination;
 034            AutoStart = autoStart;
 035            MonitoringIntervalInSeconds = monitoringIntervalInSeconds;
 036            Endpoints = endpoints;
 037            TestConfigurations = testConfigurations;
 038            TestGroups = testGroups;
 039            Outputs = outputs;
 040            Notes = notes;
 041        }
 42
 43        /// <summary> Describes the source of connection monitor. </summary>
 044        public ConnectionMonitorSource Source { get; set; }
 45        /// <summary> Describes the destination of connection monitor. </summary>
 046        public ConnectionMonitorDestination Destination { get; set; }
 47        /// <summary> Determines if the connection monitor will start automatically once created. </summary>
 048        public bool? AutoStart { get; set; }
 49        /// <summary> Monitoring interval in seconds. </summary>
 050        public int? MonitoringIntervalInSeconds { get; set; }
 51        /// <summary> List of connection monitor endpoints. </summary>
 052        public IList<ConnectionMonitorEndpoint> Endpoints { get; set; }
 53        /// <summary> List of connection monitor test configurations. </summary>
 054        public IList<ConnectionMonitorTestConfiguration> TestConfigurations { get; set; }
 55        /// <summary> List of connection monitor test groups. </summary>
 056        public IList<ConnectionMonitorTestGroup> TestGroups { get; set; }
 57        /// <summary> List of connection monitor outputs. </summary>
 058        public IList<ConnectionMonitorOutput> Outputs { get; set; }
 59        /// <summary> Optional notes to be associated with the connection monitor. </summary>
 060        public string Notes { get; set; }
 61    }
 62}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectionMonitorParameters.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 ConnectionMonitorParameters : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Source != null)
 20            {
 021                writer.WritePropertyName("source");
 022                writer.WriteObjectValue(Source);
 23            }
 024            if (Destination != null)
 25            {
 026                writer.WritePropertyName("destination");
 027                writer.WriteObjectValue(Destination);
 28            }
 029            if (AutoStart != null)
 30            {
 031                writer.WritePropertyName("autoStart");
 032                writer.WriteBooleanValue(AutoStart.Value);
 33            }
 034            if (MonitoringIntervalInSeconds != null)
 35            {
 036                writer.WritePropertyName("monitoringIntervalInSeconds");
 037                writer.WriteNumberValue(MonitoringIntervalInSeconds.Value);
 38            }
 039            if (Endpoints != null)
 40            {
 041                writer.WritePropertyName("endpoints");
 042                writer.WriteStartArray();
 043                foreach (var item in Endpoints)
 44                {
 045                    writer.WriteObjectValue(item);
 46                }
 047                writer.WriteEndArray();
 48            }
 049            if (TestConfigurations != null)
 50            {
 051                writer.WritePropertyName("testConfigurations");
 052                writer.WriteStartArray();
 053                foreach (var item in TestConfigurations)
 54                {
 055                    writer.WriteObjectValue(item);
 56                }
 057                writer.WriteEndArray();
 58            }
 059            if (TestGroups != null)
 60            {
 061                writer.WritePropertyName("testGroups");
 062                writer.WriteStartArray();
 063                foreach (var item in TestGroups)
 64                {
 065                    writer.WriteObjectValue(item);
 66                }
 067                writer.WriteEndArray();
 68            }
 069            if (Outputs != null)
 70            {
 071                writer.WritePropertyName("outputs");
 072                writer.WriteStartArray();
 073                foreach (var item in Outputs)
 74                {
 075                    writer.WriteObjectValue(item);
 76                }
 077                writer.WriteEndArray();
 78            }
 079            if (Notes != null)
 80            {
 081                writer.WritePropertyName("notes");
 082                writer.WriteStringValue(Notes);
 83            }
 084            writer.WriteEndObject();
 085        }
 86
 87        internal static ConnectionMonitorParameters DeserializeConnectionMonitorParameters(JsonElement element)
 88        {
 089            ConnectionMonitorSource source = default;
 090            ConnectionMonitorDestination destination = default;
 091            bool? autoStart = default;
 092            int? monitoringIntervalInSeconds = default;
 093            IList<ConnectionMonitorEndpoint> endpoints = default;
 094            IList<ConnectionMonitorTestConfiguration> testConfigurations = default;
 095            IList<ConnectionMonitorTestGroup> testGroups = default;
 096            IList<ConnectionMonitorOutput> outputs = default;
 097            string notes = default;
 098            foreach (var property in element.EnumerateObject())
 99            {
 0100                if (property.NameEquals("source"))
 101                {
 0102                    if (property.Value.ValueKind == JsonValueKind.Null)
 103                    {
 104                        continue;
 105                    }
 0106                    source = ConnectionMonitorSource.DeserializeConnectionMonitorSource(property.Value);
 0107                    continue;
 108                }
 0109                if (property.NameEquals("destination"))
 110                {
 0111                    if (property.Value.ValueKind == JsonValueKind.Null)
 112                    {
 113                        continue;
 114                    }
 0115                    destination = ConnectionMonitorDestination.DeserializeConnectionMonitorDestination(property.Value);
 0116                    continue;
 117                }
 0118                if (property.NameEquals("autoStart"))
 119                {
 0120                    if (property.Value.ValueKind == JsonValueKind.Null)
 121                    {
 122                        continue;
 123                    }
 0124                    autoStart = property.Value.GetBoolean();
 0125                    continue;
 126                }
 0127                if (property.NameEquals("monitoringIntervalInSeconds"))
 128                {
 0129                    if (property.Value.ValueKind == JsonValueKind.Null)
 130                    {
 131                        continue;
 132                    }
 0133                    monitoringIntervalInSeconds = property.Value.GetInt32();
 0134                    continue;
 135                }
 0136                if (property.NameEquals("endpoints"))
 137                {
 0138                    if (property.Value.ValueKind == JsonValueKind.Null)
 139                    {
 140                        continue;
 141                    }
 0142                    List<ConnectionMonitorEndpoint> array = new List<ConnectionMonitorEndpoint>();
 0143                    foreach (var item in property.Value.EnumerateArray())
 144                    {
 0145                        if (item.ValueKind == JsonValueKind.Null)
 146                        {
 0147                            array.Add(null);
 148                        }
 149                        else
 150                        {
 0151                            array.Add(ConnectionMonitorEndpoint.DeserializeConnectionMonitorEndpoint(item));
 152                        }
 153                    }
 0154                    endpoints = array;
 0155                    continue;
 156                }
 0157                if (property.NameEquals("testConfigurations"))
 158                {
 0159                    if (property.Value.ValueKind == JsonValueKind.Null)
 160                    {
 161                        continue;
 162                    }
 0163                    List<ConnectionMonitorTestConfiguration> array = new List<ConnectionMonitorTestConfiguration>();
 0164                    foreach (var item in property.Value.EnumerateArray())
 165                    {
 0166                        if (item.ValueKind == JsonValueKind.Null)
 167                        {
 0168                            array.Add(null);
 169                        }
 170                        else
 171                        {
 0172                            array.Add(ConnectionMonitorTestConfiguration.DeserializeConnectionMonitorTestConfiguration(i
 173                        }
 174                    }
 0175                    testConfigurations = array;
 0176                    continue;
 177                }
 0178                if (property.NameEquals("testGroups"))
 179                {
 0180                    if (property.Value.ValueKind == JsonValueKind.Null)
 181                    {
 182                        continue;
 183                    }
 0184                    List<ConnectionMonitorTestGroup> array = new List<ConnectionMonitorTestGroup>();
 0185                    foreach (var item in property.Value.EnumerateArray())
 186                    {
 0187                        if (item.ValueKind == JsonValueKind.Null)
 188                        {
 0189                            array.Add(null);
 190                        }
 191                        else
 192                        {
 0193                            array.Add(ConnectionMonitorTestGroup.DeserializeConnectionMonitorTestGroup(item));
 194                        }
 195                    }
 0196                    testGroups = array;
 0197                    continue;
 198                }
 0199                if (property.NameEquals("outputs"))
 200                {
 0201                    if (property.Value.ValueKind == JsonValueKind.Null)
 202                    {
 203                        continue;
 204                    }
 0205                    List<ConnectionMonitorOutput> array = new List<ConnectionMonitorOutput>();
 0206                    foreach (var item in property.Value.EnumerateArray())
 207                    {
 0208                        if (item.ValueKind == JsonValueKind.Null)
 209                        {
 0210                            array.Add(null);
 211                        }
 212                        else
 213                        {
 0214                            array.Add(ConnectionMonitorOutput.DeserializeConnectionMonitorOutput(item));
 215                        }
 216                    }
 0217                    outputs = array;
 0218                    continue;
 219                }
 0220                if (property.NameEquals("notes"))
 221                {
 0222                    if (property.Value.ValueKind == JsonValueKind.Null)
 223                    {
 224                        continue;
 225                    }
 0226                    notes = property.Value.GetString();
 227                    continue;
 228                }
 229            }
 0230            return new ConnectionMonitorParameters(source, destination, autoStart, monitoringIntervalInSeconds, endpoint
 231        }
 232    }
 233}