< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Policy()-0%100%
get_RunningStatus()-0%100%
get_Progress()-0%100%
get_Error()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeRollingUpgradeStatusInfo(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RollingUpgradeStatusInfo.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.Collections.Generic;
 10
 11namespace Azure.ResourceManager.Compute.Models
 12{
 13    /// <summary> The status of the latest virtual machine scale set rolling upgrade. </summary>
 14    public partial class RollingUpgradeStatusInfo : Resource
 15    {
 16        /// <summary> Initializes a new instance of RollingUpgradeStatusInfo. </summary>
 17        /// <param name="location"> Resource location. </param>
 018        public RollingUpgradeStatusInfo(string location) : base(location)
 19        {
 020            if (location == null)
 21            {
 022                throw new ArgumentNullException(nameof(location));
 23            }
 024        }
 25
 26        /// <summary> Initializes a new instance of RollingUpgradeStatusInfo. </summary>
 27        /// <param name="id"> Resource Id. </param>
 28        /// <param name="name"> Resource name. </param>
 29        /// <param name="type"> Resource type. </param>
 30        /// <param name="location"> Resource location. </param>
 31        /// <param name="tags"> Resource tags. </param>
 32        /// <param name="policy"> The rolling upgrade policies applied for this upgrade. </param>
 33        /// <param name="runningStatus"> Information about the current running state of the overall upgrade. </param>
 34        /// <param name="progress"> Information about the number of virtual machine instances in each upgrade state. </p
 35        /// <param name="error"> Error details for this upgrade, if there are any. </param>
 036        internal RollingUpgradeStatusInfo(string id, string name, string type, string location, IDictionary<string, stri
 37        {
 038            Policy = policy;
 039            RunningStatus = runningStatus;
 040            Progress = progress;
 041            Error = error;
 042        }
 43
 44        /// <summary> The rolling upgrade policies applied for this upgrade. </summary>
 045        public RollingUpgradePolicy Policy { get; }
 46        /// <summary> Information about the current running state of the overall upgrade. </summary>
 047        public RollingUpgradeRunningStatus RunningStatus { get; }
 48        /// <summary> Information about the number of virtual machine instances in each upgrade state. </summary>
 049        public RollingUpgradeProgressInfo Progress { get; }
 50        /// <summary> Error details for this upgrade, if there are any. </summary>
 051        public ApiError Error { get; }
 52    }
 53}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RollingUpgradeStatusInfo.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 RollingUpgradeStatusInfo : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Id != null)
 20            {
 021                writer.WritePropertyName("id");
 022                writer.WriteStringValue(Id);
 23            }
 024            if (Name != null)
 25            {
 026                writer.WritePropertyName("name");
 027                writer.WriteStringValue(Name);
 28            }
 029            if (Type != null)
 30            {
 031                writer.WritePropertyName("type");
 032                writer.WriteStringValue(Type);
 33            }
 034            writer.WritePropertyName("location");
 035            writer.WriteStringValue(Location);
 036            if (Tags != null)
 37            {
 038                writer.WritePropertyName("tags");
 039                writer.WriteStartObject();
 040                foreach (var item in Tags)
 41                {
 042                    writer.WritePropertyName(item.Key);
 043                    writer.WriteStringValue(item.Value);
 44                }
 045                writer.WriteEndObject();
 46            }
 047            writer.WritePropertyName("properties");
 048            writer.WriteStartObject();
 049            if (Policy != null)
 50            {
 051                writer.WritePropertyName("policy");
 052                writer.WriteObjectValue(Policy);
 53            }
 054            if (RunningStatus != null)
 55            {
 056                writer.WritePropertyName("runningStatus");
 057                writer.WriteObjectValue(RunningStatus);
 58            }
 059            if (Progress != null)
 60            {
 061                writer.WritePropertyName("progress");
 062                writer.WriteObjectValue(Progress);
 63            }
 064            if (Error != null)
 65            {
 066                writer.WritePropertyName("error");
 067                writer.WriteObjectValue(Error);
 68            }
 069            writer.WriteEndObject();
 070            writer.WriteEndObject();
 071        }
 72
 73        internal static RollingUpgradeStatusInfo DeserializeRollingUpgradeStatusInfo(JsonElement element)
 74        {
 075            string id = default;
 076            string name = default;
 077            string type = default;
 078            string location = default;
 079            IDictionary<string, string> tags = default;
 080            RollingUpgradePolicy policy = default;
 081            RollingUpgradeRunningStatus runningStatus = default;
 082            RollingUpgradeProgressInfo progress = default;
 083            ApiError error = default;
 084            foreach (var property in element.EnumerateObject())
 85            {
 086                if (property.NameEquals("id"))
 87                {
 088                    if (property.Value.ValueKind == JsonValueKind.Null)
 89                    {
 90                        continue;
 91                    }
 092                    id = property.Value.GetString();
 093                    continue;
 94                }
 095                if (property.NameEquals("name"))
 96                {
 097                    if (property.Value.ValueKind == JsonValueKind.Null)
 98                    {
 99                        continue;
 100                    }
 0101                    name = property.Value.GetString();
 0102                    continue;
 103                }
 0104                if (property.NameEquals("type"))
 105                {
 0106                    if (property.Value.ValueKind == JsonValueKind.Null)
 107                    {
 108                        continue;
 109                    }
 0110                    type = property.Value.GetString();
 0111                    continue;
 112                }
 0113                if (property.NameEquals("location"))
 114                {
 0115                    location = property.Value.GetString();
 0116                    continue;
 117                }
 0118                if (property.NameEquals("tags"))
 119                {
 0120                    if (property.Value.ValueKind == JsonValueKind.Null)
 121                    {
 122                        continue;
 123                    }
 0124                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0125                    foreach (var property0 in property.Value.EnumerateObject())
 126                    {
 0127                        if (property0.Value.ValueKind == JsonValueKind.Null)
 128                        {
 0129                            dictionary.Add(property0.Name, null);
 130                        }
 131                        else
 132                        {
 0133                            dictionary.Add(property0.Name, property0.Value.GetString());
 134                        }
 135                    }
 0136                    tags = dictionary;
 0137                    continue;
 138                }
 0139                if (property.NameEquals("properties"))
 140                {
 0141                    foreach (var property0 in property.Value.EnumerateObject())
 142                    {
 0143                        if (property0.NameEquals("policy"))
 144                        {
 0145                            if (property0.Value.ValueKind == JsonValueKind.Null)
 146                            {
 147                                continue;
 148                            }
 0149                            policy = RollingUpgradePolicy.DeserializeRollingUpgradePolicy(property0.Value);
 0150                            continue;
 151                        }
 0152                        if (property0.NameEquals("runningStatus"))
 153                        {
 0154                            if (property0.Value.ValueKind == JsonValueKind.Null)
 155                            {
 156                                continue;
 157                            }
 0158                            runningStatus = RollingUpgradeRunningStatus.DeserializeRollingUpgradeRunningStatus(property0
 0159                            continue;
 160                        }
 0161                        if (property0.NameEquals("progress"))
 162                        {
 0163                            if (property0.Value.ValueKind == JsonValueKind.Null)
 164                            {
 165                                continue;
 166                            }
 0167                            progress = RollingUpgradeProgressInfo.DeserializeRollingUpgradeProgressInfo(property0.Value)
 0168                            continue;
 169                        }
 0170                        if (property0.NameEquals("error"))
 171                        {
 0172                            if (property0.Value.ValueKind == JsonValueKind.Null)
 173                            {
 174                                continue;
 175                            }
 0176                            error = ApiError.DeserializeApiError(property0.Value);
 177                            continue;
 178                        }
 179                    }
 180                    continue;
 181                }
 182            }
 0183            return new RollingUpgradeStatusInfo(id, name, type, location, tags, policy, runningStatus, progress, error);
 184        }
 185    }
 186}