< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Protocol()-0%100%
get_LocalIPAddress()-0%100%
get_RemoteIPAddress()-0%100%
get_LocalPort()-0%100%
get_RemotePort()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializePacketCaptureFilter(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PacketCaptureFilter.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> Filter that is applied to packet capture request. Multiple filters can be applied. </summary>
 11    public partial class PacketCaptureFilter
 12    {
 13        /// <summary> Initializes a new instance of PacketCaptureFilter. </summary>
 014        public PacketCaptureFilter()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of PacketCaptureFilter. </summary>
 19        /// <param name="protocol"> Protocol to be filtered on. </param>
 20        /// <param name="localIPAddress"> Local IP Address to be filtered on. Notation: &quot;127.0.0.1&quot; for single
 21        /// <param name="remoteIPAddress"> Local IP Address to be filtered on. Notation: &quot;127.0.0.1&quot; for singl
 22        /// <param name="localPort"> Local port to be filtered on. Notation: &quot;80&quot; for single port entry.&quot;
 23        /// <param name="remotePort"> Remote port to be filtered on. Notation: &quot;80&quot; for single port entry.&quo
 024        internal PacketCaptureFilter(PcProtocol? protocol, string localIPAddress, string remoteIPAddress, string localPo
 25        {
 026            Protocol = protocol;
 027            LocalIPAddress = localIPAddress;
 028            RemoteIPAddress = remoteIPAddress;
 029            LocalPort = localPort;
 030            RemotePort = remotePort;
 031        }
 32
 33        /// <summary> Protocol to be filtered on. </summary>
 034        public PcProtocol? Protocol { get; set; }
 35        /// <summary> Local IP Address to be filtered on. Notation: &quot;127.0.0.1&quot; for single address entry. &quo
 036        public string LocalIPAddress { get; set; }
 37        /// <summary> Local IP Address to be filtered on. Notation: &quot;127.0.0.1&quot; for single address entry. &quo
 038        public string RemoteIPAddress { get; set; }
 39        /// <summary> Local port to be filtered on. Notation: &quot;80&quot; for single port entry.&quot;80-85&quot; for
 040        public string LocalPort { get; set; }
 41        /// <summary> Remote port to be filtered on. Notation: &quot;80&quot; for single port entry.&quot;80-85&quot; fo
 042        public string RemotePort { get; set; }
 43    }
 44}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PacketCaptureFilter.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 PacketCaptureFilter : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (Protocol != null)
 19            {
 020                writer.WritePropertyName("protocol");
 021                writer.WriteStringValue(Protocol.Value.ToString());
 22            }
 023            if (LocalIPAddress != null)
 24            {
 025                writer.WritePropertyName("localIPAddress");
 026                writer.WriteStringValue(LocalIPAddress);
 27            }
 028            if (RemoteIPAddress != null)
 29            {
 030                writer.WritePropertyName("remoteIPAddress");
 031                writer.WriteStringValue(RemoteIPAddress);
 32            }
 033            if (LocalPort != null)
 34            {
 035                writer.WritePropertyName("localPort");
 036                writer.WriteStringValue(LocalPort);
 37            }
 038            if (RemotePort != null)
 39            {
 040                writer.WritePropertyName("remotePort");
 041                writer.WriteStringValue(RemotePort);
 42            }
 043            writer.WriteEndObject();
 044        }
 45
 46        internal static PacketCaptureFilter DeserializePacketCaptureFilter(JsonElement element)
 47        {
 048            PcProtocol? protocol = default;
 049            string localIPAddress = default;
 050            string remoteIPAddress = default;
 051            string localPort = default;
 052            string remotePort = default;
 053            foreach (var property in element.EnumerateObject())
 54            {
 055                if (property.NameEquals("protocol"))
 56                {
 057                    if (property.Value.ValueKind == JsonValueKind.Null)
 58                    {
 59                        continue;
 60                    }
 061                    protocol = new PcProtocol(property.Value.GetString());
 062                    continue;
 63                }
 064                if (property.NameEquals("localIPAddress"))
 65                {
 066                    if (property.Value.ValueKind == JsonValueKind.Null)
 67                    {
 68                        continue;
 69                    }
 070                    localIPAddress = property.Value.GetString();
 071                    continue;
 72                }
 073                if (property.NameEquals("remoteIPAddress"))
 74                {
 075                    if (property.Value.ValueKind == JsonValueKind.Null)
 76                    {
 77                        continue;
 78                    }
 079                    remoteIPAddress = property.Value.GetString();
 080                    continue;
 81                }
 082                if (property.NameEquals("localPort"))
 83                {
 084                    if (property.Value.ValueKind == JsonValueKind.Null)
 85                    {
 86                        continue;
 87                    }
 088                    localPort = property.Value.GetString();
 089                    continue;
 90                }
 091                if (property.NameEquals("remotePort"))
 92                {
 093                    if (property.Value.ValueKind == JsonValueKind.Null)
 94                    {
 95                        continue;
 96                    }
 097                    remotePort = property.Value.GetString();
 98                    continue;
 99                }
 100            }
 0101            return new PacketCaptureFilter(protocol, localIPAddress, remoteIPAddress, localPort, remotePort);
 102        }
 103    }
 104}