< Summary

Class:Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetExtension
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetExtension.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetExtension.Serialization.cs
Covered lines:122
Uncovered lines:17
Coverable lines:139
Total lines:308
Line coverage:87.7% (122 of 139)
Covered branches:75
Total branches:84
Branch coverage:89.2% (75 of 84)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Name()-100%100%
get_Type()-100%100%
get_ForceUpdateTag()-100%100%
get_Publisher()-100%100%
get_TypePropertiesType()-100%100%
get_TypeHandlerVersion()-100%100%
get_AutoUpgradeMinorVersion()-100%100%
get_Settings()-100%100%
get_ProtectedSettings()-100%100%
get_ProvisioningState()-100%100%
get_ProvisionAfterExtensions()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-82.22%84.62%
DeserializeVirtualMachineScaleSetExtension(...)-89.71%91.38%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetExtension.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;
 9
 10namespace Azure.ResourceManager.Compute.Models
 11{
 12    /// <summary> Describes a Virtual Machine Scale Set Extension. </summary>
 13    public partial class VirtualMachineScaleSetExtension : SubResourceReadOnly
 14    {
 15        /// <summary> Initializes a new instance of VirtualMachineScaleSetExtension. </summary>
 016        public VirtualMachineScaleSetExtension()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of VirtualMachineScaleSetExtension. </summary>
 21        /// <param name="id"> Resource Id. </param>
 22        /// <param name="name"> The name of the extension. </param>
 23        /// <param name="type"> Resource type. </param>
 24        /// <param name="forceUpdateTag"> If a value is provided and is different from the previous value, the extension
 25        /// <param name="publisher"> The name of the extension handler publisher. </param>
 26        /// <param name="typePropertiesType"> Specifies the type of the extension; an example is &quot;CustomScriptExten
 27        /// <param name="typeHandlerVersion"> Specifies the version of the script handler. </param>
 28        /// <param name="autoUpgradeMinorVersion"> Indicates whether the extension should use a newer minor version if o
 29        /// <param name="settings"> Json formatted public settings for the extension. </param>
 30        /// <param name="protectedSettings"> The extension can contain either protectedSettings or protectedSettingsFrom
 31        /// <param name="provisioningState"> The provisioning state, which only appears in the response. </param>
 32        /// <param name="provisionAfterExtensions"> Collection of extension names after which this extension needs to be
 52433        internal VirtualMachineScaleSetExtension(string id, string name, string type, string forceUpdateTag, string publ
 34        {
 52435            Name = name;
 52436            Type = type;
 52437            ForceUpdateTag = forceUpdateTag;
 52438            Publisher = publisher;
 52439            TypePropertiesType = typePropertiesType;
 52440            TypeHandlerVersion = typeHandlerVersion;
 52441            AutoUpgradeMinorVersion = autoUpgradeMinorVersion;
 52442            Settings = settings;
 52443            ProtectedSettings = protectedSettings;
 52444            ProvisioningState = provisioningState;
 52445            ProvisionAfterExtensions = provisionAfterExtensions;
 52446        }
 47
 48        /// <summary> The name of the extension. </summary>
 64049        public string Name { get; set; }
 50        /// <summary> Resource type. </summary>
 3251        public string Type { get; }
 52        /// <summary> If a value is provided and is different from the previous value, the extension handler will be for
 62053        public string ForceUpdateTag { get; set; }
 54        /// <summary> The name of the extension handler publisher. </summary>
 65255        public string Publisher { get; set; }
 56        /// <summary> Specifies the type of the extension; an example is &quot;CustomScriptExtension&quot;. </summary>
 65257        public string TypePropertiesType { get; set; }
 58        /// <summary> Specifies the version of the script handler. </summary>
 65259        public string TypeHandlerVersion { get; set; }
 60        /// <summary> Indicates whether the extension should use a newer minor version if one is available at deployment
 65261        public bool? AutoUpgradeMinorVersion { get; set; }
 62        /// <summary> Json formatted public settings for the extension. </summary>
 65263        public object Settings { get; set; }
 64        /// <summary> The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protecte
 58865        public object ProtectedSettings { get; set; }
 66        /// <summary> The provisioning state, which only appears in the response. </summary>
 6467        public string ProvisioningState { get; }
 68        /// <summary> Collection of extension names after which this extension needs to be provisioned. </summary>
 74469        public IList<string> ProvisionAfterExtensions { get; set; }
 70    }
 71}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetExtension.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 VirtualMachineScaleSetExtension : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 3218            writer.WriteStartObject();
 3219            if (Name != null)
 20            {
 3221                writer.WritePropertyName("name");
 3222                writer.WriteStringValue(Name);
 23            }
 3224            if (Type != null)
 25            {
 026                writer.WritePropertyName("type");
 027                writer.WriteStringValue(Type);
 28            }
 3229            if (Id != null)
 30            {
 031                writer.WritePropertyName("id");
 032                writer.WriteStringValue(Id);
 33            }
 3234            writer.WritePropertyName("properties");
 3235            writer.WriteStartObject();
 3236            if (ForceUpdateTag != null)
 37            {
 038                writer.WritePropertyName("forceUpdateTag");
 039                writer.WriteStringValue(ForceUpdateTag);
 40            }
 3241            if (Publisher != null)
 42            {
 3243                writer.WritePropertyName("publisher");
 3244                writer.WriteStringValue(Publisher);
 45            }
 3246            if (TypePropertiesType != null)
 47            {
 3248                writer.WritePropertyName("type");
 3249                writer.WriteStringValue(TypePropertiesType);
 50            }
 3251            if (TypeHandlerVersion != null)
 52            {
 3253                writer.WritePropertyName("typeHandlerVersion");
 3254                writer.WriteStringValue(TypeHandlerVersion);
 55            }
 3256            if (AutoUpgradeMinorVersion != null)
 57            {
 3258                writer.WritePropertyName("autoUpgradeMinorVersion");
 3259                writer.WriteBooleanValue(AutoUpgradeMinorVersion.Value);
 60            }
 3261            if (Settings != null)
 62            {
 3263                writer.WritePropertyName("settings");
 3264                writer.WriteObjectValue(Settings);
 65            }
 3266            if (ProtectedSettings != null)
 67            {
 3268                writer.WritePropertyName("protectedSettings");
 3269                writer.WriteObjectValue(ProtectedSettings);
 70            }
 3271            if (ProvisioningState != null)
 72            {
 073                writer.WritePropertyName("provisioningState");
 074                writer.WriteStringValue(ProvisioningState);
 75            }
 3276            if (ProvisionAfterExtensions != null)
 77            {
 2478                writer.WritePropertyName("provisionAfterExtensions");
 2479                writer.WriteStartArray();
 8080                foreach (var item in ProvisionAfterExtensions)
 81                {
 1682                    writer.WriteStringValue(item);
 83                }
 2484                writer.WriteEndArray();
 85            }
 3286            writer.WriteEndObject();
 3287            writer.WriteEndObject();
 3288        }
 89
 90        internal static VirtualMachineScaleSetExtension DeserializeVirtualMachineScaleSetExtension(JsonElement element)
 91        {
 48892            string name = default;
 48893            string type = default;
 48894            string id = default;
 48895            string forceUpdateTag = default;
 48896            string publisher = default;
 48897            string type0 = default;
 48898            string typeHandlerVersion = default;
 48899            bool? autoUpgradeMinorVersion = default;
 488100            object settings = default;
 488101            object protectedSettings = default;
 488102            string provisioningState = default;
 488103            IList<string> provisionAfterExtensions = default;
 3056104            foreach (var property in element.EnumerateObject())
 105            {
 1040106                if (property.NameEquals("name"))
 107                {
 488108                    if (property.Value.ValueKind == JsonValueKind.Null)
 109                    {
 110                        continue;
 111                    }
 488112                    name = property.Value.GetString();
 488113                    continue;
 114                }
 552115                if (property.NameEquals("type"))
 116                {
 32117                    if (property.Value.ValueKind == JsonValueKind.Null)
 118                    {
 119                        continue;
 120                    }
 32121                    type = property.Value.GetString();
 32122                    continue;
 123                }
 520124                if (property.NameEquals("id"))
 125                {
 32126                    if (property.Value.ValueKind == JsonValueKind.Null)
 127                    {
 128                        continue;
 129                    }
 32130                    id = property.Value.GetString();
 32131                    continue;
 132                }
 488133                if (property.NameEquals("properties"))
 134                {
 6624135                    foreach (var property0 in property.Value.EnumerateObject())
 136                    {
 2824137                        if (property0.NameEquals("forceUpdateTag"))
 138                        {
 0139                            if (property0.Value.ValueKind == JsonValueKind.Null)
 140                            {
 141                                continue;
 142                            }
 0143                            forceUpdateTag = property0.Value.GetString();
 0144                            continue;
 145                        }
 2824146                        if (property0.NameEquals("publisher"))
 147                        {
 488148                            if (property0.Value.ValueKind == JsonValueKind.Null)
 149                            {
 150                                continue;
 151                            }
 488152                            publisher = property0.Value.GetString();
 488153                            continue;
 154                        }
 2336155                        if (property0.NameEquals("type"))
 156                        {
 488157                            if (property0.Value.ValueKind == JsonValueKind.Null)
 158                            {
 159                                continue;
 160                            }
 488161                            type0 = property0.Value.GetString();
 488162                            continue;
 163                        }
 1848164                        if (property0.NameEquals("typeHandlerVersion"))
 165                        {
 488166                            if (property0.Value.ValueKind == JsonValueKind.Null)
 167                            {
 168                                continue;
 169                            }
 488170                            typeHandlerVersion = property0.Value.GetString();
 488171                            continue;
 172                        }
 1360173                        if (property0.NameEquals("autoUpgradeMinorVersion"))
 174                        {
 488175                            if (property0.Value.ValueKind == JsonValueKind.Null)
 176                            {
 177                                continue;
 178                            }
 488179                            autoUpgradeMinorVersion = property0.Value.GetBoolean();
 488180                            continue;
 181                        }
 872182                        if (property0.NameEquals("settings"))
 183                        {
 488184                            if (property0.Value.ValueKind == JsonValueKind.Null)
 185                            {
 186                                continue;
 187                            }
 488188                            settings = property0.Value.GetObject();
 488189                            continue;
 190                        }
 384191                        if (property0.NameEquals("protectedSettings"))
 192                        {
 0193                            if (property0.Value.ValueKind == JsonValueKind.Null)
 194                            {
 195                                continue;
 196                            }
 0197                            protectedSettings = property0.Value.GetObject();
 0198                            continue;
 199                        }
 384200                        if (property0.NameEquals("provisioningState"))
 201                        {
 32202                            if (property0.Value.ValueKind == JsonValueKind.Null)
 203                            {
 204                                continue;
 205                            }
 32206                            provisioningState = property0.Value.GetString();
 32207                            continue;
 208                        }
 352209                        if (property0.NameEquals("provisionAfterExtensions"))
 210                        {
 32211                            if (property0.Value.ValueKind == JsonValueKind.Null)
 212                            {
 213                                continue;
 214                            }
 32215                            List<string> array = new List<string>();
 112216                            foreach (var item in property0.Value.EnumerateArray())
 217                            {
 24218                                if (item.ValueKind == JsonValueKind.Null)
 219                                {
 0220                                    array.Add(null);
 221                                }
 222                                else
 223                                {
 24224                                    array.Add(item.GetString());
 225                                }
 226                            }
 32227                            provisionAfterExtensions = array;
 228                            continue;
 229                        }
 230                    }
 231                    continue;
 232                }
 233            }
 488234            return new VirtualMachineScaleSetExtension(id, name, type, forceUpdateTag, publisher, type0, typeHandlerVers
 235        }
 236    }
 237}