< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceDeletedEventData
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\IotHubDeviceDeletedEventData.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\IotHubDeviceDeletedEventData.Serialization.cs
Covered lines:15
Uncovered lines:2
Coverable lines:17
Total lines:67
Line coverage:88.2% (15 of 17)
Covered branches:8
Total branches:8
Branch coverage:100% (8 of 8)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\IotHubDeviceDeletedEventData.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.DeviceDeleted event. </summary>
 11    public partial class IotHubDeviceDeletedEventData : DeviceLifeCycleEventProperties
 12    {
 13        /// <summary> Initializes a new instance of IotHubDeviceDeletedEventData. </summary>
 014        internal IotHubDeviceDeletedEventData()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of IotHubDeviceDeletedEventData. </summary>
 19        /// <param name="deviceId"> The unique identifier of the device. This case-sensitive string can be up to 128 cha
 20        /// <param name="hubName"> Name of the IoT Hub where the device was created or deleted. </param>
 21        /// <param name="twin"> Information about the device twin, which is the cloud representation of application devi
 222        internal IotHubDeviceDeletedEventData(string deviceId, string hubName, DeviceTwinInfo twin) : base(deviceId, hub
 23        {
 224        }
 25    }
 26}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\IotHubDeviceDeletedEventData.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 IotHubDeviceDeletedEventData
 14    {
 15        internal static IotHubDeviceDeletedEventData DeserializeIotHubDeviceDeletedEventData(JsonElement element)
 16        {
 217            Optional<string> deviceId = default;
 218            Optional<string> hubName = default;
 219            Optional<DeviceTwinInfo> twin = default;
 1620            foreach (var property in element.EnumerateObject())
 21            {
 622                if (property.NameEquals("deviceId"))
 23                {
 224                    deviceId = property.Value.GetString();
 225                    continue;
 26                }
 427                if (property.NameEquals("hubName"))
 28                {
 229                    hubName = property.Value.GetString();
 230                    continue;
 31                }
 232                if (property.NameEquals("twin"))
 33                {
 234                    twin = DeviceTwinInfo.DeserializeDeviceTwinInfo(property.Value);
 35                    continue;
 36                }
 37            }
 238            return new IotHubDeviceDeletedEventData(deviceId.Value, hubName.Value, twin.Value);
 39        }
 40    }
 41}