< Summary

Class:Azure.ResourceManager.Network.Models.PacketCaptureStorageLocation
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PacketCaptureStorageLocation.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PacketCaptureStorageLocation.Serialization.cs
Covered lines:31
Uncovered lines:7
Coverable lines:38
Total lines:110
Line coverage:81.5% (31 of 38)
Covered branches:16
Total branches:20
Branch coverage:80% (16 of 20)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_StorageId()-100%100%
get_StoragePath()-100%100%
get_FilePath()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-66.67%66.67%
DeserializePacketCaptureStorageLocation(...)-81.25%85.71%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PacketCaptureStorageLocation.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> The storage location for a packet capture session. </summary>
 11    public partial class PacketCaptureStorageLocation
 12    {
 13        /// <summary> Initializes a new instance of PacketCaptureStorageLocation. </summary>
 414        public PacketCaptureStorageLocation()
 15        {
 416        }
 17
 18        /// <summary> Initializes a new instance of PacketCaptureStorageLocation. </summary>
 19        /// <param name="storageId"> The ID of the storage account to save the packet capture session. Required if no lo
 20        /// <param name="storagePath"> The URI of the storage path to save the packet capture. Must be a well-formed URI
 21        /// <param name="filePath"> A valid local path on the targeting VM. Must include the name of the capture file (*
 2022        internal PacketCaptureStorageLocation(string storageId, string storagePath, string filePath)
 23        {
 2024            StorageId = storageId;
 2025            StoragePath = storagePath;
 2026            FilePath = filePath;
 2027        }
 28
 29        /// <summary> The ID of the storage account to save the packet capture session. Required if no local file path i
 3630        public string StorageId { get; set; }
 31        /// <summary> The URI of the storage path to save the packet capture. Must be a well-formed URI describing the l
 3632        public string StoragePath { get; set; }
 33        /// <summary> A valid local path on the targeting VM. Must include the name of the capture file (*.cap). For lin
 6034        public string FilePath { get; set; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PacketCaptureStorageLocation.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 PacketCaptureStorageLocation : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 1617            writer.WriteStartObject();
 1618            if (StorageId != null)
 19            {
 020                writer.WritePropertyName("storageId");
 021                writer.WriteStringValue(StorageId);
 22            }
 1623            if (StoragePath != null)
 24            {
 025                writer.WritePropertyName("storagePath");
 026                writer.WriteStringValue(StoragePath);
 27            }
 1628            if (FilePath != null)
 29            {
 1630                writer.WritePropertyName("filePath");
 1631                writer.WriteStringValue(FilePath);
 32            }
 1633            writer.WriteEndObject();
 1634        }
 35
 36        internal static PacketCaptureStorageLocation DeserializePacketCaptureStorageLocation(JsonElement element)
 37        {
 2038            string storageId = default;
 2039            string storagePath = default;
 2040            string filePath = default;
 12041            foreach (var property in element.EnumerateObject())
 42            {
 4043                if (property.NameEquals("storageId"))
 44                {
 045                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 049                    storageId = property.Value.GetString();
 050                    continue;
 51                }
 4052                if (property.NameEquals("storagePath"))
 53                {
 2054                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 2058                    storagePath = property.Value.GetString();
 2059                    continue;
 60                }
 2061                if (property.NameEquals("filePath"))
 62                {
 2063                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 2067                    filePath = property.Value.GetString();
 68                    continue;
 69                }
 70            }
 2071            return new PacketCaptureStorageLocation(storageId, storagePath, filePath);
 72        }
 73    }
 74}