< Summary

Class:Azure.Search.Documents.Indexes.Models.DataChangeDetectionPolicy
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\DataChangeDetectionPolicy.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\DataChangeDetectionPolicy.Serialization.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Indexes\Models\DataChangeDetectionPolicy.cs
Covered lines:0
Uncovered lines:20
Coverable lines:20
Total lines:82
Line coverage:0% (0 of 20)
Covered branches:0
Total branches:10
Branch coverage:0% (0 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
get_ODataType()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%100%
DeserializeDataChangeDetectionPolicy(...)-0%0%
.ctor()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\DataChangeDetectionPolicy.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.Search.Documents.Indexes.Models
 9{
 10    /// <summary> Base type for data change detection policies. </summary>
 11    public partial class DataChangeDetectionPolicy
 12    {
 13
 14        /// <summary> Initializes a new instance of DataChangeDetectionPolicy. </summary>
 15        /// <param name="oDataType"> Identifies the concrete type of the data change detection policy. </param>
 016        internal DataChangeDetectionPolicy(string oDataType)
 17        {
 018            ODataType = oDataType;
 019        }
 20
 21        /// <summary> Identifies the concrete type of the data change detection policy. </summary>
 022        internal string ODataType { get; set; }
 23    }
 24}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\DataChangeDetectionPolicy.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.Search.Documents.Indexes.Models
 12{
 13    public partial class DataChangeDetectionPolicy : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("@odata.type");
 019            writer.WriteStringValue(ODataType);
 020            writer.WriteEndObject();
 021        }
 22
 23        internal static DataChangeDetectionPolicy DeserializeDataChangeDetectionPolicy(JsonElement element)
 24        {
 025            if (element.TryGetProperty("@odata.type", out JsonElement discriminator))
 26            {
 027                switch (discriminator.GetString())
 28                {
 029                    case "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy": return HighWaterMarkChangeDetecti
 030                    case "#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy": return SqlIntegratedChangeTracking
 31                }
 32            }
 033            string odataType = default;
 034            foreach (var property in element.EnumerateObject())
 35            {
 036                if (property.NameEquals("@odata.type"))
 37                {
 038                    odataType = property.Value.GetString();
 39                    continue;
 40                }
 41            }
 042            return new DataChangeDetectionPolicy(odataType);
 43        }
 44    }
 45}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Indexes\Models\DataChangeDetectionPolicy.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4namespace Azure.Search.Documents.Indexes.Models
 5{
 6    public partial class DataChangeDetectionPolicy
 7    {
 8        /// <summary> Initializes a new instance of DataChangeDetectionPolicy. </summary>
 09        private protected DataChangeDetectionPolicy()
 10        {
 011        }
 12    }
 13}