< Summary

Class:Azure.ResourceManager.Storage.Models.ObjectReplicationPolicyFilter
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\ObjectReplicationPolicyFilter.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\ObjectReplicationPolicyFilter.Serialization.cs
Covered lines:35
Uncovered lines:1
Coverable lines:36
Total lines:111
Line coverage:97.2% (35 of 36)
Covered branches:19
Total branches:20
Branch coverage:95% (19 of 20)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_PrefixMatch()-100%100%
get_MinCreationTime()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeObjectReplicationPolicyFilter(...)-93.75%92.86%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\ObjectReplicationPolicyFilter.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.Collections.Generic;
 9
 10namespace Azure.ResourceManager.Storage.Models
 11{
 12    /// <summary> Filters limit replication to a subset of blobs within the storage account. A logical OR is performed o
 13    public partial class ObjectReplicationPolicyFilter
 14    {
 15        /// <summary> Initializes a new instance of ObjectReplicationPolicyFilter. </summary>
 416        public ObjectReplicationPolicyFilter()
 17        {
 418        }
 19
 20        /// <summary> Initializes a new instance of ObjectReplicationPolicyFilter. </summary>
 21        /// <param name="prefixMatch"> Optional. Filters the results to replicate only blobs whose names begin with the 
 22        /// <param name="minCreationTime"> Blobs created after the time will be replicated to the destination. It must b
 2423        internal ObjectReplicationPolicyFilter(IList<string> prefixMatch, string minCreationTime)
 24        {
 2425            PrefixMatch = prefixMatch;
 2426            MinCreationTime = minCreationTime;
 2427        }
 28
 29        /// <summary> Optional. Filters the results to replicate only blobs whose names begin with the specified prefix.
 7630        public IList<string> PrefixMatch { get; set; }
 31        /// <summary> Blobs created after the time will be replicated to the destination. It must be in datetime format 
 12432        public string MinCreationTime { get; set; }
 33    }
 34}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\ObjectReplicationPolicyFilter.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.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.Storage.Models
 13{
 14    public partial class ObjectReplicationPolicyFilter : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 818            writer.WriteStartObject();
 819            if (PrefixMatch != null)
 20            {
 821                writer.WritePropertyName("prefixMatch");
 822                writer.WriteStartArray();
 6423                foreach (var item in PrefixMatch)
 24                {
 2425                    writer.WriteStringValue(item);
 26                }
 827                writer.WriteEndArray();
 28            }
 829            if (MinCreationTime != null)
 30            {
 831                writer.WritePropertyName("minCreationTime");
 832                writer.WriteStringValue(MinCreationTime);
 33            }
 834            writer.WriteEndObject();
 835        }
 36
 37        internal static ObjectReplicationPolicyFilter DeserializeObjectReplicationPolicyFilter(JsonElement element)
 38        {
 2439            IList<string> prefixMatch = default;
 2440            string minCreationTime = default;
 14441            foreach (var property in element.EnumerateObject())
 42            {
 4843                if (property.NameEquals("prefixMatch"))
 44                {
 2445                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 2449                    List<string> array = new List<string>();
 19250                    foreach (var item in property.Value.EnumerateArray())
 51                    {
 7252                        if (item.ValueKind == JsonValueKind.Null)
 53                        {
 054                            array.Add(null);
 55                        }
 56                        else
 57                        {
 7258                            array.Add(item.GetString());
 59                        }
 60                    }
 2461                    prefixMatch = array;
 2462                    continue;
 63                }
 2464                if (property.NameEquals("minCreationTime"))
 65                {
 2466                    if (property.Value.ValueKind == JsonValueKind.Null)
 67                    {
 68                        continue;
 69                    }
 2470                    minCreationTime = property.Value.GetString();
 71                    continue;
 72                }
 73            }
 2474            return new ObjectReplicationPolicyFilter(prefixMatch, minCreationTime);
 75        }
 76    }
 77}