< Summary

Class:Azure.ResourceManager.EventHubs.Models.ArmDisasterRecovery
Assembly:Azure.ResourceManager.EventHubs
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\ArmDisasterRecovery.cs
C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\ArmDisasterRecovery.Serialization.cs
Covered lines:75
Uncovered lines:12
Coverable lines:87
Total lines:206
Line coverage:86.2% (75 of 87)
Covered branches:48
Total branches:54
Branch coverage:88.8% (48 of 54)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_ProvisioningState()-100%100%
get_PartnerNamespace()-100%100%
get_AlternateName()-100%100%
get_Role()-100%100%
get_PendingReplicationOperationsCount()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-60%62.5%
DeserializeArmDisasterRecovery(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\ArmDisasterRecovery.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.EventHubs.Models
 9{
 10    /// <summary> Single item in List or Get Alias(Disaster Recovery configuration) operation. </summary>
 11    public partial class ArmDisasterRecovery : Resource
 12    {
 13        /// <summary> Initializes a new instance of ArmDisasterRecovery. </summary>
 1614        public ArmDisasterRecovery()
 15        {
 1616        }
 17
 18        /// <summary> Initializes a new instance of ArmDisasterRecovery. </summary>
 19        /// <param name="id"> Resource ID. </param>
 20        /// <param name="name"> Resource name. </param>
 21        /// <param name="type"> Resource type. </param>
 22        /// <param name="provisioningState"> Provisioning state of the Alias(Disaster Recovery configuration) - possible
 23        /// <param name="partnerNamespace"> ARM Id of the Primary/Secondary eventhub namespace name, which is part of GE
 24        /// <param name="alternateName"> Alternate name specified when alias and namespace names are same. </param>
 25        /// <param name="role"> role of namespace in GEO DR - possible values &apos;Primary&apos; or &apos;PrimaryNotRep
 26        /// <param name="pendingReplicationOperationsCount"> Number of entities pending to be replicated. </param>
 607227        internal ArmDisasterRecovery(string id, string name, string type, ProvisioningStateDR? provisioningState, string
 28        {
 607229            ProvisioningState = provisioningState;
 607230            PartnerNamespace = partnerNamespace;
 607231            AlternateName = alternateName;
 607232            Role = role;
 607233            PendingReplicationOperationsCount = pendingReplicationOperationsCount;
 607234        }
 35
 36        /// <summary> Provisioning state of the Alias(Disaster Recovery configuration) - possible values &apos;Accepted&
 604037        public ProvisioningStateDR? ProvisioningState { get; }
 38        /// <summary> ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO DR pairing. </summar
 612039        public string PartnerNamespace { get; set; }
 40        /// <summary> Alternate name specified when alias and namespace names are same. </summary>
 610441        public string AlternateName { get; set; }
 42        /// <summary> role of namespace in GEO DR - possible values &apos;Primary&apos; or &apos;PrimaryNotReplicating&a
 3243        public RoleDisasterRecovery? Role { get; }
 44        /// <summary> Number of entities pending to be replicated. </summary>
 4045        public long? PendingReplicationOperationsCount { get; }
 46    }
 47}

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\ArmDisasterRecovery.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.EventHubs.Models
 12{
 13    public partial class ArmDisasterRecovery : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 1617            writer.WriteStartObject();
 1618            if (Id != null)
 19            {
 020                writer.WritePropertyName("id");
 021                writer.WriteStringValue(Id);
 22            }
 1623            if (Name != null)
 24            {
 025                writer.WritePropertyName("name");
 026                writer.WriteStringValue(Name);
 27            }
 1628            if (Type != null)
 29            {
 030                writer.WritePropertyName("type");
 031                writer.WriteStringValue(Type);
 32            }
 1633            writer.WritePropertyName("properties");
 1634            writer.WriteStartObject();
 1635            if (ProvisioningState != null)
 36            {
 037                writer.WritePropertyName("provisioningState");
 038                writer.WriteStringValue(ProvisioningState.Value.ToSerialString());
 39            }
 1640            if (PartnerNamespace != null)
 41            {
 1642                writer.WritePropertyName("partnerNamespace");
 1643                writer.WriteStringValue(PartnerNamespace);
 44            }
 1645            if (AlternateName != null)
 46            {
 847                writer.WritePropertyName("alternateName");
 848                writer.WriteStringValue(AlternateName);
 49            }
 1650            if (Role != null)
 51            {
 052                writer.WritePropertyName("role");
 053                writer.WriteStringValue(Role.Value.ToSerialString());
 54            }
 1655            if (PendingReplicationOperationsCount != null)
 56            {
 057                writer.WritePropertyName("pendingReplicationOperationsCount");
 058                writer.WriteNumberValue(PendingReplicationOperationsCount.Value);
 59            }
 1660            writer.WriteEndObject();
 1661            writer.WriteEndObject();
 1662        }
 63
 64        internal static ArmDisasterRecovery DeserializeArmDisasterRecovery(JsonElement element)
 65        {
 607266            string id = default;
 607267            string name = default;
 607268            string type = default;
 607269            ProvisioningStateDR? provisioningState = default;
 607270            string partnerNamespace = default;
 607271            string alternateName = default;
 607272            RoleDisasterRecovery? role = default;
 607273            long? pendingReplicationOperationsCount = default;
 6072074            foreach (var property in element.EnumerateObject())
 75            {
 2428876                if (property.NameEquals("id"))
 77                {
 607278                    if (property.Value.ValueKind == JsonValueKind.Null)
 79                    {
 80                        continue;
 81                    }
 607282                    id = property.Value.GetString();
 607283                    continue;
 84                }
 1821685                if (property.NameEquals("name"))
 86                {
 607287                    if (property.Value.ValueKind == JsonValueKind.Null)
 88                    {
 89                        continue;
 90                    }
 607291                    name = property.Value.GetString();
 607292                    continue;
 93                }
 1214494                if (property.NameEquals("type"))
 95                {
 607296                    if (property.Value.ValueKind == JsonValueKind.Null)
 97                    {
 98                        continue;
 99                    }
 6072100                    type = property.Value.GetString();
 6072101                    continue;
 102                }
 6072103                if (property.NameEquals("properties"))
 104                {
 68568105                    foreach (var property0 in property.Value.EnumerateObject())
 106                    {
 28212107                        if (property0.NameEquals("provisioningState"))
 108                        {
 6072109                            if (property0.Value.ValueKind == JsonValueKind.Null)
 110                            {
 111                                continue;
 112                            }
 6072113                            provisioningState = property0.Value.GetString().ToProvisioningStateDR();
 6072114                            continue;
 115                        }
 22140116                        if (property0.NameEquals("partnerNamespace"))
 117                        {
 6072118                            if (property0.Value.ValueKind == JsonValueKind.Null)
 119                            {
 120                                continue;
 121                            }
 6072122                            partnerNamespace = property0.Value.GetString();
 6072123                            continue;
 124                        }
 16068125                        if (property0.NameEquals("alternateName"))
 126                        {
 3900127                            if (property0.Value.ValueKind == JsonValueKind.Null)
 128                            {
 129                                continue;
 130                            }
 3900131                            alternateName = property0.Value.GetString();
 3900132                            continue;
 133                        }
 12168134                        if (property0.NameEquals("role"))
 135                        {
 6072136                            if (property0.Value.ValueKind == JsonValueKind.Null)
 137                            {
 138                                continue;
 139                            }
 6072140                            role = property0.Value.GetString().ToRoleDisasterRecovery();
 6072141                            continue;
 142                        }
 6096143                        if (property0.NameEquals("pendingReplicationOperationsCount"))
 144                        {
 24145                            if (property0.Value.ValueKind == JsonValueKind.Null)
 146                            {
 147                                continue;
 148                            }
 24149                            pendingReplicationOperationsCount = property0.Value.GetInt64();
 150                            continue;
 151                        }
 152                    }
 153                    continue;
 154                }
 155            }
 6072156            return new ArmDisasterRecovery(id, name, type, provisioningState, partnerNamespace, alternateName, role, pen
 157        }
 158    }
 159}