< Summary

Class:Azure.ResourceManager.EventHubs.Models.AccessKeys
Assembly:Azure.ResourceManager.EventHubs
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\AccessKeys.cs
C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\AccessKeys.Serialization.cs
Covered lines:47
Uncovered lines:7
Coverable lines:54
Total lines:145
Line coverage:87% (47 of 54)
Covered branches:30
Total branches:30
Branch coverage:100% (30 of 30)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_PrimaryConnectionString()-100%100%
get_SecondaryConnectionString()-100%100%
get_AliasPrimaryConnectionString()-0%100%
get_AliasSecondaryConnectionString()-0%100%
get_PrimaryKey()-0%100%
get_SecondaryKey()-0%100%
get_KeyName()-0%100%
DeserializeAccessKeys(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\AccessKeys.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
 8namespace Azure.ResourceManager.EventHubs.Models
 9{
 10    /// <summary> Namespace/EventHub Connection String. </summary>
 11    public partial class AccessKeys
 12    {
 13        /// <summary> Initializes a new instance of AccessKeys. </summary>
 014        internal AccessKeys()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of AccessKeys. </summary>
 19        /// <param name="primaryConnectionString"> Primary connection string of the created namespace AuthorizationRule.
 20        /// <param name="secondaryConnectionString"> Secondary connection string of the created namespace AuthorizationR
 21        /// <param name="aliasPrimaryConnectionString"> Primary connection string of the alias if GEO DR is enabled. </p
 22        /// <param name="aliasSecondaryConnectionString"> Secondary  connection string of the alias if GEO DR is enabled
 23        /// <param name="primaryKey"> A base64-encoded 256-bit primary key for signing and validating the SAS token. </p
 24        /// <param name="secondaryKey"> A base64-encoded 256-bit primary key for signing and validating the SAS token. <
 25        /// <param name="keyName"> A string that describes the AuthorizationRule. </param>
 5226        internal AccessKeys(string primaryConnectionString, string secondaryConnectionString, string aliasPrimaryConnect
 27        {
 5228            PrimaryConnectionString = primaryConnectionString;
 5229            SecondaryConnectionString = secondaryConnectionString;
 5230            AliasPrimaryConnectionString = aliasPrimaryConnectionString;
 5231            AliasSecondaryConnectionString = aliasSecondaryConnectionString;
 5232            PrimaryKey = primaryKey;
 5233            SecondaryKey = secondaryKey;
 5234            KeyName = keyName;
 5235        }
 36
 37        /// <summary> Primary connection string of the created namespace AuthorizationRule. </summary>
 6438        public string PrimaryConnectionString { get; }
 39        /// <summary> Secondary connection string of the created namespace AuthorizationRule. </summary>
 6440        public string SecondaryConnectionString { get; }
 41        /// <summary> Primary connection string of the alias if GEO DR is enabled. </summary>
 042        public string AliasPrimaryConnectionString { get; }
 43        /// <summary> Secondary  connection string of the alias if GEO DR is enabled. </summary>
 044        public string AliasSecondaryConnectionString { get; }
 45        /// <summary> A base64-encoded 256-bit primary key for signing and validating the SAS token. </summary>
 046        public string PrimaryKey { get; }
 47        /// <summary> A base64-encoded 256-bit primary key for signing and validating the SAS token. </summary>
 048        public string SecondaryKey { get; }
 49        /// <summary> A string that describes the AuthorizationRule. </summary>
 050        public string KeyName { get; }
 51    }
 52}

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\AccessKeys.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.ResourceManager.EventHubs.Models
 12{
 13    public partial class AccessKeys
 14    {
 15        internal static AccessKeys DeserializeAccessKeys(JsonElement element)
 16        {
 5217            string primaryConnectionString = default;
 5218            string secondaryConnectionString = default;
 5219            string aliasPrimaryConnectionString = default;
 5220            string aliasSecondaryConnectionString = default;
 5221            string primaryKey = default;
 5222            string secondaryKey = default;
 5223            string keyName = default;
 62424            foreach (var property in element.EnumerateObject())
 25            {
 26026                if (property.NameEquals("primaryConnectionString"))
 27                {
 4428                    if (property.Value.ValueKind == JsonValueKind.Null)
 29                    {
 30                        continue;
 31                    }
 4432                    primaryConnectionString = property.Value.GetString();
 4433                    continue;
 34                }
 21635                if (property.NameEquals("secondaryConnectionString"))
 36                {
 4437                    if (property.Value.ValueKind == JsonValueKind.Null)
 38                    {
 39                        continue;
 40                    }
 4441                    secondaryConnectionString = property.Value.GetString();
 4442                    continue;
 43                }
 17244                if (property.NameEquals("aliasPrimaryConnectionString"))
 45                {
 846                    if (property.Value.ValueKind == JsonValueKind.Null)
 47                    {
 48                        continue;
 49                    }
 850                    aliasPrimaryConnectionString = property.Value.GetString();
 851                    continue;
 52                }
 16453                if (property.NameEquals("aliasSecondaryConnectionString"))
 54                {
 855                    if (property.Value.ValueKind == JsonValueKind.Null)
 56                    {
 57                        continue;
 58                    }
 859                    aliasSecondaryConnectionString = property.Value.GetString();
 860                    continue;
 61                }
 15662                if (property.NameEquals("primaryKey"))
 63                {
 5264                    if (property.Value.ValueKind == JsonValueKind.Null)
 65                    {
 66                        continue;
 67                    }
 5268                    primaryKey = property.Value.GetString();
 5269                    continue;
 70                }
 10471                if (property.NameEquals("secondaryKey"))
 72                {
 5273                    if (property.Value.ValueKind == JsonValueKind.Null)
 74                    {
 75                        continue;
 76                    }
 5277                    secondaryKey = property.Value.GetString();
 5278                    continue;
 79                }
 5280                if (property.NameEquals("keyName"))
 81                {
 5282                    if (property.Value.ValueKind == JsonValueKind.Null)
 83                    {
 84                        continue;
 85                    }
 5286                    keyName = property.Value.GetString();
 87                    continue;
 88                }
 89            }
 5290            return new AccessKeys(primaryConnectionString, secondaryConnectionString, aliasPrimaryConnectionString, alia
 91        }
 92    }
 93}