< Summary

Class:Azure.ResourceManager.EventHubs.Models.Cluster
Assembly:Azure.ResourceManager.EventHubs
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\Cluster.cs
C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\Cluster.Serialization.cs
Covered lines:0
Uncovered lines:112
Coverable lines:112
Total lines:259
Line coverage:0% (0 of 112)
Covered branches:0
Total branches:72
Branch coverage:0% (0 of 72)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Sku()-0%100%
get_Created()-0%100%
get_Updated()-0%100%
get_MetricId()-0%100%
get_Status()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeCluster(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\Cluster.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.EventHubs.Models
 11{
 12    /// <summary> Single Event Hubs Cluster resource in List or Get operations. </summary>
 13    public partial class Cluster : TrackedResource
 14    {
 15        /// <summary> Initializes a new instance of Cluster. </summary>
 016        public Cluster()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of Cluster. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> Resource name. </param>
 23        /// <param name="type"> Resource type. </param>
 24        /// <param name="location"> Resource location. </param>
 25        /// <param name="tags"> Resource tags. </param>
 26        /// <param name="sku"> Properties of the cluster SKU. </param>
 27        /// <param name="created"> The UTC time when the Event Hubs Cluster was created. </param>
 28        /// <param name="updated"> The UTC time when the Event Hubs Cluster was last updated. </param>
 29        /// <param name="metricId"> The metric ID of the cluster resource. Provided by the service and not modifiable by
 30        /// <param name="status"> Status of the Cluster resource. </param>
 031        internal Cluster(string id, string name, string type, string location, IDictionary<string, string> tags, Cluster
 32        {
 033            Sku = sku;
 034            Created = created;
 035            Updated = updated;
 036            MetricId = metricId;
 037            Status = status;
 038        }
 39
 40        /// <summary> Properties of the cluster SKU. </summary>
 041        public ClusterSku Sku { get; set; }
 42        /// <summary> The UTC time when the Event Hubs Cluster was created. </summary>
 043        public string Created { get; }
 44        /// <summary> The UTC time when the Event Hubs Cluster was last updated. </summary>
 045        public string Updated { get; }
 46        /// <summary> The metric ID of the cluster resource. Provided by the service and not modifiable by the user. </s
 047        public string MetricId { get; }
 48        /// <summary> Status of the Cluster resource. </summary>
 049        public string Status { get; }
 50    }
 51}

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\Cluster.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.EventHubs.Models
 13{
 14    public partial class Cluster : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Sku != null)
 20            {
 021                writer.WritePropertyName("sku");
 022                writer.WriteObjectValue(Sku);
 23            }
 024            if (Location != null)
 25            {
 026                writer.WritePropertyName("location");
 027                writer.WriteStringValue(Location);
 28            }
 029            if (Tags != null)
 30            {
 031                writer.WritePropertyName("tags");
 032                writer.WriteStartObject();
 033                foreach (var item in Tags)
 34                {
 035                    writer.WritePropertyName(item.Key);
 036                    writer.WriteStringValue(item.Value);
 37                }
 038                writer.WriteEndObject();
 39            }
 040            if (Id != null)
 41            {
 042                writer.WritePropertyName("id");
 043                writer.WriteStringValue(Id);
 44            }
 045            if (Name != null)
 46            {
 047                writer.WritePropertyName("name");
 048                writer.WriteStringValue(Name);
 49            }
 050            if (Type != null)
 51            {
 052                writer.WritePropertyName("type");
 053                writer.WriteStringValue(Type);
 54            }
 055            writer.WritePropertyName("properties");
 056            writer.WriteStartObject();
 057            if (Created != null)
 58            {
 059                writer.WritePropertyName("created");
 060                writer.WriteStringValue(Created);
 61            }
 062            if (Updated != null)
 63            {
 064                writer.WritePropertyName("updated");
 065                writer.WriteStringValue(Updated);
 66            }
 067            if (MetricId != null)
 68            {
 069                writer.WritePropertyName("metricId");
 070                writer.WriteStringValue(MetricId);
 71            }
 072            if (Status != null)
 73            {
 074                writer.WritePropertyName("status");
 075                writer.WriteStringValue(Status);
 76            }
 077            writer.WriteEndObject();
 078            writer.WriteEndObject();
 079        }
 80
 81        internal static Cluster DeserializeCluster(JsonElement element)
 82        {
 083            ClusterSku sku = default;
 084            string location = default;
 085            IDictionary<string, string> tags = default;
 086            string id = default;
 087            string name = default;
 088            string type = default;
 089            string created = default;
 090            string updated = default;
 091            string metricId = default;
 092            string status = default;
 093            foreach (var property in element.EnumerateObject())
 94            {
 095                if (property.NameEquals("sku"))
 96                {
 097                    if (property.Value.ValueKind == JsonValueKind.Null)
 98                    {
 99                        continue;
 100                    }
 0101                    sku = ClusterSku.DeserializeClusterSku(property.Value);
 0102                    continue;
 103                }
 0104                if (property.NameEquals("location"))
 105                {
 0106                    if (property.Value.ValueKind == JsonValueKind.Null)
 107                    {
 108                        continue;
 109                    }
 0110                    location = property.Value.GetString();
 0111                    continue;
 112                }
 0113                if (property.NameEquals("tags"))
 114                {
 0115                    if (property.Value.ValueKind == JsonValueKind.Null)
 116                    {
 117                        continue;
 118                    }
 0119                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0120                    foreach (var property0 in property.Value.EnumerateObject())
 121                    {
 0122                        if (property0.Value.ValueKind == JsonValueKind.Null)
 123                        {
 0124                            dictionary.Add(property0.Name, null);
 125                        }
 126                        else
 127                        {
 0128                            dictionary.Add(property0.Name, property0.Value.GetString());
 129                        }
 130                    }
 0131                    tags = dictionary;
 0132                    continue;
 133                }
 0134                if (property.NameEquals("id"))
 135                {
 0136                    if (property.Value.ValueKind == JsonValueKind.Null)
 137                    {
 138                        continue;
 139                    }
 0140                    id = property.Value.GetString();
 0141                    continue;
 142                }
 0143                if (property.NameEquals("name"))
 144                {
 0145                    if (property.Value.ValueKind == JsonValueKind.Null)
 146                    {
 147                        continue;
 148                    }
 0149                    name = property.Value.GetString();
 0150                    continue;
 151                }
 0152                if (property.NameEquals("type"))
 153                {
 0154                    if (property.Value.ValueKind == JsonValueKind.Null)
 155                    {
 156                        continue;
 157                    }
 0158                    type = property.Value.GetString();
 0159                    continue;
 160                }
 0161                if (property.NameEquals("properties"))
 162                {
 0163                    foreach (var property0 in property.Value.EnumerateObject())
 164                    {
 0165                        if (property0.NameEquals("created"))
 166                        {
 0167                            if (property0.Value.ValueKind == JsonValueKind.Null)
 168                            {
 169                                continue;
 170                            }
 0171                            created = property0.Value.GetString();
 0172                            continue;
 173                        }
 0174                        if (property0.NameEquals("updated"))
 175                        {
 0176                            if (property0.Value.ValueKind == JsonValueKind.Null)
 177                            {
 178                                continue;
 179                            }
 0180                            updated = property0.Value.GetString();
 0181                            continue;
 182                        }
 0183                        if (property0.NameEquals("metricId"))
 184                        {
 0185                            if (property0.Value.ValueKind == JsonValueKind.Null)
 186                            {
 187                                continue;
 188                            }
 0189                            metricId = property0.Value.GetString();
 0190                            continue;
 191                        }
 0192                        if (property0.NameEquals("status"))
 193                        {
 0194                            if (property0.Value.ValueKind == JsonValueKind.Null)
 195                            {
 196                                continue;
 197                            }
 0198                            status = property0.Value.GetString();
 199                            continue;
 200                        }
 201                    }
 202                    continue;
 203                }
 204            }
 0205            return new Cluster(id, name, type, location, tags, sku, created, updated, metricId, status);
 206        }
 207    }
 208}