< Summary

Class:Azure.ResourceManager.Storage.Models.EncryptionService
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\EncryptionService.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\EncryptionService.Serialization.cs
Covered lines:36
Uncovered lines:2
Coverable lines:38
Total lines:113
Line coverage:94.7% (36 of 38)
Covered branches:19
Total branches:20
Branch coverage:95% (19 of 20)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_Enabled()-100%100%
get_LastEnabledTime()-100%100%
get_KeyType()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-83.33%83.33%
DeserializeEncryptionService(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\EncryptionService.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;
 9
 10namespace Azure.ResourceManager.Storage.Models
 11{
 12    /// <summary> A service that allows server-side encryption to be used. </summary>
 13    public partial class EncryptionService
 14    {
 15        /// <summary> Initializes a new instance of EncryptionService. </summary>
 6016        public EncryptionService()
 17        {
 6018        }
 19
 20        /// <summary> Initializes a new instance of EncryptionService. </summary>
 21        /// <param name="enabled"> A boolean indicating whether or not the service encrypts the data as it is stored. </
 22        /// <param name="lastEnabledTime"> Gets a rough estimate of the date/time when the encryption was last enabled b
 23        /// <param name="keyType"> Encryption key type to be used for the encryption service. &apos;Account&apos; key ty
 168424        internal EncryptionService(bool? enabled, DateTimeOffset? lastEnabledTime, KeyType? keyType)
 25        {
 168426            Enabled = enabled;
 168427            LastEnabledTime = lastEnabledTime;
 168428            KeyType = keyType;
 168429        }
 30
 31        /// <summary> A boolean indicating whether or not the service encrypts the data as it is stored. </summary>
 197632        public bool? Enabled { get; set; }
 33        /// <summary> Gets a rough estimate of the date/time when the encryption was last enabled by the user. Only retu
 16434        public DateTimeOffset? LastEnabledTime { get; }
 35        /// <summary> Encryption key type to be used for the encryption service. &apos;Account&apos; key type implies th
 181636        public KeyType? KeyType { get; set; }
 37    }
 38}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\EncryptionService.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;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.Storage.Models
 13{
 14    public partial class EncryptionService : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 9218            writer.WriteStartObject();
 9219            if (Enabled != null)
 20            {
 7621                writer.WritePropertyName("enabled");
 7622                writer.WriteBooleanValue(Enabled.Value);
 23            }
 9224            if (LastEnabledTime != null)
 25            {
 026                writer.WritePropertyName("lastEnabledTime");
 027                writer.WriteStringValue(LastEnabledTime.Value, "O");
 28            }
 9229            if (KeyType != null)
 30            {
 1631                writer.WritePropertyName("keyType");
 1632                writer.WriteStringValue(KeyType.Value.ToString());
 33            }
 9234            writer.WriteEndObject();
 9235        }
 36
 37        internal static EncryptionService DeserializeEncryptionService(JsonElement element)
 38        {
 168439            bool? enabled = default;
 168440            DateTimeOffset? lastEnabledTime = default;
 168441            KeyType? keyType = default;
 1347242            foreach (var property in element.EnumerateObject())
 43            {
 505244                if (property.NameEquals("enabled"))
 45                {
 168446                    if (property.Value.ValueKind == JsonValueKind.Null)
 47                    {
 48                        continue;
 49                    }
 168450                    enabled = property.Value.GetBoolean();
 168451                    continue;
 52                }
 336853                if (property.NameEquals("lastEnabledTime"))
 54                {
 168455                    if (property.Value.ValueKind == JsonValueKind.Null)
 56                    {
 57                        continue;
 58                    }
 168459                    lastEnabledTime = property.Value.GetDateTimeOffset("O");
 168460                    continue;
 61                }
 168462                if (property.NameEquals("keyType"))
 63                {
 168464                    if (property.Value.ValueKind == JsonValueKind.Null)
 65                    {
 66                        continue;
 67                    }
 168468                    keyType = new KeyType(property.Value.GetString());
 69                    continue;
 70                }
 71            }
 168472            return new EncryptionService(enabled, lastEnabledTime, keyType);
 73        }
 74    }
 75}