< Summary

Class:Azure.ResourceManager.Storage.Models.Encryption
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\Encryption.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\Encryption.Serialization.cs
Covered lines:43
Uncovered lines:4
Coverable lines:47
Total lines:124
Line coverage:91.4% (43 of 47)
Covered branches:20
Total branches:22
Branch coverage:90.9% (20 of 22)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
.ctor(...)-100%100%
get_Services()-100%100%
get_KeySource()-100%100%
get_RequireInfrastructureEncryption()-100%100%
get_KeyVaultProperties()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-71.43%66.67%
DeserializeEncryption(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\Encryption.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.Storage.Models
 9{
 10    /// <summary> The encryption settings on the storage account. </summary>
 11    public partial class Encryption
 12    {
 13        /// <summary> Initializes a new instance of Encryption. </summary>
 14        /// <param name="keySource"> The encryption keySource (provider). Possible values (case-insensitive):  Microsoft
 3215        public Encryption(KeySource keySource)
 16        {
 3217            KeySource = keySource;
 3218        }
 19
 20        /// <summary> Initializes a new instance of Encryption. </summary>
 21        /// <param name="services"> List of services which support encryption. </param>
 22        /// <param name="keySource"> The encryption keySource (provider). Possible values (case-insensitive):  Microsoft
 23        /// <param name="requireInfrastructureEncryption"> A boolean indicating whether or not the service applies a sec
 24        /// <param name="keyVaultProperties"> Properties provided by key vault. </param>
 83625        internal Encryption(EncryptionServices services, KeySource keySource, bool? requireInfrastructureEncryption, Key
 26        {
 83627            Services = services;
 83628            KeySource = keySource;
 83629            RequireInfrastructureEncryption = requireInfrastructureEncryption;
 83630            KeyVaultProperties = keyVaultProperties;
 83631        }
 32
 33        /// <summary> List of services which support encryption. </summary>
 122834        public EncryptionServices Services { get; set; }
 35        /// <summary> The encryption keySource (provider). Possible values (case-insensitive):  Microsoft.Storage, Micro
 91636        public KeySource KeySource { get; set; }
 37        /// <summary> A boolean indicating whether or not the service applies a secondary layer of encryption with platf
 88438        public bool? RequireInfrastructureEncryption { get; set; }
 39        /// <summary> Properties provided by key vault. </summary>
 88440        public KeyVaultProperties KeyVaultProperties { get; set; }
 41    }
 42}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\Encryption.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.Storage.Models
 12{
 13    public partial class Encryption : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 4817            writer.WriteStartObject();
 4818            if (Services != null)
 19            {
 4820                writer.WritePropertyName("services");
 4821                writer.WriteObjectValue(Services);
 22            }
 4823            writer.WritePropertyName("keySource");
 4824            writer.WriteStringValue(KeySource.ToString());
 4825            if (RequireInfrastructureEncryption != null)
 26            {
 027                writer.WritePropertyName("requireInfrastructureEncryption");
 028                writer.WriteBooleanValue(RequireInfrastructureEncryption.Value);
 29            }
 4830            if (KeyVaultProperties != null)
 31            {
 032                writer.WritePropertyName("keyvaultproperties");
 033                writer.WriteObjectValue(KeyVaultProperties);
 34            }
 4835            writer.WriteEndObject();
 4836        }
 37
 38        internal static Encryption DeserializeEncryption(JsonElement element)
 39        {
 83640            EncryptionServices services = default;
 83641            KeySource keySource = default;
 83642            bool? requireInfrastructureEncryption = default;
 83643            KeyVaultProperties keyvaultproperties = default;
 505644            foreach (var property in element.EnumerateObject())
 45            {
 169246                if (property.NameEquals("services"))
 47                {
 83648                    if (property.Value.ValueKind == JsonValueKind.Null)
 49                    {
 50                        continue;
 51                    }
 83652                    services = EncryptionServices.DeserializeEncryptionServices(property.Value);
 83653                    continue;
 54                }
 85655                if (property.NameEquals("keySource"))
 56                {
 83657                    keySource = new KeySource(property.Value.GetString());
 83658                    continue;
 59                }
 2060                if (property.NameEquals("requireInfrastructureEncryption"))
 61                {
 1262                    if (property.Value.ValueKind == JsonValueKind.Null)
 63                    {
 64                        continue;
 65                    }
 1266                    requireInfrastructureEncryption = property.Value.GetBoolean();
 1267                    continue;
 68                }
 869                if (property.NameEquals("keyvaultproperties"))
 70                {
 871                    if (property.Value.ValueKind == JsonValueKind.Null)
 72                    {
 73                        continue;
 74                    }
 875                    keyvaultproperties = KeyVaultProperties.DeserializeKeyVaultProperties(property.Value);
 76                    continue;
 77                }
 78            }
 83679            return new Encryption(services, keySource, requireInfrastructureEncryption, keyvaultproperties);
 80        }
 81    }
 82}