< Summary

Class:Azure.ResourceManager.Network.Models.PacketCaptureResult
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PacketCaptureResult.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PacketCaptureResult.Serialization.cs
Covered lines:72
Uncovered lines:10
Coverable lines:82
Total lines:209
Line coverage:87.8% (72 of 82)
Covered branches:47
Total branches:50
Branch coverage:94% (47 of 50)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Name()-100%100%
get_Id()-0%100%
get_Etag()-0%100%
get_Target()-0%100%
get_BytesToCapturePerPacket()-100%100%
get_TotalBytesPerSession()-100%100%
get_TimeLimitInSeconds()-100%100%
get_StorageLocation()-100%100%
get_Filters()-0%100%
get_ProvisioningState()-100%100%
DeserializePacketCaptureResult(...)-93.1%94%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PacketCaptureResult.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> Information about packet capture session. </summary>
 13    public partial class PacketCaptureResult
 14    {
 15        /// <summary> Initializes a new instance of PacketCaptureResult. </summary>
 016        internal PacketCaptureResult()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of PacketCaptureResult. </summary>
 21        /// <param name="name"> Name of the packet capture session. </param>
 22        /// <param name="id"> ID of the packet capture operation. </param>
 23        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 24        /// <param name="target"> The ID of the targeted resource, only VM is currently supported. </param>
 25        /// <param name="bytesToCapturePerPacket"> Number of bytes captured per packet, the remaining bytes are truncate
 26        /// <param name="totalBytesPerSession"> Maximum size of the capture output. </param>
 27        /// <param name="timeLimitInSeconds"> Maximum duration of the capture session in seconds. </param>
 28        /// <param name="storageLocation"> The storage location for a packet capture session. </param>
 29        /// <param name="filters"> A list of packet capture filters. </param>
 30        /// <param name="provisioningState"> The provisioning state of the packet capture session. </param>
 2031        internal PacketCaptureResult(string name, string id, string etag, string target, int? bytesToCapturePerPacket, i
 32        {
 2033            Name = name;
 2034            Id = id;
 2035            Etag = etag;
 2036            Target = target;
 2037            BytesToCapturePerPacket = bytesToCapturePerPacket;
 2038            TotalBytesPerSession = totalBytesPerSession;
 2039            TimeLimitInSeconds = timeLimitInSeconds;
 2040            StorageLocation = storageLocation;
 2041            Filters = filters;
 2042            ProvisioningState = provisioningState;
 2043        }
 44
 45        /// <summary> Name of the packet capture session. </summary>
 446        public string Name { get; }
 47        /// <summary> ID of the packet capture operation. </summary>
 048        public string Id { get; }
 49        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 050        public string Etag { get; }
 51        /// <summary> The ID of the targeted resource, only VM is currently supported. </summary>
 052        public string Target { get; }
 53        /// <summary> Number of bytes captured per packet, the remaining bytes are truncated. </summary>
 454        public int? BytesToCapturePerPacket { get; }
 55        /// <summary> Maximum size of the capture output. </summary>
 456        public int? TotalBytesPerSession { get; }
 57        /// <summary> Maximum duration of the capture session in seconds. </summary>
 458        public int? TimeLimitInSeconds { get; }
 59        /// <summary> The storage location for a packet capture session. </summary>
 460        public PacketCaptureStorageLocation StorageLocation { get; }
 61        /// <summary> A list of packet capture filters. </summary>
 062        public IReadOnlyList<PacketCaptureFilter> Filters { get; }
 63        /// <summary> The provisioning state of the packet capture session. </summary>
 464        public ProvisioningState? ProvisioningState { get; }
 65    }
 66}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PacketCaptureResult.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 PacketCaptureResult
 15    {
 16        internal static PacketCaptureResult DeserializePacketCaptureResult(JsonElement element)
 17        {
 2018            string name = default;
 2019            string id = default;
 2020            string etag = default;
 2021            string target = default;
 2022            int? bytesToCapturePerPacket = default;
 2023            int? totalBytesPerSession = default;
 2024            int? timeLimitInSeconds = default;
 2025            PacketCaptureStorageLocation storageLocation = default;
 2026            IReadOnlyList<PacketCaptureFilter> filters = default;
 2027            ProvisioningState? provisioningState = default;
 24028            foreach (var property in element.EnumerateObject())
 29            {
 10030                if (property.NameEquals("name"))
 31                {
 2032                    if (property.Value.ValueKind == JsonValueKind.Null)
 33                    {
 34                        continue;
 35                    }
 2036                    name = property.Value.GetString();
 2037                    continue;
 38                }
 8039                if (property.NameEquals("id"))
 40                {
 2041                    if (property.Value.ValueKind == JsonValueKind.Null)
 42                    {
 43                        continue;
 44                    }
 2045                    id = property.Value.GetString();
 2046                    continue;
 47                }
 6048                if (property.NameEquals("etag"))
 49                {
 2050                    if (property.Value.ValueKind == JsonValueKind.Null)
 51                    {
 52                        continue;
 53                    }
 2054                    etag = property.Value.GetString();
 2055                    continue;
 56                }
 4057                if (property.NameEquals("properties"))
 58                {
 32859                    foreach (var property0 in property.Value.EnumerateObject())
 60                    {
 14461                        if (property0.NameEquals("target"))
 62                        {
 2063                            if (property0.Value.ValueKind == JsonValueKind.Null)
 64                            {
 65                                continue;
 66                            }
 2067                            target = property0.Value.GetString();
 2068                            continue;
 69                        }
 12470                        if (property0.NameEquals("bytesToCapturePerPacket"))
 71                        {
 2072                            if (property0.Value.ValueKind == JsonValueKind.Null)
 73                            {
 74                                continue;
 75                            }
 2076                            bytesToCapturePerPacket = property0.Value.GetInt32();
 2077                            continue;
 78                        }
 10479                        if (property0.NameEquals("totalBytesPerSession"))
 80                        {
 2081                            if (property0.Value.ValueKind == JsonValueKind.Null)
 82                            {
 83                                continue;
 84                            }
 2085                            totalBytesPerSession = property0.Value.GetInt32();
 2086                            continue;
 87                        }
 8488                        if (property0.NameEquals("timeLimitInSeconds"))
 89                        {
 2090                            if (property0.Value.ValueKind == JsonValueKind.Null)
 91                            {
 92                                continue;
 93                            }
 2094                            timeLimitInSeconds = property0.Value.GetInt32();
 2095                            continue;
 96                        }
 6497                        if (property0.NameEquals("storageLocation"))
 98                        {
 2099                            if (property0.Value.ValueKind == JsonValueKind.Null)
 100                            {
 101                                continue;
 102                            }
 20103                            storageLocation = PacketCaptureStorageLocation.DeserializePacketCaptureStorageLocation(prope
 20104                            continue;
 105                        }
 44106                        if (property0.NameEquals("filters"))
 107                        {
 20108                            if (property0.Value.ValueKind == JsonValueKind.Null)
 109                            {
 110                                continue;
 111                            }
 20112                            List<PacketCaptureFilter> array = new List<PacketCaptureFilter>();
 0113                            foreach (var item in property0.Value.EnumerateArray())
 114                            {
 0115                                if (item.ValueKind == JsonValueKind.Null)
 116                                {
 0117                                    array.Add(null);
 118                                }
 119                                else
 120                                {
 0121                                    array.Add(PacketCaptureFilter.DeserializePacketCaptureFilter(item));
 122                                }
 123                            }
 20124                            filters = array;
 20125                            continue;
 126                        }
 24127                        if (property0.NameEquals("provisioningState"))
 128                        {
 20129                            if (property0.Value.ValueKind == JsonValueKind.Null)
 130                            {
 131                                continue;
 132                            }
 20133                            provisioningState = new ProvisioningState(property0.Value.GetString());
 134                            continue;
 135                        }
 136                    }
 137                    continue;
 138                }
 139            }
 20140            return new PacketCaptureResult(name, id, etag, target, bytesToCapturePerPacket, totalBytesPerSession, timeLi
 141        }
 142    }
 143}