< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_Code()-100%100%
get_Level()-100%100%
get_DisplayStatus()-100%100%
get_Message()-100%100%
get_Time()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeInstanceViewStatus(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\InstanceViewStatus.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> Instance view status. </summary>
 13    public partial class InstanceViewStatus
 14    {
 15        /// <summary> Initializes a new instance of InstanceViewStatus. </summary>
 1216        public InstanceViewStatus()
 17        {
 1218        }
 19
 20        /// <summary> Initializes a new instance of InstanceViewStatus. </summary>
 21        /// <param name="code"> The status code. </param>
 22        /// <param name="level"> The level code. </param>
 23        /// <param name="displayStatus"> The short localizable label for the status. </param>
 24        /// <param name="message"> The detailed status message, including for alerts and error messages. </param>
 25        /// <param name="time"> The time of the status. </param>
 98026        internal InstanceViewStatus(string code, StatusLevelTypes? level, string displayStatus, string message, DateTime
 27        {
 98028            Code = code;
 98029            Level = level;
 98030            DisplayStatus = displayStatus;
 98031            Message = message;
 98032            Time = time;
 98033        }
 34
 35        /// <summary> The status code. </summary>
 122036        public string Code { get; set; }
 37        /// <summary> The level code. </summary>
 116438        public StatusLevelTypes? Level { get; set; }
 39        /// <summary> The short localizable label for the status. </summary>
 116840        public string DisplayStatus { get; set; }
 41        /// <summary> The detailed status message, including for alerts and error messages. </summary>
 108842        public string Message { get; set; }
 43        /// <summary> The time of the status. </summary>
 112444        public DateTimeOffset? Time { get; set; }
 45    }
 46}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\InstanceViewStatus.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 InstanceViewStatus : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 8018            writer.WriteStartObject();
 8019            if (Code != null)
 20            {
 8021                writer.WritePropertyName("code");
 8022                writer.WriteStringValue(Code);
 23            }
 8024            if (Level != null)
 25            {
 8026                writer.WritePropertyName("level");
 8027                writer.WriteStringValue(Level.Value.ToSerialString());
 28            }
 8029            if (DisplayStatus != null)
 30            {
 8031                writer.WritePropertyName("displayStatus");
 8032                writer.WriteStringValue(DisplayStatus);
 33            }
 8034            if (Message != null)
 35            {
 1636                writer.WritePropertyName("message");
 1637                writer.WriteStringValue(Message);
 38            }
 8039            if (Time != null)
 40            {
 6441                writer.WritePropertyName("time");
 6442                writer.WriteStringValue(Time.Value, "O");
 43            }
 8044            writer.WriteEndObject();
 8045        }
 46
 47        internal static InstanceViewStatus DeserializeInstanceViewStatus(JsonElement element)
 48        {
 98049            string code = default;
 98050            StatusLevelTypes? level = default;
 98051            string displayStatus = default;
 98052            string message = default;
 98053            DateTimeOffset? time = default;
 981654            foreach (var property in element.EnumerateObject())
 55            {
 392856                if (property.NameEquals("code"))
 57                {
 98058                    if (property.Value.ValueKind == JsonValueKind.Null)
 59                    {
 60                        continue;
 61                    }
 98062                    code = property.Value.GetString();
 98063                    continue;
 64                }
 294865                if (property.NameEquals("level"))
 66                {
 98067                    if (property.Value.ValueKind == JsonValueKind.Null)
 68                    {
 69                        continue;
 70                    }
 98071                    level = property.Value.GetString().ToStatusLevelTypes();
 98072                    continue;
 73                }
 196874                if (property.NameEquals("displayStatus"))
 75                {
 97676                    if (property.Value.ValueKind == JsonValueKind.Null)
 77                    {
 78                        continue;
 79                    }
 97680                    displayStatus = property.Value.GetString();
 97681                    continue;
 82                }
 99283                if (property.NameEquals("message"))
 84                {
 26085                    if (property.Value.ValueKind == JsonValueKind.Null)
 86                    {
 87                        continue;
 88                    }
 26089                    message = property.Value.GetString();
 26090                    continue;
 91                }
 73292                if (property.NameEquals("time"))
 93                {
 73294                    if (property.Value.ValueKind == JsonValueKind.Null)
 95                    {
 96                        continue;
 97                    }
 73298                    time = property.Value.GetDateTimeOffset("O");
 99                    continue;
 100                }
 101            }
 980102            return new InstanceViewStatus(code, level, displayStatus, message, time);
 103        }
 104    }
 105}