< Summary

Class:Azure.ResourceManager.Network.Models.ManagedServiceIdentity
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ManagedServiceIdentity.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ManagedServiceIdentity.Serialization.cs
Covered lines:0
Uncovered lines:57
Coverable lines:57
Total lines:150
Line coverage:0% (0 of 57)
Covered branches:0
Total branches:32
Branch coverage:0% (0 of 32)

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%
get_UserAssignedIdentities()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeManagedServiceIdentity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ManagedServiceIdentity.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.Network.Models
 11{
 12    /// <summary> Identity for the resource. </summary>
 13    public partial class ManagedServiceIdentity
 14    {
 15        /// <summary> Initializes a new instance of ManagedServiceIdentity. </summary>
 016        public ManagedServiceIdentity()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ManagedServiceIdentity. </summary>
 21        /// <param name="principalId"> The principal id of the system assigned identity. This property will only be prov
 22        /// <param name="tenantId"> The tenant id of the system assigned identity. This property will only be provided f
 23        /// <param name="type"> The type of identity used for the resource. The type &apos;SystemAssigned, UserAssigned&
 24        /// <param name="userAssignedIdentities"> The list of user identities associated with resource. The user identit
 025        internal ManagedServiceIdentity(string principalId, string tenantId, ResourceIdentityType? type, IDictionary<str
 26        {
 027            PrincipalId = principalId;
 028            TenantId = tenantId;
 029            Type = type;
 030            UserAssignedIdentities = userAssignedIdentities;
 031        }
 32
 33        /// <summary> The principal id of the system assigned identity. This property will only be provided for a system
 034        public string PrincipalId { get; }
 35        /// <summary> The tenant id of the system assigned identity. This property will only be provided for a system as
 036        public string TenantId { get; }
 37        /// <summary> The type of identity used for the resource. The type &apos;SystemAssigned, UserAssigned&apos; incl
 038        public ResourceIdentityType? Type { get; set; }
 39        /// <summary> The list of user identities associated with resource. The user identity dictionary key references 
 040        public IDictionary<string, Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditio
 41    }
 42}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ManagedServiceIdentity.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.Network.Models
 13{
 14    public partial class ManagedServiceIdentity : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (PrincipalId != null)
 20            {
 021                writer.WritePropertyName("principalId");
 022                writer.WriteStringValue(PrincipalId);
 23            }
 024            if (TenantId != null)
 25            {
 026                writer.WritePropertyName("tenantId");
 027                writer.WriteStringValue(TenantId);
 28            }
 029            if (Type != null)
 30            {
 031                writer.WritePropertyName("type");
 032                writer.WriteStringValue(Type.Value.ToSerialString());
 33            }
 034            if (UserAssignedIdentities != null)
 35            {
 036                writer.WritePropertyName("userAssignedIdentities");
 037                writer.WriteStartObject();
 038                foreach (var item in UserAssignedIdentities)
 39                {
 040                    writer.WritePropertyName(item.Key);
 041                    writer.WriteObjectValue(item.Value);
 42                }
 043                writer.WriteEndObject();
 44            }
 045            writer.WriteEndObject();
 046        }
 47
 48        internal static ManagedServiceIdentity DeserializeManagedServiceIdentity(JsonElement element)
 49        {
 050            string principalId = default;
 051            string tenantId = default;
 052            ResourceIdentityType? type = default;
 053            IDictionary<string, Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditional
 054            foreach (var property in element.EnumerateObject())
 55            {
 056                if (property.NameEquals("principalId"))
 57                {
 058                    if (property.Value.ValueKind == JsonValueKind.Null)
 59                    {
 60                        continue;
 61                    }
 062                    principalId = property.Value.GetString();
 063                    continue;
 64                }
 065                if (property.NameEquals("tenantId"))
 66                {
 067                    if (property.Value.ValueKind == JsonValueKind.Null)
 68                    {
 69                        continue;
 70                    }
 071                    tenantId = property.Value.GetString();
 072                    continue;
 73                }
 074                if (property.NameEquals("type"))
 75                {
 076                    if (property.Value.ValueKind == JsonValueKind.Null)
 77                    {
 78                        continue;
 79                    }
 080                    type = property.Value.GetString().ToResourceIdentityType();
 081                    continue;
 82                }
 083                if (property.NameEquals("userAssignedIdentities"))
 84                {
 085                    if (property.Value.ValueKind == JsonValueKind.Null)
 86                    {
 87                        continue;
 88                    }
 089                    Dictionary<string, Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdd
 090                    foreach (var property0 in property.Value.EnumerateObject())
 91                    {
 092                        if (property0.Value.ValueKind == JsonValueKind.Null)
 93                        {
 094                            dictionary.Add(property0.Name, null);
 95                        }
 96                        else
 97                        {
 098                            dictionary.Add(property0.Name, Components1Jq1T4ISchemasManagedserviceidentityPropertiesUsera
 99                        }
 100                    }
 0101                    userAssignedIdentities = dictionary;
 102                    continue;
 103                }
 104            }
 0105            return new ManagedServiceIdentity(principalId, tenantId, type, userAssignedIdentities);
 106        }
 107    }
 108}