< Summary

Class:Azure.ResourceManager.Network.Models.MetricSpecification
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\MetricSpecification.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\MetricSpecification.Serialization.cs
Covered lines:0
Uncovered lines:113
Coverable lines:113
Total lines:270
Line coverage:0% (0 of 113)
Covered branches:0
Total branches:66
Branch coverage:0% (0 of 66)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_DisplayName()-0%100%
get_DisplayDescription()-0%100%
get_Unit()-0%100%
get_AggregationType()-0%100%
get_Availabilities()-0%100%
get_EnableRegionalMdmAccount()-0%100%
get_FillGapWithZero()-0%100%
get_MetricFilterPattern()-0%100%
get_Dimensions()-0%100%
get_IsInternal()-0%100%
get_SourceMdmAccount()-0%100%
get_SourceMdmNamespace()-0%100%
get_ResourceIdDimensionNameOverride()-0%100%
DeserializeMetricSpecification(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\MetricSpecification.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;
 9
 10namespace Azure.ResourceManager.Network.Models
 11{
 12    /// <summary> Description of metrics specification. </summary>
 13    public partial class MetricSpecification
 14    {
 15        /// <summary> Initializes a new instance of MetricSpecification. </summary>
 016        internal MetricSpecification()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of MetricSpecification. </summary>
 21        /// <param name="name"> The name of the metric. </param>
 22        /// <param name="displayName"> The display name of the metric. </param>
 23        /// <param name="displayDescription"> The description of the metric. </param>
 24        /// <param name="unit"> Units the metric to be displayed in. </param>
 25        /// <param name="aggregationType"> The aggregation type. </param>
 26        /// <param name="availabilities"> List of availability. </param>
 27        /// <param name="enableRegionalMdmAccount"> Whether regional MDM account enabled. </param>
 28        /// <param name="fillGapWithZero"> Whether gaps would be filled with zeros. </param>
 29        /// <param name="metricFilterPattern"> Pattern for the filter of the metric. </param>
 30        /// <param name="dimensions"> List of dimensions. </param>
 31        /// <param name="isInternal"> Whether the metric is internal. </param>
 32        /// <param name="sourceMdmAccount"> The source MDM account. </param>
 33        /// <param name="sourceMdmNamespace"> The source MDM namespace. </param>
 34        /// <param name="resourceIdDimensionNameOverride"> The resource Id dimension name override. </param>
 035        internal MetricSpecification(string name, string displayName, string displayDescription, string unit, string agg
 36        {
 037            Name = name;
 038            DisplayName = displayName;
 039            DisplayDescription = displayDescription;
 040            Unit = unit;
 041            AggregationType = aggregationType;
 042            Availabilities = availabilities;
 043            EnableRegionalMdmAccount = enableRegionalMdmAccount;
 044            FillGapWithZero = fillGapWithZero;
 045            MetricFilterPattern = metricFilterPattern;
 046            Dimensions = dimensions;
 047            IsInternal = isInternal;
 048            SourceMdmAccount = sourceMdmAccount;
 049            SourceMdmNamespace = sourceMdmNamespace;
 050            ResourceIdDimensionNameOverride = resourceIdDimensionNameOverride;
 051        }
 52
 53        /// <summary> The name of the metric. </summary>
 054        public string Name { get; }
 55        /// <summary> The display name of the metric. </summary>
 056        public string DisplayName { get; }
 57        /// <summary> The description of the metric. </summary>
 058        public string DisplayDescription { get; }
 59        /// <summary> Units the metric to be displayed in. </summary>
 060        public string Unit { get; }
 61        /// <summary> The aggregation type. </summary>
 062        public string AggregationType { get; }
 63        /// <summary> List of availability. </summary>
 064        public IReadOnlyList<Availability> Availabilities { get; }
 65        /// <summary> Whether regional MDM account enabled. </summary>
 066        public bool? EnableRegionalMdmAccount { get; }
 67        /// <summary> Whether gaps would be filled with zeros. </summary>
 068        public bool? FillGapWithZero { get; }
 69        /// <summary> Pattern for the filter of the metric. </summary>
 070        public string MetricFilterPattern { get; }
 71        /// <summary> List of dimensions. </summary>
 072        public IReadOnlyList<Dimension> Dimensions { get; }
 73        /// <summary> Whether the metric is internal. </summary>
 074        public bool? IsInternal { get; }
 75        /// <summary> The source MDM account. </summary>
 076        public string SourceMdmAccount { get; }
 77        /// <summary> The source MDM namespace. </summary>
 078        public string SourceMdmNamespace { get; }
 79        /// <summary> The resource Id dimension name override. </summary>
 080        public string ResourceIdDimensionNameOverride { get; }
 81    }
 82}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\MetricSpecification.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.ResourceManager.Network.Models
 13{
 14    public partial class MetricSpecification
 15    {
 16        internal static MetricSpecification DeserializeMetricSpecification(JsonElement element)
 17        {
 018            string name = default;
 019            string displayName = default;
 020            string displayDescription = default;
 021            string unit = default;
 022            string aggregationType = default;
 023            IReadOnlyList<Availability> availabilities = default;
 024            bool? enableRegionalMdmAccount = default;
 025            bool? fillGapWithZero = default;
 026            string metricFilterPattern = default;
 027            IReadOnlyList<Dimension> dimensions = default;
 028            bool? isInternal = default;
 029            string sourceMdmAccount = default;
 030            string sourceMdmNamespace = default;
 031            string resourceIdDimensionNameOverride = default;
 032            foreach (var property in element.EnumerateObject())
 33            {
 034                if (property.NameEquals("name"))
 35                {
 036                    if (property.Value.ValueKind == JsonValueKind.Null)
 37                    {
 38                        continue;
 39                    }
 040                    name = property.Value.GetString();
 041                    continue;
 42                }
 043                if (property.NameEquals("displayName"))
 44                {
 045                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 049                    displayName = property.Value.GetString();
 050                    continue;
 51                }
 052                if (property.NameEquals("displayDescription"))
 53                {
 054                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 058                    displayDescription = property.Value.GetString();
 059                    continue;
 60                }
 061                if (property.NameEquals("unit"))
 62                {
 063                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 067                    unit = property.Value.GetString();
 068                    continue;
 69                }
 070                if (property.NameEquals("aggregationType"))
 71                {
 072                    if (property.Value.ValueKind == JsonValueKind.Null)
 73                    {
 74                        continue;
 75                    }
 076                    aggregationType = property.Value.GetString();
 077                    continue;
 78                }
 079                if (property.NameEquals("availabilities"))
 80                {
 081                    if (property.Value.ValueKind == JsonValueKind.Null)
 82                    {
 83                        continue;
 84                    }
 085                    List<Availability> array = new List<Availability>();
 086                    foreach (var item in property.Value.EnumerateArray())
 87                    {
 088                        if (item.ValueKind == JsonValueKind.Null)
 89                        {
 090                            array.Add(null);
 91                        }
 92                        else
 93                        {
 094                            array.Add(Availability.DeserializeAvailability(item));
 95                        }
 96                    }
 097                    availabilities = array;
 098                    continue;
 99                }
 0100                if (property.NameEquals("enableRegionalMdmAccount"))
 101                {
 0102                    if (property.Value.ValueKind == JsonValueKind.Null)
 103                    {
 104                        continue;
 105                    }
 0106                    enableRegionalMdmAccount = property.Value.GetBoolean();
 0107                    continue;
 108                }
 0109                if (property.NameEquals("fillGapWithZero"))
 110                {
 0111                    if (property.Value.ValueKind == JsonValueKind.Null)
 112                    {
 113                        continue;
 114                    }
 0115                    fillGapWithZero = property.Value.GetBoolean();
 0116                    continue;
 117                }
 0118                if (property.NameEquals("metricFilterPattern"))
 119                {
 0120                    if (property.Value.ValueKind == JsonValueKind.Null)
 121                    {
 122                        continue;
 123                    }
 0124                    metricFilterPattern = property.Value.GetString();
 0125                    continue;
 126                }
 0127                if (property.NameEquals("dimensions"))
 128                {
 0129                    if (property.Value.ValueKind == JsonValueKind.Null)
 130                    {
 131                        continue;
 132                    }
 0133                    List<Dimension> array = new List<Dimension>();
 0134                    foreach (var item in property.Value.EnumerateArray())
 135                    {
 0136                        if (item.ValueKind == JsonValueKind.Null)
 137                        {
 0138                            array.Add(null);
 139                        }
 140                        else
 141                        {
 0142                            array.Add(Dimension.DeserializeDimension(item));
 143                        }
 144                    }
 0145                    dimensions = array;
 0146                    continue;
 147                }
 0148                if (property.NameEquals("isInternal"))
 149                {
 0150                    if (property.Value.ValueKind == JsonValueKind.Null)
 151                    {
 152                        continue;
 153                    }
 0154                    isInternal = property.Value.GetBoolean();
 0155                    continue;
 156                }
 0157                if (property.NameEquals("sourceMdmAccount"))
 158                {
 0159                    if (property.Value.ValueKind == JsonValueKind.Null)
 160                    {
 161                        continue;
 162                    }
 0163                    sourceMdmAccount = property.Value.GetString();
 0164                    continue;
 165                }
 0166                if (property.NameEquals("sourceMdmNamespace"))
 167                {
 0168                    if (property.Value.ValueKind == JsonValueKind.Null)
 169                    {
 170                        continue;
 171                    }
 0172                    sourceMdmNamespace = property.Value.GetString();
 0173                    continue;
 174                }
 0175                if (property.NameEquals("resourceIdDimensionNameOverride"))
 176                {
 0177                    if (property.Value.ValueKind == JsonValueKind.Null)
 178                    {
 179                        continue;
 180                    }
 0181                    resourceIdDimensionNameOverride = property.Value.GetString();
 182                    continue;
 183                }
 184            }
 0185            return new MetricSpecification(name, displayName, displayDescription, unit, aggregationType, availabilities,
 186        }
 187    }
 188}