< Summary

Class:Azure.ResourceManager.Storage.Models.FileServiceProperties
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\FileServiceProperties.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\FileServiceProperties.Serialization.cs
Covered lines:61
Uncovered lines:6
Coverable lines:67
Total lines:168
Line coverage:91% (61 of 67)
Covered branches:39
Total branches:42
Branch coverage:92.8% (39 of 42)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Sku()-100%100%
get_Cors()-100%100%
get_ShareDeleteRetentionPolicy()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-91.67%91.67%
DeserializeFileServiceProperties(...)-93.94%93.33%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\FileServiceProperties.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
 8namespace Azure.ResourceManager.Storage.Models
 9{
 10    /// <summary> The properties of File services in storage account. </summary>
 11    public partial class FileServiceProperties : Resource
 12    {
 13        /// <summary> Initializes a new instance of FileServiceProperties. </summary>
 014        public FileServiceProperties()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of FileServiceProperties. </summary>
 19        /// <param name="id"> Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourc
 20        /// <param name="name"> The name of the resource. </param>
 21        /// <param name="type"> The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/sto
 22        /// <param name="sku"> Sku name and tier. </param>
 23        /// <param name="cors"> Specifies CORS rules for the File service. You can include up to five CorsRule elements 
 24        /// <param name="shareDeleteRetentionPolicy"> The file service properties for share soft delete. </param>
 1225        internal FileServiceProperties(string id, string name, string type, Sku sku, CorsRules cors, DeleteRetentionPoli
 26        {
 1227            Sku = sku;
 1228            Cors = cors;
 1229            ShareDeleteRetentionPolicy = shareDeleteRetentionPolicy;
 1230        }
 31
 32        /// <summary> Sku name and tier. </summary>
 833        public Sku Sku { get; }
 34        /// <summary> Specifies CORS rules for the File service. You can include up to five CorsRule elements in the req
 12435        public CorsRules Cors { get; set; }
 36        /// <summary> The file service properties for share soft delete. </summary>
 1637        public DeleteRetentionPolicy ShareDeleteRetentionPolicy { get; set; }
 38    }
 39}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\FileServiceProperties.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.ResourceManager.Storage.Models
 12{
 13    public partial class FileServiceProperties : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 417            writer.WriteStartObject();
 418            if (Sku != null)
 19            {
 420                writer.WritePropertyName("sku");
 421                writer.WriteObjectValue(Sku);
 22            }
 423            if (Id != null)
 24            {
 425                writer.WritePropertyName("id");
 426                writer.WriteStringValue(Id);
 27            }
 428            if (Name != null)
 29            {
 430                writer.WritePropertyName("name");
 431                writer.WriteStringValue(Name);
 32            }
 433            if (Type != null)
 34            {
 435                writer.WritePropertyName("type");
 436                writer.WriteStringValue(Type);
 37            }
 438            writer.WritePropertyName("properties");
 439            writer.WriteStartObject();
 440            if (Cors != null)
 41            {
 442                writer.WritePropertyName("cors");
 443                writer.WriteObjectValue(Cors);
 44            }
 445            if (ShareDeleteRetentionPolicy != null)
 46            {
 047                writer.WritePropertyName("shareDeleteRetentionPolicy");
 048                writer.WriteObjectValue(ShareDeleteRetentionPolicy);
 49            }
 450            writer.WriteEndObject();
 451            writer.WriteEndObject();
 452        }
 53
 54        internal static FileServiceProperties DeserializeFileServiceProperties(JsonElement element)
 55        {
 1256            Sku sku = default;
 1257            string id = default;
 1258            string name = default;
 1259            string type = default;
 1260            CorsRules cors = default;
 1261            DeleteRetentionPolicy shareDeleteRetentionPolicy = default;
 13662            foreach (var property in element.EnumerateObject())
 63            {
 5664                if (property.NameEquals("sku"))
 65                {
 866                    if (property.Value.ValueKind == JsonValueKind.Null)
 67                    {
 68                        continue;
 69                    }
 870                    sku = Sku.DeserializeSku(property.Value);
 871                    continue;
 72                }
 4873                if (property.NameEquals("id"))
 74                {
 1275                    if (property.Value.ValueKind == JsonValueKind.Null)
 76                    {
 77                        continue;
 78                    }
 1279                    id = property.Value.GetString();
 1280                    continue;
 81                }
 3682                if (property.NameEquals("name"))
 83                {
 1284                    if (property.Value.ValueKind == JsonValueKind.Null)
 85                    {
 86                        continue;
 87                    }
 1288                    name = property.Value.GetString();
 1289                    continue;
 90                }
 2491                if (property.NameEquals("type"))
 92                {
 1293                    if (property.Value.ValueKind == JsonValueKind.Null)
 94                    {
 95                        continue;
 96                    }
 1297                    type = property.Value.GetString();
 1298                    continue;
 99                }
 12100                if (property.NameEquals("properties"))
 101                {
 64102                    foreach (var property0 in property.Value.EnumerateObject())
 103                    {
 20104                        if (property0.NameEquals("cors"))
 105                        {
 12106                            if (property0.Value.ValueKind == JsonValueKind.Null)
 107                            {
 108                                continue;
 109                            }
 12110                            cors = CorsRules.DeserializeCorsRules(property0.Value);
 12111                            continue;
 112                        }
 8113                        if (property0.NameEquals("shareDeleteRetentionPolicy"))
 114                        {
 0115                            if (property0.Value.ValueKind == JsonValueKind.Null)
 116                            {
 117                                continue;
 118                            }
 0119                            shareDeleteRetentionPolicy = DeleteRetentionPolicy.DeserializeDeleteRetentionPolicy(property
 120                            continue;
 121                        }
 122                    }
 123                    continue;
 124                }
 125            }
 12126            return new FileServiceProperties(id, name, type, sku, cors, shareDeleteRetentionPolicy);
 127        }
 128    }
 129}