< Summary

Class:Azure.ResourceManager.Network.Models.PacketCaptureQueryStatusResult
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PacketCaptureQueryStatusResult.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PacketCaptureQueryStatusResult.Serialization.cs
Covered lines:42
Uncovered lines:8
Coverable lines:50
Total lines:141
Line coverage:84% (42 of 50)
Covered branches:27
Total branches:28
Branch coverage:96.4% (27 of 28)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Name()-0%100%
get_Id()-0%100%
get_CaptureStartTime()-0%100%
get_PacketCaptureStatus()-100%100%
get_StopReason()-100%100%
get_PacketCaptureError()-0%100%
DeserializePacketCaptureQueryStatusResult(...)-94.12%96.43%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PacketCaptureQueryStatusResult.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> Status of packet capture session. </summary>
 14    public partial class PacketCaptureQueryStatusResult
 15    {
 16        /// <summary> Initializes a new instance of PacketCaptureQueryStatusResult. </summary>
 017        internal PacketCaptureQueryStatusResult()
 18        {
 019        }
 20
 21        /// <summary> Initializes a new instance of PacketCaptureQueryStatusResult. </summary>
 22        /// <param name="name"> The name of the packet capture resource. </param>
 23        /// <param name="id"> The ID of the packet capture resource. </param>
 24        /// <param name="captureStartTime"> The start time of the packet capture session. </param>
 25        /// <param name="packetCaptureStatus"> The status of the packet capture session. </param>
 26        /// <param name="stopReason"> The reason the current packet capture session was stopped. </param>
 27        /// <param name="packetCaptureError"> List of errors of packet capture session. </param>
 828        internal PacketCaptureQueryStatusResult(string name, string id, DateTimeOffset? captureStartTime, PcStatus? pack
 29        {
 830            Name = name;
 831            Id = id;
 832            CaptureStartTime = captureStartTime;
 833            PacketCaptureStatus = packetCaptureStatus;
 834            StopReason = stopReason;
 835            PacketCaptureError = packetCaptureError;
 836        }
 37
 38        /// <summary> The name of the packet capture resource. </summary>
 039        public string Name { get; }
 40        /// <summary> The ID of the packet capture resource. </summary>
 041        public string Id { get; }
 42        /// <summary> The start time of the packet capture session. </summary>
 043        public DateTimeOffset? CaptureStartTime { get; }
 44        /// <summary> The status of the packet capture session. </summary>
 445        public PcStatus? PacketCaptureStatus { get; }
 46        /// <summary> The reason the current packet capture session was stopped. </summary>
 447        public string StopReason { get; }
 48        /// <summary> List of errors of packet capture session. </summary>
 049        public IReadOnlyList<PcError> PacketCaptureError { get; }
 50    }
 51}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PacketCaptureQueryStatusResult.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;
 9using System.Collections.Generic;
 10using System.Text.Json;
 11using Azure.Core;
 12
 13namespace Azure.ResourceManager.Network.Models
 14{
 15    public partial class PacketCaptureQueryStatusResult
 16    {
 17        internal static PacketCaptureQueryStatusResult DeserializePacketCaptureQueryStatusResult(JsonElement element)
 18        {
 819            string name = default;
 820            string id = default;
 821            DateTimeOffset? captureStartTime = default;
 822            PcStatus? packetCaptureStatus = default;
 823            string stopReason = default;
 824            IReadOnlyList<PcError> packetCaptureError = default;
 10425            foreach (var property in element.EnumerateObject())
 26            {
 4427                if (property.NameEquals("name"))
 28                {
 829                    if (property.Value.ValueKind == JsonValueKind.Null)
 30                    {
 31                        continue;
 32                    }
 833                    name = property.Value.GetString();
 834                    continue;
 35                }
 3636                if (property.NameEquals("id"))
 37                {
 838                    if (property.Value.ValueKind == JsonValueKind.Null)
 39                    {
 40                        continue;
 41                    }
 842                    id = property.Value.GetString();
 843                    continue;
 44                }
 2845                if (property.NameEquals("captureStartTime"))
 46                {
 847                    if (property.Value.ValueKind == JsonValueKind.Null)
 48                    {
 49                        continue;
 50                    }
 851                    captureStartTime = property.Value.GetDateTimeOffset("O");
 852                    continue;
 53                }
 2054                if (property.NameEquals("packetCaptureStatus"))
 55                {
 856                    if (property.Value.ValueKind == JsonValueKind.Null)
 57                    {
 58                        continue;
 59                    }
 860                    packetCaptureStatus = new PcStatus(property.Value.GetString());
 861                    continue;
 62                }
 1263                if (property.NameEquals("stopReason"))
 64                {
 465                    if (property.Value.ValueKind == JsonValueKind.Null)
 66                    {
 67                        continue;
 68                    }
 469                    stopReason = property.Value.GetString();
 470                    continue;
 71                }
 872                if (property.NameEquals("packetCaptureError"))
 73                {
 874                    if (property.Value.ValueKind == JsonValueKind.Null)
 75                    {
 76                        continue;
 77                    }
 878                    List<PcError> array = new List<PcError>();
 079                    foreach (var item in property.Value.EnumerateArray())
 80                    {
 081                        array.Add(new PcError(item.GetString()));
 82                    }
 883                    packetCaptureError = array;
 84                    continue;
 85                }
 86            }
 887            return new PacketCaptureQueryStatusResult(name, id, captureStartTime, packetCaptureStatus, stopReason, packe
 88        }
 89    }
 90}