< Summary

Class:Azure.ResourceManager.Storage.Models.FileShare
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\FileShare.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\FileShare.Serialization.cs
Covered lines:126
Uncovered lines:58
Coverable lines:184
Total lines:397
Line coverage:68.4% (126 of 184)
Covered branches:80
Total branches:114
Branch coverage:70.1% (80 of 114)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_LastModifiedTime()-100%100%
get_Metadata()-100%100%
get_ShareQuota()-100%100%
get_EnabledProtocols()-100%100%
get_RootSquash()-100%100%
get_Version()-100%100%
get_Deleted()-100%100%
get_DeletedTime()-100%100%
get_RemainingRetentionDays()-100%100%
get_AccessTier()-100%100%
get_AccessTierChangeTime()-100%100%
get_AccessTierStatus()-100%100%
get_ShareUsageBytes()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-50.82%58.33%
DeserializeFileShare(...)-69.89%75.64%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\FileShare.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> Properties of the file share, including Id, resource name, resource type, Etag. </summary>
 14    public partial class FileShare : AzureEntityResource
 15    {
 16        /// <summary> Initializes a new instance of FileShare. </summary>
 817        public FileShare()
 18        {
 819        }
 20
 21        /// <summary> Initializes a new instance of FileShare. </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
 2839        internal FileShare(string id, string name, string type, string etag, DateTimeOffset? lastModifiedTime, IDictiona
 40        {
 2841            LastModifiedTime = lastModifiedTime;
 2842            Metadata = metadata;
 2843            ShareQuota = shareQuota;
 2844            EnabledProtocols = enabledProtocols;
 2845            RootSquash = rootSquash;
 2846            Version = version;
 2847            Deleted = deleted;
 2848            DeletedTime = deletedTime;
 2849            RemainingRetentionDays = remainingRetentionDays;
 2850            AccessTier = accessTier;
 2851            AccessTierChangeTime = accessTierChangeTime;
 2852            AccessTierStatus = accessTierStatus;
 2853            ShareUsageBytes = shareUsageBytes;
 2854        }
 55
 56        /// <summary> Returns the date and time the share was last modified. </summary>
 1657        public DateTimeOffset? LastModifiedTime { get; }
 58        /// <summary> A name-value pair to associate with the share as metadata. </summary>
 12059        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
 9261        public int? ShareQuota { get; set; }
 62        /// <summary> The authentication protocol that is used for the file share. Can only be specified when creating a
 4463        public EnabledProtocols? EnabledProtocols { get; set; }
 64        /// <summary> The property is for NFS share only. The default is NoRootSquash. </summary>
 4465        public RootSquashType? RootSquash { get; set; }
 66        /// <summary> The version of the share. </summary>
 1667        public string Version { get; }
 68        /// <summary> Indicates whether the share was deleted. </summary>
 1669        public bool? Deleted { get; }
 70        /// <summary> The deleted time if the share was deleted. </summary>
 1671        public DateTimeOffset? DeletedTime { get; }
 72        /// <summary> Remaining retention days for share that was soft deleted. </summary>
 1673        public int? RemainingRetentionDays { get; }
 74        /// <summary> Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Ho
 4475        public ShareAccessTier? AccessTier { get; set; }
 76        /// <summary> Indicates the last modification time for share access tier. </summary>
 1677        public DateTimeOffset? AccessTierChangeTime { get; }
 78        /// <summary> Indicates if there is a pending transition for access tier. </summary>
 1679        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
 1681        public long? ShareUsageBytes { get; }
 82    }
 83}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\FileShare.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 FileShare : IUtf8JsonSerializable
 16    {
 17        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 18        {
 1619            writer.WriteStartObject();
 1620            if (Etag != null)
 21            {
 022                writer.WritePropertyName("etag");
 023                writer.WriteStringValue(Etag);
 24            }
 1625            if (Id != null)
 26            {
 027                writer.WritePropertyName("id");
 028                writer.WriteStringValue(Id);
 29            }
 1630            if (Name != null)
 31            {
 032                writer.WritePropertyName("name");
 033                writer.WriteStringValue(Name);
 34            }
 1635            if (Type != null)
 36            {
 037                writer.WritePropertyName("type");
 038                writer.WriteStringValue(Type);
 39            }
 1640            writer.WritePropertyName("properties");
 1641            writer.WriteStartObject();
 1642            if (LastModifiedTime != null)
 43            {
 044                writer.WritePropertyName("lastModifiedTime");
 045                writer.WriteStringValue(LastModifiedTime.Value, "O");
 46            }
 1647            if (Metadata != null)
 48            {
 849                writer.WritePropertyName("metadata");
 850                writer.WriteStartObject();
 4851                foreach (var item in Metadata)
 52                {
 1653                    writer.WritePropertyName(item.Key);
 1654                    writer.WriteStringValue(item.Value);
 55                }
 856                writer.WriteEndObject();
 57            }
 1658            if (ShareQuota != null)
 59            {
 860                writer.WritePropertyName("shareQuota");
 861                writer.WriteNumberValue(ShareQuota.Value);
 62            }
 1663            if (EnabledProtocols != null)
 64            {
 065                writer.WritePropertyName("enabledProtocols");
 066                writer.WriteStringValue(EnabledProtocols.Value.ToString());
 67            }
 1668            if (RootSquash != null)
 69            {
 070                writer.WritePropertyName("rootSquash");
 071                writer.WriteStringValue(RootSquash.Value.ToString());
 72            }
 1673            if (Version != null)
 74            {
 075                writer.WritePropertyName("version");
 076                writer.WriteStringValue(Version);
 77            }
 1678            if (Deleted != null)
 79            {
 080                writer.WritePropertyName("deleted");
 081                writer.WriteBooleanValue(Deleted.Value);
 82            }
 1683            if (DeletedTime != null)
 84            {
 085                writer.WritePropertyName("deletedTime");
 086                writer.WriteStringValue(DeletedTime.Value, "O");
 87            }
 1688            if (RemainingRetentionDays != null)
 89            {
 090                writer.WritePropertyName("remainingRetentionDays");
 091                writer.WriteNumberValue(RemainingRetentionDays.Value);
 92            }
 1693            if (AccessTier != null)
 94            {
 095                writer.WritePropertyName("accessTier");
 096                writer.WriteStringValue(AccessTier.Value.ToString());
 97            }
 1698            if (AccessTierChangeTime != null)
 99            {
 0100                writer.WritePropertyName("accessTierChangeTime");
 0101                writer.WriteStringValue(AccessTierChangeTime.Value, "O");
 102            }
 16103            if (AccessTierStatus != null)
 104            {
 0105                writer.WritePropertyName("accessTierStatus");
 0106                writer.WriteStringValue(AccessTierStatus);
 107            }
 16108            if (ShareUsageBytes != null)
 109            {
 0110                writer.WritePropertyName("shareUsageBytes");
 0111                writer.WriteNumberValue(ShareUsageBytes.Value);
 112            }
 16113            writer.WriteEndObject();
 16114            writer.WriteEndObject();
 16115        }
 116
 117        internal static FileShare DeserializeFileShare(JsonElement element)
 118        {
 28119            string etag = default;
 28120            string id = default;
 28121            string name = default;
 28122            string type = default;
 28123            DateTimeOffset? lastModifiedTime = default;
 28124            IDictionary<string, string> metadata = default;
 28125            int? shareQuota = default;
 28126            EnabledProtocols? enabledProtocols = default;
 28127            RootSquashType? rootSquash = default;
 28128            string version = default;
 28129            bool? deleted = default;
 28130            DateTimeOffset? deletedTime = default;
 28131            int? remainingRetentionDays = default;
 28132            ShareAccessTier? accessTier = default;
 28133            DateTimeOffset? accessTierChangeTime = default;
 28134            string accessTierStatus = default;
 28135            long? shareUsageBytes = default;
 304136            foreach (var property in element.EnumerateObject())
 137            {
 124138                if (property.NameEquals("etag"))
 139                {
 12140                    if (property.Value.ValueKind == JsonValueKind.Null)
 141                    {
 142                        continue;
 143                    }
 12144                    etag = property.Value.GetString();
 12145                    continue;
 146                }
 112147                if (property.NameEquals("id"))
 148                {
 28149                    if (property.Value.ValueKind == JsonValueKind.Null)
 150                    {
 151                        continue;
 152                    }
 28153                    id = property.Value.GetString();
 28154                    continue;
 155                }
 84156                if (property.NameEquals("name"))
 157                {
 28158                    if (property.Value.ValueKind == JsonValueKind.Null)
 159                    {
 160                        continue;
 161                    }
 28162                    name = property.Value.GetString();
 28163                    continue;
 164                }
 56165                if (property.NameEquals("type"))
 166                {
 28167                    if (property.Value.ValueKind == JsonValueKind.Null)
 168                    {
 169                        continue;
 170                    }
 28171                    type = property.Value.GetString();
 28172                    continue;
 173                }
 28174                if (property.NameEquals("properties"))
 175                {
 176176                    foreach (var property0 in property.Value.EnumerateObject())
 177                    {
 60178                        if (property0.NameEquals("lastModifiedTime"))
 179                        {
 12180                            if (property0.Value.ValueKind == JsonValueKind.Null)
 181                            {
 182                                continue;
 183                            }
 12184                            lastModifiedTime = property0.Value.GetDateTimeOffset("O");
 12185                            continue;
 186                        }
 48187                        if (property0.NameEquals("metadata"))
 188                        {
 16189                            if (property0.Value.ValueKind == JsonValueKind.Null)
 190                            {
 191                                continue;
 192                            }
 16193                            Dictionary<string, string> dictionary = new Dictionary<string, string>();
 96194                            foreach (var property1 in property0.Value.EnumerateObject())
 195                            {
 32196                                if (property1.Value.ValueKind == JsonValueKind.Null)
 197                                {
 0198                                    dictionary.Add(property1.Name, null);
 199                                }
 200                                else
 201                                {
 32202                                    dictionary.Add(property1.Name, property1.Value.GetString());
 203                                }
 204                            }
 16205                            metadata = dictionary;
 16206                            continue;
 207                        }
 32208                        if (property0.NameEquals("shareQuota"))
 209                        {
 20210                            if (property0.Value.ValueKind == JsonValueKind.Null)
 211                            {
 212                                continue;
 213                            }
 20214                            shareQuota = property0.Value.GetInt32();
 20215                            continue;
 216                        }
 12217                        if (property0.NameEquals("enabledProtocols"))
 218                        {
 0219                            if (property0.Value.ValueKind == JsonValueKind.Null)
 220                            {
 221                                continue;
 222                            }
 0223                            enabledProtocols = new EnabledProtocols(property0.Value.GetString());
 0224                            continue;
 225                        }
 12226                        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                        }
 12235                        if (property0.NameEquals("version"))
 236                        {
 0237                            if (property0.Value.ValueKind == JsonValueKind.Null)
 238                            {
 239                                continue;
 240                            }
 0241                            version = property0.Value.GetString();
 0242                            continue;
 243                        }
 12244                        if (property0.NameEquals("deleted"))
 245                        {
 0246                            if (property0.Value.ValueKind == JsonValueKind.Null)
 247                            {
 248                                continue;
 249                            }
 0250                            deleted = property0.Value.GetBoolean();
 0251                            continue;
 252                        }
 12253                        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                        }
 12262                        if (property0.NameEquals("remainingRetentionDays"))
 263                        {
 0264                            if (property0.Value.ValueKind == JsonValueKind.Null)
 265                            {
 266                                continue;
 267                            }
 0268                            remainingRetentionDays = property0.Value.GetInt32();
 0269                            continue;
 270                        }
 12271                        if (property0.NameEquals("accessTier"))
 272                        {
 0273                            if (property0.Value.ValueKind == JsonValueKind.Null)
 274                            {
 275                                continue;
 276                            }
 0277                            accessTier = new ShareAccessTier(property0.Value.GetString());
 0278                            continue;
 279                        }
 12280                        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                        }
 12289                        if (property0.NameEquals("accessTierStatus"))
 290                        {
 0291                            if (property0.Value.ValueKind == JsonValueKind.Null)
 292                            {
 293                                continue;
 294                            }
 0295                            accessTierStatus = property0.Value.GetString();
 0296                            continue;
 297                        }
 12298                        if (property0.NameEquals("shareUsageBytes"))
 299                        {
 12300                            if (property0.Value.ValueKind == JsonValueKind.Null)
 301                            {
 302                                continue;
 303                            }
 12304                            shareUsageBytes = property0.Value.GetInt64();
 305                            continue;
 306                        }
 307                    }
 308                    continue;
 309                }
 310            }
 28311            return new FileShare(id, name, type, etag, lastModifiedTime, metadata, shareQuota, enabledProtocols, rootSqu
 312        }
 313    }
 314}