< Summary

Class:Azure.ResourceManager.Storage.Models.SkuInformation
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\SkuInformation.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\SkuInformation.Serialization.cs
Covered lines:56
Uncovered lines:13
Coverable lines:69
Total lines:182
Line coverage:81.1% (56 of 69)
Covered branches:35
Total branches:40
Branch coverage:87.5% (35 of 40)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
.ctor(...)-100%100%
get_Name()-100%100%
get_Tier()-0%100%
get_ResourceType()-100%100%
get_Kind()-100%100%
get_Locations()-0%100%
get_Capabilities()-0%100%
get_Restrictions()-0%100%
DeserializeSkuInformation(...)-88%87.5%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\SkuInformation.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.Storage.Models
 11{
 12    /// <summary> Storage SKU and its properties. </summary>
 13    public partial class SkuInformation
 14    {
 15        /// <summary> Initializes a new instance of SkuInformation. </summary>
 16        /// <param name="name"> The SKU name. Required for account creation; optional for update. Note that in older ver
 017        internal SkuInformation(SkuName name)
 18        {
 019            Name = name;
 020        }
 21
 22        /// <summary> Initializes a new instance of SkuInformation. </summary>
 23        /// <param name="name"> The SKU name. Required for account creation; optional for update. Note that in older ver
 24        /// <param name="tier"> The SKU tier. This is based on the SKU name. </param>
 25        /// <param name="resourceType"> The type of the resource, usually it is &apos;storageAccounts&apos;. </param>
 26        /// <param name="kind"> Indicates the type of storage account. </param>
 27        /// <param name="locations"> The set of locations that the SKU is available. This will be supported and register
 28        /// <param name="capabilities"> The capability information in the specified SKU, including file encryption, netw
 29        /// <param name="restrictions"> The restrictions because of which SKU cannot be used. This is empty if there are
 245230        internal SkuInformation(SkuName name, SkuTier? tier, string resourceType, Kind? kind, IReadOnlyList<string> loca
 31        {
 245232            Name = name;
 245233            Tier = tier;
 245234            ResourceType = resourceType;
 245235            Kind = kind;
 245236            Locations = locations;
 245237            Capabilities = capabilities;
 245238            Restrictions = restrictions;
 245239        }
 40
 41        /// <summary> The SKU name. Required for account creation; optional for update. Note that in older versions, SKU
 2842        public SkuName Name { get; }
 43        /// <summary> The SKU tier. This is based on the SKU name. </summary>
 044        public SkuTier? Tier { get; }
 45        /// <summary> The type of the resource, usually it is &apos;storageAccounts&apos;. </summary>
 446        public string ResourceType { get; }
 47        /// <summary> Indicates the type of storage account. </summary>
 1648        public Kind? Kind { get; }
 49        /// <summary> The set of locations that the SKU is available. This will be supported and registered Azure Geo Re
 050        public IReadOnlyList<string> Locations { get; }
 51        /// <summary> The capability information in the specified SKU, including file encryption, network ACLs, change n
 052        public IReadOnlyList<SKUCapability> Capabilities { get; }
 53        /// <summary> The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. 
 054        public IReadOnlyList<Restriction> Restrictions { get; }
 55    }
 56}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\SkuInformation.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.Storage.Models
 13{
 14    public partial class SkuInformation
 15    {
 16        internal static SkuInformation DeserializeSkuInformation(JsonElement element)
 17        {
 245218            SkuName name = default;
 245219            SkuTier? tier = default;
 245220            string resourceType = default;
 245221            Kind? kind = default;
 245222            IReadOnlyList<string> locations = default;
 245223            IReadOnlyList<SKUCapability> capabilities = default;
 245224            IReadOnlyList<Restriction> restrictions = default;
 4413625            foreach (var property in element.EnumerateObject())
 26            {
 1961627                if (property.NameEquals("name"))
 28                {
 245229                    name = new SkuName(property.Value.GetString());
 245230                    continue;
 31                }
 1716432                if (property.NameEquals("tier"))
 33                {
 245234                    if (property.Value.ValueKind == JsonValueKind.Null)
 35                    {
 36                        continue;
 37                    }
 245238                    tier = property.Value.GetString().ToSkuTier();
 245239                    continue;
 40                }
 1471241                if (property.NameEquals("resourceType"))
 42                {
 245243                    if (property.Value.ValueKind == JsonValueKind.Null)
 44                    {
 45                        continue;
 46                    }
 245247                    resourceType = property.Value.GetString();
 245248                    continue;
 49                }
 1226050                if (property.NameEquals("kind"))
 51                {
 245252                    if (property.Value.ValueKind == JsonValueKind.Null)
 53                    {
 54                        continue;
 55                    }
 245256                    kind = new Kind(property.Value.GetString());
 245257                    continue;
 58                }
 980859                if (property.NameEquals("locations"))
 60                {
 245261                    if (property.Value.ValueKind == JsonValueKind.Null)
 62                    {
 63                        continue;
 64                    }
 245265                    List<string> array = new List<string>();
 980866                    foreach (var item in property.Value.EnumerateArray())
 67                    {
 245268                        if (item.ValueKind == JsonValueKind.Null)
 69                        {
 070                            array.Add(null);
 71                        }
 72                        else
 73                        {
 245274                            array.Add(item.GetString());
 75                        }
 76                    }
 245277                    locations = array;
 245278                    continue;
 79                }
 735680                if (property.NameEquals("capabilities"))
 81                {
 245282                    if (property.Value.ValueKind == JsonValueKind.Null)
 83                    {
 84                        continue;
 85                    }
 245286                    List<SKUCapability> array = new List<SKUCapability>();
 5600087                    foreach (var item in property.Value.EnumerateArray())
 88                    {
 2554889                        if (item.ValueKind == JsonValueKind.Null)
 90                        {
 091                            array.Add(null);
 92                        }
 93                        else
 94                        {
 2554895                            array.Add(SKUCapability.DeserializeSKUCapability(item));
 96                        }
 97                    }
 245298                    capabilities = array;
 245299                    continue;
 100                }
 4904101                if (property.NameEquals("restrictions"))
 102                {
 2452103                    if (property.Value.ValueKind == JsonValueKind.Null)
 104                    {
 105                        continue;
 106                    }
 2452107                    List<Restriction> array = new List<Restriction>();
 0108                    foreach (var item in property.Value.EnumerateArray())
 109                    {
 0110                        if (item.ValueKind == JsonValueKind.Null)
 111                        {
 0112                            array.Add(null);
 113                        }
 114                        else
 115                        {
 0116                            array.Add(Restriction.DeserializeRestriction(item));
 117                        }
 118                    }
 2452119                    restrictions = array;
 120                    continue;
 121                }
 122            }
 2452123            return new SkuInformation(name, tier, resourceType, kind, locations, capabilities, restrictions);
 124        }
 125    }
 126}