< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_DisablePasswordAuthentication()-100%100%
get_Ssh()-100%100%
get_ProvisionVMAgent()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeLinuxConfiguration(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\LinuxConfiguration.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
 8namespace Azure.ResourceManager.Compute.Models
 9{
 10    /// <summary> Specifies the Linux operating system settings on the virtual machine. &lt;br&gt;&lt;br&gt;For a list o
 11    public partial class LinuxConfiguration
 12    {
 13        /// <summary> Initializes a new instance of LinuxConfiguration. </summary>
 414        public LinuxConfiguration()
 15        {
 416        }
 17
 18        /// <summary> Initializes a new instance of LinuxConfiguration. </summary>
 19        /// <param name="disablePasswordAuthentication"> Specifies whether password authentication should be disabled. <
 20        /// <param name="ssh"> Specifies the ssh key configuration for a Linux OS. </param>
 21        /// <param name="provisionVMAgent"> Indicates whether virtual machine agent should be provisioned on the virtual
 2422        internal LinuxConfiguration(bool? disablePasswordAuthentication, SshConfiguration ssh, bool? provisionVMAgent)
 23        {
 2424            DisablePasswordAuthentication = disablePasswordAuthentication;
 2425            Ssh = ssh;
 2426            ProvisionVMAgent = provisionVMAgent;
 2427        }
 28
 29        /// <summary> Specifies whether password authentication should be disabled. </summary>
 6830        public bool? DisablePasswordAuthentication { get; set; }
 31        /// <summary> Specifies the ssh key configuration for a Linux OS. </summary>
 7232        public SshConfiguration Ssh { get; set; }
 33        /// <summary> Indicates whether virtual machine agent should be provisioned on the virtual machine. &lt;br&gt;&l
 4834        public bool? ProvisionVMAgent { get; set; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\LinuxConfiguration.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.ResourceManager.Compute.Models
 12{
 13    public partial class LinuxConfiguration : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 1617            writer.WriteStartObject();
 1618            if (DisablePasswordAuthentication != null)
 19            {
 1620                writer.WritePropertyName("disablePasswordAuthentication");
 1621                writer.WriteBooleanValue(DisablePasswordAuthentication.Value);
 22            }
 1623            if (Ssh != null)
 24            {
 1625                writer.WritePropertyName("ssh");
 1626                writer.WriteObjectValue(Ssh);
 27            }
 1628            if (ProvisionVMAgent != null)
 29            {
 830                writer.WritePropertyName("provisionVMAgent");
 831                writer.WriteBooleanValue(ProvisionVMAgent.Value);
 32            }
 1633            writer.WriteEndObject();
 1634        }
 35
 36        internal static LinuxConfiguration DeserializeLinuxConfiguration(JsonElement element)
 37        {
 2438            bool? disablePasswordAuthentication = default;
 2439            SshConfiguration ssh = default;
 2440            bool? provisionVMAgent = default;
 17641            foreach (var property in element.EnumerateObject())
 42            {
 6443                if (property.NameEquals("disablePasswordAuthentication"))
 44                {
 2445                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 2449                    disablePasswordAuthentication = property.Value.GetBoolean();
 2450                    continue;
 51                }
 4052                if (property.NameEquals("ssh"))
 53                {
 1654                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 1658                    ssh = SshConfiguration.DeserializeSshConfiguration(property.Value);
 1659                    continue;
 60                }
 2461                if (property.NameEquals("provisionVMAgent"))
 62                {
 2463                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 2467                    provisionVMAgent = property.Value.GetBoolean();
 68                    continue;
 69                }
 70            }
 2471            return new LinuxConfiguration(disablePasswordAuthentication, ssh, provisionVMAgent);
 72        }
 73    }
 74}