< Summary

Class:Azure.ResourceManager.Compute.Models.Disallowed
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\Disallowed.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\Disallowed.Serialization.cs
Covered lines:0
Uncovered lines:26
Coverable lines:26
Total lines:92
Line coverage:0% (0 of 26)
Covered branches:0
Total branches:14
Branch coverage:0% (0 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_DiskTypes()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeDisallowed(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\Disallowed.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 the disallowed disk types. </summary>
 13    public partial class Disallowed
 14    {
 15        /// <summary> Initializes a new instance of Disallowed. </summary>
 016        public Disallowed()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of Disallowed. </summary>
 21        /// <param name="diskTypes"> A list of disk types. </param>
 022        internal Disallowed(IList<string> diskTypes)
 23        {
 024            DiskTypes = diskTypes;
 025        }
 26
 27        /// <summary> A list of disk types. </summary>
 028        public IList<string> DiskTypes { get; set; }
 29    }
 30}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\Disallowed.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 Disallowed : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (DiskTypes != null)
 20            {
 021                writer.WritePropertyName("diskTypes");
 022                writer.WriteStartArray();
 023                foreach (var item in DiskTypes)
 24                {
 025                    writer.WriteStringValue(item);
 26                }
 027                writer.WriteEndArray();
 28            }
 029            writer.WriteEndObject();
 030        }
 31
 32        internal static Disallowed DeserializeDisallowed(JsonElement element)
 33        {
 034            IList<string> diskTypes = default;
 035            foreach (var property in element.EnumerateObject())
 36            {
 037                if (property.NameEquals("diskTypes"))
 38                {
 039                    if (property.Value.ValueKind == JsonValueKind.Null)
 40                    {
 41                        continue;
 42                    }
 043                    List<string> array = new List<string>();
 044                    foreach (var item in property.Value.EnumerateArray())
 45                    {
 046                        if (item.ValueKind == JsonValueKind.Null)
 47                        {
 048                            array.Add(null);
 49                        }
 50                        else
 51                        {
 052                            array.Add(item.GetString());
 53                        }
 54                    }
 055                    diskTypes = array;
 56                    continue;
 57                }
 58            }
 059            return new Disallowed(diskTypes);
 60        }
 61    }
 62}