< Summary

Class:Azure.ResourceManager.Compute.Models.OSProfile
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\OSProfile.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\OSProfile.Serialization.cs
Covered lines:94
Uncovered lines:12
Coverable lines:106
Total lines:244
Line coverage:88.6% (94 of 106)
Covered branches:54
Total branches:62
Branch coverage:87% (54 of 62)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_ComputerName()-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%
get_AllowExtensionOperations()-100%100%
get_RequireGuestProvisionSignal()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-93.94%95%
DeserializeOSProfile(...)-80.39%83.33%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\OSProfile.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> Specifies the operating system settings for the virtual machine. Some of the settings cannot be change
 13    public partial class OSProfile
 14    {
 15        /// <summary> Initializes a new instance of OSProfile. </summary>
 14816        public OSProfile()
 17        {
 14818        }
 19
 20        /// <summary> Initializes a new instance of OSProfile. </summary>
 21        /// <param name="computerName"> Specifies the host OS name of the virtual machine. &lt;br&gt;&lt;br&gt; This nam
 22        /// <param name="adminUsername"> Specifies the name of the administrator account. &lt;br&gt;&lt;br&gt; This prop
 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 machine. </pa
 28        /// <param name="allowExtensionOperations"> Specifies whether extension operations should be allowed on the virt
 29        /// <param name="requireGuestProvisionSignal"> Specifies whether the guest provision signal is required to infer
 43230        internal OSProfile(string computerName, string adminUsername, string adminPassword, string customData, WindowsCo
 31        {
 43232            ComputerName = computerName;
 43233            AdminUsername = adminUsername;
 43234            AdminPassword = adminPassword;
 43235            CustomData = customData;
 43236            WindowsConfiguration = windowsConfiguration;
 43237            LinuxConfiguration = linuxConfiguration;
 43238            Secrets = secrets;
 43239            AllowExtensionOperations = allowExtensionOperations;
 43240            RequireGuestProvisionSignal = requireGuestProvisionSignal;
 43241        }
 42
 43        /// <summary> Specifies the host OS name of the virtual machine. &lt;br&gt;&lt;br&gt; This name cannot be update
 106844        public string ComputerName { get; set; }
 45        /// <summary> Specifies the name of the administrator account. &lt;br&gt;&lt;br&gt; This property cannot be upda
 107246        public string AdminUsername { get; set; }
 47        /// <summary> Specifies the password of the administrator account. &lt;br&gt;&lt;br&gt; **Minimum-length (Window
 105248        public string AdminPassword { get; set; }
 49        /// <summary> Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a bina
 72050        public string CustomData { get; set; }
 51        /// <summary> Specifies Windows operating system settings on the virtual machine. </summary>
 68852        public WindowsConfiguration WindowsConfiguration { get; set; }
 53        /// <summary> Specifies the Linux operating system settings on the virtual machine. &lt;br&gt;&lt;br&gt;For a li
 72054        public LinuxConfiguration LinuxConfiguration { get; set; }
 55        /// <summary> Specifies set of certificates that should be installed onto the virtual machine. </summary>
 89256        public IList<VaultSecretGroup> Secrets { get; set; }
 57        /// <summary> Specifies whether extension operations should be allowed on the virtual machine. &lt;br&gt;&lt;br&
 69258        public bool? AllowExtensionOperations { get; set; }
 59        /// <summary> Specifies whether the guest provision signal is required to infer provision success of the virtual
 69260        public bool? RequireGuestProvisionSignal { get; set; }
 61    }
 62}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\OSProfile.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 OSProfile : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 24418            writer.WriteStartObject();
 24419            if (ComputerName != null)
 20            {
 24421                writer.WritePropertyName("computerName");
 24422                writer.WriteStringValue(ComputerName);
 23            }
 24424            if (AdminUsername != null)
 25            {
 24426                writer.WritePropertyName("adminUsername");
 24427                writer.WriteStringValue(AdminUsername);
 28            }
 24429            if (AdminPassword != null)
 30            {
 22831                writer.WritePropertyName("adminPassword");
 22832                writer.WriteStringValue(AdminPassword);
 33            }
 24434            if (CustomData != null)
 35            {
 836                writer.WritePropertyName("customData");
 837                writer.WriteStringValue(CustomData);
 38            }
 24439            if (WindowsConfiguration != null)
 40            {
 841                writer.WritePropertyName("windowsConfiguration");
 842                writer.WriteObjectValue(WindowsConfiguration);
 43            }
 24444            if (LinuxConfiguration != null)
 45            {
 1646                writer.WritePropertyName("linuxConfiguration");
 1647                writer.WriteObjectValue(LinuxConfiguration);
 48            }
 24449            if (Secrets != null)
 50            {
 1651                writer.WritePropertyName("secrets");
 1652                writer.WriteStartArray();
 053                foreach (var item in Secrets)
 54                {
 055                    writer.WriteObjectValue(item);
 56                }
 1657                writer.WriteEndArray();
 58            }
 24459            if (AllowExtensionOperations != null)
 60            {
 1661                writer.WritePropertyName("allowExtensionOperations");
 1662                writer.WriteBooleanValue(AllowExtensionOperations.Value);
 63            }
 24464            if (RequireGuestProvisionSignal != null)
 65            {
 1666                writer.WritePropertyName("requireGuestProvisionSignal");
 1667                writer.WriteBooleanValue(RequireGuestProvisionSignal.Value);
 68            }
 24469            writer.WriteEndObject();
 24470        }
 71
 72        internal static OSProfile DeserializeOSProfile(JsonElement element)
 73        {
 43274            string computerName = default;
 43275            string adminUsername = default;
 43276            string adminPassword = default;
 43277            string customData = default;
 43278            WindowsConfiguration windowsConfiguration = default;
 43279            LinuxConfiguration linuxConfiguration = default;
 43280            IList<VaultSecretGroup> secrets = default;
 43281            bool? allowExtensionOperations = default;
 43282            bool? requireGuestProvisionSignal = default;
 604883            foreach (var property in element.EnumerateObject())
 84            {
 259285                if (property.NameEquals("computerName"))
 86                {
 43287                    if (property.Value.ValueKind == JsonValueKind.Null)
 88                    {
 89                        continue;
 90                    }
 43291                    computerName = property.Value.GetString();
 43292                    continue;
 93                }
 216094                if (property.NameEquals("adminUsername"))
 95                {
 43296                    if (property.Value.ValueKind == JsonValueKind.Null)
 97                    {
 98                        continue;
 99                    }
 432100                    adminUsername = property.Value.GetString();
 432101                    continue;
 102                }
 1728103                if (property.NameEquals("adminPassword"))
 104                {
 0105                    if (property.Value.ValueKind == JsonValueKind.Null)
 106                    {
 107                        continue;
 108                    }
 0109                    adminPassword = property.Value.GetString();
 0110                    continue;
 111                }
 1728112                if (property.NameEquals("customData"))
 113                {
 0114                    if (property.Value.ValueKind == JsonValueKind.Null)
 115                    {
 116                        continue;
 117                    }
 0118                    customData = property.Value.GetString();
 0119                    continue;
 120                }
 1728121                if (property.NameEquals("windowsConfiguration"))
 122                {
 416123                    if (property.Value.ValueKind == JsonValueKind.Null)
 124                    {
 125                        continue;
 126                    }
 416127                    windowsConfiguration = WindowsConfiguration.DeserializeWindowsConfiguration(property.Value);
 416128                    continue;
 129                }
 1312130                if (property.NameEquals("linuxConfiguration"))
 131                {
 16132                    if (property.Value.ValueKind == JsonValueKind.Null)
 133                    {
 134                        continue;
 135                    }
 16136                    linuxConfiguration = LinuxConfiguration.DeserializeLinuxConfiguration(property.Value);
 16137                    continue;
 138                }
 1296139                if (property.NameEquals("secrets"))
 140                {
 432141                    if (property.Value.ValueKind == JsonValueKind.Null)
 142                    {
 143                        continue;
 144                    }
 432145                    List<VaultSecretGroup> array = new List<VaultSecretGroup>();
 0146                    foreach (var item in property.Value.EnumerateArray())
 147                    {
 0148                        if (item.ValueKind == JsonValueKind.Null)
 149                        {
 0150                            array.Add(null);
 151                        }
 152                        else
 153                        {
 0154                            array.Add(VaultSecretGroup.DeserializeVaultSecretGroup(item));
 155                        }
 156                    }
 432157                    secrets = array;
 432158                    continue;
 159                }
 864160                if (property.NameEquals("allowExtensionOperations"))
 161                {
 432162                    if (property.Value.ValueKind == JsonValueKind.Null)
 163                    {
 164                        continue;
 165                    }
 432166                    allowExtensionOperations = property.Value.GetBoolean();
 432167                    continue;
 168                }
 432169                if (property.NameEquals("requireGuestProvisionSignal"))
 170                {
 432171                    if (property.Value.ValueKind == JsonValueKind.Null)
 172                    {
 173                        continue;
 174                    }
 432175                    requireGuestProvisionSignal = property.Value.GetBoolean();
 176                    continue;
 177                }
 178            }
 432179            return new OSProfile(computerName, adminUsername, adminPassword, customData, windowsConfiguration, linuxConf
 180        }
 181    }
 182}