< Summary

Class:Azure.ResourceManager.Storage.Models.MetricSpecification
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\MetricSpecification.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\MetricSpecification.Serialization.cs
Covered lines:0
Uncovered lines:73
Coverable lines:73
Total lines:188
Line coverage:0% (0 of 73)
Covered branches:0
Total branches:42
Branch coverage:0% (0 of 42)

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_Dimensions()-0%100%
get_AggregationType()-0%100%
get_FillGapWithZero()-0%100%
get_Category()-0%100%
get_ResourceIdDimensionNameOverride()-0%100%
DeserializeMetricSpecification(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\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.Storage.Models
 11{
 12    /// <summary> Metric specification of operation. </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"> Name of metric specification. </param>
 22        /// <param name="displayName"> Display name of metric specification. </param>
 23        /// <param name="displayDescription"> Display description of metric specification. </param>
 24        /// <param name="unit"> Unit could be Bytes or Count. </param>
 25        /// <param name="dimensions"> Dimensions of blobs, including blob type and access tier. </param>
 26        /// <param name="aggregationType"> Aggregation type could be Average. </param>
 27        /// <param name="fillGapWithZero"> The property to decide fill gap with zero or not. </param>
 28        /// <param name="category"> The category this metric specification belong to, could be Capacity. </param>
 29        /// <param name="resourceIdDimensionNameOverride"> Account Resource Id. </param>
 030        internal MetricSpecification(string name, string displayName, string displayDescription, string unit, IReadOnlyL
 31        {
 032            Name = name;
 033            DisplayName = displayName;
 034            DisplayDescription = displayDescription;
 035            Unit = unit;
 036            Dimensions = dimensions;
 037            AggregationType = aggregationType;
 038            FillGapWithZero = fillGapWithZero;
 039            Category = category;
 040            ResourceIdDimensionNameOverride = resourceIdDimensionNameOverride;
 041        }
 42
 43        /// <summary> Name of metric specification. </summary>
 044        public string Name { get; }
 45        /// <summary> Display name of metric specification. </summary>
 046        public string DisplayName { get; }
 47        /// <summary> Display description of metric specification. </summary>
 048        public string DisplayDescription { get; }
 49        /// <summary> Unit could be Bytes or Count. </summary>
 050        public string Unit { get; }
 51        /// <summary> Dimensions of blobs, including blob type and access tier. </summary>
 052        public IReadOnlyList<Dimension> Dimensions { get; }
 53        /// <summary> Aggregation type could be Average. </summary>
 054        public string AggregationType { get; }
 55        /// <summary> The property to decide fill gap with zero or not. </summary>
 056        public bool? FillGapWithZero { get; }
 57        /// <summary> The category this metric specification belong to, could be Capacity. </summary>
 058        public string Category { get; }
 59        /// <summary> Account Resource Id. </summary>
 060        public string ResourceIdDimensionNameOverride { get; }
 61    }
 62}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\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.Storage.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            IReadOnlyList<Dimension> dimensions = default;
 023            string aggregationType = default;
 024            bool? fillGapWithZero = default;
 025            string category = default;
 026            string resourceIdDimensionNameOverride = default;
 027            foreach (var property in element.EnumerateObject())
 28            {
 029                if (property.NameEquals("name"))
 30                {
 031                    if (property.Value.ValueKind == JsonValueKind.Null)
 32                    {
 33                        continue;
 34                    }
 035                    name = property.Value.GetString();
 036                    continue;
 37                }
 038                if (property.NameEquals("displayName"))
 39                {
 040                    if (property.Value.ValueKind == JsonValueKind.Null)
 41                    {
 42                        continue;
 43                    }
 044                    displayName = property.Value.GetString();
 045                    continue;
 46                }
 047                if (property.NameEquals("displayDescription"))
 48                {
 049                    if (property.Value.ValueKind == JsonValueKind.Null)
 50                    {
 51                        continue;
 52                    }
 053                    displayDescription = property.Value.GetString();
 054                    continue;
 55                }
 056                if (property.NameEquals("unit"))
 57                {
 058                    if (property.Value.ValueKind == JsonValueKind.Null)
 59                    {
 60                        continue;
 61                    }
 062                    unit = property.Value.GetString();
 063                    continue;
 64                }
 065                if (property.NameEquals("dimensions"))
 66                {
 067                    if (property.Value.ValueKind == JsonValueKind.Null)
 68                    {
 69                        continue;
 70                    }
 071                    List<Dimension> array = new List<Dimension>();
 072                    foreach (var item in property.Value.EnumerateArray())
 73                    {
 074                        if (item.ValueKind == JsonValueKind.Null)
 75                        {
 076                            array.Add(null);
 77                        }
 78                        else
 79                        {
 080                            array.Add(Dimension.DeserializeDimension(item));
 81                        }
 82                    }
 083                    dimensions = array;
 084                    continue;
 85                }
 086                if (property.NameEquals("aggregationType"))
 87                {
 088                    if (property.Value.ValueKind == JsonValueKind.Null)
 89                    {
 90                        continue;
 91                    }
 092                    aggregationType = property.Value.GetString();
 093                    continue;
 94                }
 095                if (property.NameEquals("fillGapWithZero"))
 96                {
 097                    if (property.Value.ValueKind == JsonValueKind.Null)
 98                    {
 99                        continue;
 100                    }
 0101                    fillGapWithZero = property.Value.GetBoolean();
 0102                    continue;
 103                }
 0104                if (property.NameEquals("category"))
 105                {
 0106                    if (property.Value.ValueKind == JsonValueKind.Null)
 107                    {
 108                        continue;
 109                    }
 0110                    category = property.Value.GetString();
 0111                    continue;
 112                }
 0113                if (property.NameEquals("resourceIdDimensionNameOverride"))
 114                {
 0115                    if (property.Value.ValueKind == JsonValueKind.Null)
 116                    {
 117                        continue;
 118                    }
 0119                    resourceIdDimensionNameOverride = property.Value.GetString();
 120                    continue;
 121                }
 122            }
 0123            return new MetricSpecification(name, displayName, displayDescription, unit, dimensions, aggregationType, fil
 124        }
 125    }
 126}