< Summary

Class:Azure.ResourceManager.Compute.Models.SshPublicKeyGenerateKeyPairResult
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\SshPublicKeyGenerateKeyPairResult.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\SshPublicKeyGenerateKeyPairResult.Serialization.cs
Covered lines:0
Uncovered lines:27
Coverable lines:27
Total lines:87
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%
get_PrivateKey()-0%100%
get_PublicKey()-0%100%
get_Id()-0%100%
DeserializeSshPublicKeyGenerateKeyPairResult(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\SshPublicKeyGenerateKeyPairResult.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;
 9
 10namespace Azure.ResourceManager.Compute.Models
 11{
 12    /// <summary> Response from generation of an SSH key pair. </summary>
 13    public partial class SshPublicKeyGenerateKeyPairResult
 14    {
 15        /// <summary> Initializes a new instance of SshPublicKeyGenerateKeyPairResult. </summary>
 16        /// <param name="privateKey"> Private key portion of the key pair used to authenticate to a virtual machine thro
 17        /// <param name="publicKey"> Public key portion of the key pair used to authenticate to a virtual machine throug
 18        /// <param name="id"> The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{Resourc
 019        internal SshPublicKeyGenerateKeyPairResult(string privateKey, string publicKey, string id)
 20        {
 021            if (privateKey == null)
 22            {
 023                throw new ArgumentNullException(nameof(privateKey));
 24            }
 025            if (publicKey == null)
 26            {
 027                throw new ArgumentNullException(nameof(publicKey));
 28            }
 029            if (id == null)
 30            {
 031                throw new ArgumentNullException(nameof(id));
 32            }
 33
 034            PrivateKey = privateKey;
 035            PublicKey = publicKey;
 036            Id = id;
 037        }
 38
 39        /// <summary> Private key portion of the key pair used to authenticate to a virtual machine through ssh. The pri
 040        public string PrivateKey { get; }
 41        /// <summary> Public key portion of the key pair used to authenticate to a virtual machine through ssh. The publ
 042        public string PublicKey { get; }
 43        /// <summary> The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupNa
 044        public string Id { get; }
 45    }
 46}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\SshPublicKeyGenerateKeyPairResult.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 SshPublicKeyGenerateKeyPairResult
 14    {
 15        internal static SshPublicKeyGenerateKeyPairResult DeserializeSshPublicKeyGenerateKeyPairResult(JsonElement eleme
 16        {
 017            string privateKey = default;
 018            string publicKey = default;
 019            string id = default;
 020            foreach (var property in element.EnumerateObject())
 21            {
 022                if (property.NameEquals("privateKey"))
 23                {
 024                    privateKey = property.Value.GetString();
 025                    continue;
 26                }
 027                if (property.NameEquals("publicKey"))
 28                {
 029                    publicKey = property.Value.GetString();
 030                    continue;
 31                }
 032                if (property.NameEquals("id"))
 33                {
 034                    id = property.Value.GetString();
 35                    continue;
 36                }
 37            }
 038            return new SshPublicKeyGenerateKeyPairResult(privateKey, publicKey, id);
 39        }
 40    }
 41}