< Summary

Class:Azure.ResourceManager.KeyVault.Models.Resource
Assembly:Azure.ResourceManager.KeyVault
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\Resource.cs
C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\Resource.Serialization.cs
Covered lines:0
Uncovered lines:42
Coverable lines:42
Total lines:113
Line coverage:0% (0 of 42)
Covered branches:0
Total branches:14
Branch coverage:0% (0 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Id()-0%100%
get_Name()-0%100%
get_Type()-0%100%
get_Location()-0%100%
get_Tags()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%100%
DeserializeResource(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\Resource.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 Azure.Core;
 10
 11namespace Azure.ResourceManager.KeyVault.Models
 12{
 13    /// <summary> Key Vault resource. </summary>
 14    public partial class Resource
 15    {
 16        /// <summary> Initializes a new instance of Resource. </summary>
 017        public Resource()
 18        {
 019            Tags = new ChangeTrackingDictionary<string, string>();
 020        }
 21
 22        /// <summary> Initializes a new instance of Resource. </summary>
 23        /// <param name="id"> Fully qualified identifier of the key vault resource. </param>
 24        /// <param name="name"> Name of the key vault resource. </param>
 25        /// <param name="type"> Resource type of the key vault resource. </param>
 26        /// <param name="location"> Azure location of the key vault resource. </param>
 27        /// <param name="tags"> Tags assigned to the key vault resource. </param>
 028        internal Resource(string id, string name, string type, string location, IReadOnlyDictionary<string, string> tags
 29        {
 030            Id = id;
 031            Name = name;
 032            Type = type;
 033            Location = location;
 034            Tags = tags;
 035        }
 36
 37        /// <summary> Fully qualified identifier of the key vault resource. </summary>
 038        public string Id { get; }
 39        /// <summary> Name of the key vault resource. </summary>
 040        public string Name { get; }
 41        /// <summary> Resource type of the key vault resource. </summary>
 042        public string Type { get; }
 43        /// <summary> Azure location of the key vault resource. </summary>
 044        public string Location { get; }
 45        /// <summary> Tags assigned to the key vault resource. </summary>
 046        public IReadOnlyDictionary<string, string> Tags { get; }
 47    }
 48}

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\Resource.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.KeyVault.Models
 13{
 14    public partial class Resource : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            writer.WriteEndObject();
 020        }
 21
 22        internal static Resource DeserializeResource(JsonElement element)
 23        {
 024            Optional<string> id = default;
 025            Optional<string> name = default;
 026            Optional<string> type = default;
 027            Optional<string> location = default;
 028            Optional<IReadOnlyDictionary<string, string>> tags = default;
 029            foreach (var property in element.EnumerateObject())
 30            {
 031                if (property.NameEquals("id"))
 32                {
 033                    id = property.Value.GetString();
 034                    continue;
 35                }
 036                if (property.NameEquals("name"))
 37                {
 038                    name = property.Value.GetString();
 039                    continue;
 40                }
 041                if (property.NameEquals("type"))
 42                {
 043                    type = property.Value.GetString();
 044                    continue;
 45                }
 046                if (property.NameEquals("location"))
 47                {
 048                    location = property.Value.GetString();
 049                    continue;
 50                }
 051                if (property.NameEquals("tags"))
 52                {
 053                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 054                    foreach (var property0 in property.Value.EnumerateObject())
 55                    {
 056                        dictionary.Add(property0.Name, property0.Value.GetString());
 57                    }
 058                    tags = dictionary;
 59                    continue;
 60                }
 61            }
 062            return new Resource(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags));
 63        }
 64    }
 65}