< Summary

Class:Azure.ResourceManager.Resources.Models.ProviderResourceType
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ProviderResourceType.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ProviderResourceType.Serialization.cs
Covered lines:53
Uncovered lines:14
Coverable lines:67
Total lines:182
Line coverage:79.1% (53 of 67)
Covered branches:34
Total branches:42
Branch coverage:80.9% (34 of 42)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_ResourceType()-100%100%
get_Locations()-100%100%
get_Aliases()-100%100%
get_ApiVersions()-0%100%
get_Capabilities()-0%100%
get_Properties()-0%100%
DeserializeProviderResourceType(...)-82.35%80.95%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ProviderResourceType.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.Resources.Models
 11{
 12    /// <summary> Resource type managed by the resource provider. </summary>
 13    public partial class ProviderResourceType
 14    {
 15        /// <summary> Initializes a new instance of ProviderResourceType. </summary>
 016        internal ProviderResourceType()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ProviderResourceType. </summary>
 21        /// <param name="resourceType"> The resource type. </param>
 22        /// <param name="locations"> The collection of locations where this resource type can be created. </param>
 23        /// <param name="aliases"> The aliases that are supported by this resource type. </param>
 24        /// <param name="apiVersions"> The API version. </param>
 25        /// <param name="capabilities"> The additional capabilities offered by this resource type. </param>
 26        /// <param name="properties"> The properties. </param>
 1646027        internal ProviderResourceType(string resourceType, IReadOnlyList<string> locations, IReadOnlyList<Alias> aliases
 28        {
 1646029            ResourceType = resourceType;
 1646030            Locations = locations;
 1646031            Aliases = aliases;
 1646032            ApiVersions = apiVersions;
 1646033            Capabilities = capabilities;
 1646034            Properties = properties;
 1646035        }
 36
 37        /// <summary> The resource type. </summary>
 2438        public string ResourceType { get; }
 39        /// <summary> The collection of locations where this resource type can be created. </summary>
 2440        public IReadOnlyList<string> Locations { get; }
 41        /// <summary> The aliases that are supported by this resource type. </summary>
 4042        public IReadOnlyList<Alias> Aliases { get; }
 43        /// <summary> The API version. </summary>
 044        public IReadOnlyList<string> ApiVersions { get; }
 45        /// <summary> The additional capabilities offered by this resource type. </summary>
 046        public string Capabilities { get; }
 47        /// <summary> The properties. </summary>
 048        public IReadOnlyDictionary<string, string> Properties { get; }
 49    }
 50}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ProviderResourceType.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.Resources.Models
 13{
 14    public partial class ProviderResourceType
 15    {
 16        internal static ProviderResourceType DeserializeProviderResourceType(JsonElement element)
 17        {
 1646018            string resourceType = default;
 1646019            IReadOnlyList<string> locations = default;
 1646020            IReadOnlyList<Alias> aliases = default;
 1646021            IReadOnlyList<string> apiVersions = default;
 1646022            string capabilities = default;
 1646023            IReadOnlyDictionary<string, string> properties = default;
 19091224            foreach (var property in element.EnumerateObject())
 25            {
 7899626                if (property.NameEquals("resourceType"))
 27                {
 1646028                    if (property.Value.ValueKind == JsonValueKind.Null)
 29                    {
 30                        continue;
 31                    }
 1646032                    resourceType = property.Value.GetString();
 1646033                    continue;
 34                }
 6253635                if (property.NameEquals("locations"))
 36                {
 1646037                    if (property.Value.ValueKind == JsonValueKind.Null)
 38                    {
 39                        continue;
 40                    }
 1646041                    List<string> array = new List<string>();
 55244042                    foreach (var item in property.Value.EnumerateArray())
 43                    {
 25976044                        if (item.ValueKind == JsonValueKind.Null)
 45                        {
 13246                            array.Add(null);
 47                        }
 48                        else
 49                        {
 25962850                            array.Add(item.GetString());
 51                        }
 52                    }
 1646053                    locations = array;
 1646054                    continue;
 55                }
 4607656                if (property.NameEquals("aliases"))
 57                {
 857658                    if (property.Value.ValueKind == JsonValueKind.Null)
 59                    {
 60                        continue;
 61                    }
 857662                    List<Alias> array = new List<Alias>();
 22563263                    foreach (var item in property.Value.EnumerateArray())
 64                    {
 10424065                        if (item.ValueKind == JsonValueKind.Null)
 66                        {
 067                            array.Add(null);
 68                        }
 69                        else
 70                        {
 10424071                            array.Add(Alias.DeserializeAlias(item));
 72                        }
 73                    }
 857674                    aliases = array;
 857675                    continue;
 76                }
 3750077                if (property.NameEquals("apiVersions"))
 78                {
 1621279                    if (property.Value.ValueKind == JsonValueKind.Null)
 80                    {
 81                        continue;
 82                    }
 1621283                    List<string> array = new List<string>();
 19787284                    foreach (var item in property.Value.EnumerateArray())
 85                    {
 8272486                        if (item.ValueKind == JsonValueKind.Null)
 87                        {
 088                            array.Add(null);
 89                        }
 90                        else
 91                        {
 8272492                            array.Add(item.GetString());
 93                        }
 94                    }
 1621295                    apiVersions = array;
 1621296                    continue;
 97                }
 2128898                if (property.NameEquals("capabilities"))
 99                {
 15172100                    if (property.Value.ValueKind == JsonValueKind.Null)
 101                    {
 102                        continue;
 103                    }
 15172104                    capabilities = property.Value.GetString();
 15172105                    continue;
 106                }
 6116107                if (property.NameEquals("properties"))
 108                {
 0109                    if (property.Value.ValueKind == JsonValueKind.Null)
 110                    {
 111                        continue;
 112                    }
 0113                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0114                    foreach (var property0 in property.Value.EnumerateObject())
 115                    {
 0116                        if (property0.Value.ValueKind == JsonValueKind.Null)
 117                        {
 0118                            dictionary.Add(property0.Name, null);
 119                        }
 120                        else
 121                        {
 0122                            dictionary.Add(property0.Name, property0.Value.GetString());
 123                        }
 124                    }
 0125                    properties = dictionary;
 126                    continue;
 127                }
 128            }
 16460129            return new ProviderResourceType(resourceType, locations, aliases, apiVersions, capabilities, properties);
 130        }
 131    }
 132}