< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Type()-0%100%
get_Values()-0%100%
get_ReasonCode()-0%100%
DeserializeRestriction(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\Restriction.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> The restriction because of which SKU cannot be used. </summary>
 13    public partial class Restriction
 14    {
 15        /// <summary> Initializes a new instance of Restriction. </summary>
 016        internal Restriction()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of Restriction. </summary>
 21        /// <param name="type"> The type of restrictions. As of now only possible value for this is location. </param>
 22        /// <param name="values"> The value of restrictions. If the restriction type is set to location. This would be d
 23        /// <param name="reasonCode"> The reason for the restriction. As of now this can be &quot;QuotaId&quot; or &quot
 024        internal Restriction(string type, IReadOnlyList<string> values, ReasonCode? reasonCode)
 25        {
 026            Type = type;
 027            Values = values;
 028            ReasonCode = reasonCode;
 029        }
 30
 31        /// <summary> The type of restrictions. As of now only possible value for this is location. </summary>
 032        public string Type { get; }
 33        /// <summary> The value of restrictions. If the restriction type is set to location. This would be different loc
 034        public IReadOnlyList<string> Values { get; }
 35        /// <summary> The reason for the restriction. As of now this can be &quot;QuotaId&quot; or &quot;NotAvailableFor
 036        public ReasonCode? ReasonCode { get; }
 37    }
 38}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\Restriction.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 Restriction
 15    {
 16        internal static Restriction DeserializeRestriction(JsonElement element)
 17        {
 018            string type = default;
 019            IReadOnlyList<string> values = default;
 020            ReasonCode? reasonCode = default;
 021            foreach (var property in element.EnumerateObject())
 22            {
 023                if (property.NameEquals("type"))
 24                {
 025                    if (property.Value.ValueKind == JsonValueKind.Null)
 26                    {
 27                        continue;
 28                    }
 029                    type = property.Value.GetString();
 030                    continue;
 31                }
 032                if (property.NameEquals("values"))
 33                {
 034                    if (property.Value.ValueKind == JsonValueKind.Null)
 35                    {
 36                        continue;
 37                    }
 038                    List<string> array = new List<string>();
 039                    foreach (var item in property.Value.EnumerateArray())
 40                    {
 041                        if (item.ValueKind == JsonValueKind.Null)
 42                        {
 043                            array.Add(null);
 44                        }
 45                        else
 46                        {
 047                            array.Add(item.GetString());
 48                        }
 49                    }
 050                    values = array;
 051                    continue;
 52                }
 053                if (property.NameEquals("reasonCode"))
 54                {
 055                    if (property.Value.ValueKind == JsonValueKind.Null)
 56                    {
 57                        continue;
 58                    }
 059                    reasonCode = new ReasonCode(property.Value.GetString());
 60                    continue;
 61                }
 62            }
 063            return new Restriction(type, values, reasonCode);
 64        }
 65    }
 66}