< Summary

Class:Azure.ResourceManager.Storage.Models.ListContainerItem
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\ListContainerItem.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\ListContainerItem.Serialization.cs
Covered lines:106
Uncovered lines:108
Coverable lines:214
Total lines:454
Line coverage:49.5% (106 of 214)
Covered branches:74
Total branches:132
Branch coverage:56% (74 of 132)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Version()-0%100%
get_Deleted()-0%100%
get_DeletedTime()-0%100%
get_RemainingRetentionDays()-0%100%
get_DefaultEncryptionScope()-0%100%
get_DenyEncryptionScopeOverride()-0%100%
get_PublicAccess()-100%100%
get_LastModifiedTime()-0%100%
get_LeaseStatus()-0%100%
get_LeaseState()-0%100%
get_LeaseDuration()-0%100%
get_Metadata()-0%100%
get_ImmutabilityPolicy()-0%100%
get_LegalHold()-0%100%
get_HasLegalHold()-100%100%
get_HasImmutabilityPolicy()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeListContainerItem(...)-78.7%82.22%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\ListContainerItem.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.Collections.Generic;
 10
 11namespace Azure.ResourceManager.Storage.Models
 12{
 13    /// <summary> The blob container properties be listed out. </summary>
 14    public partial class ListContainerItem : AzureEntityResource
 15    {
 16        /// <summary> Initializes a new instance of ListContainerItem. </summary>
 017        public ListContainerItem()
 18        {
 019        }
 20
 21        /// <summary> Initializes a new instance of ListContainerItem. </summary>
 22        /// <param name="id"> Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourc
 23        /// <param name="name"> The name of the resource. </param>
 24        /// <param name="type"> The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/sto
 25        /// <param name="etag"> Resource Etag. </param>
 26        /// <param name="version"> The version of the deleted blob container. </param>
 27        /// <param name="deleted"> Indicates whether the blob container was deleted. </param>
 28        /// <param name="deletedTime"> Blob container deletion time. </param>
 29        /// <param name="remainingRetentionDays"> Remaining retention days for soft deleted blob container. </param>
 30        /// <param name="defaultEncryptionScope"> Default the container to use specified encryption scope for all writes
 31        /// <param name="denyEncryptionScopeOverride"> Block override of encryption scope from the container default. </
 32        /// <param name="publicAccess"> Specifies whether data in the container may be accessed publicly and the level o
 33        /// <param name="lastModifiedTime"> Returns the date and time the container was last modified. </param>
 34        /// <param name="leaseStatus"> The lease status of the container. </param>
 35        /// <param name="leaseState"> Lease state of the container. </param>
 36        /// <param name="leaseDuration"> Specifies whether the lease on a container is of infinite or fixed duration, on
 37        /// <param name="metadata"> A name-value pair to associate with the container as metadata. </param>
 38        /// <param name="immutabilityPolicy"> The ImmutabilityPolicy property of the container. </param>
 39        /// <param name="legalHold"> The LegalHold property of the container. </param>
 40        /// <param name="hasLegalHold"> The hasLegalHold public property is set to true by SRP if there are at least one
 41        /// <param name="hasImmutabilityPolicy"> The hasImmutabilityPolicy public property is set to true by SRP if Immu
 2442        internal ListContainerItem(string id, string name, string type, string etag, string version, bool? deleted, Date
 43        {
 2444            Version = version;
 2445            Deleted = deleted;
 2446            DeletedTime = deletedTime;
 2447            RemainingRetentionDays = remainingRetentionDays;
 2448            DefaultEncryptionScope = defaultEncryptionScope;
 2449            DenyEncryptionScopeOverride = denyEncryptionScopeOverride;
 2450            PublicAccess = publicAccess;
 2451            LastModifiedTime = lastModifiedTime;
 2452            LeaseStatus = leaseStatus;
 2453            LeaseState = leaseState;
 2454            LeaseDuration = leaseDuration;
 2455            Metadata = metadata;
 2456            ImmutabilityPolicy = immutabilityPolicy;
 2457            LegalHold = legalHold;
 2458            HasLegalHold = hasLegalHold;
 2459            HasImmutabilityPolicy = hasImmutabilityPolicy;
 2460        }
 61
 62        /// <summary> The version of the deleted blob container. </summary>
 063        public string Version { get; }
 64        /// <summary> Indicates whether the blob container was deleted. </summary>
 065        public bool? Deleted { get; }
 66        /// <summary> Blob container deletion time. </summary>
 067        public DateTimeOffset? DeletedTime { get; }
 68        /// <summary> Remaining retention days for soft deleted blob container. </summary>
 069        public int? RemainingRetentionDays { get; }
 70        /// <summary> Default the container to use specified encryption scope for all writes. </summary>
 071        public string DefaultEncryptionScope { get; set; }
 72        /// <summary> Block override of encryption scope from the container default. </summary>
 073        public bool? DenyEncryptionScopeOverride { get; set; }
 74        /// <summary> Specifies whether data in the container may be accessed publicly and the level of access. </summar
 3675        public PublicAccess? PublicAccess { get; set; }
 76        /// <summary> Returns the date and time the container was last modified. </summary>
 077        public DateTimeOffset? LastModifiedTime { get; }
 78        /// <summary> The lease status of the container. </summary>
 079        public LeaseStatus? LeaseStatus { get; }
 80        /// <summary> Lease state of the container. </summary>
 081        public LeaseState? LeaseState { get; }
 82        /// <summary> Specifies whether the lease on a container is of infinite or fixed duration, only when the contain
 083        public LeaseDuration? LeaseDuration { get; }
 84        /// <summary> A name-value pair to associate with the container as metadata. </summary>
 085        public IDictionary<string, string> Metadata { get; set; }
 86        /// <summary> The ImmutabilityPolicy property of the container. </summary>
 087        public ImmutabilityPolicyProperties ImmutabilityPolicy { get; }
 88        /// <summary> The LegalHold property of the container. </summary>
 089        public LegalHoldProperties LegalHold { get; }
 90        /// <summary> The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The
 1291        public bool? HasLegalHold { get; }
 92        /// <summary> The hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been cre
 1293        public bool? HasImmutabilityPolicy { get; }
 94    }
 95}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\ListContainerItem.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.Collections.Generic;
 10using System.Text.Json;
 11using Azure.Core;
 12
 13namespace Azure.ResourceManager.Storage.Models
 14{
 15    public partial class ListContainerItem : IUtf8JsonSerializable
 16    {
 17        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 18        {
 019            writer.WriteStartObject();
 020            if (Etag != null)
 21            {
 022                writer.WritePropertyName("etag");
 023                writer.WriteStringValue(Etag);
 24            }
 025            if (Id != null)
 26            {
 027                writer.WritePropertyName("id");
 028                writer.WriteStringValue(Id);
 29            }
 030            if (Name != null)
 31            {
 032                writer.WritePropertyName("name");
 033                writer.WriteStringValue(Name);
 34            }
 035            if (Type != null)
 36            {
 037                writer.WritePropertyName("type");
 038                writer.WriteStringValue(Type);
 39            }
 040            writer.WritePropertyName("properties");
 041            writer.WriteStartObject();
 042            if (Version != null)
 43            {
 044                writer.WritePropertyName("version");
 045                writer.WriteStringValue(Version);
 46            }
 047            if (Deleted != null)
 48            {
 049                writer.WritePropertyName("deleted");
 050                writer.WriteBooleanValue(Deleted.Value);
 51            }
 052            if (DeletedTime != null)
 53            {
 054                writer.WritePropertyName("deletedTime");
 055                writer.WriteStringValue(DeletedTime.Value, "O");
 56            }
 057            if (RemainingRetentionDays != null)
 58            {
 059                writer.WritePropertyName("remainingRetentionDays");
 060                writer.WriteNumberValue(RemainingRetentionDays.Value);
 61            }
 062            if (DefaultEncryptionScope != null)
 63            {
 064                writer.WritePropertyName("defaultEncryptionScope");
 065                writer.WriteStringValue(DefaultEncryptionScope);
 66            }
 067            if (DenyEncryptionScopeOverride != null)
 68            {
 069                writer.WritePropertyName("denyEncryptionScopeOverride");
 070                writer.WriteBooleanValue(DenyEncryptionScopeOverride.Value);
 71            }
 072            if (PublicAccess != null)
 73            {
 074                writer.WritePropertyName("publicAccess");
 075                writer.WriteStringValue(PublicAccess.Value.ToSerialString());
 76            }
 077            if (LastModifiedTime != null)
 78            {
 079                writer.WritePropertyName("lastModifiedTime");
 080                writer.WriteStringValue(LastModifiedTime.Value, "O");
 81            }
 082            if (LeaseStatus != null)
 83            {
 084                writer.WritePropertyName("leaseStatus");
 085                writer.WriteStringValue(LeaseStatus.Value.ToString());
 86            }
 087            if (LeaseState != null)
 88            {
 089                writer.WritePropertyName("leaseState");
 090                writer.WriteStringValue(LeaseState.Value.ToString());
 91            }
 092            if (LeaseDuration != null)
 93            {
 094                writer.WritePropertyName("leaseDuration");
 095                writer.WriteStringValue(LeaseDuration.Value.ToString());
 96            }
 097            if (Metadata != null)
 98            {
 099                writer.WritePropertyName("metadata");
 0100                writer.WriteStartObject();
 0101                foreach (var item in Metadata)
 102                {
 0103                    writer.WritePropertyName(item.Key);
 0104                    writer.WriteStringValue(item.Value);
 105                }
 0106                writer.WriteEndObject();
 107            }
 0108            if (ImmutabilityPolicy != null)
 109            {
 0110                writer.WritePropertyName("immutabilityPolicy");
 0111                writer.WriteObjectValue(ImmutabilityPolicy);
 112            }
 0113            if (LegalHold != null)
 114            {
 0115                writer.WritePropertyName("legalHold");
 0116                writer.WriteObjectValue(LegalHold);
 117            }
 0118            if (HasLegalHold != null)
 119            {
 0120                writer.WritePropertyName("hasLegalHold");
 0121                writer.WriteBooleanValue(HasLegalHold.Value);
 122            }
 0123            if (HasImmutabilityPolicy != null)
 124            {
 0125                writer.WritePropertyName("hasImmutabilityPolicy");
 0126                writer.WriteBooleanValue(HasImmutabilityPolicy.Value);
 127            }
 0128            writer.WriteEndObject();
 0129            writer.WriteEndObject();
 0130        }
 131
 132        internal static ListContainerItem DeserializeListContainerItem(JsonElement element)
 133        {
 24134            string etag = default;
 24135            string id = default;
 24136            string name = default;
 24137            string type = default;
 24138            string version = default;
 24139            bool? deleted = default;
 24140            DateTimeOffset? deletedTime = default;
 24141            int? remainingRetentionDays = default;
 24142            string defaultEncryptionScope = default;
 24143            bool? denyEncryptionScopeOverride = default;
 24144            PublicAccess? publicAccess = default;
 24145            DateTimeOffset? lastModifiedTime = default;
 24146            LeaseStatus? leaseStatus = default;
 24147            LeaseState? leaseState = default;
 24148            LeaseDuration? leaseDuration = default;
 24149            IDictionary<string, string> metadata = default;
 24150            ImmutabilityPolicyProperties immutabilityPolicy = default;
 24151            LegalHoldProperties legalHold = default;
 24152            bool? hasLegalHold = default;
 24153            bool? hasImmutabilityPolicy = default;
 288154            foreach (var property in element.EnumerateObject())
 155            {
 120156                if (property.NameEquals("etag"))
 157                {
 24158                    if (property.Value.ValueKind == JsonValueKind.Null)
 159                    {
 160                        continue;
 161                    }
 24162                    etag = property.Value.GetString();
 24163                    continue;
 164                }
 96165                if (property.NameEquals("id"))
 166                {
 24167                    if (property.Value.ValueKind == JsonValueKind.Null)
 168                    {
 169                        continue;
 170                    }
 24171                    id = property.Value.GetString();
 24172                    continue;
 173                }
 72174                if (property.NameEquals("name"))
 175                {
 24176                    if (property.Value.ValueKind == JsonValueKind.Null)
 177                    {
 178                        continue;
 179                    }
 24180                    name = property.Value.GetString();
 24181                    continue;
 182                }
 48183                if (property.NameEquals("type"))
 184                {
 24185                    if (property.Value.ValueKind == JsonValueKind.Null)
 186                    {
 187                        continue;
 188                    }
 24189                    type = property.Value.GetString();
 24190                    continue;
 191                }
 24192                if (property.NameEquals("properties"))
 193                {
 528194                    foreach (var property0 in property.Value.EnumerateObject())
 195                    {
 240196                        if (property0.NameEquals("version"))
 197                        {
 0198                            if (property0.Value.ValueKind == JsonValueKind.Null)
 199                            {
 200                                continue;
 201                            }
 0202                            version = property0.Value.GetString();
 0203                            continue;
 204                        }
 240205                        if (property0.NameEquals("deleted"))
 206                        {
 24207                            if (property0.Value.ValueKind == JsonValueKind.Null)
 208                            {
 209                                continue;
 210                            }
 24211                            deleted = property0.Value.GetBoolean();
 24212                            continue;
 213                        }
 216214                        if (property0.NameEquals("deletedTime"))
 215                        {
 0216                            if (property0.Value.ValueKind == JsonValueKind.Null)
 217                            {
 218                                continue;
 219                            }
 0220                            deletedTime = property0.Value.GetDateTimeOffset("O");
 0221                            continue;
 222                        }
 216223                        if (property0.NameEquals("remainingRetentionDays"))
 224                        {
 24225                            if (property0.Value.ValueKind == JsonValueKind.Null)
 226                            {
 227                                continue;
 228                            }
 24229                            remainingRetentionDays = property0.Value.GetInt32();
 24230                            continue;
 231                        }
 192232                        if (property0.NameEquals("defaultEncryptionScope"))
 233                        {
 24234                            if (property0.Value.ValueKind == JsonValueKind.Null)
 235                            {
 236                                continue;
 237                            }
 24238                            defaultEncryptionScope = property0.Value.GetString();
 24239                            continue;
 240                        }
 168241                        if (property0.NameEquals("denyEncryptionScopeOverride"))
 242                        {
 24243                            if (property0.Value.ValueKind == JsonValueKind.Null)
 244                            {
 245                                continue;
 246                            }
 24247                            denyEncryptionScopeOverride = property0.Value.GetBoolean();
 24248                            continue;
 249                        }
 144250                        if (property0.NameEquals("publicAccess"))
 251                        {
 24252                            if (property0.Value.ValueKind == JsonValueKind.Null)
 253                            {
 254                                continue;
 255                            }
 24256                            publicAccess = property0.Value.GetString().ToPublicAccess();
 24257                            continue;
 258                        }
 120259                        if (property0.NameEquals("lastModifiedTime"))
 260                        {
 24261                            if (property0.Value.ValueKind == JsonValueKind.Null)
 262                            {
 263                                continue;
 264                            }
 24265                            lastModifiedTime = property0.Value.GetDateTimeOffset("O");
 24266                            continue;
 267                        }
 96268                        if (property0.NameEquals("leaseStatus"))
 269                        {
 24270                            if (property0.Value.ValueKind == JsonValueKind.Null)
 271                            {
 272                                continue;
 273                            }
 24274                            leaseStatus = new LeaseStatus(property0.Value.GetString());
 24275                            continue;
 276                        }
 72277                        if (property0.NameEquals("leaseState"))
 278                        {
 24279                            if (property0.Value.ValueKind == JsonValueKind.Null)
 280                            {
 281                                continue;
 282                            }
 24283                            leaseState = new LeaseState(property0.Value.GetString());
 24284                            continue;
 285                        }
 48286                        if (property0.NameEquals("leaseDuration"))
 287                        {
 0288                            if (property0.Value.ValueKind == JsonValueKind.Null)
 289                            {
 290                                continue;
 291                            }
 0292                            leaseDuration = new LeaseDuration(property0.Value.GetString());
 0293                            continue;
 294                        }
 48295                        if (property0.NameEquals("metadata"))
 296                        {
 0297                            if (property0.Value.ValueKind == JsonValueKind.Null)
 298                            {
 299                                continue;
 300                            }
 0301                            Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0302                            foreach (var property1 in property0.Value.EnumerateObject())
 303                            {
 0304                                if (property1.Value.ValueKind == JsonValueKind.Null)
 305                                {
 0306                                    dictionary.Add(property1.Name, null);
 307                                }
 308                                else
 309                                {
 0310                                    dictionary.Add(property1.Name, property1.Value.GetString());
 311                                }
 312                            }
 0313                            metadata = dictionary;
 0314                            continue;
 315                        }
 48316                        if (property0.NameEquals("immutabilityPolicy"))
 317                        {
 0318                            if (property0.Value.ValueKind == JsonValueKind.Null)
 319                            {
 320                                continue;
 321                            }
 0322                            immutabilityPolicy = ImmutabilityPolicyProperties.DeserializeImmutabilityPolicyProperties(pr
 0323                            continue;
 324                        }
 48325                        if (property0.NameEquals("legalHold"))
 326                        {
 0327                            if (property0.Value.ValueKind == JsonValueKind.Null)
 328                            {
 329                                continue;
 330                            }
 0331                            legalHold = LegalHoldProperties.DeserializeLegalHoldProperties(property0.Value);
 0332                            continue;
 333                        }
 48334                        if (property0.NameEquals("hasLegalHold"))
 335                        {
 24336                            if (property0.Value.ValueKind == JsonValueKind.Null)
 337                            {
 338                                continue;
 339                            }
 24340                            hasLegalHold = property0.Value.GetBoolean();
 24341                            continue;
 342                        }
 24343                        if (property0.NameEquals("hasImmutabilityPolicy"))
 344                        {
 24345                            if (property0.Value.ValueKind == JsonValueKind.Null)
 346                            {
 347                                continue;
 348                            }
 24349                            hasImmutabilityPolicy = property0.Value.GetBoolean();
 350                            continue;
 351                        }
 352                    }
 353                    continue;
 354                }
 355            }
 24356            return new ListContainerItem(id, name, type, etag, version, deleted, deletedTime, remainingRetentionDays, de
 357        }
 358    }
 359}