< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.DeviceConnectionStateEventProperties
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\DeviceConnectionStateEventProperties.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\DeviceConnectionStateEventProperties.Serialization.cs
Covered lines:8
Uncovered lines:21
Coverable lines:29
Total lines:87
Line coverage:27.5% (8 of 29)
Covered branches:0
Total branches:10
Branch coverage:0% (0 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_DeviceId()-0%100%
get_ModuleId()-0%100%
get_HubName()-100%100%
get_DeviceConnectionStateEventInfo()-100%100%
DeserializeDeviceConnectionStateEventProperties(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\DeviceConnectionStateEventProperties.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> Schema of the Data property of an EventGridEvent for a device connection state event (DeviceConnected,
 11    public partial class DeviceConnectionStateEventProperties
 12    {
 13        /// <summary> Initializes a new instance of DeviceConnectionStateEventProperties. </summary>
 014        internal DeviceConnectionStateEventProperties()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of DeviceConnectionStateEventProperties. </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>
 423        internal DeviceConnectionStateEventProperties(string deviceId, string moduleId, string hubName, DeviceConnection
 24        {
 425            DeviceId = deviceId;
 426            ModuleId = moduleId;
 427            HubName = hubName;
 428            DeviceConnectionStateEventInfo = deviceConnectionStateEventInfo;
 429        }
 30
 31        /// <summary> The unique identifier of the device. This case-sensitive string can be up to 128 characters long, 
 032        public string DeviceId { get; }
 33        /// <summary> The unique identifier of the module. This case-sensitive string can be up to 128 characters long, 
 034        public string ModuleId { get; }
 35        /// <summary> Name of the IoT Hub where the device was created or deleted. </summary>
 236        public string HubName { get; }
 37        /// <summary> Information about the device connection state event. </summary>
 238        public DeviceConnectionStateEventInfo DeviceConnectionStateEventInfo { get; }
 39    }
 40}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\DeviceConnectionStateEventProperties.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 DeviceConnectionStateEventProperties
 14    {
 15        internal static DeviceConnectionStateEventProperties DeserializeDeviceConnectionStateEventProperties(JsonElement
 16        {
 017            Optional<string> deviceId = default;
 018            Optional<string> moduleId = default;
 019            Optional<string> hubName = default;
 020            Optional<DeviceConnectionStateEventInfo> deviceConnectionStateEventInfo = default;
 021            foreach (var property in element.EnumerateObject())
 22            {
 023                if (property.NameEquals("deviceId"))
 24                {
 025                    deviceId = property.Value.GetString();
 026                    continue;
 27                }
 028                if (property.NameEquals("moduleId"))
 29                {
 030                    moduleId = property.Value.GetString();
 031                    continue;
 32                }
 033                if (property.NameEquals("hubName"))
 34                {
 035                    hubName = property.Value.GetString();
 036                    continue;
 37                }
 038                if (property.NameEquals("deviceConnectionStateEventInfo"))
 39                {
 040                    deviceConnectionStateEventInfo = DeviceConnectionStateEventInfo.DeserializeDeviceConnectionStateEven
 41                    continue;
 42                }
 43            }
 044            return new DeviceConnectionStateEventProperties(deviceId.Value, moduleId.Value, hubName.Value, deviceConnect
 45        }
 46    }
 47}