< Summary

Class:Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetOSProfile
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetOSProfile.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetOSProfile.Serialization.cs
Covered lines:67
Uncovered lines:19
Coverable lines:86
Total lines:206
Line coverage:77.9% (67 of 86)
Covered branches:38
Total branches:50
Branch coverage:76% (38 of 50)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_ComputerNamePrefix()-100%100%
get_AdminUsername()-100%100%
get_AdminPassword()-100%100%
get_CustomData()-100%100%
get_WindowsConfiguration()-100%100%
get_LinuxConfiguration()-100%100%
get_Secrets()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-66.67%68.75%
DeserializeVirtualMachineScaleSetOSProfile(...)-75.61%79.41%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetOSProfile.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 OS profile. </summary>
 13    public partial class VirtualMachineScaleSetOSProfile
 14    {
 15        /// <summary> Initializes a new instance of VirtualMachineScaleSetOSProfile. </summary>
 16016        public VirtualMachineScaleSetOSProfile()
 17        {
 16018        }
 19
 20        /// <summary> Initializes a new instance of VirtualMachineScaleSetOSProfile. </summary>
 21        /// <param name="computerNamePrefix"> Specifies the computer name prefix for all of the virtual machines in the 
 22        /// <param name="adminUsername"> Specifies the name of the administrator account. &lt;br&gt;&lt;br&gt; **Windows
 23        /// <param name="adminPassword"> Specifies the password of the administrator account. &lt;br&gt;&lt;br&gt; **Min
 24        /// <param name="customData"> Specifies a base-64 encoded string of custom data. The base-64 encoded string is d
 25        /// <param name="windowsConfiguration"> Specifies Windows operating system settings on the virtual machine. </pa
 26        /// <param name="linuxConfiguration"> Specifies the Linux operating system settings on the virtual machine. &lt;
 27        /// <param name="secrets"> Specifies set of certificates that should be installed onto the virtual machines in t
 44828        internal VirtualMachineScaleSetOSProfile(string computerNamePrefix, string adminUsername, string adminPassword, 
 29        {
 44830            ComputerNamePrefix = computerNamePrefix;
 44831            AdminUsername = adminUsername;
 44832            AdminPassword = adminPassword;
 44833            CustomData = customData;
 44834            WindowsConfiguration = windowsConfiguration;
 44835            LinuxConfiguration = linuxConfiguration;
 44836            Secrets = secrets;
 44837        }
 38
 39        /// <summary> Specifies the computer name prefix for all of the virtual machines in the scale set. Computer name
 136840        public string ComputerNamePrefix { get; set; }
 41        /// <summary> Specifies the name of the administrator account. &lt;br&gt;&lt;br&gt; **Windows-only restriction:*
 136842        public string AdminUsername { get; set; }
 43        /// <summary> Specifies the password of the administrator account. &lt;br&gt;&lt;br&gt; **Minimum-length (Window
 136844        public string AdminPassword { get; set; }
 45        /// <summary> Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a bina
 136846        public string CustomData { get; set; }
 47        /// <summary> Specifies Windows operating system settings on the virtual machine. </summary>
 81248        public WindowsConfiguration WindowsConfiguration { get; set; }
 49        /// <summary> Specifies the Linux operating system settings on the virtual machine. &lt;br&gt;&lt;br&gt;For a li
 81250        public LinuxConfiguration LinuxConfiguration { get; set; }
 51        /// <summary> Specifies set of certificates that should be installed onto the virtual machines in the scale set.
 109652        public IList<VaultSecretGroup> Secrets { get; set; }
 53    }
 54}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetOSProfile.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 VirtualMachineScaleSetOSProfile : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 36418            writer.WriteStartObject();
 36419            if (ComputerNamePrefix != null)
 20            {
 36421                writer.WritePropertyName("computerNamePrefix");
 36422                writer.WriteStringValue(ComputerNamePrefix);
 23            }
 36424            if (AdminUsername != null)
 25            {
 36426                writer.WritePropertyName("adminUsername");
 36427                writer.WriteStringValue(AdminUsername);
 28            }
 36429            if (AdminPassword != null)
 30            {
 36431                writer.WritePropertyName("adminPassword");
 36432                writer.WriteStringValue(AdminPassword);
 33            }
 36434            if (CustomData != null)
 35            {
 36436                writer.WritePropertyName("customData");
 36437                writer.WriteStringValue(CustomData);
 38            }
 36439            if (WindowsConfiguration != null)
 40            {
 041                writer.WritePropertyName("windowsConfiguration");
 042                writer.WriteObjectValue(WindowsConfiguration);
 43            }
 36444            if (LinuxConfiguration != null)
 45            {
 046                writer.WritePropertyName("linuxConfiguration");
 047                writer.WriteObjectValue(LinuxConfiguration);
 48            }
 36449            if (Secrets != null)
 50            {
 051                writer.WritePropertyName("secrets");
 052                writer.WriteStartArray();
 053                foreach (var item in Secrets)
 54                {
 055                    writer.WriteObjectValue(item);
 56                }
 057                writer.WriteEndArray();
 58            }
 36459            writer.WriteEndObject();
 36460        }
 61
 62        internal static VirtualMachineScaleSetOSProfile DeserializeVirtualMachineScaleSetOSProfile(JsonElement element)
 63        {
 44864            string computerNamePrefix = default;
 44865            string adminUsername = default;
 44866            string adminPassword = default;
 44867            string customData = default;
 44868            WindowsConfiguration windowsConfiguration = default;
 44869            LinuxConfiguration linuxConfiguration = default;
 44870            IList<VaultSecretGroup> secrets = default;
 627271            foreach (var property in element.EnumerateObject())
 72            {
 268873                if (property.NameEquals("computerNamePrefix"))
 74                {
 44875                    if (property.Value.ValueKind == JsonValueKind.Null)
 76                    {
 77                        continue;
 78                    }
 44879                    computerNamePrefix = property.Value.GetString();
 44880                    continue;
 81                }
 224082                if (property.NameEquals("adminUsername"))
 83                {
 44884                    if (property.Value.ValueKind == JsonValueKind.Null)
 85                    {
 86                        continue;
 87                    }
 44888                    adminUsername = property.Value.GetString();
 44889                    continue;
 90                }
 179291                if (property.NameEquals("adminPassword"))
 92                {
 093                    if (property.Value.ValueKind == JsonValueKind.Null)
 94                    {
 95                        continue;
 96                    }
 097                    adminPassword = property.Value.GetString();
 098                    continue;
 99                }
 1792100                if (property.NameEquals("customData"))
 101                {
 0102                    if (property.Value.ValueKind == JsonValueKind.Null)
 103                    {
 104                        continue;
 105                    }
 0106                    customData = property.Value.GetString();
 0107                    continue;
 108                }
 1792109                if (property.NameEquals("windowsConfiguration"))
 110                {
 440111                    if (property.Value.ValueKind == JsonValueKind.Null)
 112                    {
 113                        continue;
 114                    }
 440115                    windowsConfiguration = WindowsConfiguration.DeserializeWindowsConfiguration(property.Value);
 440116                    continue;
 117                }
 1352118                if (property.NameEquals("linuxConfiguration"))
 119                {
 8120                    if (property.Value.ValueKind == JsonValueKind.Null)
 121                    {
 122                        continue;
 123                    }
 8124                    linuxConfiguration = LinuxConfiguration.DeserializeLinuxConfiguration(property.Value);
 8125                    continue;
 126                }
 1344127                if (property.NameEquals("secrets"))
 128                {
 448129                    if (property.Value.ValueKind == JsonValueKind.Null)
 130                    {
 131                        continue;
 132                    }
 448133                    List<VaultSecretGroup> array = new List<VaultSecretGroup>();
 0134                    foreach (var item in property.Value.EnumerateArray())
 135                    {
 0136                        if (item.ValueKind == JsonValueKind.Null)
 137                        {
 0138                            array.Add(null);
 139                        }
 140                        else
 141                        {
 0142                            array.Add(VaultSecretGroup.DeserializeVaultSecretGroup(item));
 143                        }
 144                    }
 448145                    secrets = array;
 146                    continue;
 147                }
 148            }
 448149            return new VirtualMachineScaleSetOSProfile(computerNamePrefix, adminUsername, adminPassword, customData, win
 150        }
 151    }
 152}