< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
get_Direction()-0%100%
get_Protocol()-0%100%
get_Source()-0%100%
get_Destination()-0%100%
get_DestinationPort()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%100%
DeserializeNetworkConfigurationDiagnosticProfile(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NetworkConfigurationDiagnosticProfile.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;
 9
 10namespace Azure.ResourceManager.Network.Models
 11{
 12    /// <summary> Parameters to compare with network configuration. </summary>
 13    public partial class NetworkConfigurationDiagnosticProfile
 14    {
 15        /// <summary> Initializes a new instance of NetworkConfigurationDiagnosticProfile. </summary>
 16        /// <param name="direction"> The direction of the traffic. </param>
 17        /// <param name="protocol"> Protocol to be verified on. Accepted values are &apos;*&apos;, TCP, UDP. </param>
 18        /// <param name="source"> Traffic source. Accepted values are &apos;*&apos;, IP Address/CIDR, Service Tag. </par
 19        /// <param name="destination"> Traffic destination. Accepted values are: &apos;*&apos;, IP Address/CIDR, Service
 20        /// <param name="destinationPort"> Traffic destination port. Accepted values are &apos;*&apos; and a single port
 021        public NetworkConfigurationDiagnosticProfile(Direction direction, string protocol, string source, string destina
 22        {
 023            if (protocol == null)
 24            {
 025                throw new ArgumentNullException(nameof(protocol));
 26            }
 027            if (source == null)
 28            {
 029                throw new ArgumentNullException(nameof(source));
 30            }
 031            if (destination == null)
 32            {
 033                throw new ArgumentNullException(nameof(destination));
 34            }
 035            if (destinationPort == null)
 36            {
 037                throw new ArgumentNullException(nameof(destinationPort));
 38            }
 39
 040            Direction = direction;
 041            Protocol = protocol;
 042            Source = source;
 043            Destination = destination;
 044            DestinationPort = destinationPort;
 045        }
 46
 47        /// <summary> The direction of the traffic. </summary>
 048        public Direction Direction { get; set; }
 49        /// <summary> Protocol to be verified on. Accepted values are &apos;*&apos;, TCP, UDP. </summary>
 050        public string Protocol { get; set; }
 51        /// <summary> Traffic source. Accepted values are &apos;*&apos;, IP Address/CIDR, Service Tag. </summary>
 052        public string Source { get; set; }
 53        /// <summary> Traffic destination. Accepted values are: &apos;*&apos;, IP Address/CIDR, Service Tag. </summary>
 054        public string Destination { get; set; }
 55        /// <summary> Traffic destination port. Accepted values are &apos;*&apos; and a single port in the range (0 - 65
 056        public string DestinationPort { get; set; }
 57    }
 58}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NetworkConfigurationDiagnosticProfile.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 NetworkConfigurationDiagnosticProfile : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("direction");
 019            writer.WriteStringValue(Direction.ToString());
 020            writer.WritePropertyName("protocol");
 021            writer.WriteStringValue(Protocol);
 022            writer.WritePropertyName("source");
 023            writer.WriteStringValue(Source);
 024            writer.WritePropertyName("destination");
 025            writer.WriteStringValue(Destination);
 026            writer.WritePropertyName("destinationPort");
 027            writer.WriteStringValue(DestinationPort);
 028            writer.WriteEndObject();
 029        }
 30
 31        internal static NetworkConfigurationDiagnosticProfile DeserializeNetworkConfigurationDiagnosticProfile(JsonEleme
 32        {
 033            Direction direction = default;
 034            string protocol = default;
 035            string source = default;
 036            string destination = default;
 037            string destinationPort = default;
 038            foreach (var property in element.EnumerateObject())
 39            {
 040                if (property.NameEquals("direction"))
 41                {
 042                    direction = new Direction(property.Value.GetString());
 043                    continue;
 44                }
 045                if (property.NameEquals("protocol"))
 46                {
 047                    protocol = property.Value.GetString();
 048                    continue;
 49                }
 050                if (property.NameEquals("source"))
 51                {
 052                    source = property.Value.GetString();
 053                    continue;
 54                }
 055                if (property.NameEquals("destination"))
 56                {
 057                    destination = property.Value.GetString();
 058                    continue;
 59                }
 060                if (property.NameEquals("destinationPort"))
 61                {
 062                    destinationPort = property.Value.GetString();
 63                    continue;
 64                }
 65            }
 066            return new NetworkConfigurationDiagnosticProfile(direction, protocol, source, destination, destinationPort);
 67        }
 68    }
 69}