< Summary

Class:Azure.ResourceManager.Storage.Models.GeoReplicationStats
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\GeoReplicationStats.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\GeoReplicationStats.Serialization.cs
Covered lines:24
Uncovered lines:14
Coverable lines:38
Total lines:113
Line coverage:63.1% (24 of 38)
Covered branches:14
Total branches:20
Branch coverage:70% (14 of 20)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Status()-100%100%
get_LastSyncTime()-100%100%
get_CanFailover()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeGeoReplicationStats(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\GeoReplicationStats.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;
 9
 10namespace Azure.ResourceManager.Storage.Models
 11{
 12    /// <summary> Statistics related to replication for storage account&apos;s Blob, Table, Queue and File services. It 
 13    public partial class GeoReplicationStats
 14    {
 15        /// <summary> Initializes a new instance of GeoReplicationStats. </summary>
 016        public GeoReplicationStats()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of GeoReplicationStats. </summary>
 21        /// <param name="status"> The status of the secondary location. Possible values are: - Live: Indicates that the 
 22        /// <param name="lastSyncTime"> All primary writes preceding this UTC date/time value are guaranteed to be avail
 23        /// <param name="canFailover"> A boolean flag which indicates whether or not account failover is supported for t
 424        internal GeoReplicationStats(GeoReplicationStatus? status, DateTimeOffset? lastSyncTime, bool? canFailover)
 25        {
 426            Status = status;
 427            LastSyncTime = lastSyncTime;
 428            CanFailover = canFailover;
 429        }
 30
 31        /// <summary> The status of the secondary location. Possible values are: - Live: Indicates that the secondary lo
 432        public GeoReplicationStatus? Status { get; }
 33        /// <summary> All primary writes preceding this UTC date/time value are guaranteed to be available for read oper
 434        public DateTimeOffset? LastSyncTime { get; }
 35        /// <summary> A boolean flag which indicates whether or not account failover is supported for the account. </sum
 436        public bool? CanFailover { get; }
 37    }
 38}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\GeoReplicationStats.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.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.Storage.Models
 13{
 14    public partial class GeoReplicationStats : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Status != null)
 20            {
 021                writer.WritePropertyName("status");
 022                writer.WriteStringValue(Status.Value.ToString());
 23            }
 024            if (LastSyncTime != null)
 25            {
 026                writer.WritePropertyName("lastSyncTime");
 027                writer.WriteStringValue(LastSyncTime.Value, "O");
 28            }
 029            if (CanFailover != null)
 30            {
 031                writer.WritePropertyName("canFailover");
 032                writer.WriteBooleanValue(CanFailover.Value);
 33            }
 034            writer.WriteEndObject();
 035        }
 36
 37        internal static GeoReplicationStats DeserializeGeoReplicationStats(JsonElement element)
 38        {
 439            GeoReplicationStatus? status = default;
 440            DateTimeOffset? lastSyncTime = default;
 441            bool? canFailover = default;
 3242            foreach (var property in element.EnumerateObject())
 43            {
 1244                if (property.NameEquals("status"))
 45                {
 446                    if (property.Value.ValueKind == JsonValueKind.Null)
 47                    {
 48                        continue;
 49                    }
 450                    status = new GeoReplicationStatus(property.Value.GetString());
 451                    continue;
 52                }
 853                if (property.NameEquals("lastSyncTime"))
 54                {
 455                    if (property.Value.ValueKind == JsonValueKind.Null)
 56                    {
 57                        continue;
 58                    }
 459                    lastSyncTime = property.Value.GetDateTimeOffset("O");
 460                    continue;
 61                }
 462                if (property.NameEquals("canFailover"))
 63                {
 464                    if (property.Value.ValueKind == JsonValueKind.Null)
 65                    {
 66                        continue;
 67                    }
 468                    canFailover = property.Value.GetBoolean();
 69                    continue;
 70                }
 71            }
 472            return new GeoReplicationStats(status, lastSyncTime, canFailover);
 73        }
 74    }
 75}