< Summary

Class:Azure.ResourceManager.Compute.Models.UpgradeOperationHistoryStatus
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\UpgradeOperationHistoryStatus.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\UpgradeOperationHistoryStatus.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_Code()-0%100%
get_StartTime()-0%100%
get_EndTime()-0%100%
DeserializeUpgradeOperationHistoryStatus(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\UpgradeOperationHistoryStatus.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 UpgradeOperationHistoryStatus
 14    {
 15        /// <summary> Initializes a new instance of UpgradeOperationHistoryStatus. </summary>
 016        internal UpgradeOperationHistoryStatus()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of UpgradeOperationHistoryStatus. </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="endTime"> End time of the upgrade. </param>
 024        internal UpgradeOperationHistoryStatus(UpgradeState? code, DateTimeOffset? startTime, DateTimeOffset? endTime)
 25        {
 026            Code = code;
 027            StartTime = startTime;
 028            EndTime = endTime;
 029        }
 30
 31        /// <summary> Code indicating the current status of the upgrade. </summary>
 032        public UpgradeState? Code { get; }
 33        /// <summary> Start time of the upgrade. </summary>
 034        public DateTimeOffset? StartTime { get; }
 35        /// <summary> End time of the upgrade. </summary>
 036        public DateTimeOffset? EndTime { get; }
 37    }
 38}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\UpgradeOperationHistoryStatus.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 UpgradeOperationHistoryStatus
 15    {
 16        internal static UpgradeOperationHistoryStatus DeserializeUpgradeOperationHistoryStatus(JsonElement element)
 17        {
 018            UpgradeState? code = default;
 019            DateTimeOffset? startTime = default;
 020            DateTimeOffset? endTime = default;
 021            foreach (var property in element.EnumerateObject())
 22            {
 023                if (property.NameEquals("code"))
 24                {
 025                    if (property.Value.ValueKind == JsonValueKind.Null)
 26                    {
 27                        continue;
 28                    }
 029                    code = property.Value.GetString().ToUpgradeState();
 030                    continue;
 31                }
 032                if (property.NameEquals("startTime"))
 33                {
 034                    if (property.Value.ValueKind == JsonValueKind.Null)
 35                    {
 36                        continue;
 37                    }
 038                    startTime = property.Value.GetDateTimeOffset("O");
 039                    continue;
 40                }
 041                if (property.NameEquals("endTime"))
 42                {
 043                    if (property.Value.ValueKind == JsonValueKind.Null)
 44                    {
 45                        continue;
 46                    }
 047                    endTime = property.Value.GetDateTimeOffset("O");
 48                    continue;
 49                }
 50            }
 051            return new UpgradeOperationHistoryStatus(code, startTime, endTime);
 52        }
 53    }
 54}