< Summary

Class:Azure.Iot.Hub.Service.Models.ConfigurationContent
Assembly:Azure.Iot.Hub.Service
File(s):C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\ConfigurationContent.cs
C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\ConfigurationContent.Serialization.cs
Covered lines:0
Uncovered lines:59
Coverable lines:59
Total lines:138
Line coverage:0% (0 of 59)
Covered branches:0
Total branches:26
Branch coverage:0% (0 of 26)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_DeviceContent()-0%100%
get_ModulesContent()-0%100%
get_ModuleContent()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeConfigurationContent(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\ConfigurationContent.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 configuration content for devices or modules on edge devices. </summary>
 14    public partial class ConfigurationContent
 15    {
 16        /// <summary> Initializes a new instance of ConfigurationContent. </summary>
 017        public ConfigurationContent()
 18        {
 019            DeviceContent = new ChangeTrackingDictionary<string, object>();
 020            ModulesContent = new ChangeTrackingDictionary<string, object>();
 021            ModuleContent = new ChangeTrackingDictionary<string, object>();
 022        }
 23
 24        /// <summary> Initializes a new instance of ConfigurationContent. </summary>
 25        /// <param name="deviceContent"> The device configuration content. </param>
 26        /// <param name="modulesContent"> The modules configuration content. </param>
 27        /// <param name="moduleContent"> The module configuration content. </param>
 028        internal ConfigurationContent(IDictionary<string, object> deviceContent, IDictionary<string, object> modulesCont
 29        {
 030            DeviceContent = deviceContent;
 031            ModulesContent = modulesContent;
 032            ModuleContent = moduleContent;
 033        }
 34
 35        /// <summary> The device configuration content. </summary>
 036        public IDictionary<string, object> DeviceContent { get; }
 37        /// <summary> The modules configuration content. </summary>
 038        public IDictionary<string, object> ModulesContent { get; }
 39        /// <summary> The module configuration content. </summary>
 040        public IDictionary<string, object> ModuleContent { get; }
 41    }
 42}

C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\ConfigurationContent.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.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.Iot.Hub.Service.Models
 13{
 14    public partial class ConfigurationContent : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Optional.IsCollectionDefined(DeviceContent))
 20            {
 021                writer.WritePropertyName("deviceContent");
 022                writer.WriteStartObject();
 023                foreach (var item in DeviceContent)
 24                {
 025                    writer.WritePropertyName(item.Key);
 026                    writer.WriteObjectValue(item.Value);
 27                }
 028                writer.WriteEndObject();
 29            }
 030            if (Optional.IsCollectionDefined(ModulesContent))
 31            {
 032                writer.WritePropertyName("modulesContent");
 033                writer.WriteStartObject();
 034                foreach (var item in ModulesContent)
 35                {
 036                    writer.WritePropertyName(item.Key);
 037                    writer.WriteObjectValue(item.Value);
 38                }
 039                writer.WriteEndObject();
 40            }
 041            if (Optional.IsCollectionDefined(ModuleContent))
 42            {
 043                writer.WritePropertyName("moduleContent");
 044                writer.WriteStartObject();
 045                foreach (var item in ModuleContent)
 46                {
 047                    writer.WritePropertyName(item.Key);
 048                    writer.WriteObjectValue(item.Value);
 49                }
 050                writer.WriteEndObject();
 51            }
 052            writer.WriteEndObject();
 053        }
 54
 55        internal static ConfigurationContent DeserializeConfigurationContent(JsonElement element)
 56        {
 057            Optional<IDictionary<string, object>> deviceContent = default;
 058            Optional<IDictionary<string, object>> modulesContent = default;
 059            Optional<IDictionary<string, object>> moduleContent = default;
 060            foreach (var property in element.EnumerateObject())
 61            {
 062                if (property.NameEquals("deviceContent"))
 63                {
 064                    Dictionary<string, object> dictionary = new Dictionary<string, object>();
 065                    foreach (var property0 in property.Value.EnumerateObject())
 66                    {
 067                        dictionary.Add(property0.Name, property0.Value.GetObject());
 68                    }
 069                    deviceContent = dictionary;
 070                    continue;
 71                }
 072                if (property.NameEquals("modulesContent"))
 73                {
 074                    Dictionary<string, object> dictionary = new Dictionary<string, object>();
 075                    foreach (var property0 in property.Value.EnumerateObject())
 76                    {
 077                        dictionary.Add(property0.Name, property0.Value.GetObject());
 78                    }
 079                    modulesContent = dictionary;
 080                    continue;
 81                }
 082                if (property.NameEquals("moduleContent"))
 83                {
 084                    Dictionary<string, object> dictionary = new Dictionary<string, object>();
 085                    foreach (var property0 in property.Value.EnumerateObject())
 86                    {
 087                        dictionary.Add(property0.Name, property0.Value.GetObject());
 88                    }
 089                    moduleContent = dictionary;
 90                    continue;
 91                }
 92            }
 093            return new ConfigurationContent(Optional.ToDictionary(deviceContent), Optional.ToDictionary(modulesContent),
 94        }
 95    }
 96}