< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Vm()-0%100%
get_Bsl()-0%100%
get_CreatedAt()-0%100%
get_Message()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeBastionShareableLink(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\BastionShareableLink.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> Bastion Shareable Link. </summary>
 13    public partial class BastionShareableLink
 14    {
 15        /// <summary> Initializes a new instance of BastionShareableLink. </summary>
 16        /// <param name="vm"> Reference of the virtual machine resource. </param>
 017        public BastionShareableLink(Resource vm)
 18        {
 019            if (vm == null)
 20            {
 021                throw new ArgumentNullException(nameof(vm));
 22            }
 23
 024            Vm = vm;
 025        }
 26
 27        /// <summary> Initializes a new instance of BastionShareableLink. </summary>
 28        /// <param name="vm"> Reference of the virtual machine resource. </param>
 29        /// <param name="bsl"> The unique Bastion Shareable Link to the virtual machine. </param>
 30        /// <param name="createdAt"> The time when the link was created. </param>
 31        /// <param name="message"> Optional field indicating the warning or error message related to the vm in case of p
 032        internal BastionShareableLink(Resource vm, string bsl, string createdAt, string message)
 33        {
 034            Vm = vm;
 035            Bsl = bsl;
 036            CreatedAt = createdAt;
 037            Message = message;
 038        }
 39
 40        /// <summary> Reference of the virtual machine resource. </summary>
 041        public Resource Vm { get; set; }
 42        /// <summary> The unique Bastion Shareable Link to the virtual machine. </summary>
 043        public string Bsl { get; }
 44        /// <summary> The time when the link was created. </summary>
 045        public string CreatedAt { get; }
 46        /// <summary> Optional field indicating the warning or error message related to the vm in case of partial failur
 047        public string Message { get; }
 48    }
 49}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\BastionShareableLink.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 BastionShareableLink : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("vm");
 019            writer.WriteObjectValue(Vm);
 020            if (Bsl != null)
 21            {
 022                writer.WritePropertyName("bsl");
 023                writer.WriteStringValue(Bsl);
 24            }
 025            if (CreatedAt != null)
 26            {
 027                writer.WritePropertyName("createdAt");
 028                writer.WriteStringValue(CreatedAt);
 29            }
 030            if (Message != null)
 31            {
 032                writer.WritePropertyName("message");
 033                writer.WriteStringValue(Message);
 34            }
 035            writer.WriteEndObject();
 036        }
 37
 38        internal static BastionShareableLink DeserializeBastionShareableLink(JsonElement element)
 39        {
 040            Resource vm = default;
 041            string bsl = default;
 042            string createdAt = default;
 043            string message = default;
 044            foreach (var property in element.EnumerateObject())
 45            {
 046                if (property.NameEquals("vm"))
 47                {
 048                    vm = Resource.DeserializeResource(property.Value);
 049                    continue;
 50                }
 051                if (property.NameEquals("bsl"))
 52                {
 053                    if (property.Value.ValueKind == JsonValueKind.Null)
 54                    {
 55                        continue;
 56                    }
 057                    bsl = property.Value.GetString();
 058                    continue;
 59                }
 060                if (property.NameEquals("createdAt"))
 61                {
 062                    if (property.Value.ValueKind == JsonValueKind.Null)
 63                    {
 64                        continue;
 65                    }
 066                    createdAt = property.Value.GetString();
 067                    continue;
 68                }
 069                if (property.NameEquals("message"))
 70                {
 071                    if (property.Value.ValueKind == JsonValueKind.Null)
 72                    {
 73                        continue;
 74                    }
 075                    message = property.Value.GetString();
 76                    continue;
 77                }
 78            }
 079            return new BastionShareableLink(vm, bsl, createdAt, message);
 80        }
 81    }
 82}