< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceDisconnectedEventData
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\IotHubDeviceDisconnectedEventData.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\IotHubDeviceDisconnectedEventData.Serialization.cs
Covered lines:19
Uncovered lines:2
Coverable lines:21
Total lines:74
Line coverage:90.4% (19 of 21)
Covered branches:10
Total branches:10
Branch coverage:100% (10 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
DeserializeIotHubDeviceDisconnectedEventData(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\IotHubDeviceDisconnectedEventData.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> Event data for Microsoft.Devices.DeviceDisconnected event. </summary>
 11    public partial class IotHubDeviceDisconnectedEventData : DeviceConnectionStateEventProperties
 12    {
 13        /// <summary> Initializes a new instance of IotHubDeviceDisconnectedEventData. </summary>
 014        internal IotHubDeviceDisconnectedEventData()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of IotHubDeviceDisconnectedEventData. </summary>
 19        /// <param name="deviceId"> The unique identifier of the device. This case-sensitive string can be up to 128 cha
 20        /// <param name="moduleId"> The unique identifier of the module. This case-sensitive string can be up to 128 cha
 21        /// <param name="hubName"> Name of the IoT Hub where the device was created or deleted. </param>
 22        /// <param name="deviceConnectionStateEventInfo"> Information about the device connection state event. </param>
 223        internal IotHubDeviceDisconnectedEventData(string deviceId, string moduleId, string hubName, DeviceConnectionSta
 24        {
 225        }
 26    }
 27}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\IotHubDeviceDisconnectedEventData.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 IotHubDeviceDisconnectedEventData
 14    {
 15        internal static IotHubDeviceDisconnectedEventData DeserializeIotHubDeviceDisconnectedEventData(JsonElement eleme
 16        {
 217            Optional<string> deviceId = default;
 218            Optional<string> moduleId = default;
 219            Optional<string> hubName = default;
 220            Optional<DeviceConnectionStateEventInfo> deviceConnectionStateEventInfo = default;
 2021            foreach (var property in element.EnumerateObject())
 22            {
 823                if (property.NameEquals("deviceId"))
 24                {
 225                    deviceId = property.Value.GetString();
 226                    continue;
 27                }
 628                if (property.NameEquals("moduleId"))
 29                {
 230                    moduleId = property.Value.GetString();
 231                    continue;
 32                }
 433                if (property.NameEquals("hubName"))
 34                {
 235                    hubName = property.Value.GetString();
 236                    continue;
 37                }
 238                if (property.NameEquals("deviceConnectionStateEventInfo"))
 39                {
 240                    deviceConnectionStateEventInfo = DeviceConnectionStateEventInfo.DeserializeDeviceConnectionStateEven
 41                    continue;
 42                }
 43            }
 244            return new IotHubDeviceDisconnectedEventData(deviceId.Value, moduleId.Value, hubName.Value, deviceConnection
 45        }
 46    }
 47}