< Summary

Class:Azure.ResourceManager.Storage.Models.BlobRestoreParameters
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\BlobRestoreParameters.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\BlobRestoreParameters.Serialization.cs
Covered lines:0
Uncovered lines:36
Coverable lines:36
Total lines:109
Line coverage:0% (0 of 36)
Covered branches:0
Total branches:16
Branch coverage:0% (0 of 16)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_TimeToRestore()-0%100%
get_BlobRanges()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeBlobRestoreParameters(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\BlobRestoreParameters.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.Linq;
 11
 12namespace Azure.ResourceManager.Storage.Models
 13{
 14    /// <summary> Blob restore parameters. </summary>
 15    public partial class BlobRestoreParameters
 16    {
 17        /// <summary> Initializes a new instance of BlobRestoreParameters. </summary>
 18        /// <param name="timeToRestore"> Restore blob to the specified time. </param>
 19        /// <param name="blobRanges"> Blob ranges to restore. </param>
 020        public BlobRestoreParameters(DateTimeOffset timeToRestore, IEnumerable<BlobRestoreRange> blobRanges)
 21        {
 022            if (blobRanges == null)
 23            {
 024                throw new ArgumentNullException(nameof(blobRanges));
 25            }
 26
 027            TimeToRestore = timeToRestore;
 028            BlobRanges = blobRanges.ToList();
 029        }
 30
 31        /// <summary> Initializes a new instance of BlobRestoreParameters. </summary>
 32        /// <param name="timeToRestore"> Restore blob to the specified time. </param>
 33        /// <param name="blobRanges"> Blob ranges to restore. </param>
 034        internal BlobRestoreParameters(DateTimeOffset timeToRestore, IList<BlobRestoreRange> blobRanges)
 35        {
 036            TimeToRestore = timeToRestore;
 037            BlobRanges = blobRanges ?? new List<BlobRestoreRange>();
 038        }
 39
 40        /// <summary> Restore blob to the specified time. </summary>
 041        public DateTimeOffset TimeToRestore { get; set; }
 42        /// <summary> Blob ranges to restore. </summary>
 043        public IList<BlobRestoreRange> BlobRanges { get; }
 44    }
 45}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\BlobRestoreParameters.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 BlobRestoreParameters : IUtf8JsonSerializable
 16    {
 17        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 18        {
 019            writer.WriteStartObject();
 020            writer.WritePropertyName("timeToRestore");
 021            writer.WriteStringValue(TimeToRestore, "O");
 022            writer.WritePropertyName("blobRanges");
 023            writer.WriteStartArray();
 024            foreach (var item in BlobRanges)
 25            {
 026                writer.WriteObjectValue(item);
 27            }
 028            writer.WriteEndArray();
 029            writer.WriteEndObject();
 030        }
 31
 32        internal static BlobRestoreParameters DeserializeBlobRestoreParameters(JsonElement element)
 33        {
 034            DateTimeOffset timeToRestore = default;
 035            IList<BlobRestoreRange> blobRanges = default;
 036            foreach (var property in element.EnumerateObject())
 37            {
 038                if (property.NameEquals("timeToRestore"))
 39                {
 040                    timeToRestore = property.Value.GetDateTimeOffset("O");
 041                    continue;
 42                }
 043                if (property.NameEquals("blobRanges"))
 44                {
 045                    List<BlobRestoreRange> array = new List<BlobRestoreRange>();
 046                    foreach (var item in property.Value.EnumerateArray())
 47                    {
 048                        if (item.ValueKind == JsonValueKind.Null)
 49                        {
 050                            array.Add(null);
 51                        }
 52                        else
 53                        {
 054                            array.Add(BlobRestoreRange.DeserializeBlobRestoreRange(item));
 55                        }
 56                    }
 057                    blobRanges = array;
 58                    continue;
 59                }
 60            }
 061            return new BlobRestoreParameters(timeToRestore, blobRanges);
 62        }
 63    }
 64}