< Summary

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

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryOSDiskImage.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 OS disk image. </summary>
 11    public partial class GalleryOSDiskImage : GalleryDiskImage
 12    {
 13        /// <summary> Initializes a new instance of GalleryOSDiskImage. </summary>
 014        public GalleryOSDiskImage()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of GalleryOSDiskImage. </summary>
 19        /// <param name="sizeInGB"> This property indicates the size of the VHD to be created. </param>
 20        /// <param name="hostCaching"> The host caching of the disk. Valid values are &apos;None&apos;, &apos;ReadOnly&a
 21        /// <param name="source"> The gallery artifact version source. </param>
 022        internal GalleryOSDiskImage(int? sizeInGB, HostCaching? hostCaching, GalleryArtifactVersionSource source) : base
 23        {
 024        }
 25    }
 26}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryOSDiskImage.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 GalleryOSDiskImage : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (SizeInGB != null)
 19            {
 020                writer.WritePropertyName("sizeInGB");
 021                writer.WriteNumberValue(SizeInGB.Value);
 22            }
 023            if (HostCaching != null)
 24            {
 025                writer.WritePropertyName("hostCaching");
 026                writer.WriteStringValue(HostCaching.Value.ToSerialString());
 27            }
 028            if (Source != null)
 29            {
 030                writer.WritePropertyName("source");
 031                writer.WriteObjectValue(Source);
 32            }
 033            writer.WriteEndObject();
 034        }
 35
 36        internal static GalleryOSDiskImage DeserializeGalleryOSDiskImage(JsonElement element)
 37        {
 038            int? sizeInGB = default;
 039            HostCaching? hostCaching = default;
 040            GalleryArtifactVersionSource source = default;
 041            foreach (var property in element.EnumerateObject())
 42            {
 043                if (property.NameEquals("sizeInGB"))
 44                {
 045                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 049                    sizeInGB = property.Value.GetInt32();
 050                    continue;
 51                }
 052                if (property.NameEquals("hostCaching"))
 53                {
 054                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 058                    hostCaching = property.Value.GetString().ToHostCaching();
 059                    continue;
 60                }
 061                if (property.NameEquals("source"))
 62                {
 063                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 067                    source = GalleryArtifactVersionSource.DeserializeGalleryArtifactVersionSource(property.Value);
 68                    continue;
 69                }
 70            }
 071            return new GalleryOSDiskImage(sizeInGB, hostCaching, source);
 72        }
 73    }
 74}