< Summary

Class:Azure.ResourceManager.Compute.Models.ResourceSku
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ResourceSku.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ResourceSku.Serialization.cs
Covered lines:89
Uncovered lines:37
Coverable lines:126
Total lines:304
Line coverage:70.6% (89 of 126)
Covered branches:58
Total branches:78
Branch coverage:74.3% (58 of 78)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_ResourceType()-100%100%
get_Name()-100%100%
get_Tier()-0%100%
get_Size()-0%100%
get_Family()-0%100%
get_Kind()-0%100%
get_Capacity()-0%100%
get_Locations()-100%100%
get_LocationInfo()-100%100%
get_ApiVersions()-0%100%
get_Costs()-0%100%
get_Capabilities()-0%100%
get_Restrictions()-0%100%
DeserializeResourceSku(...)-72.92%74.36%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ResourceSku.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.Compute.Models
 11{
 12    /// <summary> Describes an available Compute SKU. </summary>
 13    public partial class ResourceSku
 14    {
 15        /// <summary> Initializes a new instance of ResourceSku. </summary>
 016        internal ResourceSku()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ResourceSku. </summary>
 21        /// <param name="resourceType"> The type of resource the SKU applies to. </param>
 22        /// <param name="name"> The name of SKU. </param>
 23        /// <param name="tier"> Specifies the tier of virtual machines in a scale set.&lt;br /&gt;&lt;br /&gt; Possible 
 24        /// <param name="size"> The Size of the SKU. </param>
 25        /// <param name="family"> The Family of this particular SKU. </param>
 26        /// <param name="kind"> The Kind of resources that are supported in this SKU. </param>
 27        /// <param name="capacity"> Specifies the number of virtual machines in the scale set. </param>
 28        /// <param name="locations"> The set of locations that the SKU is available. </param>
 29        /// <param name="locationInfo"> A list of locations and availability zones in those locations where the SKU is a
 30        /// <param name="apiVersions"> The api versions that support this SKU. </param>
 31        /// <param name="costs"> Metadata for retrieving price info. </param>
 32        /// <param name="capabilities"> A name value pair to describe the capability. </param>
 33        /// <param name="restrictions"> The restrictions because of which SKU cannot be used. This is empty if there are
 4080034        internal ResourceSku(string resourceType, string name, string tier, string size, string family, string kind, Res
 35        {
 4080036            ResourceType = resourceType;
 4080037            Name = name;
 4080038            Tier = tier;
 4080039            Size = size;
 4080040            Family = family;
 4080041            Kind = kind;
 4080042            Capacity = capacity;
 4080043            Locations = locations;
 4080044            LocationInfo = locationInfo;
 4080045            ApiVersions = apiVersions;
 4080046            Costs = costs;
 4080047            Capabilities = capabilities;
 4080048            Restrictions = restrictions;
 4080049        }
 50
 51        /// <summary> The type of resource the SKU applies to. </summary>
 895652        public string ResourceType { get; }
 53        /// <summary> The name of SKU. </summary>
 9254        public string Name { get; }
 55        /// <summary> Specifies the tier of virtual machines in a scale set.&lt;br /&gt;&lt;br /&gt; Possible Values:&lt
 056        public string Tier { get; }
 57        /// <summary> The Size of the SKU. </summary>
 058        public string Size { get; }
 59        /// <summary> The Family of this particular SKU. </summary>
 060        public string Family { get; }
 61        /// <summary> The Kind of resources that are supported in this SKU. </summary>
 062        public string Kind { get; }
 63        /// <summary> Specifies the number of virtual machines in the scale set. </summary>
 064        public ResourceSkuCapacity Capacity { get; }
 65        /// <summary> The set of locations that the SKU is available. </summary>
 4080066        public IReadOnlyList<string> Locations { get; }
 67        /// <summary> A list of locations and availability zones in those locations where the SKU is available. </summar
 4086468        public IReadOnlyList<ResourceSkuLocationInfo> LocationInfo { get; }
 69        /// <summary> The api versions that support this SKU. </summary>
 070        public IReadOnlyList<string> ApiVersions { get; }
 71        /// <summary> Metadata for retrieving price info. </summary>
 072        public IReadOnlyList<ResourceSkuCosts> Costs { get; }
 73        /// <summary> A name value pair to describe the capability. </summary>
 074        public IReadOnlyList<ResourceSkuCapabilities> Capabilities { get; }
 75        /// <summary> The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. 
 076        public IReadOnlyList<ResourceSkuRestrictions> Restrictions { get; }
 77    }
 78}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ResourceSku.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.Compute.Models
 13{
 14    public partial class ResourceSku
 15    {
 16        internal static ResourceSku DeserializeResourceSku(JsonElement element)
 17        {
 4080018            string resourceType = default;
 4080019            string name = default;
 4080020            string tier = default;
 4080021            string size = default;
 4080022            string family = default;
 4080023            string kind = default;
 4080024            ResourceSkuCapacity capacity = default;
 4080025            IReadOnlyList<string> locations = default;
 4080026            IReadOnlyList<ResourceSkuLocationInfo> locationInfo = default;
 4080027            IReadOnlyList<string> apiVersions = default;
 4080028            IReadOnlyList<ResourceSkuCosts> costs = default;
 4080029            IReadOnlyList<ResourceSkuCapabilities> capabilities = default;
 4080030            IReadOnlyList<ResourceSkuRestrictions> restrictions = default;
 79480031            foreach (var property in element.EnumerateObject())
 32            {
 35660033                if (property.NameEquals("resourceType"))
 34                {
 4080035                    if (property.Value.ValueKind == JsonValueKind.Null)
 36                    {
 37                        continue;
 38                    }
 4080039                    resourceType = property.Value.GetString();
 4080040                    continue;
 41                }
 31580042                if (property.NameEquals("name"))
 43                {
 4080044                    if (property.Value.ValueKind == JsonValueKind.Null)
 45                    {
 46                        continue;
 47                    }
 4080048                    name = property.Value.GetString();
 4080049                    continue;
 50                }
 27500051                if (property.NameEquals("tier"))
 52                {
 3955253                    if (property.Value.ValueKind == JsonValueKind.Null)
 54                    {
 55                        continue;
 56                    }
 3955257                    tier = property.Value.GetString();
 3955258                    continue;
 59                }
 23544860                if (property.NameEquals("size"))
 61                {
 3916462                    if (property.Value.ValueKind == JsonValueKind.Null)
 63                    {
 64                        continue;
 65                    }
 3916466                    size = property.Value.GetString();
 3916467                    continue;
 68                }
 19628469                if (property.NameEquals("family"))
 70                {
 3347271                    if (property.Value.ValueKind == JsonValueKind.Null)
 72                    {
 73                        continue;
 74                    }
 3347275                    family = property.Value.GetString();
 3347276                    continue;
 77                }
 16281278                if (property.NameEquals("kind"))
 79                {
 080                    if (property.Value.ValueKind == JsonValueKind.Null)
 81                    {
 82                        continue;
 83                    }
 084                    kind = property.Value.GetString();
 085                    continue;
 86                }
 16281287                if (property.NameEquals("capacity"))
 88                {
 089                    if (property.Value.ValueKind == JsonValueKind.Null)
 90                    {
 91                        continue;
 92                    }
 093                    capacity = ResourceSkuCapacity.DeserializeResourceSkuCapacity(property.Value);
 094                    continue;
 95                }
 16281296                if (property.NameEquals("locations"))
 97                {
 4080098                    if (property.Value.ValueKind == JsonValueKind.Null)
 99                    {
 100                        continue;
 101                    }
 40800102                    List<string> array = new List<string>();
 163200103                    foreach (var item in property.Value.EnumerateArray())
 104                    {
 40800105                        if (item.ValueKind == JsonValueKind.Null)
 106                        {
 0107                            array.Add(null);
 108                        }
 109                        else
 110                        {
 40800111                            array.Add(item.GetString());
 112                        }
 113                    }
 40800114                    locations = array;
 40800115                    continue;
 116                }
 122012117                if (property.NameEquals("locationInfo"))
 118                {
 40800119                    if (property.Value.ValueKind == JsonValueKind.Null)
 120                    {
 121                        continue;
 122                    }
 40800123                    List<ResourceSkuLocationInfo> array = new List<ResourceSkuLocationInfo>();
 163200124                    foreach (var item in property.Value.EnumerateArray())
 125                    {
 40800126                        if (item.ValueKind == JsonValueKind.Null)
 127                        {
 0128                            array.Add(null);
 129                        }
 130                        else
 131                        {
 40800132                            array.Add(ResourceSkuLocationInfo.DeserializeResourceSkuLocationInfo(item));
 133                        }
 134                    }
 40800135                    locationInfo = array;
 40800136                    continue;
 137                }
 81212138                if (property.NameEquals("apiVersions"))
 139                {
 0140                    if (property.Value.ValueKind == JsonValueKind.Null)
 141                    {
 142                        continue;
 143                    }
 0144                    List<string> array = new List<string>();
 0145                    foreach (var item in property.Value.EnumerateArray())
 146                    {
 0147                        if (item.ValueKind == JsonValueKind.Null)
 148                        {
 0149                            array.Add(null);
 150                        }
 151                        else
 152                        {
 0153                            array.Add(item.GetString());
 154                        }
 155                    }
 0156                    apiVersions = array;
 0157                    continue;
 158                }
 81212159                if (property.NameEquals("costs"))
 160                {
 0161                    if (property.Value.ValueKind == JsonValueKind.Null)
 162                    {
 163                        continue;
 164                    }
 0165                    List<ResourceSkuCosts> array = new List<ResourceSkuCosts>();
 0166                    foreach (var item in property.Value.EnumerateArray())
 167                    {
 0168                        if (item.ValueKind == JsonValueKind.Null)
 169                        {
 0170                            array.Add(null);
 171                        }
 172                        else
 173                        {
 0174                            array.Add(ResourceSkuCosts.DeserializeResourceSkuCosts(item));
 175                        }
 176                    }
 0177                    costs = array;
 0178                    continue;
 179                }
 81212180                if (property.NameEquals("capabilities"))
 181                {
 40412182                    if (property.Value.ValueKind == JsonValueKind.Null)
 183                    {
 184                        continue;
 185                    }
 40412186                    List<ResourceSkuCapabilities> array = new List<ResourceSkuCapabilities>();
 1577720187                    foreach (var item in property.Value.EnumerateArray())
 188                    {
 748448189                        if (item.ValueKind == JsonValueKind.Null)
 190                        {
 0191                            array.Add(null);
 192                        }
 193                        else
 194                        {
 748448195                            array.Add(ResourceSkuCapabilities.DeserializeResourceSkuCapabilities(item));
 196                        }
 197                    }
 40412198                    capabilities = array;
 40412199                    continue;
 200                }
 40800201                if (property.NameEquals("restrictions"))
 202                {
 40800203                    if (property.Value.ValueKind == JsonValueKind.Null)
 204                    {
 205                        continue;
 206                    }
 40800207                    List<ResourceSkuRestrictions> array = new List<ResourceSkuRestrictions>();
 112024208                    foreach (var item in property.Value.EnumerateArray())
 209                    {
 15212210                        if (item.ValueKind == JsonValueKind.Null)
 211                        {
 0212                            array.Add(null);
 213                        }
 214                        else
 215                        {
 15212216                            array.Add(ResourceSkuRestrictions.DeserializeResourceSkuRestrictions(item));
 217                        }
 218                    }
 40800219                    restrictions = array;
 220                    continue;
 221                }
 222            }
 40800223            return new ResourceSku(resourceType, name, tier, size, family, kind, capacity, locations, locationInfo, apiV
 224        }
 225    }
 226}