< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_SessionId()-0%100%
get_StartTime()-0%100%
get_TargetSubscriptionId()-0%100%
get_ResourceType()-0%100%
get_TargetHostName()-0%100%
get_TargetResourceGroup()-0%100%
get_UserName()-0%100%
get_TargetIpAddress()-0%100%
get_Protocol()-0%100%
get_TargetResourceId()-0%100%
get_SessionDurationInMins()-0%100%
DeserializeBastionActiveSession(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\BastionActiveSession.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.Network.Models
 9{
 10    /// <summary> The session detail for a target. </summary>
 11    public partial class BastionActiveSession
 12    {
 13        /// <summary> Initializes a new instance of BastionActiveSession. </summary>
 014        internal BastionActiveSession()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of BastionActiveSession. </summary>
 19        /// <param name="sessionId"> A unique id for the session. </param>
 20        /// <param name="startTime"> The time when the session started. </param>
 21        /// <param name="targetSubscriptionId"> The subscription id for the target virtual machine. </param>
 22        /// <param name="resourceType"> The type of the resource. </param>
 23        /// <param name="targetHostName"> The host name of the target. </param>
 24        /// <param name="targetResourceGroup"> The resource group of the target. </param>
 25        /// <param name="userName"> The user name who is active on this session. </param>
 26        /// <param name="targetIpAddress"> The IP Address of the target. </param>
 27        /// <param name="protocol"> The protocol used to connect to the target. </param>
 28        /// <param name="targetResourceId"> The resource id of the target. </param>
 29        /// <param name="sessionDurationInMins"> Duration in mins the session has been active. </param>
 030        internal BastionActiveSession(string sessionId, object startTime, string targetSubscriptionId, string resourceTy
 31        {
 032            SessionId = sessionId;
 033            StartTime = startTime;
 034            TargetSubscriptionId = targetSubscriptionId;
 035            ResourceType = resourceType;
 036            TargetHostName = targetHostName;
 037            TargetResourceGroup = targetResourceGroup;
 038            UserName = userName;
 039            TargetIpAddress = targetIpAddress;
 040            Protocol = protocol;
 041            TargetResourceId = targetResourceId;
 042            SessionDurationInMins = sessionDurationInMins;
 043        }
 44
 45        /// <summary> A unique id for the session. </summary>
 046        public string SessionId { get; }
 47        /// <summary> The time when the session started. </summary>
 048        public object StartTime { get; }
 49        /// <summary> The subscription id for the target virtual machine. </summary>
 050        public string TargetSubscriptionId { get; }
 51        /// <summary> The type of the resource. </summary>
 052        public string ResourceType { get; }
 53        /// <summary> The host name of the target. </summary>
 054        public string TargetHostName { get; }
 55        /// <summary> The resource group of the target. </summary>
 056        public string TargetResourceGroup { get; }
 57        /// <summary> The user name who is active on this session. </summary>
 058        public string UserName { get; }
 59        /// <summary> The IP Address of the target. </summary>
 060        public string TargetIpAddress { get; }
 61        /// <summary> The protocol used to connect to the target. </summary>
 062        public BastionConnectProtocol? Protocol { get; }
 63        /// <summary> The resource id of the target. </summary>
 064        public string TargetResourceId { get; }
 65        /// <summary> Duration in mins the session has been active. </summary>
 066        public float? SessionDurationInMins { get; }
 67    }
 68}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\BastionActiveSession.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 BastionActiveSession
 14    {
 15        internal static BastionActiveSession DeserializeBastionActiveSession(JsonElement element)
 16        {
 017            string sessionId = default;
 018            object startTime = default;
 019            string targetSubscriptionId = default;
 020            string resourceType = default;
 021            string targetHostName = default;
 022            string targetResourceGroup = default;
 023            string userName = default;
 024            string targetIpAddress = default;
 025            BastionConnectProtocol? protocol = default;
 026            string targetResourceId = default;
 027            float? sessionDurationInMins = default;
 028            foreach (var property in element.EnumerateObject())
 29            {
 030                if (property.NameEquals("sessionId"))
 31                {
 032                    if (property.Value.ValueKind == JsonValueKind.Null)
 33                    {
 34                        continue;
 35                    }
 036                    sessionId = property.Value.GetString();
 037                    continue;
 38                }
 039                if (property.NameEquals("startTime"))
 40                {
 041                    if (property.Value.ValueKind == JsonValueKind.Null)
 42                    {
 43                        continue;
 44                    }
 045                    startTime = property.Value.GetObject();
 046                    continue;
 47                }
 048                if (property.NameEquals("targetSubscriptionId"))
 49                {
 050                    if (property.Value.ValueKind == JsonValueKind.Null)
 51                    {
 52                        continue;
 53                    }
 054                    targetSubscriptionId = property.Value.GetString();
 055                    continue;
 56                }
 057                if (property.NameEquals("resourceType"))
 58                {
 059                    if (property.Value.ValueKind == JsonValueKind.Null)
 60                    {
 61                        continue;
 62                    }
 063                    resourceType = property.Value.GetString();
 064                    continue;
 65                }
 066                if (property.NameEquals("targetHostName"))
 67                {
 068                    if (property.Value.ValueKind == JsonValueKind.Null)
 69                    {
 70                        continue;
 71                    }
 072                    targetHostName = property.Value.GetString();
 073                    continue;
 74                }
 075                if (property.NameEquals("targetResourceGroup"))
 76                {
 077                    if (property.Value.ValueKind == JsonValueKind.Null)
 78                    {
 79                        continue;
 80                    }
 081                    targetResourceGroup = property.Value.GetString();
 082                    continue;
 83                }
 084                if (property.NameEquals("userName"))
 85                {
 086                    if (property.Value.ValueKind == JsonValueKind.Null)
 87                    {
 88                        continue;
 89                    }
 090                    userName = property.Value.GetString();
 091                    continue;
 92                }
 093                if (property.NameEquals("targetIpAddress"))
 94                {
 095                    if (property.Value.ValueKind == JsonValueKind.Null)
 96                    {
 97                        continue;
 98                    }
 099                    targetIpAddress = property.Value.GetString();
 0100                    continue;
 101                }
 0102                if (property.NameEquals("protocol"))
 103                {
 0104                    if (property.Value.ValueKind == JsonValueKind.Null)
 105                    {
 106                        continue;
 107                    }
 0108                    protocol = new BastionConnectProtocol(property.Value.GetString());
 0109                    continue;
 110                }
 0111                if (property.NameEquals("targetResourceId"))
 112                {
 0113                    if (property.Value.ValueKind == JsonValueKind.Null)
 114                    {
 115                        continue;
 116                    }
 0117                    targetResourceId = property.Value.GetString();
 0118                    continue;
 119                }
 0120                if (property.NameEquals("sessionDurationInMins"))
 121                {
 0122                    if (property.Value.ValueKind == JsonValueKind.Null)
 123                    {
 124                        continue;
 125                    }
 0126                    sessionDurationInMins = property.Value.GetSingle();
 127                    continue;
 128                }
 129            }
 0130            return new BastionActiveSession(sessionId, startTime, targetSubscriptionId, resourceType, targetHostName, ta
 131        }
 132    }
 133}