< Summary

Class:Azure.ResourceManager.Storage.Models.FileShareItem
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\FileShareItem.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\FileShareItem.Serialization.cs
Covered lines:74
Uncovered lines:110
Coverable lines:184
Total lines:397
Line coverage:40.2% (74 of 184)
Covered branches:53
Total branches:114
Branch coverage:46.4% (53 of 114)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_LastModifiedTime()-0%100%
get_Metadata()-0%100%
get_ShareQuota()-0%100%
get_EnabledProtocols()-0%100%
get_RootSquash()-0%100%
get_Version()-0%100%
get_Deleted()-0%100%
get_DeletedTime()-0%100%
get_RemainingRetentionDays()-0%100%
get_AccessTier()-0%100%
get_AccessTierChangeTime()-0%100%
get_AccessTierStatus()-0%100%
get_ShareUsageBytes()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeFileShareItem(...)-63.44%67.95%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\FileShareItem.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 file share properties be listed out. </summary>
 14    public partial class FileShareItem : AzureEntityResource
 15    {
 16        /// <summary> Initializes a new instance of FileShareItem. </summary>
 017        public FileShareItem()
 18        {
 019        }
 20
 21        /// <summary> Initializes a new instance of FileShareItem. </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="lastModifiedTime"> Returns the date and time the share was last modified. </param>
 27        /// <param name="metadata"> A name-value pair to associate with the share as metadata. </param>
 28        /// <param name="shareQuota"> The maximum size of the share, in gigabytes. Must be greater than 0, and less than
 29        /// <param name="enabledProtocols"> The authentication protocol that is used for the file share. Can only be spe
 30        /// <param name="rootSquash"> The property is for NFS share only. The default is NoRootSquash. </param>
 31        /// <param name="version"> The version of the share. </param>
 32        /// <param name="deleted"> Indicates whether the share was deleted. </param>
 33        /// <param name="deletedTime"> The deleted time if the share was deleted. </param>
 34        /// <param name="remainingRetentionDays"> Remaining retention days for share that was soft deleted. </param>
 35        /// <param name="accessTier"> Access tier for specific share. GpV2 account can choose between TransactionOptimiz
 36        /// <param name="accessTierChangeTime"> Indicates the last modification time for share access tier. </param>
 37        /// <param name="accessTierStatus"> Indicates if there is a pending transition for access tier. </param>
 38        /// <param name="shareUsageBytes"> The approximate size of the data stored on the share. Note that this value ma
 439        internal FileShareItem(string id, string name, string type, string etag, DateTimeOffset? lastModifiedTime, IDict
 40        {
 441            LastModifiedTime = lastModifiedTime;
 442            Metadata = metadata;
 443            ShareQuota = shareQuota;
 444            EnabledProtocols = enabledProtocols;
 445            RootSquash = rootSquash;
 446            Version = version;
 447            Deleted = deleted;
 448            DeletedTime = deletedTime;
 449            RemainingRetentionDays = remainingRetentionDays;
 450            AccessTier = accessTier;
 451            AccessTierChangeTime = accessTierChangeTime;
 452            AccessTierStatus = accessTierStatus;
 453            ShareUsageBytes = shareUsageBytes;
 454        }
 55
 56        /// <summary> Returns the date and time the share was last modified. </summary>
 057        public DateTimeOffset? LastModifiedTime { get; }
 58        /// <summary> A name-value pair to associate with the share as metadata. </summary>
 059        public IDictionary<string, string> Metadata { get; set; }
 60        /// <summary> The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB
 061        public int? ShareQuota { get; set; }
 62        /// <summary> The authentication protocol that is used for the file share. Can only be specified when creating a
 063        public EnabledProtocols? EnabledProtocols { get; set; }
 64        /// <summary> The property is for NFS share only. The default is NoRootSquash. </summary>
 065        public RootSquashType? RootSquash { get; set; }
 66        /// <summary> The version of the share. </summary>
 067        public string Version { get; }
 68        /// <summary> Indicates whether the share was deleted. </summary>
 069        public bool? Deleted { get; }
 70        /// <summary> The deleted time if the share was deleted. </summary>
 071        public DateTimeOffset? DeletedTime { get; }
 72        /// <summary> Remaining retention days for share that was soft deleted. </summary>
 073        public int? RemainingRetentionDays { get; }
 74        /// <summary> Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Ho
 075        public ShareAccessTier? AccessTier { get; set; }
 76        /// <summary> Indicates the last modification time for share access tier. </summary>
 077        public DateTimeOffset? AccessTierChangeTime { get; }
 78        /// <summary> Indicates if there is a pending transition for access tier. </summary>
 079        public string AccessTierStatus { get; }
 80        /// <summary> The approximate size of the data stored on the share. Note that this value may not include all rec
 081        public long? ShareUsageBytes { get; }
 82    }
 83}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\FileShareItem.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 FileShareItem : 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 (LastModifiedTime != null)
 43            {
 044                writer.WritePropertyName("lastModifiedTime");
 045                writer.WriteStringValue(LastModifiedTime.Value, "O");
 46            }
 047            if (Metadata != null)
 48            {
 049                writer.WritePropertyName("metadata");
 050                writer.WriteStartObject();
 051                foreach (var item in Metadata)
 52                {
 053                    writer.WritePropertyName(item.Key);
 054                    writer.WriteStringValue(item.Value);
 55                }
 056                writer.WriteEndObject();
 57            }
 058            if (ShareQuota != null)
 59            {
 060                writer.WritePropertyName("shareQuota");
 061                writer.WriteNumberValue(ShareQuota.Value);
 62            }
 063            if (EnabledProtocols != null)
 64            {
 065                writer.WritePropertyName("enabledProtocols");
 066                writer.WriteStringValue(EnabledProtocols.Value.ToString());
 67            }
 068            if (RootSquash != null)
 69            {
 070                writer.WritePropertyName("rootSquash");
 071                writer.WriteStringValue(RootSquash.Value.ToString());
 72            }
 073            if (Version != null)
 74            {
 075                writer.WritePropertyName("version");
 076                writer.WriteStringValue(Version);
 77            }
 078            if (Deleted != null)
 79            {
 080                writer.WritePropertyName("deleted");
 081                writer.WriteBooleanValue(Deleted.Value);
 82            }
 083            if (DeletedTime != null)
 84            {
 085                writer.WritePropertyName("deletedTime");
 086                writer.WriteStringValue(DeletedTime.Value, "O");
 87            }
 088            if (RemainingRetentionDays != null)
 89            {
 090                writer.WritePropertyName("remainingRetentionDays");
 091                writer.WriteNumberValue(RemainingRetentionDays.Value);
 92            }
 093            if (AccessTier != null)
 94            {
 095                writer.WritePropertyName("accessTier");
 096                writer.WriteStringValue(AccessTier.Value.ToString());
 97            }
 098            if (AccessTierChangeTime != null)
 99            {
 0100                writer.WritePropertyName("accessTierChangeTime");
 0101                writer.WriteStringValue(AccessTierChangeTime.Value, "O");
 102            }
 0103            if (AccessTierStatus != null)
 104            {
 0105                writer.WritePropertyName("accessTierStatus");
 0106                writer.WriteStringValue(AccessTierStatus);
 107            }
 0108            if (ShareUsageBytes != null)
 109            {
 0110                writer.WritePropertyName("shareUsageBytes");
 0111                writer.WriteNumberValue(ShareUsageBytes.Value);
 112            }
 0113            writer.WriteEndObject();
 0114            writer.WriteEndObject();
 0115        }
 116
 117        internal static FileShareItem DeserializeFileShareItem(JsonElement element)
 118        {
 4119            string etag = default;
 4120            string id = default;
 4121            string name = default;
 4122            string type = default;
 4123            DateTimeOffset? lastModifiedTime = default;
 4124            IDictionary<string, string> metadata = default;
 4125            int? shareQuota = default;
 4126            EnabledProtocols? enabledProtocols = default;
 4127            RootSquashType? rootSquash = default;
 4128            string version = default;
 4129            bool? deleted = default;
 4130            DateTimeOffset? deletedTime = default;
 4131            int? remainingRetentionDays = default;
 4132            ShareAccessTier? accessTier = default;
 4133            DateTimeOffset? accessTierChangeTime = default;
 4134            string accessTierStatus = default;
 4135            long? shareUsageBytes = default;
 48136            foreach (var property in element.EnumerateObject())
 137            {
 20138                if (property.NameEquals("etag"))
 139                {
 4140                    if (property.Value.ValueKind == JsonValueKind.Null)
 141                    {
 142                        continue;
 143                    }
 4144                    etag = property.Value.GetString();
 4145                    continue;
 146                }
 16147                if (property.NameEquals("id"))
 148                {
 4149                    if (property.Value.ValueKind == JsonValueKind.Null)
 150                    {
 151                        continue;
 152                    }
 4153                    id = property.Value.GetString();
 4154                    continue;
 155                }
 12156                if (property.NameEquals("name"))
 157                {
 4158                    if (property.Value.ValueKind == JsonValueKind.Null)
 159                    {
 160                        continue;
 161                    }
 4162                    name = property.Value.GetString();
 4163                    continue;
 164                }
 8165                if (property.NameEquals("type"))
 166                {
 4167                    if (property.Value.ValueKind == JsonValueKind.Null)
 168                    {
 169                        continue;
 170                    }
 4171                    type = property.Value.GetString();
 4172                    continue;
 173                }
 4174                if (property.NameEquals("properties"))
 175                {
 40176                    foreach (var property0 in property.Value.EnumerateObject())
 177                    {
 16178                        if (property0.NameEquals("lastModifiedTime"))
 179                        {
 4180                            if (property0.Value.ValueKind == JsonValueKind.Null)
 181                            {
 182                                continue;
 183                            }
 4184                            lastModifiedTime = property0.Value.GetDateTimeOffset("O");
 4185                            continue;
 186                        }
 12187                        if (property0.NameEquals("metadata"))
 188                        {
 0189                            if (property0.Value.ValueKind == JsonValueKind.Null)
 190                            {
 191                                continue;
 192                            }
 0193                            Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0194                            foreach (var property1 in property0.Value.EnumerateObject())
 195                            {
 0196                                if (property1.Value.ValueKind == JsonValueKind.Null)
 197                                {
 0198                                    dictionary.Add(property1.Name, null);
 199                                }
 200                                else
 201                                {
 0202                                    dictionary.Add(property1.Name, property1.Value.GetString());
 203                                }
 204                            }
 0205                            metadata = dictionary;
 0206                            continue;
 207                        }
 12208                        if (property0.NameEquals("shareQuota"))
 209                        {
 4210                            if (property0.Value.ValueKind == JsonValueKind.Null)
 211                            {
 212                                continue;
 213                            }
 4214                            shareQuota = property0.Value.GetInt32();
 4215                            continue;
 216                        }
 8217                        if (property0.NameEquals("enabledProtocols"))
 218                        {
 4219                            if (property0.Value.ValueKind == JsonValueKind.Null)
 220                            {
 221                                continue;
 222                            }
 4223                            enabledProtocols = new EnabledProtocols(property0.Value.GetString());
 4224                            continue;
 225                        }
 4226                        if (property0.NameEquals("rootSquash"))
 227                        {
 0228                            if (property0.Value.ValueKind == JsonValueKind.Null)
 229                            {
 230                                continue;
 231                            }
 0232                            rootSquash = new RootSquashType(property0.Value.GetString());
 0233                            continue;
 234                        }
 4235                        if (property0.NameEquals("version"))
 236                        {
 0237                            if (property0.Value.ValueKind == JsonValueKind.Null)
 238                            {
 239                                continue;
 240                            }
 0241                            version = property0.Value.GetString();
 0242                            continue;
 243                        }
 4244                        if (property0.NameEquals("deleted"))
 245                        {
 0246                            if (property0.Value.ValueKind == JsonValueKind.Null)
 247                            {
 248                                continue;
 249                            }
 0250                            deleted = property0.Value.GetBoolean();
 0251                            continue;
 252                        }
 4253                        if (property0.NameEquals("deletedTime"))
 254                        {
 0255                            if (property0.Value.ValueKind == JsonValueKind.Null)
 256                            {
 257                                continue;
 258                            }
 0259                            deletedTime = property0.Value.GetDateTimeOffset("O");
 0260                            continue;
 261                        }
 4262                        if (property0.NameEquals("remainingRetentionDays"))
 263                        {
 0264                            if (property0.Value.ValueKind == JsonValueKind.Null)
 265                            {
 266                                continue;
 267                            }
 0268                            remainingRetentionDays = property0.Value.GetInt32();
 0269                            continue;
 270                        }
 4271                        if (property0.NameEquals("accessTier"))
 272                        {
 4273                            if (property0.Value.ValueKind == JsonValueKind.Null)
 274                            {
 275                                continue;
 276                            }
 4277                            accessTier = new ShareAccessTier(property0.Value.GetString());
 4278                            continue;
 279                        }
 0280                        if (property0.NameEquals("accessTierChangeTime"))
 281                        {
 0282                            if (property0.Value.ValueKind == JsonValueKind.Null)
 283                            {
 284                                continue;
 285                            }
 0286                            accessTierChangeTime = property0.Value.GetDateTimeOffset("O");
 0287                            continue;
 288                        }
 0289                        if (property0.NameEquals("accessTierStatus"))
 290                        {
 0291                            if (property0.Value.ValueKind == JsonValueKind.Null)
 292                            {
 293                                continue;
 294                            }
 0295                            accessTierStatus = property0.Value.GetString();
 0296                            continue;
 297                        }
 0298                        if (property0.NameEquals("shareUsageBytes"))
 299                        {
 0300                            if (property0.Value.ValueKind == JsonValueKind.Null)
 301                            {
 302                                continue;
 303                            }
 0304                            shareUsageBytes = property0.Value.GetInt64();
 305                            continue;
 306                        }
 307                    }
 308                    continue;
 309                }
 310            }
 4311            return new FileShareItem(id, name, type, etag, lastModifiedTime, metadata, shareQuota, enabledProtocols, roo
 312        }
 313    }
 314}