< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_PrincipalId()-0%100%
get_TenantId()-0%100%
get_Type()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeIdentity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\Identity.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> Properties to configure Identity for Bring your Own Keys. </summary>
 11    public partial class Identity
 12    {
 13        /// <summary> Initializes a new instance of Identity. </summary>
 014        public Identity()
 15        {
 016            Type = "SystemAssigned";
 017        }
 18
 19        /// <summary> Initializes a new instance of Identity. </summary>
 20        /// <param name="principalId"> ObjectId from the KeyVault. </param>
 21        /// <param name="tenantId"> TenantId from the KeyVault. </param>
 22        /// <param name="type"> Enumerates the possible value Identity type, which currently supports only &apos;SystemA
 023        internal Identity(string principalId, string tenantId, string type)
 24        {
 025            PrincipalId = principalId;
 026            TenantId = tenantId;
 027            Type = type;
 028        }
 29
 30        /// <summary> ObjectId from the KeyVault. </summary>
 031        public string PrincipalId { get; set; }
 32        /// <summary> TenantId from the KeyVault. </summary>
 033        public string TenantId { get; set; }
 34        /// <summary> Enumerates the possible value Identity type, which currently supports only &apos;SystemAssigned&ap
 035        public string Type { get; set; }
 36    }
 37}

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\Identity.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 Identity : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (PrincipalId != null)
 19            {
 020                writer.WritePropertyName("principalId");
 021                writer.WriteStringValue(PrincipalId);
 22            }
 023            if (TenantId != null)
 24            {
 025                writer.WritePropertyName("tenantId");
 026                writer.WriteStringValue(TenantId);
 27            }
 028            if (Type != null)
 29            {
 030                writer.WritePropertyName("type");
 031                writer.WriteStringValue(Type);
 32            }
 033            writer.WriteEndObject();
 034        }
 35
 36        internal static Identity DeserializeIdentity(JsonElement element)
 37        {
 038            string principalId = default;
 039            string tenantId = default;
 040            string type = default;
 041            foreach (var property in element.EnumerateObject())
 42            {
 043                if (property.NameEquals("principalId"))
 44                {
 045                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 049                    principalId = property.Value.GetString();
 050                    continue;
 51                }
 052                if (property.NameEquals("tenantId"))
 53                {
 054                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 058                    tenantId = property.Value.GetString();
 059                    continue;
 60                }
 061                if (property.NameEquals("type"))
 62                {
 063                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 067                    type = property.Value.GetString();
 68                    continue;
 69                }
 70            }
 071            return new Identity(principalId, tenantId, type);
 72        }
 73    }
 74}