< Summary

Class:Azure.ResourceManager.Network.Models.PacketCapture
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PacketCapture.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PacketCapture.Serialization.cs
Covered lines:22
Uncovered lines:25
Coverable lines:47
Total lines:117
Line coverage:46.8% (22 of 47)
Covered branches:6
Total branches:14
Branch coverage:42.8% (6 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-75%50%
.ctor(...)-0%100%
get_Target()-100%100%
get_BytesToCapturePerPacket()-0%100%
get_TotalBytesPerSession()-0%100%
get_TimeLimitInSeconds()-0%100%
get_StorageLocation()-100%100%
get_Filters()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-56%40%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PacketCapture.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;
 9using System.Collections.Generic;
 10
 11namespace Azure.ResourceManager.Network.Models
 12{
 13    /// <summary> Parameters that define the create packet capture operation. </summary>
 14    public partial class PacketCapture
 15    {
 16        /// <summary> Initializes a new instance of PacketCapture. </summary>
 17        /// <param name="target"> The ID of the targeted resource, only VM is currently supported. </param>
 18        /// <param name="storageLocation"> The storage location for a packet capture session. </param>
 419        public PacketCapture(string target, PacketCaptureStorageLocation storageLocation)
 20        {
 421            if (target == null)
 22            {
 023                throw new ArgumentNullException(nameof(target));
 24            }
 425            if (storageLocation == null)
 26            {
 027                throw new ArgumentNullException(nameof(storageLocation));
 28            }
 29
 430            Target = target;
 431            StorageLocation = storageLocation;
 432        }
 33
 34        /// <summary> Initializes a new instance of PacketCapture. </summary>
 35        /// <param name="target"> The ID of the targeted resource, only VM is currently supported. </param>
 36        /// <param name="bytesToCapturePerPacket"> Number of bytes captured per packet, the remaining bytes are truncate
 37        /// <param name="totalBytesPerSession"> Maximum size of the capture output. </param>
 38        /// <param name="timeLimitInSeconds"> Maximum duration of the capture session in seconds. </param>
 39        /// <param name="storageLocation"> The storage location for a packet capture session. </param>
 40        /// <param name="filters"> A list of packet capture filters. </param>
 041        internal PacketCapture(string target, int? bytesToCapturePerPacket, int? totalBytesPerSession, int? timeLimitInS
 42        {
 043            Target = target;
 044            BytesToCapturePerPacket = bytesToCapturePerPacket;
 045            TotalBytesPerSession = totalBytesPerSession;
 046            TimeLimitInSeconds = timeLimitInSeconds;
 047            StorageLocation = storageLocation;
 048            Filters = filters;
 049        }
 50
 51        /// <summary> The ID of the targeted resource, only VM is currently supported. </summary>
 1652        public string Target { get; }
 53        /// <summary> Number of bytes captured per packet, the remaining bytes are truncated. </summary>
 054        public int? BytesToCapturePerPacket { get; set; }
 55        /// <summary> Maximum size of the capture output. </summary>
 056        public int? TotalBytesPerSession { get; set; }
 57        /// <summary> Maximum duration of the capture session in seconds. </summary>
 058        public int? TimeLimitInSeconds { get; set; }
 59        /// <summary> The storage location for a packet capture session. </summary>
 1660        public PacketCaptureStorageLocation StorageLocation { get; }
 61        /// <summary> A list of packet capture filters. </summary>
 062        public IList<PacketCaptureFilter> Filters { get; set; }
 63    }
 64}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PacketCapture.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 PacketCapture : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 1617            writer.WriteStartObject();
 1618            writer.WritePropertyName("properties");
 1619            writer.WriteStartObject();
 1620            writer.WritePropertyName("target");
 1621            writer.WriteStringValue(Target);
 1622            if (BytesToCapturePerPacket != null)
 23            {
 024                writer.WritePropertyName("bytesToCapturePerPacket");
 025                writer.WriteNumberValue(BytesToCapturePerPacket.Value);
 26            }
 1627            if (TotalBytesPerSession != null)
 28            {
 029                writer.WritePropertyName("totalBytesPerSession");
 030                writer.WriteNumberValue(TotalBytesPerSession.Value);
 31            }
 1632            if (TimeLimitInSeconds != null)
 33            {
 034                writer.WritePropertyName("timeLimitInSeconds");
 035                writer.WriteNumberValue(TimeLimitInSeconds.Value);
 36            }
 1637            writer.WritePropertyName("storageLocation");
 1638            writer.WriteObjectValue(StorageLocation);
 1639            if (Filters != null)
 40            {
 041                writer.WritePropertyName("filters");
 042                writer.WriteStartArray();
 043                foreach (var item in Filters)
 44                {
 045                    writer.WriteObjectValue(item);
 46                }
 047                writer.WriteEndArray();
 48            }
 1649            writer.WriteEndObject();
 1650            writer.WriteEndObject();
 1651        }
 52    }
 53}