< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_SuccessfulInstanceCount()-0%100%
get_FailedInstanceCount()-0%100%
get_InProgressInstanceCount()-0%100%
get_PendingInstanceCount()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeRollingUpgradeProgressInfo(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RollingUpgradeProgressInfo.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
 8namespace Azure.ResourceManager.Compute.Models
 9{
 10    /// <summary> Information about the number of virtual machine instances in each upgrade state. </summary>
 11    public partial class RollingUpgradeProgressInfo
 12    {
 13        /// <summary> Initializes a new instance of RollingUpgradeProgressInfo. </summary>
 014        public RollingUpgradeProgressInfo()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of RollingUpgradeProgressInfo. </summary>
 19        /// <param name="successfulInstanceCount"> The number of instances that have been successfully upgraded. </param
 20        /// <param name="failedInstanceCount"> The number of instances that have failed to be upgraded successfully. </p
 21        /// <param name="inProgressInstanceCount"> The number of instances that are currently being upgraded. </param>
 22        /// <param name="pendingInstanceCount"> The number of instances that have not yet begun to be upgraded. </param>
 023        internal RollingUpgradeProgressInfo(int? successfulInstanceCount, int? failedInstanceCount, int? inProgressInsta
 24        {
 025            SuccessfulInstanceCount = successfulInstanceCount;
 026            FailedInstanceCount = failedInstanceCount;
 027            InProgressInstanceCount = inProgressInstanceCount;
 028            PendingInstanceCount = pendingInstanceCount;
 029        }
 30
 31        /// <summary> The number of instances that have been successfully upgraded. </summary>
 032        public int? SuccessfulInstanceCount { get; }
 33        /// <summary> The number of instances that have failed to be upgraded successfully. </summary>
 034        public int? FailedInstanceCount { get; }
 35        /// <summary> The number of instances that are currently being upgraded. </summary>
 036        public int? InProgressInstanceCount { get; }
 37        /// <summary> The number of instances that have not yet begun to be upgraded. </summary>
 038        public int? PendingInstanceCount { get; }
 39    }
 40}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RollingUpgradeProgressInfo.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.Compute.Models
 12{
 13    public partial class RollingUpgradeProgressInfo : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (SuccessfulInstanceCount != null)
 19            {
 020                writer.WritePropertyName("successfulInstanceCount");
 021                writer.WriteNumberValue(SuccessfulInstanceCount.Value);
 22            }
 023            if (FailedInstanceCount != null)
 24            {
 025                writer.WritePropertyName("failedInstanceCount");
 026                writer.WriteNumberValue(FailedInstanceCount.Value);
 27            }
 028            if (InProgressInstanceCount != null)
 29            {
 030                writer.WritePropertyName("inProgressInstanceCount");
 031                writer.WriteNumberValue(InProgressInstanceCount.Value);
 32            }
 033            if (PendingInstanceCount != null)
 34            {
 035                writer.WritePropertyName("pendingInstanceCount");
 036                writer.WriteNumberValue(PendingInstanceCount.Value);
 37            }
 038            writer.WriteEndObject();
 039        }
 40
 41        internal static RollingUpgradeProgressInfo DeserializeRollingUpgradeProgressInfo(JsonElement element)
 42        {
 043            int? successfulInstanceCount = default;
 044            int? failedInstanceCount = default;
 045            int? inProgressInstanceCount = default;
 046            int? pendingInstanceCount = default;
 047            foreach (var property in element.EnumerateObject())
 48            {
 049                if (property.NameEquals("successfulInstanceCount"))
 50                {
 051                    if (property.Value.ValueKind == JsonValueKind.Null)
 52                    {
 53                        continue;
 54                    }
 055                    successfulInstanceCount = property.Value.GetInt32();
 056                    continue;
 57                }
 058                if (property.NameEquals("failedInstanceCount"))
 59                {
 060                    if (property.Value.ValueKind == JsonValueKind.Null)
 61                    {
 62                        continue;
 63                    }
 064                    failedInstanceCount = property.Value.GetInt32();
 065                    continue;
 66                }
 067                if (property.NameEquals("inProgressInstanceCount"))
 68                {
 069                    if (property.Value.ValueKind == JsonValueKind.Null)
 70                    {
 71                        continue;
 72                    }
 073                    inProgressInstanceCount = property.Value.GetInt32();
 074                    continue;
 75                }
 076                if (property.NameEquals("pendingInstanceCount"))
 77                {
 078                    if (property.Value.ValueKind == JsonValueKind.Null)
 79                    {
 80                        continue;
 81                    }
 082                    pendingInstanceCount = property.Value.GetInt32();
 83                    continue;
 84                }
 85            }
 086            return new RollingUpgradeProgressInfo(successfulInstanceCount, failedInstanceCount, inProgressInstanceCount,
 87        }
 88    }
 89}