< Summary

Class:Azure.ResourceManager.Compute.Models.ContainerServicePrincipalProfile
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ContainerServicePrincipalProfile.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ContainerServicePrincipalProfile.Serialization.cs
Covered lines:0
Uncovered lines:26
Coverable lines:26
Total lines:83
Line coverage:0% (0 of 26)
Covered branches:0
Total branches:10
Branch coverage:0% (0 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
get_ClientId()-0%100%
get_Secret()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%100%
DeserializeContainerServicePrincipalProfile(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ContainerServicePrincipalProfile.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;
 9
 10namespace Azure.ResourceManager.Compute.Models
 11{
 12    /// <summary> Information about a service principal identity for the cluster to use for manipulating Azure APIs. </s
 13    public partial class ContainerServicePrincipalProfile
 14    {
 15        /// <summary> Initializes a new instance of ContainerServicePrincipalProfile. </summary>
 16        /// <param name="clientId"> The ID for the service principal. </param>
 17        /// <param name="secret"> The secret password associated with the service principal. </param>
 018        public ContainerServicePrincipalProfile(string clientId, string secret)
 19        {
 020            if (clientId == null)
 21            {
 022                throw new ArgumentNullException(nameof(clientId));
 23            }
 024            if (secret == null)
 25            {
 026                throw new ArgumentNullException(nameof(secret));
 27            }
 28
 029            ClientId = clientId;
 030            Secret = secret;
 031        }
 32
 33        /// <summary> The ID for the service principal. </summary>
 034        public string ClientId { get; set; }
 35        /// <summary> The secret password associated with the service principal. </summary>
 036        public string Secret { get; set; }
 37    }
 38}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ContainerServicePrincipalProfile.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.Compute.Models
 12{
 13    public partial class ContainerServicePrincipalProfile : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("clientId");
 019            writer.WriteStringValue(ClientId);
 020            writer.WritePropertyName("secret");
 021            writer.WriteStringValue(Secret);
 022            writer.WriteEndObject();
 023        }
 24
 25        internal static ContainerServicePrincipalProfile DeserializeContainerServicePrincipalProfile(JsonElement element
 26        {
 027            string clientId = default;
 028            string secret = default;
 029            foreach (var property in element.EnumerateObject())
 30            {
 031                if (property.NameEquals("clientId"))
 32                {
 033                    clientId = property.Value.GetString();
 034                    continue;
 35                }
 036                if (property.NameEquals("secret"))
 37                {
 038                    secret = property.Value.GetString();
 39                    continue;
 40                }
 41            }
 042            return new ContainerServicePrincipalProfile(clientId, secret);
 43        }
 44    }
 45}