< Summary

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

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ScaleInPolicy.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 a scale-in policy for a virtual machine scale set. </summary>
 13    public partial class ScaleInPolicy
 14    {
 15        /// <summary> Initializes a new instance of ScaleInPolicy. </summary>
 016        public ScaleInPolicy()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ScaleInPolicy. </summary>
 21        /// <param name="rules"> The rules to be followed when scaling-in a virtual machine scale set. &lt;br&gt;&lt;br&
 022        internal ScaleInPolicy(IList<VirtualMachineScaleSetScaleInRules> rules)
 23        {
 024            Rules = rules;
 025        }
 26
 27        /// <summary> The rules to be followed when scaling-in a virtual machine scale set. &lt;br&gt;&lt;br&gt; Possibl
 028        public IList<VirtualMachineScaleSetScaleInRules> Rules { get; set; }
 29    }
 30}

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