< Summary

Class:Microsoft.Azure.CognitiveServices.Search.VideoSearch.Models.ErrorSubCodeEnumExtension
Assembly:Microsoft.Azure.CognitiveServices.Search.BingVideoSearch
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingVideoSearch\src\Generated\VideoSearch\Models\ErrorSubCode.cs
Covered lines:0
Uncovered lines:25
Coverable lines:25
Total lines:110
Line coverage:0% (0 of 25)
Covered branches:0
Total branches:64
Branch coverage:0% (0 of 64)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingVideoSearch\src\Generated\VideoSearch\Models\ErrorSubCode.cs

#LineLine coverage
 1// <auto-generated>
 2// Code generated by Microsoft (R) AutoRest Code Generator.
 3// Changes may cause incorrect behavior and will be lost if the code is
 4// regenerated.
 5// </auto-generated>
 6
 7namespace Microsoft.Azure.CognitiveServices.Search.VideoSearch.Models
 8{
 9    using Newtonsoft.Json;
 10    using Newtonsoft.Json.Converters;
 11    using System.Runtime;
 12    using System.Runtime.Serialization;
 13
 14    /// <summary>
 15    /// Defines values for ErrorSubCode.
 16    /// </summary>
 17    [JsonConverter(typeof(StringEnumConverter))]
 18    public enum ErrorSubCode
 19    {
 20        [EnumMember(Value = "UnexpectedError")]
 21        UnexpectedError,
 22        [EnumMember(Value = "ResourceError")]
 23        ResourceError,
 24        [EnumMember(Value = "NotImplemented")]
 25        NotImplemented,
 26        [EnumMember(Value = "ParameterMissing")]
 27        ParameterMissing,
 28        [EnumMember(Value = "ParameterInvalidValue")]
 29        ParameterInvalidValue,
 30        [EnumMember(Value = "HttpNotAllowed")]
 31        HttpNotAllowed,
 32        [EnumMember(Value = "Blocked")]
 33        Blocked,
 34        [EnumMember(Value = "AuthorizationMissing")]
 35        AuthorizationMissing,
 36        [EnumMember(Value = "AuthorizationRedundancy")]
 37        AuthorizationRedundancy,
 38        [EnumMember(Value = "AuthorizationDisabled")]
 39        AuthorizationDisabled,
 40        [EnumMember(Value = "AuthorizationExpired")]
 41        AuthorizationExpired
 42    }
 43    internal static class ErrorSubCodeEnumExtension
 44    {
 45        internal static string ToSerializedValue(this ErrorSubCode? value)
 46        {
 047            return value == null ? null : ((ErrorSubCode)value).ToSerializedValue();
 48        }
 49
 50        internal static string ToSerializedValue(this ErrorSubCode value)
 51        {
 52            switch( value )
 53            {
 54                case ErrorSubCode.UnexpectedError:
 055                    return "UnexpectedError";
 56                case ErrorSubCode.ResourceError:
 057                    return "ResourceError";
 58                case ErrorSubCode.NotImplemented:
 059                    return "NotImplemented";
 60                case ErrorSubCode.ParameterMissing:
 061                    return "ParameterMissing";
 62                case ErrorSubCode.ParameterInvalidValue:
 063                    return "ParameterInvalidValue";
 64                case ErrorSubCode.HttpNotAllowed:
 065                    return "HttpNotAllowed";
 66                case ErrorSubCode.Blocked:
 067                    return "Blocked";
 68                case ErrorSubCode.AuthorizationMissing:
 069                    return "AuthorizationMissing";
 70                case ErrorSubCode.AuthorizationRedundancy:
 071                    return "AuthorizationRedundancy";
 72                case ErrorSubCode.AuthorizationDisabled:
 073                    return "AuthorizationDisabled";
 74                case ErrorSubCode.AuthorizationExpired:
 075                    return "AuthorizationExpired";
 76            }
 077            return null;
 78        }
 79
 80        internal static ErrorSubCode? ParseErrorSubCode(this string value)
 81        {
 82            switch( value )
 83            {
 84                case "UnexpectedError":
 085                    return ErrorSubCode.UnexpectedError;
 86                case "ResourceError":
 087                    return ErrorSubCode.ResourceError;
 88                case "NotImplemented":
 089                    return ErrorSubCode.NotImplemented;
 90                case "ParameterMissing":
 091                    return ErrorSubCode.ParameterMissing;
 92                case "ParameterInvalidValue":
 093                    return ErrorSubCode.ParameterInvalidValue;
 94                case "HttpNotAllowed":
 095                    return ErrorSubCode.HttpNotAllowed;
 96                case "Blocked":
 097                    return ErrorSubCode.Blocked;
 98                case "AuthorizationMissing":
 099                    return ErrorSubCode.AuthorizationMissing;
 100                case "AuthorizationRedundancy":
 0101                    return ErrorSubCode.AuthorizationRedundancy;
 102                case "AuthorizationDisabled":
 0103                    return ErrorSubCode.AuthorizationDisabled;
 104                case "AuthorizationExpired":
 0105                    return ErrorSubCode.AuthorizationExpired;
 106            }
 0107            return null;
 108        }
 109    }
 110}