< Summary

Class:Azure.ResourceManager.Compute.Models.EncryptionSettingsElement
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\EncryptionSettingsElement.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\EncryptionSettingsElement.Serialization.cs
Covered lines:15
Uncovered lines:13
Coverable lines:28
Total lines:91
Line coverage:53.5% (15 of 28)
Covered branches:4
Total branches:14
Branch coverage:28.5% (4 of 14)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\EncryptionSettingsElement.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> Encryption settings for one disk volume. </summary>
 11    public partial class EncryptionSettingsElement
 12    {
 13        /// <summary> Initializes a new instance of EncryptionSettingsElement. </summary>
 014        public EncryptionSettingsElement()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of EncryptionSettingsElement. </summary>
 19        /// <param name="diskEncryptionKey"> Key Vault Secret Url and vault id of the disk encryption key. </param>
 20        /// <param name="keyEncryptionKey"> Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey i
 421        internal EncryptionSettingsElement(KeyVaultAndSecretReference diskEncryptionKey, KeyVaultAndKeyReference keyEncr
 22        {
 423            DiskEncryptionKey = diskEncryptionKey;
 424            KeyEncryptionKey = keyEncryptionKey;
 425        }
 26
 27        /// <summary> Key Vault Secret Url and vault id of the disk encryption key. </summary>
 1228        public KeyVaultAndSecretReference DiskEncryptionKey { get; set; }
 29        /// <summary> Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey is optional and when pr
 1230        public KeyVaultAndKeyReference KeyEncryptionKey { get; set; }
 31    }
 32}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\EncryptionSettingsElement.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 EncryptionSettingsElement : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 417            writer.WriteStartObject();
 418            if (DiskEncryptionKey != null)
 19            {
 420                writer.WritePropertyName("diskEncryptionKey");
 421                writer.WriteObjectValue(DiskEncryptionKey);
 22            }
 423            if (KeyEncryptionKey != null)
 24            {
 425                writer.WritePropertyName("keyEncryptionKey");
 426                writer.WriteObjectValue(KeyEncryptionKey);
 27            }
 428            writer.WriteEndObject();
 429        }
 30
 31        internal static EncryptionSettingsElement DeserializeEncryptionSettingsElement(JsonElement element)
 32        {
 033            KeyVaultAndSecretReference diskEncryptionKey = default;
 034            KeyVaultAndKeyReference keyEncryptionKey = default;
 035            foreach (var property in element.EnumerateObject())
 36            {
 037                if (property.NameEquals("diskEncryptionKey"))
 38                {
 039                    if (property.Value.ValueKind == JsonValueKind.Null)
 40                    {
 41                        continue;
 42                    }
 043                    diskEncryptionKey = KeyVaultAndSecretReference.DeserializeKeyVaultAndSecretReference(property.Value)
 044                    continue;
 45                }
 046                if (property.NameEquals("keyEncryptionKey"))
 47                {
 048                    if (property.Value.ValueKind == JsonValueKind.Null)
 49                    {
 50                        continue;
 51                    }
 052                    keyEncryptionKey = KeyVaultAndKeyReference.DeserializeKeyVaultAndKeyReference(property.Value);
 53                    continue;
 54                }
 55            }
 056            return new EncryptionSettingsElement(diskEncryptionKey, keyEncryptionKey);
 57        }
 58    }
 59}