< Summary

Class:Azure.ResourceManager.Resources.Models.IdentityAutoGenerated2
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\IdentityAutoGenerated2.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\IdentityAutoGenerated2.Serialization.cs
Covered lines:0
Uncovered lines:38
Coverable lines:38
Total lines:110
Line coverage:0% (0 of 38)
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%
DeserializeIdentityAutoGenerated2(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\IdentityAutoGenerated2.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.Resources.Models
 9{
 10    /// <summary> Identity for the resource. </summary>
 11    public partial class IdentityAutoGenerated2
 12    {
 13        /// <summary> Initializes a new instance of IdentityAutoGenerated2. </summary>
 014        public IdentityAutoGenerated2()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of IdentityAutoGenerated2. </summary>
 19        /// <param name="principalId"> The principal ID of resource identity. </param>
 20        /// <param name="tenantId"> The tenant ID of resource. </param>
 21        /// <param name="type"> The identity type. </param>
 022        internal IdentityAutoGenerated2(string principalId, string tenantId, ResourceIdentityType? type)
 23        {
 024            PrincipalId = principalId;
 025            TenantId = tenantId;
 026            Type = type;
 027        }
 28
 29        /// <summary> The principal ID of resource identity. </summary>
 030        public string PrincipalId { get; }
 31        /// <summary> The tenant ID of resource. </summary>
 032        public string TenantId { get; }
 33        /// <summary> The identity type. </summary>
 034        public ResourceIdentityType? Type { get; set; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\IdentityAutoGenerated2.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.Resources.Models
 12{
 13    public partial class IdentityAutoGenerated2 : 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.Value.ToSerialString());
 32            }
 033            writer.WriteEndObject();
 034        }
 35
 36        internal static IdentityAutoGenerated2 DeserializeIdentityAutoGenerated2(JsonElement element)
 37        {
 038            string principalId = default;
 039            string tenantId = default;
 040            ResourceIdentityType? 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().ToResourceIdentityType();
 68                    continue;
 69                }
 70            }
 071            return new IdentityAutoGenerated2(principalId, tenantId, type);
 72        }
 73    }
 74}