< Summary

Class:Azure.ResourceManager.Storage.Models.BlobServiceProperties
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\BlobServiceProperties.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\BlobServiceProperties.Serialization.cs
Covered lines:111
Uncovered lines:16
Coverable lines:127
Total lines:282
Line coverage:87.4% (111 of 127)
Covered branches:67
Total branches:78
Branch coverage:85.8% (67 of 78)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_Sku()-100%100%
get_Cors()-100%100%
get_DefaultServiceVersion()-100%100%
get_DeleteRetentionPolicy()-100%100%
get_IsVersioningEnabled()-100%100%
get_AutomaticSnapshotPolicyEnabled()-100%100%
get_ChangeFeed()-100%100%
get_RestorePolicy()-100%100%
get_ContainerDeleteRetentionPolicy()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-85.71%87.5%
DeserializeBlobServiceProperties(...)-84.13%85.19%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\BlobServiceProperties.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 a storage account’s Blob service. </summary>
 11    public partial class BlobServiceProperties : Resource
 12    {
 13        /// <summary> Initializes a new instance of BlobServiceProperties. </summary>
 414        public BlobServiceProperties()
 15        {
 416        }
 17
 18        /// <summary> Initializes a new instance of BlobServiceProperties. </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 Blob service. You can include up to five CorsRule elements 
 24        /// <param name="defaultServiceVersion"> DefaultServiceVersion indicates the default version to use for requests
 25        /// <param name="deleteRetentionPolicy"> The blob service properties for blob soft delete. </param>
 26        /// <param name="isVersioningEnabled"> Versioning is enabled if set to true. </param>
 27        /// <param name="automaticSnapshotPolicyEnabled"> Deprecated in favor of isVersioningEnabled property. </param>
 28        /// <param name="changeFeed"> The blob service properties for change feed events. </param>
 29        /// <param name="restorePolicy"> The blob service properties for blob restore policy. </param>
 30        /// <param name="containerDeleteRetentionPolicy"> The blob service properties for container soft delete. </param
 5231        internal BlobServiceProperties(string id, string name, string type, Sku sku, CorsRules cors, string defaultServi
 32        {
 5233            Sku = sku;
 5234            Cors = cors;
 5235            DefaultServiceVersion = defaultServiceVersion;
 5236            DeleteRetentionPolicy = deleteRetentionPolicy;
 5237            IsVersioningEnabled = isVersioningEnabled;
 5238            AutomaticSnapshotPolicyEnabled = automaticSnapshotPolicyEnabled;
 5239            ChangeFeed = changeFeed;
 5240            RestorePolicy = restorePolicy;
 5241            ContainerDeleteRetentionPolicy = containerDeleteRetentionPolicy;
 5242        }
 43
 44        /// <summary> Sku name and tier. </summary>
 3245        public Sku Sku { get; }
 46        /// <summary> Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the req
 20047        public CorsRules Cors { get; set; }
 48        /// <summary> DefaultServiceVersion indicates the default version to use for requests to the Blob service if an 
 10049        public string DefaultServiceVersion { get; set; }
 50        /// <summary> The blob service properties for blob soft delete. </summary>
 12451        public DeleteRetentionPolicy DeleteRetentionPolicy { get; set; }
 52        /// <summary> Versioning is enabled if set to true. </summary>
 9253        public bool? IsVersioningEnabled { get; set; }
 54        /// <summary> Deprecated in favor of isVersioningEnabled property. </summary>
 6855        public bool? AutomaticSnapshotPolicyEnabled { get; set; }
 56        /// <summary> The blob service properties for change feed events. </summary>
 9257        public ChangeFeed ChangeFeed { get; set; }
 58        /// <summary> The blob service properties for blob restore policy. </summary>
 6859        public RestorePolicyProperties RestorePolicy { get; set; }
 60        /// <summary> The blob service properties for container soft delete. </summary>
 6861        public DeleteRetentionPolicy ContainerDeleteRetentionPolicy { get; set; }
 62    }
 63}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\BlobServiceProperties.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 BlobServiceProperties : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 1617            writer.WriteStartObject();
 1618            if (Sku != null)
 19            {
 1220                writer.WritePropertyName("sku");
 1221                writer.WriteObjectValue(Sku);
 22            }
 1623            if (Id != null)
 24            {
 1225                writer.WritePropertyName("id");
 1226                writer.WriteStringValue(Id);
 27            }
 1628            if (Name != null)
 29            {
 1230                writer.WritePropertyName("name");
 1231                writer.WriteStringValue(Name);
 32            }
 1633            if (Type != null)
 34            {
 1235                writer.WritePropertyName("type");
 1236                writer.WriteStringValue(Type);
 37            }
 1638            writer.WritePropertyName("properties");
 1639            writer.WriteStartObject();
 1640            if (Cors != null)
 41            {
 1642                writer.WritePropertyName("cors");
 1643                writer.WriteObjectValue(Cors);
 44            }
 1645            if (DefaultServiceVersion != null)
 46            {
 847                writer.WritePropertyName("defaultServiceVersion");
 848                writer.WriteStringValue(DefaultServiceVersion);
 49            }
 1650            if (DeleteRetentionPolicy != null)
 51            {
 1652                writer.WritePropertyName("deleteRetentionPolicy");
 1653                writer.WriteObjectValue(DeleteRetentionPolicy);
 54            }
 1655            if (IsVersioningEnabled != null)
 56            {
 857                writer.WritePropertyName("isVersioningEnabled");
 858                writer.WriteBooleanValue(IsVersioningEnabled.Value);
 59            }
 1660            if (AutomaticSnapshotPolicyEnabled != null)
 61            {
 062                writer.WritePropertyName("automaticSnapshotPolicyEnabled");
 063                writer.WriteBooleanValue(AutomaticSnapshotPolicyEnabled.Value);
 64            }
 1665            if (ChangeFeed != null)
 66            {
 867                writer.WritePropertyName("changeFeed");
 868                writer.WriteObjectValue(ChangeFeed);
 69            }
 1670            if (RestorePolicy != null)
 71            {
 072                writer.WritePropertyName("restorePolicy");
 073                writer.WriteObjectValue(RestorePolicy);
 74            }
 1675            if (ContainerDeleteRetentionPolicy != null)
 76            {
 077                writer.WritePropertyName("containerDeleteRetentionPolicy");
 078                writer.WriteObjectValue(ContainerDeleteRetentionPolicy);
 79            }
 1680            writer.WriteEndObject();
 1681            writer.WriteEndObject();
 1682        }
 83
 84        internal static BlobServiceProperties DeserializeBlobServiceProperties(JsonElement element)
 85        {
 5286            Sku sku = default;
 5287            string id = default;
 5288            string name = default;
 5289            string type = default;
 5290            CorsRules cors = default;
 5291            string defaultServiceVersion = default;
 5292            DeleteRetentionPolicy deleteRetentionPolicy = default;
 5293            bool? isVersioningEnabled = default;
 5294            bool? automaticSnapshotPolicyEnabled = default;
 5295            ChangeFeed changeFeed = default;
 5296            RestorePolicyProperties restorePolicy = default;
 5297            DeleteRetentionPolicy containerDeleteRetentionPolicy = default;
 59298            foreach (var property in element.EnumerateObject())
 99            {
 244100                if (property.NameEquals("sku"))
 101                {
 36102                    if (property.Value.ValueKind == JsonValueKind.Null)
 103                    {
 104                        continue;
 105                    }
 36106                    sku = Sku.DeserializeSku(property.Value);
 36107                    continue;
 108                }
 208109                if (property.NameEquals("id"))
 110                {
 52111                    if (property.Value.ValueKind == JsonValueKind.Null)
 112                    {
 113                        continue;
 114                    }
 52115                    id = property.Value.GetString();
 52116                    continue;
 117                }
 156118                if (property.NameEquals("name"))
 119                {
 52120                    if (property.Value.ValueKind == JsonValueKind.Null)
 121                    {
 122                        continue;
 123                    }
 52124                    name = property.Value.GetString();
 52125                    continue;
 126                }
 104127                if (property.NameEquals("type"))
 128                {
 52129                    if (property.Value.ValueKind == JsonValueKind.Null)
 130                    {
 131                        continue;
 132                    }
 52133                    type = property.Value.GetString();
 52134                    continue;
 135                }
 52136                if (property.NameEquals("properties"))
 137                {
 408138                    foreach (var property0 in property.Value.EnumerateObject())
 139                    {
 152140                        if (property0.NameEquals("cors"))
 141                        {
 52142                            if (property0.Value.ValueKind == JsonValueKind.Null)
 143                            {
 144                                continue;
 145                            }
 52146                            cors = CorsRules.DeserializeCorsRules(property0.Value);
 52147                            continue;
 148                        }
 100149                        if (property0.NameEquals("defaultServiceVersion"))
 150                        {
 16151                            if (property0.Value.ValueKind == JsonValueKind.Null)
 152                            {
 153                                continue;
 154                            }
 16155                            defaultServiceVersion = property0.Value.GetString();
 16156                            continue;
 157                        }
 84158                        if (property0.NameEquals("deleteRetentionPolicy"))
 159                        {
 52160                            if (property0.Value.ValueKind == JsonValueKind.Null)
 161                            {
 162                                continue;
 163                            }
 52164                            deleteRetentionPolicy = DeleteRetentionPolicy.DeserializeDeleteRetentionPolicy(property0.Val
 52165                            continue;
 166                        }
 32167                        if (property0.NameEquals("isVersioningEnabled"))
 168                        {
 16169                            if (property0.Value.ValueKind == JsonValueKind.Null)
 170                            {
 171                                continue;
 172                            }
 16173                            isVersioningEnabled = property0.Value.GetBoolean();
 16174                            continue;
 175                        }
 16176                        if (property0.NameEquals("automaticSnapshotPolicyEnabled"))
 177                        {
 0178                            if (property0.Value.ValueKind == JsonValueKind.Null)
 179                            {
 180                                continue;
 181                            }
 0182                            automaticSnapshotPolicyEnabled = property0.Value.GetBoolean();
 0183                            continue;
 184                        }
 16185                        if (property0.NameEquals("changeFeed"))
 186                        {
 16187                            if (property0.Value.ValueKind == JsonValueKind.Null)
 188                            {
 189                                continue;
 190                            }
 16191                            changeFeed = ChangeFeed.DeserializeChangeFeed(property0.Value);
 16192                            continue;
 193                        }
 0194                        if (property0.NameEquals("restorePolicy"))
 195                        {
 0196                            if (property0.Value.ValueKind == JsonValueKind.Null)
 197                            {
 198                                continue;
 199                            }
 0200                            restorePolicy = RestorePolicyProperties.DeserializeRestorePolicyProperties(property0.Value);
 0201                            continue;
 202                        }
 0203                        if (property0.NameEquals("containerDeleteRetentionPolicy"))
 204                        {
 0205                            if (property0.Value.ValueKind == JsonValueKind.Null)
 206                            {
 207                                continue;
 208                            }
 0209                            containerDeleteRetentionPolicy = DeleteRetentionPolicy.DeserializeDeleteRetentionPolicy(prop
 210                            continue;
 211                        }
 212                    }
 213                    continue;
 214                }
 215            }
 52216            return new BlobServiceProperties(id, name, type, sku, cors, defaultServiceVersion, deleteRetentionPolicy, is
 217        }
 218    }
 219}