< Summary

Class:Azure.ResourceManager.Storage.Models.TagProperty
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\TagProperty.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\TagProperty.Serialization.cs
Covered lines:31
Uncovered lines:27
Coverable lines:58
Total lines:151
Line coverage:53.4% (31 of 58)
Covered branches:19
Total branches:32
Branch coverage:59.3% (19 of 32)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Tag()-100%100%
get_Timestamp()-0%100%
get_ObjectIdentifier()-0%100%
get_TenantId()-0%100%
get_Upn()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeTagProperty(...)-88.46%86.36%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\TagProperty.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.Storage.Models
 11{
 12    /// <summary> A tag of the LegalHold of a blob container. </summary>
 13    public partial class TagProperty
 14    {
 15        /// <summary> Initializes a new instance of TagProperty. </summary>
 016        public TagProperty()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of TagProperty. </summary>
 21        /// <param name="tag"> The tag value. </param>
 22        /// <param name="timestamp"> Returns the date and time the tag was added. </param>
 23        /// <param name="objectIdentifier"> Returns the Object ID of the user who added the tag. </param>
 24        /// <param name="tenantId"> Returns the Tenant ID that issued the token for the user who added the tag. </param>
 25        /// <param name="upn"> Returns the User Principal Name of the user who added the tag. </param>
 1226        internal TagProperty(string tag, DateTimeOffset? timestamp, string objectIdentifier, string tenantId, string upn
 27        {
 1228            Tag = tag;
 1229            Timestamp = timestamp;
 1230            ObjectIdentifier = objectIdentifier;
 1231            TenantId = tenantId;
 1232            Upn = upn;
 1233        }
 34
 35        /// <summary> The tag value. </summary>
 1236        public string Tag { get; }
 37        /// <summary> Returns the date and time the tag was added. </summary>
 038        public DateTimeOffset? Timestamp { get; }
 39        /// <summary> Returns the Object ID of the user who added the tag. </summary>
 040        public string ObjectIdentifier { get; }
 41        /// <summary> Returns the Tenant ID that issued the token for the user who added the tag. </summary>
 042        public string TenantId { get; }
 43        /// <summary> Returns the User Principal Name of the user who added the tag. </summary>
 044        public string Upn { get; }
 45    }
 46}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\TagProperty.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;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.Storage.Models
 13{
 14    public partial class TagProperty : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Tag != null)
 20            {
 021                writer.WritePropertyName("tag");
 022                writer.WriteStringValue(Tag);
 23            }
 024            if (Timestamp != null)
 25            {
 026                writer.WritePropertyName("timestamp");
 027                writer.WriteStringValue(Timestamp.Value, "O");
 28            }
 029            if (ObjectIdentifier != null)
 30            {
 031                writer.WritePropertyName("objectIdentifier");
 032                writer.WriteStringValue(ObjectIdentifier);
 33            }
 034            if (TenantId != null)
 35            {
 036                writer.WritePropertyName("tenantId");
 037                writer.WriteStringValue(TenantId);
 38            }
 039            if (Upn != null)
 40            {
 041                writer.WritePropertyName("upn");
 042                writer.WriteStringValue(Upn);
 43            }
 044            writer.WriteEndObject();
 045        }
 46
 47        internal static TagProperty DeserializeTagProperty(JsonElement element)
 48        {
 1249            string tag = default;
 1250            DateTimeOffset? timestamp = default;
 1251            string objectIdentifier = default;
 1252            string tenantId = default;
 1253            string upn = default;
 12054            foreach (var property in element.EnumerateObject())
 55            {
 4856                if (property.NameEquals("tag"))
 57                {
 1258                    if (property.Value.ValueKind == JsonValueKind.Null)
 59                    {
 60                        continue;
 61                    }
 1262                    tag = property.Value.GetString();
 1263                    continue;
 64                }
 3665                if (property.NameEquals("timestamp"))
 66                {
 1267                    if (property.Value.ValueKind == JsonValueKind.Null)
 68                    {
 69                        continue;
 70                    }
 1271                    timestamp = property.Value.GetDateTimeOffset("O");
 1272                    continue;
 73                }
 2474                if (property.NameEquals("objectIdentifier"))
 75                {
 1276                    if (property.Value.ValueKind == JsonValueKind.Null)
 77                    {
 78                        continue;
 79                    }
 1280                    objectIdentifier = property.Value.GetString();
 1281                    continue;
 82                }
 1283                if (property.NameEquals("tenantId"))
 84                {
 1285                    if (property.Value.ValueKind == JsonValueKind.Null)
 86                    {
 87                        continue;
 88                    }
 1289                    tenantId = property.Value.GetString();
 1290                    continue;
 91                }
 092                if (property.NameEquals("upn"))
 93                {
 094                    if (property.Value.ValueKind == JsonValueKind.Null)
 95                    {
 96                        continue;
 97                    }
 098                    upn = property.Value.GetString();
 99                    continue;
 100                }
 101            }
 12102            return new TagProperty(tag, timestamp, objectIdentifier, tenantId, upn);
 103        }
 104    }
 105}