< Summary

Class:Azure.ResourceManager.Compute.Models.RegionalReplicationStatus
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RegionalReplicationStatus.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RegionalReplicationStatus.Serialization.cs
Covered lines:24
Uncovered lines:24
Coverable lines:48
Total lines:129
Line coverage:50% (24 of 48)
Covered branches:16
Total branches:26
Branch coverage:61.5% (16 of 26)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Region()-0%100%
get_State()-0%100%
get_Details()-0%100%
get_Progress()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeRegionalReplicationStatus(...)-85.71%88.89%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RegionalReplicationStatus.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.Compute.Models
 9{
 10    /// <summary> This is the regional replication status. </summary>
 11    public partial class RegionalReplicationStatus
 12    {
 13        /// <summary> Initializes a new instance of RegionalReplicationStatus. </summary>
 014        public RegionalReplicationStatus()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of RegionalReplicationStatus. </summary>
 19        /// <param name="region"> The region to which the gallery Image Version is being replicated to. </param>
 20        /// <param name="state"> This is the regional replication state. </param>
 21        /// <param name="details"> The details of the replication status. </param>
 22        /// <param name="progress"> It indicates progress of the replication job. </param>
 1223        internal RegionalReplicationStatus(string region, ReplicationState? state, string details, int? progress)
 24        {
 1225            Region = region;
 1226            State = state;
 1227            Details = details;
 1228            Progress = progress;
 1229        }
 30
 31        /// <summary> The region to which the gallery Image Version is being replicated to. </summary>
 032        public string Region { get; }
 33        /// <summary> This is the regional replication state. </summary>
 034        public ReplicationState? State { get; }
 35        /// <summary> The details of the replication status. </summary>
 036        public string Details { get; }
 37        /// <summary> It indicates progress of the replication job. </summary>
 038        public int? Progress { get; }
 39    }
 40}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RegionalReplicationStatus.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.Compute.Models
 12{
 13    public partial class RegionalReplicationStatus : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (Region != null)
 19            {
 020                writer.WritePropertyName("region");
 021                writer.WriteStringValue(Region);
 22            }
 023            if (State != null)
 24            {
 025                writer.WritePropertyName("state");
 026                writer.WriteStringValue(State.Value.ToString());
 27            }
 028            if (Details != null)
 29            {
 030                writer.WritePropertyName("details");
 031                writer.WriteStringValue(Details);
 32            }
 033            if (Progress != null)
 34            {
 035                writer.WritePropertyName("progress");
 036                writer.WriteNumberValue(Progress.Value);
 37            }
 038            writer.WriteEndObject();
 039        }
 40
 41        internal static RegionalReplicationStatus DeserializeRegionalReplicationStatus(JsonElement element)
 42        {
 1243            string region = default;
 1244            ReplicationState? state = default;
 1245            string details = default;
 1246            int? progress = default;
 9647            foreach (var property in element.EnumerateObject())
 48            {
 3649                if (property.NameEquals("region"))
 50                {
 1251                    if (property.Value.ValueKind == JsonValueKind.Null)
 52                    {
 53                        continue;
 54                    }
 1255                    region = property.Value.GetString();
 1256                    continue;
 57                }
 2458                if (property.NameEquals("state"))
 59                {
 1260                    if (property.Value.ValueKind == JsonValueKind.Null)
 61                    {
 62                        continue;
 63                    }
 1264                    state = new ReplicationState(property.Value.GetString());
 1265                    continue;
 66                }
 1267                if (property.NameEquals("details"))
 68                {
 069                    if (property.Value.ValueKind == JsonValueKind.Null)
 70                    {
 71                        continue;
 72                    }
 073                    details = property.Value.GetString();
 074                    continue;
 75                }
 1276                if (property.NameEquals("progress"))
 77                {
 1278                    if (property.Value.ValueKind == JsonValueKind.Null)
 79                    {
 80                        continue;
 81                    }
 1282                    progress = property.Value.GetInt32();
 83                    continue;
 84                }
 85            }
 1286            return new RegionalReplicationStatus(region, state, details, progress);
 87        }
 88    }
 89}