< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_Id()-0%100%
get_Type()-0%100%
get_ServiceName()-0%100%
get_Actions()-0%100%
DeserializeAvailableDelegation(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\AvailableDelegation.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> The serviceName of an AvailableDelegation indicates a possible delegation for a subnet. </summary>
 13    public partial class AvailableDelegation
 14    {
 15        /// <summary> Initializes a new instance of AvailableDelegation. </summary>
 016        internal AvailableDelegation()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of AvailableDelegation. </summary>
 21        /// <param name="name"> The name of the AvailableDelegation resource. </param>
 22        /// <param name="id"> A unique identifier of the AvailableDelegation resource. </param>
 23        /// <param name="type"> Resource type. </param>
 24        /// <param name="serviceName"> The name of the service and resource. </param>
 25        /// <param name="actions"> The actions permitted to the service upon delegation. </param>
 026        internal AvailableDelegation(string name, string id, string type, string serviceName, IReadOnlyList<string> acti
 27        {
 028            Name = name;
 029            Id = id;
 030            Type = type;
 031            ServiceName = serviceName;
 032            Actions = actions;
 033        }
 34
 35        /// <summary> The name of the AvailableDelegation resource. </summary>
 036        public string Name { get; }
 37        /// <summary> A unique identifier of the AvailableDelegation resource. </summary>
 038        public string Id { get; }
 39        /// <summary> Resource type. </summary>
 040        public string Type { get; }
 41        /// <summary> The name of the service and resource. </summary>
 042        public string ServiceName { get; }
 43        /// <summary> The actions permitted to the service upon delegation. </summary>
 044        public IReadOnlyList<string> Actions { get; }
 45    }
 46}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\AvailableDelegation.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 AvailableDelegation
 15    {
 16        internal static AvailableDelegation DeserializeAvailableDelegation(JsonElement element)
 17        {
 018            string name = default;
 019            string id = default;
 020            string type = default;
 021            string serviceName = default;
 022            IReadOnlyList<string> actions = default;
 023            foreach (var property in element.EnumerateObject())
 24            {
 025                if (property.NameEquals("name"))
 26                {
 027                    if (property.Value.ValueKind == JsonValueKind.Null)
 28                    {
 29                        continue;
 30                    }
 031                    name = property.Value.GetString();
 032                    continue;
 33                }
 034                if (property.NameEquals("id"))
 35                {
 036                    if (property.Value.ValueKind == JsonValueKind.Null)
 37                    {
 38                        continue;
 39                    }
 040                    id = property.Value.GetString();
 041                    continue;
 42                }
 043                if (property.NameEquals("type"))
 44                {
 045                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 049                    type = property.Value.GetString();
 050                    continue;
 51                }
 052                if (property.NameEquals("serviceName"))
 53                {
 054                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 058                    serviceName = property.Value.GetString();
 059                    continue;
 60                }
 061                if (property.NameEquals("actions"))
 62                {
 063                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 067                    List<string> array = new List<string>();
 068                    foreach (var item in property.Value.EnumerateArray())
 69                    {
 070                        if (item.ValueKind == JsonValueKind.Null)
 71                        {
 072                            array.Add(null);
 73                        }
 74                        else
 75                        {
 076                            array.Add(item.GetString());
 77                        }
 78                    }
 079                    actions = array;
 80                    continue;
 81                }
 82            }
 083            return new AvailableDelegation(name, id, type, serviceName, actions);
 84        }
 85    }
 86}