< Summary

Class:Azure.ResourceManager.Storage.Models.StorageQueue
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\StorageQueue.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\StorageQueue.Serialization.cs
Covered lines:0
Uncovered lines:66
Coverable lines:66
Total lines:170
Line coverage:0% (0 of 66)
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_Metadata()-0%100%
get_ApproximateMessageCount()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeStorageQueue(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\StorageQueue.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> The StorageQueue. </summary>
 13    public partial class StorageQueue : Resource
 14    {
 15        /// <summary> Initializes a new instance of StorageQueue. </summary>
 016        public StorageQueue()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of StorageQueue. </summary>
 21        /// <param name="id"> Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourc
 22        /// <param name="name"> The name of the resource. </param>
 23        /// <param name="type"> The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/sto
 24        /// <param name="metadata"> A name-value pair that represents queue metadata. </param>
 25        /// <param name="approximateMessageCount"> Integer indicating an approximate number of messages in the queue. Th
 026        internal StorageQueue(string id, string name, string type, IDictionary<string, string> metadata, int? approximat
 27        {
 028            Metadata = metadata;
 029            ApproximateMessageCount = approximateMessageCount;
 030        }
 31
 32        /// <summary> A name-value pair that represents queue metadata. </summary>
 033        public IDictionary<string, string> Metadata { get; set; }
 34        /// <summary> Integer indicating an approximate number of messages in the queue. This number is not lower than t
 035        public int? ApproximateMessageCount { get; }
 36    }
 37}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\StorageQueue.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 StorageQueue : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Id != null)
 20            {
 021                writer.WritePropertyName("id");
 022                writer.WriteStringValue(Id);
 23            }
 024            if (Name != null)
 25            {
 026                writer.WritePropertyName("name");
 027                writer.WriteStringValue(Name);
 28            }
 029            if (Type != null)
 30            {
 031                writer.WritePropertyName("type");
 032                writer.WriteStringValue(Type);
 33            }
 034            writer.WritePropertyName("properties");
 035            writer.WriteStartObject();
 036            if (Metadata != null)
 37            {
 038                writer.WritePropertyName("metadata");
 039                writer.WriteStartObject();
 040                foreach (var item in Metadata)
 41                {
 042                    writer.WritePropertyName(item.Key);
 043                    writer.WriteStringValue(item.Value);
 44                }
 045                writer.WriteEndObject();
 46            }
 047            if (ApproximateMessageCount != null)
 48            {
 049                writer.WritePropertyName("approximateMessageCount");
 050                writer.WriteNumberValue(ApproximateMessageCount.Value);
 51            }
 052            writer.WriteEndObject();
 053            writer.WriteEndObject();
 054        }
 55
 56        internal static StorageQueue DeserializeStorageQueue(JsonElement element)
 57        {
 058            string id = default;
 059            string name = default;
 060            string type = default;
 061            IDictionary<string, string> metadata = default;
 062            int? approximateMessageCount = default;
 063            foreach (var property in element.EnumerateObject())
 64            {
 065                if (property.NameEquals("id"))
 66                {
 067                    if (property.Value.ValueKind == JsonValueKind.Null)
 68                    {
 69                        continue;
 70                    }
 071                    id = property.Value.GetString();
 072                    continue;
 73                }
 074                if (property.NameEquals("name"))
 75                {
 076                    if (property.Value.ValueKind == JsonValueKind.Null)
 77                    {
 78                        continue;
 79                    }
 080                    name = property.Value.GetString();
 081                    continue;
 82                }
 083                if (property.NameEquals("type"))
 84                {
 085                    if (property.Value.ValueKind == JsonValueKind.Null)
 86                    {
 87                        continue;
 88                    }
 089                    type = property.Value.GetString();
 090                    continue;
 91                }
 092                if (property.NameEquals("properties"))
 93                {
 094                    foreach (var property0 in property.Value.EnumerateObject())
 95                    {
 096                        if (property0.NameEquals("metadata"))
 97                        {
 098                            if (property0.Value.ValueKind == JsonValueKind.Null)
 99                            {
 100                                continue;
 101                            }
 0102                            Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0103                            foreach (var property1 in property0.Value.EnumerateObject())
 104                            {
 0105                                if (property1.Value.ValueKind == JsonValueKind.Null)
 106                                {
 0107                                    dictionary.Add(property1.Name, null);
 108                                }
 109                                else
 110                                {
 0111                                    dictionary.Add(property1.Name, property1.Value.GetString());
 112                                }
 113                            }
 0114                            metadata = dictionary;
 0115                            continue;
 116                        }
 0117                        if (property0.NameEquals("approximateMessageCount"))
 118                        {
 0119                            if (property0.Value.ValueKind == JsonValueKind.Null)
 120                            {
 121                                continue;
 122                            }
 0123                            approximateMessageCount = property0.Value.GetInt32();
 124                            continue;
 125                        }
 126                    }
 127                    continue;
 128                }
 129            }
 0130            return new StorageQueue(id, name, type, metadata, approximateMessageCount);
 131        }
 132    }
 133}