< Summary

Class:Azure.ResourceManager.Storage.Models.UpdateHistoryProperty
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\UpdateHistoryProperty.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\UpdateHistoryProperty.Serialization.cs
Covered lines:37
Uncovered lines:31
Coverable lines:68
Total lines:170
Line coverage:54.4% (37 of 68)
Covered branches:23
Total branches:38
Branch coverage:60.5% (23 of 38)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Update()-100%100%
get_ImmutabilityPeriodSinceCreationInDays()-0%100%
get_Timestamp()-0%100%
get_ObjectIdentifier()-0%100%
get_TenantId()-0%100%
get_Upn()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeUpdateHistoryProperty(...)-90.32%88.46%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\UpdateHistoryProperty.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> An update history of the ImmutabilityPolicy of a blob container. </summary>
 13    public partial class UpdateHistoryProperty
 14    {
 15        /// <summary> Initializes a new instance of UpdateHistoryProperty. </summary>
 016        public UpdateHistoryProperty()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of UpdateHistoryProperty. </summary>
 21        /// <param name="update"> The ImmutabilityPolicy update type of a blob container, possible values include: put, 
 22        /// <param name="immutabilityPeriodSinceCreationInDays"> The immutability period for the blobs in the container 
 23        /// <param name="timestamp"> Returns the date and time the ImmutabilityPolicy was updated. </param>
 24        /// <param name="objectIdentifier"> Returns the Object ID of the user who updated the ImmutabilityPolicy. </para
 25        /// <param name="tenantId"> Returns the Tenant ID that issued the token for the user who updated the Immutabilit
 26        /// <param name="upn"> Returns the User Principal Name of the user who updated the ImmutabilityPolicy. </param>
 1227        internal UpdateHistoryProperty(ImmutabilityPolicyUpdateType? update, int? immutabilityPeriodSinceCreationInDays,
 28        {
 1229            Update = update;
 1230            ImmutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays;
 1231            Timestamp = timestamp;
 1232            ObjectIdentifier = objectIdentifier;
 1233            TenantId = tenantId;
 1234            Upn = upn;
 1235        }
 36
 37        /// <summary> The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and ext
 1238        public ImmutabilityPolicyUpdateType? Update { get; }
 39        /// <summary> The immutability period for the blobs in the container since the policy creation, in days. </summa
 040        public int? ImmutabilityPeriodSinceCreationInDays { get; }
 41        /// <summary> Returns the date and time the ImmutabilityPolicy was updated. </summary>
 042        public DateTimeOffset? Timestamp { get; }
 43        /// <summary> Returns the Object ID of the user who updated the ImmutabilityPolicy. </summary>
 044        public string ObjectIdentifier { get; }
 45        /// <summary> Returns the Tenant ID that issued the token for the user who updated the ImmutabilityPolicy. </sum
 046        public string TenantId { get; }
 47        /// <summary> Returns the User Principal Name of the user who updated the ImmutabilityPolicy. </summary>
 048        public string Upn { get; }
 49    }
 50}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\UpdateHistoryProperty.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 UpdateHistoryProperty : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Update != null)
 20            {
 021                writer.WritePropertyName("update");
 022                writer.WriteStringValue(Update.Value.ToString());
 23            }
 024            if (ImmutabilityPeriodSinceCreationInDays != null)
 25            {
 026                writer.WritePropertyName("immutabilityPeriodSinceCreationInDays");
 027                writer.WriteNumberValue(ImmutabilityPeriodSinceCreationInDays.Value);
 28            }
 029            if (Timestamp != null)
 30            {
 031                writer.WritePropertyName("timestamp");
 032                writer.WriteStringValue(Timestamp.Value, "O");
 33            }
 034            if (ObjectIdentifier != null)
 35            {
 036                writer.WritePropertyName("objectIdentifier");
 037                writer.WriteStringValue(ObjectIdentifier);
 38            }
 039            if (TenantId != null)
 40            {
 041                writer.WritePropertyName("tenantId");
 042                writer.WriteStringValue(TenantId);
 43            }
 044            if (Upn != null)
 45            {
 046                writer.WritePropertyName("upn");
 047                writer.WriteStringValue(Upn);
 48            }
 049            writer.WriteEndObject();
 050        }
 51
 52        internal static UpdateHistoryProperty DeserializeUpdateHistoryProperty(JsonElement element)
 53        {
 1254            ImmutabilityPolicyUpdateType? update = default;
 1255            int? immutabilityPeriodSinceCreationInDays = default;
 1256            DateTimeOffset? timestamp = default;
 1257            string objectIdentifier = default;
 1258            string tenantId = default;
 1259            string upn = default;
 14460            foreach (var property in element.EnumerateObject())
 61            {
 6062                if (property.NameEquals("update"))
 63                {
 1264                    if (property.Value.ValueKind == JsonValueKind.Null)
 65                    {
 66                        continue;
 67                    }
 1268                    update = new ImmutabilityPolicyUpdateType(property.Value.GetString());
 1269                    continue;
 70                }
 4871                if (property.NameEquals("immutabilityPeriodSinceCreationInDays"))
 72                {
 1273                    if (property.Value.ValueKind == JsonValueKind.Null)
 74                    {
 75                        continue;
 76                    }
 1277                    immutabilityPeriodSinceCreationInDays = property.Value.GetInt32();
 1278                    continue;
 79                }
 3680                if (property.NameEquals("timestamp"))
 81                {
 1282                    if (property.Value.ValueKind == JsonValueKind.Null)
 83                    {
 84                        continue;
 85                    }
 1286                    timestamp = property.Value.GetDateTimeOffset("O");
 1287                    continue;
 88                }
 2489                if (property.NameEquals("objectIdentifier"))
 90                {
 1291                    if (property.Value.ValueKind == JsonValueKind.Null)
 92                    {
 93                        continue;
 94                    }
 1295                    objectIdentifier = property.Value.GetString();
 1296                    continue;
 97                }
 1298                if (property.NameEquals("tenantId"))
 99                {
 12100                    if (property.Value.ValueKind == JsonValueKind.Null)
 101                    {
 102                        continue;
 103                    }
 12104                    tenantId = property.Value.GetString();
 12105                    continue;
 106                }
 0107                if (property.NameEquals("upn"))
 108                {
 0109                    if (property.Value.ValueKind == JsonValueKind.Null)
 110                    {
 111                        continue;
 112                    }
 0113                    upn = property.Value.GetString();
 114                    continue;
 115                }
 116            }
 12117            return new UpdateHistoryProperty(update, immutabilityPeriodSinceCreationInDays, timestamp, objectIdentifier,
 118        }
 119    }
 120}