< Summary

Class:Azure.ResourceManager.Resources.Models.TagsResource
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\TagsResource.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\TagsResource.Serialization.cs
Covered lines:42
Uncovered lines:7
Coverable lines:49
Total lines:131
Line coverage:85.7% (42 of 49)
Covered branches:20
Total branches:24
Branch coverage:83.3% (20 of 24)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-80%50%
.ctor(...)-100%100%
get_Id()-100%100%
get_Name()-100%100%
get_Type()-100%100%
get_Properties()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-57.14%50%
DeserializeTagsResource(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\TagsResource.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> Wrapper resource for tags API requests and responses. </summary>
 13    public partial class TagsResource
 14    {
 15        /// <summary> Initializes a new instance of TagsResource. </summary>
 16        /// <param name="properties"> The set of tags. </param>
 4817        public TagsResource(Tags properties)
 18        {
 4819            if (properties == null)
 20            {
 021                throw new ArgumentNullException(nameof(properties));
 22            }
 23
 4824            Properties = properties;
 4825        }
 26
 27        /// <summary> Initializes a new instance of TagsResource. </summary>
 28        /// <param name="id"> The ID of the tags wrapper resource. </param>
 29        /// <param name="name"> The name of the tags wrapper resource. </param>
 30        /// <param name="type"> The type of the tags wrapper resource. </param>
 31        /// <param name="properties"> The set of tags. </param>
 7232        internal TagsResource(string id, string name, string type, Tags properties)
 33        {
 7234            Id = id;
 7235            Name = name;
 7236            Type = type;
 7237            Properties = properties;
 7238        }
 39
 40        /// <summary> The ID of the tags wrapper resource. </summary>
 3241        public string Id { get; }
 42        /// <summary> The name of the tags wrapper resource. </summary>
 3243        public string Name { get; }
 44        /// <summary> The type of the tags wrapper resource. </summary>
 3245        public string Type { get; }
 46        /// <summary> The set of tags. </summary>
 50447        public Tags Properties { get; set; }
 48    }
 49}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\TagsResource.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 TagsResource : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 3217            writer.WriteStartObject();
 3218            if (Id != null)
 19            {
 020                writer.WritePropertyName("id");
 021                writer.WriteStringValue(Id);
 22            }
 3223            if (Name != null)
 24            {
 025                writer.WritePropertyName("name");
 026                writer.WriteStringValue(Name);
 27            }
 3228            if (Type != null)
 29            {
 030                writer.WritePropertyName("type");
 031                writer.WriteStringValue(Type);
 32            }
 3233            writer.WritePropertyName("properties");
 3234            writer.WriteObjectValue(Properties);
 3235            writer.WriteEndObject();
 3236        }
 37
 38        internal static TagsResource DeserializeTagsResource(JsonElement element)
 39        {
 7240            string id = default;
 7241            string name = default;
 7242            string type = default;
 7243            Tags properties = default;
 72044            foreach (var property in element.EnumerateObject())
 45            {
 28846                if (property.NameEquals("id"))
 47                {
 7248                    if (property.Value.ValueKind == JsonValueKind.Null)
 49                    {
 50                        continue;
 51                    }
 7252                    id = property.Value.GetString();
 7253                    continue;
 54                }
 21655                if (property.NameEquals("name"))
 56                {
 7257                    if (property.Value.ValueKind == JsonValueKind.Null)
 58                    {
 59                        continue;
 60                    }
 7261                    name = property.Value.GetString();
 7262                    continue;
 63                }
 14464                if (property.NameEquals("type"))
 65                {
 7266                    if (property.Value.ValueKind == JsonValueKind.Null)
 67                    {
 68                        continue;
 69                    }
 7270                    type = property.Value.GetString();
 7271                    continue;
 72                }
 7273                if (property.NameEquals("properties"))
 74                {
 7275                    properties = Tags.DeserializeTags(property.Value);
 76                    continue;
 77                }
 78            }
 7279            return new TagsResource(id, name, type, properties);
 80        }
 81    }
 82}