< Summary

Class:Azure.ResourceManager.Storage.Models.EncryptionScope
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\EncryptionScope.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\EncryptionScope.Serialization.cs
Covered lines:87
Uncovered lines:0
Coverable lines:87
Total lines:209
Line coverage:100% (87 of 87)
Covered branches:54
Total branches:54
Branch coverage:100% (54 of 54)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_Source()-100%100%
get_State()-100%100%
get_CreationTime()-100%100%
get_LastModifiedTime()-100%100%
get_KeyVaultProperties()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeEncryptionScope(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\EncryptionScope.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> The Encryption Scope resource. </summary>
 13    public partial class EncryptionScope : Resource
 14    {
 15        /// <summary> Initializes a new instance of EncryptionScope. </summary>
 1216        public EncryptionScope()
 17        {
 1218        }
 19
 20        /// <summary> Initializes a new instance of EncryptionScope. </summary>
 21        /// <param name="id"> Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourc
 22        /// <param name="name"> The name of the resource. </param>
 23        /// <param name="type"> The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/sto
 24        /// <param name="source"> The provider for the encryption scope. Possible values (case-insensitive):  Microsoft.
 25        /// <param name="state"> The state of the encryption scope. Possible values (case-insensitive):  Enabled, Disabl
 26        /// <param name="creationTime"> Gets the creation date and time of the encryption scope in UTC. </param>
 27        /// <param name="lastModifiedTime"> Gets the last modification date and time of the encryption scope in UTC. </p
 28        /// <param name="keyVaultProperties"> The key vault properties for the encryption scope. This is a required fiel
 2429        internal EncryptionScope(string id, string name, string type, EncryptionScopeSource? source, EncryptionScopeStat
 30        {
 2431            Source = source;
 2432            State = state;
 2433            CreationTime = creationTime;
 2434            LastModifiedTime = lastModifiedTime;
 2435            KeyVaultProperties = keyVaultProperties;
 2436        }
 37
 38        /// <summary> The provider for the encryption scope. Possible values (case-insensitive):  Microsoft.Storage, Mic
 8439        public EncryptionScopeSource? Source { get; set; }
 40        /// <summary> The state of the encryption scope. Possible values (case-insensitive):  Enabled, Disabled. </summa
 8841        public EncryptionScopeState? State { get; set; }
 42        /// <summary> Gets the creation date and time of the encryption scope in UTC. </summary>
 2043        public DateTimeOffset? CreationTime { get; }
 44        /// <summary> Gets the last modification date and time of the encryption scope in UTC. </summary>
 2045        public DateTimeOffset? LastModifiedTime { get; }
 46        /// <summary> The key vault properties for the encryption scope. This is a required field if encryption scope &a
 4447        public EncryptionScopeKeyVaultProperties KeyVaultProperties { get; set; }
 48    }
 49}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\EncryptionScope.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 EncryptionScope : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 1618            writer.WriteStartObject();
 1619            if (Id != null)
 20            {
 421                writer.WritePropertyName("id");
 422                writer.WriteStringValue(Id);
 23            }
 1624            if (Name != null)
 25            {
 426                writer.WritePropertyName("name");
 427                writer.WriteStringValue(Name);
 28            }
 1629            if (Type != null)
 30            {
 431                writer.WritePropertyName("type");
 432                writer.WriteStringValue(Type);
 33            }
 1634            writer.WritePropertyName("properties");
 1635            writer.WriteStartObject();
 1636            if (Source != null)
 37            {
 1638                writer.WritePropertyName("source");
 1639                writer.WriteStringValue(Source.Value.ToString());
 40            }
 1641            if (State != null)
 42            {
 1643                writer.WritePropertyName("state");
 1644                writer.WriteStringValue(State.Value.ToString());
 45            }
 1646            if (CreationTime != null)
 47            {
 448                writer.WritePropertyName("creationTime");
 449                writer.WriteStringValue(CreationTime.Value, "O");
 50            }
 1651            if (LastModifiedTime != null)
 52            {
 453                writer.WritePropertyName("lastModifiedTime");
 454                writer.WriteStringValue(LastModifiedTime.Value, "O");
 55            }
 1656            if (KeyVaultProperties != null)
 57            {
 458                writer.WritePropertyName("keyVaultProperties");
 459                writer.WriteObjectValue(KeyVaultProperties);
 60            }
 1661            writer.WriteEndObject();
 1662            writer.WriteEndObject();
 1663        }
 64
 65        internal static EncryptionScope DeserializeEncryptionScope(JsonElement element)
 66        {
 2467            string id = default;
 2468            string name = default;
 2469            string type = default;
 2470            EncryptionScopeSource? source = default;
 2471            EncryptionScopeState? state = default;
 2472            DateTimeOffset? creationTime = default;
 2473            DateTimeOffset? lastModifiedTime = default;
 2474            EncryptionScopeKeyVaultProperties keyVaultProperties = default;
 24075            foreach (var property in element.EnumerateObject())
 76            {
 9677                if (property.NameEquals("id"))
 78                {
 2479                    if (property.Value.ValueKind == JsonValueKind.Null)
 80                    {
 81                        continue;
 82                    }
 2483                    id = property.Value.GetString();
 2484                    continue;
 85                }
 7286                if (property.NameEquals("name"))
 87                {
 2488                    if (property.Value.ValueKind == JsonValueKind.Null)
 89                    {
 90                        continue;
 91                    }
 2492                    name = property.Value.GetString();
 2493                    continue;
 94                }
 4895                if (property.NameEquals("type"))
 96                {
 2497                    if (property.Value.ValueKind == JsonValueKind.Null)
 98                    {
 99                        continue;
 100                    }
 24101                    type = property.Value.GetString();
 24102                    continue;
 103                }
 24104                if (property.NameEquals("properties"))
 105                {
 288106                    foreach (var property0 in property.Value.EnumerateObject())
 107                    {
 120108                        if (property0.NameEquals("source"))
 109                        {
 24110                            if (property0.Value.ValueKind == JsonValueKind.Null)
 111                            {
 112                                continue;
 113                            }
 24114                            source = new EncryptionScopeSource(property0.Value.GetString());
 24115                            continue;
 116                        }
 96117                        if (property0.NameEquals("state"))
 118                        {
 24119                            if (property0.Value.ValueKind == JsonValueKind.Null)
 120                            {
 121                                continue;
 122                            }
 24123                            state = new EncryptionScopeState(property0.Value.GetString());
 24124                            continue;
 125                        }
 72126                        if (property0.NameEquals("creationTime"))
 127                        {
 24128                            if (property0.Value.ValueKind == JsonValueKind.Null)
 129                            {
 130                                continue;
 131                            }
 24132                            creationTime = property0.Value.GetDateTimeOffset("O");
 24133                            continue;
 134                        }
 48135                        if (property0.NameEquals("lastModifiedTime"))
 136                        {
 24137                            if (property0.Value.ValueKind == JsonValueKind.Null)
 138                            {
 139                                continue;
 140                            }
 24141                            lastModifiedTime = property0.Value.GetDateTimeOffset("O");
 24142                            continue;
 143                        }
 24144                        if (property0.NameEquals("keyVaultProperties"))
 145                        {
 24146                            if (property0.Value.ValueKind == JsonValueKind.Null)
 147                            {
 148                                continue;
 149                            }
 24150                            keyVaultProperties = EncryptionScopeKeyVaultProperties.DeserializeEncryptionScopeKeyVaultPro
 151                            continue;
 152                        }
 153                    }
 154                    continue;
 155                }
 156            }
 24157            return new EncryptionScope(id, name, type, source, state, creationTime, lastModifiedTime, keyVaultProperties
 158        }
 159    }
 160}