< Summary

Class:Azure.Iot.Hub.Service.Models.ExportImportDevice
Assembly:Azure.Iot.Hub.Service
File(s):C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\ExportImportDevice.cs
C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\ExportImportDevice.Serialization.cs
Covered lines:48
Uncovered lines:18
Coverable lines:66
Total lines:147
Line coverage:72.7% (48 of 66)
Covered branches:21
Total branches:30
Branch coverage:70% (21 of 30)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
get_Id()-100%100%
get_ModuleId()-100%100%
get_ETag()-100%100%
get_ImportMode()-100%100%
get_Status()-100%100%
get_StatusReason()-100%100%
get_Authentication()-100%100%
get_TwinETag()-0%100%
get_Tags()-100%100%
get_Properties()-100%100%
get_Capabilities()-100%100%
get_DeviceScope()-100%100%
get_ParentScopes()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-65.31%70%

File(s)

C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\ExportImportDevice.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.Collections.Generic;
 9using Azure.Core;
 10
 11namespace Azure.Iot.Hub.Service.Models
 12{
 13    /// <summary> The ExportImportDevice. </summary>
 14    public partial class ExportImportDevice
 15    {
 16        /// <summary> Initializes a new instance of ExportImportDevice. </summary>
 53617        public ExportImportDevice()
 18        {
 53619            Tags = new ChangeTrackingDictionary<string, object>();
 53620            ParentScopes = new ChangeTrackingList<string>();
 53621        }
 22
 23        /// <summary> The unique identifier of the device. </summary>
 160824        public string Id { get; set; }
 25        /// <summary> The unique identifier of the module, if applicable. </summary>
 93626        public string ModuleId { get; set; }
 27        /// <summary> The string representing a weak ETag for the device RFC7232. The value is only used if import mode 
 72828        public string ETag { get; set; }
 29        /// <summary> The type of registry operation and ETag preferences. </summary>
 160830        public ExportImportDeviceImportMode? ImportMode { get; set; }
 31        /// <summary> The status of the module. If disabled, the module cannot connect to the service. </summary>
 87232        public ExportImportDeviceStatus? Status { get; set; }
 33        /// <summary> The 128 character-long string that stores the reason for the device identity status. All UTF-8 cha
 70434        public string StatusReason { get; set; }
 35        /// <summary> The authentication mechanism used by the module. This parameter is optional and defaults to SAS if
 95236        public AuthenticationMechanism Authentication { get; set; }
 37        /// <summary> The string representing a weak ETag for the device twin RFC7232. The value is only used if import 
 038        public string TwinETag { get; set; }
 39        /// <summary> The JSON document read and written by the solution back end. The tags are not visible to device ap
 53640        public IDictionary<string, object> Tags { get; }
 41        /// <summary> The desired and reported properties for the device. </summary>
 69642        public PropertyContainer Properties { get; set; }
 43        /// <summary> The status of capabilities enabled on the device. </summary>
 71244        public DeviceCapabilities Capabilities { get; set; }
 45        /// <summary> The scope of the device. </summary>
 70446        public string DeviceScope { get; set; }
 47        /// <summary> The scopes of the upper level edge devices if applicable. Only available for edge devices. </summa
 53648        public IList<string> ParentScopes { get; }
 49    }
 50}

C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\ExportImportDevice.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.Iot.Hub.Service.Models
 12{
 13    public partial class ExportImportDevice : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 53617            writer.WriteStartObject();
 53618            if (Optional.IsDefined(Id))
 19            {
 53620                writer.WritePropertyName("id");
 53621                writer.WriteStringValue(Id);
 22            }
 53623            if (Optional.IsDefined(ModuleId))
 24            {
 20025                writer.WritePropertyName("moduleId");
 20026                writer.WriteStringValue(ModuleId);
 27            }
 53628            if (Optional.IsDefined(ETag))
 29            {
 1630                writer.WritePropertyName("eTag");
 1631                writer.WriteStringValue(ETag);
 32            }
 53633            if (Optional.IsDefined(ImportMode))
 34            {
 53635                writer.WritePropertyName("importMode");
 53636                writer.WriteStringValue(ImportMode.Value.ToString());
 37            }
 53638            if (Optional.IsDefined(Status))
 39            {
 16840                writer.WritePropertyName("status");
 16841                writer.WriteStringValue(Status.Value.ToString());
 42            }
 53643            if (Optional.IsDefined(StatusReason))
 44            {
 045                writer.WritePropertyName("statusReason");
 046                writer.WriteStringValue(StatusReason);
 47            }
 53648            if (Optional.IsDefined(Authentication))
 49            {
 4850                writer.WritePropertyName("authentication");
 4851                writer.WriteObjectValue(Authentication);
 52            }
 53653            if (Optional.IsDefined(TwinETag))
 54            {
 055                writer.WritePropertyName("twinETag");
 056                writer.WriteStringValue(TwinETag);
 57            }
 53658            if (Optional.IsCollectionDefined(Tags))
 59            {
 060                writer.WritePropertyName("tags");
 061                writer.WriteStartObject();
 062                foreach (var item in Tags)
 63                {
 064                    writer.WritePropertyName(item.Key);
 065                    writer.WriteObjectValue(item.Value);
 66                }
 067                writer.WriteEndObject();
 68            }
 53669            if (Optional.IsDefined(Properties))
 70            {
 8071                writer.WritePropertyName("properties");
 8072                writer.WriteObjectValue(Properties);
 73            }
 53674            if (Optional.IsDefined(Capabilities))
 75            {
 876                writer.WritePropertyName("capabilities");
 877                writer.WriteObjectValue(Capabilities);
 78            }
 53679            if (Optional.IsDefined(DeviceScope))
 80            {
 081                writer.WritePropertyName("deviceScope");
 082                writer.WriteStringValue(DeviceScope);
 83            }
 53684            if (Optional.IsCollectionDefined(ParentScopes))
 85            {
 086                writer.WritePropertyName("parentScopes");
 087                writer.WriteStartArray();
 088                foreach (var item in ParentScopes)
 89                {
 090                    writer.WriteStringValue(item);
 91                }
 092                writer.WriteEndArray();
 93            }
 53694            writer.WriteEndObject();
 53695        }
 96    }
 97}