< Summary

Class:Azure.ResourceManager.Compute.Models.RollingUpgradeRunningStatus
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RollingUpgradeRunningStatus.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RollingUpgradeRunningStatus.Serialization.cs
Covered lines:0
Uncovered lines:48
Coverable lines:48
Total lines:132
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_Code()-0%100%
get_StartTime()-0%100%
get_LastAction()-0%100%
get_LastActionTime()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeRollingUpgradeRunningStatus(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RollingUpgradeRunningStatus.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.Compute.Models
 11{
 12    /// <summary> Information about the current running state of the overall upgrade. </summary>
 13    public partial class RollingUpgradeRunningStatus
 14    {
 15        /// <summary> Initializes a new instance of RollingUpgradeRunningStatus. </summary>
 016        public RollingUpgradeRunningStatus()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of RollingUpgradeRunningStatus. </summary>
 21        /// <param name="code"> Code indicating the current status of the upgrade. </param>
 22        /// <param name="startTime"> Start time of the upgrade. </param>
 23        /// <param name="lastAction"> The last action performed on the rolling upgrade. </param>
 24        /// <param name="lastActionTime"> Last action time of the upgrade. </param>
 025        internal RollingUpgradeRunningStatus(RollingUpgradeStatusCode? code, DateTimeOffset? startTime, RollingUpgradeAc
 26        {
 027            Code = code;
 028            StartTime = startTime;
 029            LastAction = lastAction;
 030            LastActionTime = lastActionTime;
 031        }
 32
 33        /// <summary> Code indicating the current status of the upgrade. </summary>
 034        public RollingUpgradeStatusCode? Code { get; }
 35        /// <summary> Start time of the upgrade. </summary>
 036        public DateTimeOffset? StartTime { get; }
 37        /// <summary> The last action performed on the rolling upgrade. </summary>
 038        public RollingUpgradeActionType? LastAction { get; }
 39        /// <summary> Last action time of the upgrade. </summary>
 040        public DateTimeOffset? LastActionTime { get; }
 41    }
 42}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RollingUpgradeRunningStatus.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;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.Compute.Models
 13{
 14    public partial class RollingUpgradeRunningStatus : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Code != null)
 20            {
 021                writer.WritePropertyName("code");
 022                writer.WriteStringValue(Code.Value.ToSerialString());
 23            }
 024            if (StartTime != null)
 25            {
 026                writer.WritePropertyName("startTime");
 027                writer.WriteStringValue(StartTime.Value, "O");
 28            }
 029            if (LastAction != null)
 30            {
 031                writer.WritePropertyName("lastAction");
 032                writer.WriteStringValue(LastAction.Value.ToSerialString());
 33            }
 034            if (LastActionTime != null)
 35            {
 036                writer.WritePropertyName("lastActionTime");
 037                writer.WriteStringValue(LastActionTime.Value, "O");
 38            }
 039            writer.WriteEndObject();
 040        }
 41
 42        internal static RollingUpgradeRunningStatus DeserializeRollingUpgradeRunningStatus(JsonElement element)
 43        {
 044            RollingUpgradeStatusCode? code = default;
 045            DateTimeOffset? startTime = default;
 046            RollingUpgradeActionType? lastAction = default;
 047            DateTimeOffset? lastActionTime = default;
 048            foreach (var property in element.EnumerateObject())
 49            {
 050                if (property.NameEquals("code"))
 51                {
 052                    if (property.Value.ValueKind == JsonValueKind.Null)
 53                    {
 54                        continue;
 55                    }
 056                    code = property.Value.GetString().ToRollingUpgradeStatusCode();
 057                    continue;
 58                }
 059                if (property.NameEquals("startTime"))
 60                {
 061                    if (property.Value.ValueKind == JsonValueKind.Null)
 62                    {
 63                        continue;
 64                    }
 065                    startTime = property.Value.GetDateTimeOffset("O");
 066                    continue;
 67                }
 068                if (property.NameEquals("lastAction"))
 69                {
 070                    if (property.Value.ValueKind == JsonValueKind.Null)
 71                    {
 72                        continue;
 73                    }
 074                    lastAction = property.Value.GetString().ToRollingUpgradeActionType();
 075                    continue;
 76                }
 077                if (property.NameEquals("lastActionTime"))
 78                {
 079                    if (property.Value.ValueKind == JsonValueKind.Null)
 80                    {
 81                        continue;
 82                    }
 083                    lastActionTime = property.Value.GetDateTimeOffset("O");
 84                    continue;
 85                }
 86            }
 087            return new RollingUpgradeRunningStatus(code, startTime, lastAction, lastActionTime);
 88        }
 89    }
 90}