< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfo
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\DeviceTwinInfo.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\DeviceTwinInfo.Serialization.cs
Covered lines:60
Uncovered lines:11
Coverable lines:71
Total lines:157
Line coverage:84.5% (60 of 71)
Covered branches:24
Total branches:24
Branch coverage:100% (24 of 24)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_AuthenticationType()-0%100%
get_CloudToDeviceMessageCount()-0%100%
get_ConnectionState()-0%100%
get_DeviceId()-0%100%
get_Etag()-100%100%
get_LastActivityTime()-0%100%
get_Properties()-0%100%
get_Status()-100%100%
get_StatusUpdateTime()-0%100%
get_Version()-0%100%
get_X509Thumbprint()-0%100%
DeserializeDeviceTwinInfo(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\DeviceTwinInfo.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.Messaging.EventGrid.SystemEvents
 9{
 10    /// <summary> Information about the device twin, which is the cloud representation of application device metadata. <
 11    public partial class DeviceTwinInfo
 12    {
 13        /// <summary> Initializes a new instance of DeviceTwinInfo. </summary>
 014        internal DeviceTwinInfo()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of DeviceTwinInfo. </summary>
 19        /// <param name="authenticationType"> Authentication type used for this device: either SAS, SelfSigned, or Certi
 20        /// <param name="cloudToDeviceMessageCount"> Count of cloud to device messages sent to this device. </param>
 21        /// <param name="connectionState"> Whether the device is connected or disconnected. </param>
 22        /// <param name="deviceId"> The unique identifier of the device twin. </param>
 23        /// <param name="etag"> A piece of information that describes the content of the device twin. Each etag is guara
 24        /// <param name="lastActivityTime"> The ISO8601 timestamp of the last activity. </param>
 25        /// <param name="properties"> Properties JSON element. </param>
 26        /// <param name="status"> Whether the device twin is enabled or disabled. </param>
 27        /// <param name="statusUpdateTime"> The ISO8601 timestamp of the last device twin status update. </param>
 28        /// <param name="version"> An integer that is incremented by one each time the device twin is updated. </param>
 29        /// <param name="x509Thumbprint"> The thumbprint is a unique value for the x509 certificate, commonly used to fi
 430        internal DeviceTwinInfo(string authenticationType, float? cloudToDeviceMessageCount, string connectionState, str
 31        {
 432            AuthenticationType = authenticationType;
 433            CloudToDeviceMessageCount = cloudToDeviceMessageCount;
 434            ConnectionState = connectionState;
 435            DeviceId = deviceId;
 436            Etag = etag;
 437            LastActivityTime = lastActivityTime;
 438            Properties = properties;
 439            Status = status;
 440            StatusUpdateTime = statusUpdateTime;
 441            Version = version;
 442            X509Thumbprint = x509Thumbprint;
 443        }
 44
 45        /// <summary> Authentication type used for this device: either SAS, SelfSigned, or CertificateAuthority. </summa
 046        public string AuthenticationType { get; }
 47        /// <summary> Count of cloud to device messages sent to this device. </summary>
 048        public float? CloudToDeviceMessageCount { get; }
 49        /// <summary> Whether the device is connected or disconnected. </summary>
 050        public string ConnectionState { get; }
 51        /// <summary> The unique identifier of the device twin. </summary>
 052        public string DeviceId { get; }
 53        /// <summary> A piece of information that describes the content of the device twin. Each etag is guaranteed to b
 254        public string Etag { get; }
 55        /// <summary> The ISO8601 timestamp of the last activity. </summary>
 056        public string LastActivityTime { get; }
 57        /// <summary> Properties JSON element. </summary>
 058        public DeviceTwinInfoProperties Properties { get; }
 59        /// <summary> Whether the device twin is enabled or disabled. </summary>
 260        public string Status { get; }
 61        /// <summary> The ISO8601 timestamp of the last device twin status update. </summary>
 062        public string StatusUpdateTime { get; }
 63        /// <summary> An integer that is incremented by one each time the device twin is updated. </summary>
 064        public float? Version { get; }
 65        /// <summary> The thumbprint is a unique value for the x509 certificate, commonly used to find a particular cert
 066        public DeviceTwinInfoX509Thumbprint X509Thumbprint { get; }
 67    }
 68}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\DeviceTwinInfo.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.Messaging.EventGrid.SystemEvents
 12{
 13    public partial class DeviceTwinInfo
 14    {
 15        internal static DeviceTwinInfo DeserializeDeviceTwinInfo(JsonElement element)
 16        {
 417            Optional<string> authenticationType = default;
 418            Optional<float> cloudToDeviceMessageCount = default;
 419            Optional<string> connectionState = default;
 420            Optional<string> deviceId = default;
 421            Optional<string> etag = default;
 422            Optional<string> lastActivityTime = default;
 423            Optional<DeviceTwinInfoProperties> properties = default;
 424            Optional<string> status = default;
 425            Optional<string> statusUpdateTime = default;
 426            Optional<float> version = default;
 427            Optional<DeviceTwinInfoX509Thumbprint> x509Thumbprint = default;
 10828            foreach (var property in element.EnumerateObject())
 29            {
 5030                if (property.NameEquals("authenticationType"))
 31                {
 432                    authenticationType = property.Value.GetString();
 433                    continue;
 34                }
 4635                if (property.NameEquals("cloudToDeviceMessageCount"))
 36                {
 437                    cloudToDeviceMessageCount = property.Value.GetSingle();
 438                    continue;
 39                }
 4240                if (property.NameEquals("connectionState"))
 41                {
 442                    connectionState = property.Value.GetString();
 443                    continue;
 44                }
 3845                if (property.NameEquals("deviceId"))
 46                {
 447                    deviceId = property.Value.GetString();
 448                    continue;
 49                }
 3450                if (property.NameEquals("etag"))
 51                {
 452                    etag = property.Value.GetString();
 453                    continue;
 54                }
 3055                if (property.NameEquals("lastActivityTime"))
 56                {
 457                    lastActivityTime = property.Value.GetString();
 458                    continue;
 59                }
 2660                if (property.NameEquals("properties"))
 61                {
 462                    properties = DeviceTwinInfoProperties.DeserializeDeviceTwinInfoProperties(property.Value);
 463                    continue;
 64                }
 2265                if (property.NameEquals("status"))
 66                {
 467                    status = property.Value.GetString();
 468                    continue;
 69                }
 1870                if (property.NameEquals("statusUpdateTime"))
 71                {
 472                    statusUpdateTime = property.Value.GetString();
 473                    continue;
 74                }
 1475                if (property.NameEquals("version"))
 76                {
 477                    version = property.Value.GetSingle();
 478                    continue;
 79                }
 1080                if (property.NameEquals("x509Thumbprint"))
 81                {
 482                    x509Thumbprint = DeviceTwinInfoX509Thumbprint.DeserializeDeviceTwinInfoX509Thumbprint(property.Value
 83                    continue;
 84                }
 85            }
 486            return new DeviceTwinInfo(authenticationType.Value, Optional.ToNullable(cloudToDeviceMessageCount), connecti
 87        }
 88    }
 89}