< Summary

Class:Azure.ResourceManager.Compute.Models.GalleryDataDiskImage
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryDataDiskImage.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryDataDiskImage.Serialization.cs
Covered lines:0
Uncovered lines:41
Coverable lines:41
Total lines:115
Line coverage:0% (0 of 41)
Covered branches:0
Total branches:22
Branch coverage:0% (0 of 22)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
.ctor(...)-0%100%
get_Lun()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeGalleryDataDiskImage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryDataDiskImage.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.Compute.Models
 9{
 10    /// <summary> This is the data disk image. </summary>
 11    public partial class GalleryDataDiskImage : GalleryDiskImage
 12    {
 13        /// <summary> Initializes a new instance of GalleryDataDiskImage. </summary>
 14        /// <param name="lun"> This property specifies the logical unit number of the data disk. This value is used to i
 015        public GalleryDataDiskImage(int lun)
 16        {
 017            Lun = lun;
 018        }
 19
 20        /// <summary> Initializes a new instance of GalleryDataDiskImage. </summary>
 21        /// <param name="sizeInGB"> This property indicates the size of the VHD to be created. </param>
 22        /// <param name="hostCaching"> The host caching of the disk. Valid values are &apos;None&apos;, &apos;ReadOnly&a
 23        /// <param name="source"> The gallery artifact version source. </param>
 24        /// <param name="lun"> This property specifies the logical unit number of the data disk. This value is used to i
 025        internal GalleryDataDiskImage(int? sizeInGB, HostCaching? hostCaching, GalleryArtifactVersionSource source, int 
 26        {
 027            Lun = lun;
 028        }
 29
 30        /// <summary> This property specifies the logical unit number of the data disk. This value is used to identify d
 031        public int Lun { get; set; }
 32    }
 33}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryDataDiskImage.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.Compute.Models
 12{
 13    public partial class GalleryDataDiskImage : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("lun");
 019            writer.WriteNumberValue(Lun);
 020            if (SizeInGB != null)
 21            {
 022                writer.WritePropertyName("sizeInGB");
 023                writer.WriteNumberValue(SizeInGB.Value);
 24            }
 025            if (HostCaching != null)
 26            {
 027                writer.WritePropertyName("hostCaching");
 028                writer.WriteStringValue(HostCaching.Value.ToSerialString());
 29            }
 030            if (Source != null)
 31            {
 032                writer.WritePropertyName("source");
 033                writer.WriteObjectValue(Source);
 34            }
 035            writer.WriteEndObject();
 036        }
 37
 38        internal static GalleryDataDiskImage DeserializeGalleryDataDiskImage(JsonElement element)
 39        {
 040            int lun = default;
 041            int? sizeInGB = default;
 042            HostCaching? hostCaching = default;
 043            GalleryArtifactVersionSource source = default;
 044            foreach (var property in element.EnumerateObject())
 45            {
 046                if (property.NameEquals("lun"))
 47                {
 048                    lun = property.Value.GetInt32();
 049                    continue;
 50                }
 051                if (property.NameEquals("sizeInGB"))
 52                {
 053                    if (property.Value.ValueKind == JsonValueKind.Null)
 54                    {
 55                        continue;
 56                    }
 057                    sizeInGB = property.Value.GetInt32();
 058                    continue;
 59                }
 060                if (property.NameEquals("hostCaching"))
 61                {
 062                    if (property.Value.ValueKind == JsonValueKind.Null)
 63                    {
 64                        continue;
 65                    }
 066                    hostCaching = property.Value.GetString().ToHostCaching();
 067                    continue;
 68                }
 069                if (property.NameEquals("source"))
 70                {
 071                    if (property.Value.ValueKind == JsonValueKind.Null)
 72                    {
 73                        continue;
 74                    }
 075                    source = GalleryArtifactVersionSource.DeserializeGalleryArtifactVersionSource(property.Value);
 76                    continue;
 77                }
 78            }
 079            return new GalleryDataDiskImage(sizeInGB, hostCaching, source, lun);
 80        }
 81    }
 82}