< Summary

Class:Azure.ResourceManager.EventHubs.Models.Encryption
Assembly:Azure.ResourceManager.EventHubs
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\Encryption.cs
C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\Encryption.Serialization.cs
Covered lines:0
Uncovered lines:37
Coverable lines:37
Total lines:112
Line coverage:0% (0 of 37)
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_KeyVaultProperties()-0%100%
get_KeySource()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeEncryption(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\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
 8using System.Collections.Generic;
 9
 10namespace Azure.ResourceManager.EventHubs.Models
 11{
 12    /// <summary> Properties to configure Encryption. </summary>
 13    public partial class Encryption
 14    {
 15        /// <summary> Initializes a new instance of Encryption. </summary>
 016        public Encryption()
 17        {
 018            KeySource = "Microsoft.KeyVault";
 019        }
 20
 21        /// <summary> Initializes a new instance of Encryption. </summary>
 22        /// <param name="keyVaultProperties"> Properties of KeyVault. </param>
 23        /// <param name="keySource"> Enumerates the possible value of keySource for Encryption. </param>
 024        internal Encryption(IList<KeyVaultProperties> keyVaultProperties, string keySource)
 25        {
 026            KeyVaultProperties = keyVaultProperties;
 027            KeySource = keySource;
 028        }
 29
 30        /// <summary> Properties of KeyVault. </summary>
 031        public IList<KeyVaultProperties> KeyVaultProperties { get; set; }
 32        /// <summary> Enumerates the possible value of keySource for Encryption. </summary>
 033        public string KeySource { get; set; }
 34    }
 35}

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\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.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.EventHubs.Models
 13{
 14    public partial class Encryption : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (KeyVaultProperties != null)
 20            {
 021                writer.WritePropertyName("keyVaultProperties");
 022                writer.WriteStartArray();
 023                foreach (var item in KeyVaultProperties)
 24                {
 025                    writer.WriteObjectValue(item);
 26                }
 027                writer.WriteEndArray();
 28            }
 029            if (KeySource != null)
 30            {
 031                writer.WritePropertyName("keySource");
 032                writer.WriteStringValue(KeySource);
 33            }
 034            writer.WriteEndObject();
 035        }
 36
 37        internal static Encryption DeserializeEncryption(JsonElement element)
 38        {
 039            IList<KeyVaultProperties> keyVaultProperties = default;
 040            string keySource = default;
 041            foreach (var property in element.EnumerateObject())
 42            {
 043                if (property.NameEquals("keyVaultProperties"))
 44                {
 045                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 049                    List<KeyVaultProperties> array = new List<KeyVaultProperties>();
 050                    foreach (var item in property.Value.EnumerateArray())
 51                    {
 052                        if (item.ValueKind == JsonValueKind.Null)
 53                        {
 054                            array.Add(null);
 55                        }
 56                        else
 57                        {
 058                            array.Add(Models.KeyVaultProperties.DeserializeKeyVaultProperties(item));
 59                        }
 60                    }
 061                    keyVaultProperties = array;
 062                    continue;
 63                }
 064                if (property.NameEquals("keySource"))
 65                {
 066                    if (property.Value.ValueKind == JsonValueKind.Null)
 67                    {
 68                        continue;
 69                    }
 070                    keySource = property.Value.GetString();
 71                    continue;
 72                }
 73            }
 074            return new Encryption(keyVaultProperties, keySource);
 75        }
 76    }
 77}