< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_PublicKeys()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeContainerServiceSshConfiguration(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ContainerServiceSshConfiguration.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;
 10using System.Linq;
 11
 12namespace Azure.ResourceManager.Compute.Models
 13{
 14    /// <summary> SSH configuration for Linux-based VMs running on Azure. </summary>
 15    public partial class ContainerServiceSshConfiguration
 16    {
 17        /// <summary> Initializes a new instance of ContainerServiceSshConfiguration. </summary>
 18        /// <param name="publicKeys"> the list of SSH public keys used to authenticate with Linux-based VMs. </param>
 019        public ContainerServiceSshConfiguration(IEnumerable<ContainerServiceSshPublicKey> publicKeys)
 20        {
 021            if (publicKeys == null)
 22            {
 023                throw new ArgumentNullException(nameof(publicKeys));
 24            }
 25
 026            PublicKeys = publicKeys.ToList();
 027        }
 28
 29        /// <summary> Initializes a new instance of ContainerServiceSshConfiguration. </summary>
 30        /// <param name="publicKeys"> the list of SSH public keys used to authenticate with Linux-based VMs. </param>
 031        internal ContainerServiceSshConfiguration(IList<ContainerServiceSshPublicKey> publicKeys)
 32        {
 033            PublicKeys = publicKeys ?? new List<ContainerServiceSshPublicKey>();
 034        }
 35
 36        /// <summary> the list of SSH public keys used to authenticate with Linux-based VMs. </summary>
 037        public IList<ContainerServiceSshPublicKey> PublicKeys { get; }
 38    }
 39}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ContainerServiceSshConfiguration.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 ContainerServiceSshConfiguration : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            writer.WritePropertyName("publicKeys");
 020            writer.WriteStartArray();
 021            foreach (var item in PublicKeys)
 22            {
 023                writer.WriteObjectValue(item);
 24            }
 025            writer.WriteEndArray();
 026            writer.WriteEndObject();
 027        }
 28
 29        internal static ContainerServiceSshConfiguration DeserializeContainerServiceSshConfiguration(JsonElement element
 30        {
 031            IList<ContainerServiceSshPublicKey> publicKeys = default;
 032            foreach (var property in element.EnumerateObject())
 33            {
 034                if (property.NameEquals("publicKeys"))
 35                {
 036                    List<ContainerServiceSshPublicKey> array = new List<ContainerServiceSshPublicKey>();
 037                    foreach (var item in property.Value.EnumerateArray())
 38                    {
 039                        if (item.ValueKind == JsonValueKind.Null)
 40                        {
 041                            array.Add(null);
 42                        }
 43                        else
 44                        {
 045                            array.Add(ContainerServiceSshPublicKey.DeserializeContainerServiceSshPublicKey(item));
 46                        }
 47                    }
 048                    publicKeys = array;
 49                    continue;
 50                }
 51            }
 052            return new ContainerServiceSshConfiguration(publicKeys);
 53        }
 54    }
 55}