< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Results()-0%100%
get_Queries()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeConfigurationMetrics(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\ConfigurationMetrics.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 metrics for Iot Hub devices and modules. </summary>
 14    public partial class ConfigurationMetrics
 15    {
 16        /// <summary> Initializes a new instance of ConfigurationMetrics. </summary>
 017        public ConfigurationMetrics()
 18        {
 019            Results = new ChangeTrackingDictionary<string, long>();
 020            Queries = new ChangeTrackingDictionary<string, string>();
 021        }
 22
 23        /// <summary> Initializes a new instance of ConfigurationMetrics. </summary>
 24        /// <param name="results"> The results of the metrics collection queries. </param>
 25        /// <param name="queries"> The key-value pairs with queries and their identifier. </param>
 026        internal ConfigurationMetrics(IDictionary<string, long> results, IDictionary<string, string> queries)
 27        {
 028            Results = results;
 029            Queries = queries;
 030        }
 31
 32        /// <summary> The results of the metrics collection queries. </summary>
 033        public IDictionary<string, long> Results { get; }
 34        /// <summary> The key-value pairs with queries and their identifier. </summary>
 035        public IDictionary<string, string> Queries { get; }
 36    }
 37}

C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\ConfigurationMetrics.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 ConfigurationMetrics : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Optional.IsCollectionDefined(Results))
 20            {
 021                writer.WritePropertyName("results");
 022                writer.WriteStartObject();
 023                foreach (var item in Results)
 24                {
 025                    writer.WritePropertyName(item.Key);
 026                    writer.WriteNumberValue(item.Value);
 27                }
 028                writer.WriteEndObject();
 29            }
 030            if (Optional.IsCollectionDefined(Queries))
 31            {
 032                writer.WritePropertyName("queries");
 033                writer.WriteStartObject();
 034                foreach (var item in Queries)
 35                {
 036                    writer.WritePropertyName(item.Key);
 037                    writer.WriteStringValue(item.Value);
 38                }
 039                writer.WriteEndObject();
 40            }
 041            writer.WriteEndObject();
 042        }
 43
 44        internal static ConfigurationMetrics DeserializeConfigurationMetrics(JsonElement element)
 45        {
 046            Optional<IDictionary<string, long>> results = default;
 047            Optional<IDictionary<string, string>> queries = default;
 048            foreach (var property in element.EnumerateObject())
 49            {
 050                if (property.NameEquals("results"))
 51                {
 052                    Dictionary<string, long> dictionary = new Dictionary<string, long>();
 053                    foreach (var property0 in property.Value.EnumerateObject())
 54                    {
 055                        dictionary.Add(property0.Name, property0.Value.GetInt64());
 56                    }
 057                    results = dictionary;
 058                    continue;
 59                }
 060                if (property.NameEquals("queries"))
 61                {
 062                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 063                    foreach (var property0 in property.Value.EnumerateObject())
 64                    {
 065                        dictionary.Add(property0.Name, property0.Value.GetString());
 66                    }
 067                    queries = dictionary;
 68                    continue;
 69                }
 70            }
 071            return new ConfigurationMetrics(Optional.ToDictionary(results), Optional.ToDictionary(queries));
 72        }
 73    }
 74}