< Summary

Class:Azure.ResourceManager.Resources.Models.SkuAutoGenerated
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\SkuAutoGenerated.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\SkuAutoGenerated.Serialization.cs
Covered lines:0
Uncovered lines:69
Coverable lines:69
Total lines:169
Line coverage:0% (0 of 69)
Covered branches:0
Total branches:36
Branch coverage:0% (0 of 36)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Name()-0%100%
get_Tier()-0%100%
get_Size()-0%100%
get_Family()-0%100%
get_Model()-0%100%
get_Capacity()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeSkuAutoGenerated(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\SkuAutoGenerated.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.Resources.Models
 11{
 12    /// <summary> SKU for the resource. </summary>
 13    public partial class SkuAutoGenerated
 14    {
 15        /// <summary> Initializes a new instance of SkuAutoGenerated. </summary>
 16        /// <param name="name"> The SKU name. </param>
 017        public SkuAutoGenerated(string name)
 18        {
 019            if (name == null)
 20            {
 021                throw new ArgumentNullException(nameof(name));
 22            }
 23
 024            Name = name;
 025        }
 26
 27        /// <summary> Initializes a new instance of SkuAutoGenerated. </summary>
 28        /// <param name="name"> The SKU name. </param>
 29        /// <param name="tier"> The SKU tier. </param>
 30        /// <param name="size"> The SKU size. </param>
 31        /// <param name="family"> The SKU family. </param>
 32        /// <param name="model"> The SKU model. </param>
 33        /// <param name="capacity"> The SKU capacity. </param>
 034        internal SkuAutoGenerated(string name, string tier, string size, string family, string model, int? capacity)
 35        {
 036            Name = name;
 037            Tier = tier;
 038            Size = size;
 039            Family = family;
 040            Model = model;
 041            Capacity = capacity;
 042        }
 43
 44        /// <summary> The SKU name. </summary>
 045        public string Name { get; set; }
 46        /// <summary> The SKU tier. </summary>
 047        public string Tier { get; set; }
 48        /// <summary> The SKU size. </summary>
 049        public string Size { get; set; }
 50        /// <summary> The SKU family. </summary>
 051        public string Family { get; set; }
 52        /// <summary> The SKU model. </summary>
 053        public string Model { get; set; }
 54        /// <summary> The SKU capacity. </summary>
 055        public int? Capacity { get; set; }
 56    }
 57}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\SkuAutoGenerated.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.ResourceManager.Resources.Models
 12{
 13    public partial class SkuAutoGenerated : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("name");
 019            writer.WriteStringValue(Name);
 020            if (Tier != null)
 21            {
 022                writer.WritePropertyName("tier");
 023                writer.WriteStringValue(Tier);
 24            }
 025            if (Size != null)
 26            {
 027                writer.WritePropertyName("size");
 028                writer.WriteStringValue(Size);
 29            }
 030            if (Family != null)
 31            {
 032                writer.WritePropertyName("family");
 033                writer.WriteStringValue(Family);
 34            }
 035            if (Model != null)
 36            {
 037                writer.WritePropertyName("model");
 038                writer.WriteStringValue(Model);
 39            }
 040            if (Capacity != null)
 41            {
 042                writer.WritePropertyName("capacity");
 043                writer.WriteNumberValue(Capacity.Value);
 44            }
 045            writer.WriteEndObject();
 046        }
 47
 48        internal static SkuAutoGenerated DeserializeSkuAutoGenerated(JsonElement element)
 49        {
 050            string name = default;
 051            string tier = default;
 052            string size = default;
 053            string family = default;
 054            string model = default;
 055            int? capacity = default;
 056            foreach (var property in element.EnumerateObject())
 57            {
 058                if (property.NameEquals("name"))
 59                {
 060                    name = property.Value.GetString();
 061                    continue;
 62                }
 063                if (property.NameEquals("tier"))
 64                {
 065                    if (property.Value.ValueKind == JsonValueKind.Null)
 66                    {
 67                        continue;
 68                    }
 069                    tier = property.Value.GetString();
 070                    continue;
 71                }
 072                if (property.NameEquals("size"))
 73                {
 074                    if (property.Value.ValueKind == JsonValueKind.Null)
 75                    {
 76                        continue;
 77                    }
 078                    size = property.Value.GetString();
 079                    continue;
 80                }
 081                if (property.NameEquals("family"))
 82                {
 083                    if (property.Value.ValueKind == JsonValueKind.Null)
 84                    {
 85                        continue;
 86                    }
 087                    family = property.Value.GetString();
 088                    continue;
 89                }
 090                if (property.NameEquals("model"))
 91                {
 092                    if (property.Value.ValueKind == JsonValueKind.Null)
 93                    {
 94                        continue;
 95                    }
 096                    model = property.Value.GetString();
 097                    continue;
 98                }
 099                if (property.NameEquals("capacity"))
 100                {
 0101                    if (property.Value.ValueKind == JsonValueKind.Null)
 102                    {
 103                        continue;
 104                    }
 0105                    capacity = property.Value.GetInt32();
 106                    continue;
 107                }
 108            }
 0109            return new SkuAutoGenerated(name, tier, size, family, model, capacity);
 110        }
 111    }
 112}