< Summary

Class:Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetIdentity
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetIdentity.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetIdentity.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%
DeserializeVirtualMachineScaleSetIdentity(...)-0%0%

File(s)

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

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetIdentity.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.Compute.Models
 13{
 14    public partial class VirtualMachineScaleSetIdentity : 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 VirtualMachineScaleSetIdentity DeserializeVirtualMachineScaleSetIdentity(JsonElement element)
 49        {
 050            string principalId = default;
 051            string tenantId = default;
 052            ResourceIdentityType? type = default;
 053            IDictionary<string, ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdd
 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, ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidenti
 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, ComponentsNj115SSchemasVirtualmachinescalesetidentityProperti
 99                        }
 100                    }
 0101                    userAssignedIdentities = dictionary;
 102                    continue;
 103                }
 104            }
 0105            return new VirtualMachineScaleSetIdentity(principalId, tenantId, type, userAssignedIdentities);
 106        }
 107    }
 108}