< Summary

Class:Azure.ResourceManager.Network.Models.ConnectionSharedKey
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectionSharedKey.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectionSharedKey.Serialization.cs
Covered lines:0
Uncovered lines:27
Coverable lines:27
Total lines:90
Line coverage:0% (0 of 27)
Covered branches:0
Total branches:12
Branch coverage:0% (0 of 12)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectionSharedKey.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.Network.Models
 11{
 12    /// <summary> Response for GetConnectionSharedKey API service call. </summary>
 13    public partial class ConnectionSharedKey : SubResource
 14    {
 15        /// <summary> Initializes a new instance of ConnectionSharedKey. </summary>
 16        /// <param name="value"> The virtual network connection shared key value. </param>
 017        public ConnectionSharedKey(string value)
 18        {
 019            if (value == null)
 20            {
 021                throw new ArgumentNullException(nameof(value));
 22            }
 23
 024            Value = value;
 025        }
 26
 27        /// <summary> Initializes a new instance of ConnectionSharedKey. </summary>
 28        /// <param name="id"> Resource ID. </param>
 29        /// <param name="value"> The virtual network connection shared key value. </param>
 030        internal ConnectionSharedKey(string id, string value) : base(id)
 31        {
 032            Value = value;
 033        }
 34
 35        /// <summary> The virtual network connection shared key value. </summary>
 036        public string Value { get; set; }
 37    }
 38}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectionSharedKey.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.Network.Models
 12{
 13    public partial class ConnectionSharedKey : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("value");
 019            writer.WriteStringValue(Value);
 020            if (Id != null)
 21            {
 022                writer.WritePropertyName("id");
 023                writer.WriteStringValue(Id);
 24            }
 025            writer.WriteEndObject();
 026        }
 27
 28        internal static ConnectionSharedKey DeserializeConnectionSharedKey(JsonElement element)
 29        {
 030            string value = default;
 031            string id = default;
 032            foreach (var property in element.EnumerateObject())
 33            {
 034                if (property.NameEquals("value"))
 35                {
 036                    value = property.Value.GetString();
 037                    continue;
 38                }
 039                if (property.NameEquals("id"))
 40                {
 041                    if (property.Value.ValueKind == JsonValueKind.Null)
 42                    {
 43                        continue;
 44                    }
 045                    id = property.Value.GetString();
 46                    continue;
 47                }
 48            }
 049            return new ConnectionSharedKey(id, value);
 50        }
 51    }
 52}