< Summary

Class:Azure.ResourceManager.EventHubs.Models.EHNamespace
Assembly:Azure.ResourceManager.EventHubs
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\EHNamespace.cs
C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\EHNamespace.Serialization.cs
Covered lines:159
Uncovered lines:33
Coverable lines:192
Total lines:413
Line coverage:82.8% (159 of 192)
Covered branches:101
Total branches:120
Branch coverage:84.1% (101 of 120)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_Sku()-100%100%
get_Identity()-100%100%
get_ProvisioningState()-100%100%
get_CreatedAt()-100%100%
get_UpdatedAt()-100%100%
get_ServiceBusEndpoint()-100%100%
get_ClusterArmId()-100%100%
get_MetricId()-100%100%
get_IsAutoInflateEnabled()-100%100%
get_MaximumThroughputUnits()-100%100%
get_KafkaEnabled()-100%100%
get_ZoneRedundant()-100%100%
get_Encryption()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-62.5%68.42%
DeserializeEHNamespace(...)-90.82%91.46%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\EHNamespace.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;
 9using System.Collections.Generic;
 10
 11namespace Azure.ResourceManager.EventHubs.Models
 12{
 13    /// <summary> Single Namespace item in List or Get Operation. </summary>
 14    public partial class EHNamespace : TrackedResource
 15    {
 16        /// <summary> Initializes a new instance of EHNamespace. </summary>
 6417        public EHNamespace()
 18        {
 6419        }
 20
 21        /// <summary> Initializes a new instance of EHNamespace. </summary>
 22        /// <param name="id"> Resource ID. </param>
 23        /// <param name="name"> Resource name. </param>
 24        /// <param name="type"> Resource type. </param>
 25        /// <param name="location"> Resource location. </param>
 26        /// <param name="tags"> Resource tags. </param>
 27        /// <param name="sku"> Properties of sku resource. </param>
 28        /// <param name="identity"> Properties of BYOK Identity description. </param>
 29        /// <param name="provisioningState"> Provisioning state of the Namespace. </param>
 30        /// <param name="createdAt"> The time the Namespace was created. </param>
 31        /// <param name="updatedAt"> The time the Namespace was updated. </param>
 32        /// <param name="serviceBusEndpoint"> Endpoint you can use to perform Service Bus operations. </param>
 33        /// <param name="clusterArmId"> Cluster ARM ID of the Namespace. </param>
 34        /// <param name="metricId"> Identifier for Azure Insights metrics. </param>
 35        /// <param name="isAutoInflateEnabled"> Value that indicates whether AutoInflate is enabled for eventhub namespa
 36        /// <param name="maximumThroughputUnits"> Upper limit of throughput units when AutoInflate is enabled, value sho
 37        /// <param name="kafkaEnabled"> Value that indicates whether Kafka is enabled for eventhub namespace. </param>
 38        /// <param name="zoneRedundant"> Enabling this property creates a Standard Event Hubs Namespace in regions suppo
 39        /// <param name="encryption"> Properties of BYOK Encryption description. </param>
 14440        internal EHNamespace(string id, string name, string type, string location, IDictionary<string, string> tags, Sku
 41        {
 14442            Sku = sku;
 14443            Identity = identity;
 14444            ProvisioningState = provisioningState;
 14445            CreatedAt = createdAt;
 14446            UpdatedAt = updatedAt;
 14447            ServiceBusEndpoint = serviceBusEndpoint;
 14448            ClusterArmId = clusterArmId;
 14449            MetricId = metricId;
 14450            IsAutoInflateEnabled = isAutoInflateEnabled;
 14451            MaximumThroughputUnits = maximumThroughputUnits;
 14452            KafkaEnabled = kafkaEnabled;
 14453            ZoneRedundant = zoneRedundant;
 14454            Encryption = encryption;
 14455        }
 56
 57        /// <summary> Properties of sku resource. </summary>
 34858        public Sku Sku { get; set; }
 59        /// <summary> Properties of BYOK Identity description. </summary>
 26460        public Identity Identity { get; set; }
 61        /// <summary> Provisioning state of the Namespace. </summary>
 17662        public string ProvisioningState { get; }
 63        /// <summary> The time the Namespace was created. </summary>
 12064        public DateTimeOffset? CreatedAt { get; }
 65        /// <summary> The time the Namespace was updated. </summary>
 12066        public DateTimeOffset? UpdatedAt { get; }
 67        /// <summary> Endpoint you can use to perform Service Bus operations. </summary>
 12068        public string ServiceBusEndpoint { get; }
 69        /// <summary> Cluster ARM ID of the Namespace. </summary>
 26470        public string ClusterArmId { get; set; }
 71        /// <summary> Identifier for Azure Insights metrics. </summary>
 12072        public string MetricId { get; }
 73        /// <summary> Value that indicates whether AutoInflate is enabled for eventhub namespace. </summary>
 27674        public bool? IsAutoInflateEnabled { get; set; }
 75        /// <summary> Upper limit of throughput units when AutoInflate is enabled, value should be within 0 to 20 throug
 27676        public int? MaximumThroughputUnits { get; set; }
 77        /// <summary> Value that indicates whether Kafka is enabled for eventhub namespace. </summary>
 28078        public bool? KafkaEnabled { get; set; }
 79        /// <summary> Enabling this property creates a Standard Event Hubs Namespace in regions supported availability z
 26480        public bool? ZoneRedundant { get; set; }
 81        /// <summary> Properties of BYOK Encryption description. </summary>
 26482        public Encryption Encryption { get; set; }
 83    }
 84}

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\EHNamespace.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;
 9using System.Collections.Generic;
 10using System.Text.Json;
 11using Azure.Core;
 12
 13namespace Azure.ResourceManager.EventHubs.Models
 14{
 15    public partial class EHNamespace : IUtf8JsonSerializable
 16    {
 17        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 18        {
 12019            writer.WriteStartObject();
 12020            if (Sku != null)
 21            {
 5622                writer.WritePropertyName("sku");
 5623                writer.WriteObjectValue(Sku);
 24            }
 12025            if (Identity != null)
 26            {
 027                writer.WritePropertyName("identity");
 028                writer.WriteObjectValue(Identity);
 29            }
 12030            if (Location != null)
 31            {
 11232                writer.WritePropertyName("location");
 11233                writer.WriteStringValue(Location);
 34            }
 12035            if (Tags != null)
 36            {
 10437                writer.WritePropertyName("tags");
 10438                writer.WriteStartObject();
 62439                foreach (var item in Tags)
 40                {
 20841                    writer.WritePropertyName(item.Key);
 20842                    writer.WriteStringValue(item.Value);
 43                }
 10444                writer.WriteEndObject();
 45            }
 12046            if (Id != null)
 47            {
 048                writer.WritePropertyName("id");
 049                writer.WriteStringValue(Id);
 50            }
 12051            if (Name != null)
 52            {
 053                writer.WritePropertyName("name");
 054                writer.WriteStringValue(Name);
 55            }
 12056            if (Type != null)
 57            {
 058                writer.WritePropertyName("type");
 059                writer.WriteStringValue(Type);
 60            }
 12061            writer.WritePropertyName("properties");
 12062            writer.WriteStartObject();
 12063            if (ProvisioningState != null)
 64            {
 065                writer.WritePropertyName("provisioningState");
 066                writer.WriteStringValue(ProvisioningState);
 67            }
 12068            if (CreatedAt != null)
 69            {
 070                writer.WritePropertyName("createdAt");
 071                writer.WriteStringValue(CreatedAt.Value, "O");
 72            }
 12073            if (UpdatedAt != null)
 74            {
 075                writer.WritePropertyName("updatedAt");
 076                writer.WriteStringValue(UpdatedAt.Value, "O");
 77            }
 12078            if (ServiceBusEndpoint != null)
 79            {
 080                writer.WritePropertyName("serviceBusEndpoint");
 081                writer.WriteStringValue(ServiceBusEndpoint);
 82            }
 12083            if (ClusterArmId != null)
 84            {
 085                writer.WritePropertyName("clusterArmId");
 086                writer.WriteStringValue(ClusterArmId);
 87            }
 12088            if (MetricId != null)
 89            {
 090                writer.WritePropertyName("metricId");
 091                writer.WriteStringValue(MetricId);
 92            }
 12093            if (IsAutoInflateEnabled != null)
 94            {
 895                writer.WritePropertyName("isAutoInflateEnabled");
 896                writer.WriteBooleanValue(IsAutoInflateEnabled.Value);
 97            }
 12098            if (MaximumThroughputUnits != null)
 99            {
 8100                writer.WritePropertyName("maximumThroughputUnits");
 8101                writer.WriteNumberValue(MaximumThroughputUnits.Value);
 102            }
 120103            if (KafkaEnabled != null)
 104            {
 8105                writer.WritePropertyName("kafkaEnabled");
 8106                writer.WriteBooleanValue(KafkaEnabled.Value);
 107            }
 120108            if (ZoneRedundant != null)
 109            {
 0110                writer.WritePropertyName("zoneRedundant");
 0111                writer.WriteBooleanValue(ZoneRedundant.Value);
 112            }
 120113            if (Encryption != null)
 114            {
 0115                writer.WritePropertyName("encryption");
 0116                writer.WriteObjectValue(Encryption);
 117            }
 120118            writer.WriteEndObject();
 120119            writer.WriteEndObject();
 120120        }
 121
 122        internal static EHNamespace DeserializeEHNamespace(JsonElement element)
 123        {
 144124            Sku sku = default;
 144125            Identity identity = default;
 144126            string location = default;
 144127            IDictionary<string, string> tags = default;
 144128            string id = default;
 144129            string name = default;
 144130            string type = default;
 144131            string provisioningState = default;
 144132            DateTimeOffset? createdAt = default;
 144133            DateTimeOffset? updatedAt = default;
 144134            string serviceBusEndpoint = default;
 144135            string clusterArmId = default;
 144136            string metricId = default;
 144137            bool? isAutoInflateEnabled = default;
 144138            int? maximumThroughputUnits = default;
 144139            bool? kafkaEnabled = default;
 144140            bool? zoneRedundant = default;
 144141            Encryption encryption = default;
 2304142            foreach (var property in element.EnumerateObject())
 143            {
 1008144                if (property.NameEquals("sku"))
 145                {
 144146                    if (property.Value.ValueKind == JsonValueKind.Null)
 147                    {
 148                        continue;
 149                    }
 144150                    sku = Sku.DeserializeSku(property.Value);
 144151                    continue;
 152                }
 864153                if (property.NameEquals("identity"))
 154                {
 0155                    if (property.Value.ValueKind == JsonValueKind.Null)
 156                    {
 157                        continue;
 158                    }
 0159                    identity = Identity.DeserializeIdentity(property.Value);
 0160                    continue;
 161                }
 864162                if (property.NameEquals("location"))
 163                {
 144164                    if (property.Value.ValueKind == JsonValueKind.Null)
 165                    {
 166                        continue;
 167                    }
 144168                    location = property.Value.GetString();
 144169                    continue;
 170                }
 720171                if (property.NameEquals("tags"))
 172                {
 144173                    if (property.Value.ValueKind == JsonValueKind.Null)
 174                    {
 175                        continue;
 176                    }
 144177                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 784178                    foreach (var property0 in property.Value.EnumerateObject())
 179                    {
 248180                        if (property0.Value.ValueKind == JsonValueKind.Null)
 181                        {
 0182                            dictionary.Add(property0.Name, null);
 183                        }
 184                        else
 185                        {
 248186                            dictionary.Add(property0.Name, property0.Value.GetString());
 187                        }
 188                    }
 144189                    tags = dictionary;
 144190                    continue;
 191                }
 576192                if (property.NameEquals("id"))
 193                {
 144194                    if (property.Value.ValueKind == JsonValueKind.Null)
 195                    {
 196                        continue;
 197                    }
 144198                    id = property.Value.GetString();
 144199                    continue;
 200                }
 432201                if (property.NameEquals("name"))
 202                {
 144203                    if (property.Value.ValueKind == JsonValueKind.Null)
 204                    {
 205                        continue;
 206                    }
 144207                    name = property.Value.GetString();
 144208                    continue;
 209                }
 288210                if (property.NameEquals("type"))
 211                {
 144212                    if (property.Value.ValueKind == JsonValueKind.Null)
 213                    {
 214                        continue;
 215                    }
 144216                    type = property.Value.GetString();
 144217                    continue;
 218                }
 144219                if (property.NameEquals("properties"))
 220                {
 3168221                    foreach (var property0 in property.Value.EnumerateObject())
 222                    {
 1440223                        if (property0.NameEquals("provisioningState"))
 224                        {
 144225                            if (property0.Value.ValueKind == JsonValueKind.Null)
 226                            {
 227                                continue;
 228                            }
 144229                            provisioningState = property0.Value.GetString();
 144230                            continue;
 231                        }
 1296232                        if (property0.NameEquals("createdAt"))
 233                        {
 144234                            if (property0.Value.ValueKind == JsonValueKind.Null)
 235                            {
 236                                continue;
 237                            }
 144238                            createdAt = property0.Value.GetDateTimeOffset("O");
 144239                            continue;
 240                        }
 1152241                        if (property0.NameEquals("updatedAt"))
 242                        {
 144243                            if (property0.Value.ValueKind == JsonValueKind.Null)
 244                            {
 245                                continue;
 246                            }
 144247                            updatedAt = property0.Value.GetDateTimeOffset("O");
 144248                            continue;
 249                        }
 1008250                        if (property0.NameEquals("serviceBusEndpoint"))
 251                        {
 144252                            if (property0.Value.ValueKind == JsonValueKind.Null)
 253                            {
 254                                continue;
 255                            }
 144256                            serviceBusEndpoint = property0.Value.GetString();
 144257                            continue;
 258                        }
 864259                        if (property0.NameEquals("clusterArmId"))
 260                        {
 0261                            if (property0.Value.ValueKind == JsonValueKind.Null)
 262                            {
 263                                continue;
 264                            }
 0265                            clusterArmId = property0.Value.GetString();
 0266                            continue;
 267                        }
 864268                        if (property0.NameEquals("metricId"))
 269                        {
 144270                            if (property0.Value.ValueKind == JsonValueKind.Null)
 271                            {
 272                                continue;
 273                            }
 144274                            metricId = property0.Value.GetString();
 144275                            continue;
 276                        }
 720277                        if (property0.NameEquals("isAutoInflateEnabled"))
 278                        {
 144279                            if (property0.Value.ValueKind == JsonValueKind.Null)
 280                            {
 281                                continue;
 282                            }
 144283                            isAutoInflateEnabled = property0.Value.GetBoolean();
 144284                            continue;
 285                        }
 576286                        if (property0.NameEquals("maximumThroughputUnits"))
 287                        {
 144288                            if (property0.Value.ValueKind == JsonValueKind.Null)
 289                            {
 290                                continue;
 291                            }
 144292                            maximumThroughputUnits = property0.Value.GetInt32();
 144293                            continue;
 294                        }
 432295                        if (property0.NameEquals("kafkaEnabled"))
 296                        {
 144297                            if (property0.Value.ValueKind == JsonValueKind.Null)
 298                            {
 299                                continue;
 300                            }
 144301                            kafkaEnabled = property0.Value.GetBoolean();
 144302                            continue;
 303                        }
 288304                        if (property0.NameEquals("zoneRedundant"))
 305                        {
 144306                            if (property0.Value.ValueKind == JsonValueKind.Null)
 307                            {
 308                                continue;
 309                            }
 144310                            zoneRedundant = property0.Value.GetBoolean();
 144311                            continue;
 312                        }
 144313                        if (property0.NameEquals("encryption"))
 314                        {
 0315                            if (property0.Value.ValueKind == JsonValueKind.Null)
 316                            {
 317                                continue;
 318                            }
 0319                            encryption = Encryption.DeserializeEncryption(property0.Value);
 320                            continue;
 321                        }
 322                    }
 323                    continue;
 324                }
 325            }
 144326            return new EHNamespace(id, name, type, location, tags, sku, identity, provisioningState, createdAt, updatedA
 327        }
 328    }
 329}