< Summary

Class:Microsoft.Azure.Management.Search.Models.SearchServiceStatusEnumExtension
Assembly:Microsoft.Azure.Management.Search
File(s):C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Management.Search\src\Generated\Models\SearchServiceStatus.cs
Covered lines:0
Uncovered lines:15
Coverable lines:15
Total lines:84
Line coverage:0% (0 of 15)
Covered branches:0
Total branches:21
Branch coverage:0% (0 of 21)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Management.Search\src\Generated\Models\SearchServiceStatus.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.Management.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 SearchServiceStatus.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum SearchServiceStatus
 23    {
 24        [EnumMember(Value = "running")]
 25        Running,
 26        [EnumMember(Value = "provisioning")]
 27        Provisioning,
 28        [EnumMember(Value = "deleting")]
 29        Deleting,
 30        [EnumMember(Value = "degraded")]
 31        Degraded,
 32        [EnumMember(Value = "disabled")]
 33        Disabled,
 34        [EnumMember(Value = "error")]
 35        Error
 36    }
 37    internal static class SearchServiceStatusEnumExtension
 38    {
 39        internal static string ToSerializedValue(this SearchServiceStatus? value)
 40        {
 041            return value == null ? null : ((SearchServiceStatus)value).ToSerializedValue();
 42        }
 43
 44        internal static string ToSerializedValue(this SearchServiceStatus value)
 45        {
 46            switch( value )
 47            {
 48                case SearchServiceStatus.Running:
 049                    return "running";
 50                case SearchServiceStatus.Provisioning:
 051                    return "provisioning";
 52                case SearchServiceStatus.Deleting:
 053                    return "deleting";
 54                case SearchServiceStatus.Degraded:
 055                    return "degraded";
 56                case SearchServiceStatus.Disabled:
 057                    return "disabled";
 58                case SearchServiceStatus.Error:
 059                    return "error";
 60            }
 061            return null;
 62        }
 63
 64        internal static SearchServiceStatus? ParseSearchServiceStatus(this string value)
 65        {
 66            switch( value )
 67            {
 68                case "running":
 069                    return SearchServiceStatus.Running;
 70                case "provisioning":
 071                    return SearchServiceStatus.Provisioning;
 72                case "deleting":
 073                    return SearchServiceStatus.Deleting;
 74                case "degraded":
 075                    return SearchServiceStatus.Degraded;
 76                case "disabled":
 077                    return SearchServiceStatus.Disabled;
 78                case "error":
 079                    return SearchServiceStatus.Error;
 80            }
 081            return null;
 82        }
 83    }
 84}