< Summary

Class:Microsoft.Azure.Search.Models.IndexActionTypeEnumExtension
Assembly:Microsoft.Azure.Search.Data
File(s):C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Data\src\Generated\Models\IndexActionType.cs
Covered lines:0
Uncovered lines:11
Coverable lines:11
Total lines:72
Line coverage:0% (0 of 11)
Covered branches:0
Total branches:15
Branch coverage:0% (0 of 15)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerializedValue(...)-0%0%
ToSerializedValue(...)-0%0%
ParseIndexActionType(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Data\src\Generated\Models\IndexActionType.cs

#LineLine coverage
 1// <auto-generated>
 2// Copyright (c) Microsoft Corporation. All rights reserved.
 3// Licensed under the MIT License. See License.txt in the project root for
 4// license information.
 5//
 6// Code generated by Microsoft (R) AutoRest Code Generator.
 7// Changes may cause incorrect behavior and will be lost if the code is
 8// regenerated.
 9// </auto-generated>
 10
 11namespace Microsoft.Azure.Search.Models
 12{
 13    using Newtonsoft.Json;
 14    using Newtonsoft.Json.Converters;
 15    using System.Runtime;
 16    using System.Runtime.Serialization;
 17
 18    /// <summary>
 19    /// Defines values for IndexActionType.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum IndexActionType
 23    {
 24        [EnumMember(Value = "upload")]
 25        Upload,
 26        [EnumMember(Value = "merge")]
 27        Merge,
 28        [EnumMember(Value = "mergeOrUpload")]
 29        MergeOrUpload,
 30        [EnumMember(Value = "delete")]
 31        Delete
 32    }
 33    internal static class IndexActionTypeEnumExtension
 34    {
 35        internal static string ToSerializedValue(this IndexActionType? value)
 36        {
 037            return value == null ? null : ((IndexActionType)value).ToSerializedValue();
 38        }
 39
 40        internal static string ToSerializedValue(this IndexActionType value)
 41        {
 42            switch( value )
 43            {
 44                case IndexActionType.Upload:
 045                    return "upload";
 46                case IndexActionType.Merge:
 047                    return "merge";
 48                case IndexActionType.MergeOrUpload:
 049                    return "mergeOrUpload";
 50                case IndexActionType.Delete:
 051                    return "delete";
 52            }
 053            return null;
 54        }
 55
 56        internal static IndexActionType? ParseIndexActionType(this string value)
 57        {
 58            switch( value )
 59            {
 60                case "upload":
 061                    return IndexActionType.Upload;
 62                case "merge":
 063                    return IndexActionType.Merge;
 64                case "mergeOrUpload":
 065                    return IndexActionType.MergeOrUpload;
 66                case "delete":
 067                    return IndexActionType.Delete;
 68            }
 069            return null;
 70        }
 71    }
 72}