< Summary

Class:Azure.ResourceManager.Resources.Models.ApplicationProviderAuthorization
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ApplicationProviderAuthorization.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ApplicationProviderAuthorization.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_PrincipalId()-0%100%
get_RoleDefinitionId()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%100%
DeserializeApplicationProviderAuthorization(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ApplicationProviderAuthorization.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.Resources.Models
 11{
 12    /// <summary> The managed application provider authorization. </summary>
 13    public partial class ApplicationProviderAuthorization
 14    {
 15        /// <summary> Initializes a new instance of ApplicationProviderAuthorization. </summary>
 16        /// <param name="principalId"> The provider&apos;s principal identifier. This is the identity that the provider 
 17        /// <param name="roleDefinitionId"> The provider&apos;s role definition identifier. This role will define all th
 018        public ApplicationProviderAuthorization(string principalId, string roleDefinitionId)
 19        {
 020            if (principalId == null)
 21            {
 022                throw new ArgumentNullException(nameof(principalId));
 23            }
 024            if (roleDefinitionId == null)
 25            {
 026                throw new ArgumentNullException(nameof(roleDefinitionId));
 27            }
 28
 029            PrincipalId = principalId;
 030            RoleDefinitionId = roleDefinitionId;
 031        }
 32
 33        /// <summary> The provider&apos;s principal identifier. This is the identity that the provider will use to call 
 034        public string PrincipalId { get; set; }
 35        /// <summary> The provider&apos;s role definition identifier. This role will define all the permissions that the
 036        public string RoleDefinitionId { get; set; }
 37    }
 38}

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