< Summary

Class:Azure.ResourceManager.Compute.Models.EncryptionImages
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\EncryptionImages.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\EncryptionImages.Serialization.cs
Covered lines:0
Uncovered lines:36
Coverable lines:36
Total lines:111
Line coverage:0% (0 of 36)
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%
get_OsDiskImage()-0%100%
get_DataDiskImages()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeEncryptionImages(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\EncryptionImages.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.Collections.Generic;
 9
 10namespace Azure.ResourceManager.Compute.Models
 11{
 12    /// <summary> Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the ga
 13    public partial class EncryptionImages
 14    {
 15        /// <summary> Initializes a new instance of EncryptionImages. </summary>
 016        public EncryptionImages()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of EncryptionImages. </summary>
 21        /// <param name="osDiskImage"> This is the disk image encryption base class. </param>
 22        /// <param name="dataDiskImages"> A list of encryption specifications for data disk images. </param>
 023        internal EncryptionImages(DiskImageEncryption osDiskImage, IList<DataDiskImageEncryption> dataDiskImages)
 24        {
 025            OsDiskImage = osDiskImage;
 026            DataDiskImages = dataDiskImages;
 027        }
 28
 29        /// <summary> This is the disk image encryption base class. </summary>
 030        public DiskImageEncryption OsDiskImage { get; set; }
 31        /// <summary> A list of encryption specifications for data disk images. </summary>
 032        public IList<DataDiskImageEncryption> DataDiskImages { get; set; }
 33    }
 34}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\EncryptionImages.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.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.Compute.Models
 13{
 14    public partial class EncryptionImages : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (OsDiskImage != null)
 20            {
 021                writer.WritePropertyName("osDiskImage");
 022                writer.WriteObjectValue(OsDiskImage);
 23            }
 024            if (DataDiskImages != null)
 25            {
 026                writer.WritePropertyName("dataDiskImages");
 027                writer.WriteStartArray();
 028                foreach (var item in DataDiskImages)
 29                {
 030                    writer.WriteObjectValue(item);
 31                }
 032                writer.WriteEndArray();
 33            }
 034            writer.WriteEndObject();
 035        }
 36
 37        internal static EncryptionImages DeserializeEncryptionImages(JsonElement element)
 38        {
 039            DiskImageEncryption osDiskImage = default;
 040            IList<DataDiskImageEncryption> dataDiskImages = default;
 041            foreach (var property in element.EnumerateObject())
 42            {
 043                if (property.NameEquals("osDiskImage"))
 44                {
 045                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 049                    osDiskImage = DiskImageEncryption.DeserializeDiskImageEncryption(property.Value);
 050                    continue;
 51                }
 052                if (property.NameEquals("dataDiskImages"))
 53                {
 054                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 058                    List<DataDiskImageEncryption> array = new List<DataDiskImageEncryption>();
 059                    foreach (var item in property.Value.EnumerateArray())
 60                    {
 061                        if (item.ValueKind == JsonValueKind.Null)
 62                        {
 063                            array.Add(null);
 64                        }
 65                        else
 66                        {
 067                            array.Add(DataDiskImageEncryption.DeserializeDataDiskImageEncryption(item));
 68                        }
 69                    }
 070                    dataDiskImages = array;
 71                    continue;
 72                }
 73            }
 074            return new EncryptionImages(osDiskImage, dataDiskImages);
 75        }
 76    }
 77}