< Summary

Class:Microsoft.Azure.CognitiveServices.Vision.ComputerVision.Models.OcrLanguagesEnumExtension
Assembly:Microsoft.Azure.CognitiveServices.Vision.ComputerVision
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.ComputerVision\src\Generated\Models\OcrLanguages.cs
Covered lines:0
Uncovered lines:57
Coverable lines:57
Total lines:210
Line coverage:0% (0 of 57)
Covered branches:0
Total branches:158
Branch coverage:0% (0 of 158)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.ComputerVision\src\Generated\Models\OcrLanguages.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.CognitiveServices.Vision.ComputerVision.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 OcrLanguages.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum OcrLanguages
 23    {
 24        [EnumMember(Value = "unk")]
 25        Unk,
 26        [EnumMember(Value = "zh-Hans")]
 27        ZhHans,
 28        [EnumMember(Value = "zh-Hant")]
 29        ZhHant,
 30        [EnumMember(Value = "cs")]
 31        Cs,
 32        [EnumMember(Value = "da")]
 33        Da,
 34        [EnumMember(Value = "nl")]
 35        Nl,
 36        [EnumMember(Value = "en")]
 37        En,
 38        [EnumMember(Value = "fi")]
 39        Fi,
 40        [EnumMember(Value = "fr")]
 41        Fr,
 42        [EnumMember(Value = "de")]
 43        De,
 44        [EnumMember(Value = "el")]
 45        El,
 46        [EnumMember(Value = "hu")]
 47        Hu,
 48        [EnumMember(Value = "it")]
 49        It,
 50        [EnumMember(Value = "ja")]
 51        Ja,
 52        [EnumMember(Value = "ko")]
 53        Ko,
 54        [EnumMember(Value = "nb")]
 55        Nb,
 56        [EnumMember(Value = "pl")]
 57        Pl,
 58        [EnumMember(Value = "pt")]
 59        Pt,
 60        [EnumMember(Value = "ru")]
 61        Ru,
 62        [EnumMember(Value = "es")]
 63        Es,
 64        [EnumMember(Value = "sv")]
 65        Sv,
 66        [EnumMember(Value = "tr")]
 67        Tr,
 68        [EnumMember(Value = "ar")]
 69        Ar,
 70        [EnumMember(Value = "ro")]
 71        Ro,
 72        [EnumMember(Value = "sr-Cyrl")]
 73        SrCyrl,
 74        [EnumMember(Value = "sr-Latn")]
 75        SrLatn,
 76        [EnumMember(Value = "sk")]
 77        Sk
 78    }
 79    internal static class OcrLanguagesEnumExtension
 80    {
 81        internal static string ToSerializedValue(this OcrLanguages? value)
 82        {
 083            return value == null ? null : ((OcrLanguages)value).ToSerializedValue();
 84        }
 85
 86        internal static string ToSerializedValue(this OcrLanguages value)
 87        {
 88            switch( value )
 89            {
 90                case OcrLanguages.Unk:
 091                    return "unk";
 92                case OcrLanguages.ZhHans:
 093                    return "zh-Hans";
 94                case OcrLanguages.ZhHant:
 095                    return "zh-Hant";
 96                case OcrLanguages.Cs:
 097                    return "cs";
 98                case OcrLanguages.Da:
 099                    return "da";
 100                case OcrLanguages.Nl:
 0101                    return "nl";
 102                case OcrLanguages.En:
 0103                    return "en";
 104                case OcrLanguages.Fi:
 0105                    return "fi";
 106                case OcrLanguages.Fr:
 0107                    return "fr";
 108                case OcrLanguages.De:
 0109                    return "de";
 110                case OcrLanguages.El:
 0111                    return "el";
 112                case OcrLanguages.Hu:
 0113                    return "hu";
 114                case OcrLanguages.It:
 0115                    return "it";
 116                case OcrLanguages.Ja:
 0117                    return "ja";
 118                case OcrLanguages.Ko:
 0119                    return "ko";
 120                case OcrLanguages.Nb:
 0121                    return "nb";
 122                case OcrLanguages.Pl:
 0123                    return "pl";
 124                case OcrLanguages.Pt:
 0125                    return "pt";
 126                case OcrLanguages.Ru:
 0127                    return "ru";
 128                case OcrLanguages.Es:
 0129                    return "es";
 130                case OcrLanguages.Sv:
 0131                    return "sv";
 132                case OcrLanguages.Tr:
 0133                    return "tr";
 134                case OcrLanguages.Ar:
 0135                    return "ar";
 136                case OcrLanguages.Ro:
 0137                    return "ro";
 138                case OcrLanguages.SrCyrl:
 0139                    return "sr-Cyrl";
 140                case OcrLanguages.SrLatn:
 0141                    return "sr-Latn";
 142                case OcrLanguages.Sk:
 0143                    return "sk";
 144            }
 0145            return null;
 146        }
 147
 148        internal static OcrLanguages? ParseOcrLanguages(this string value)
 149        {
 150            switch( value )
 151            {
 152                case "unk":
 0153                    return OcrLanguages.Unk;
 154                case "zh-Hans":
 0155                    return OcrLanguages.ZhHans;
 156                case "zh-Hant":
 0157                    return OcrLanguages.ZhHant;
 158                case "cs":
 0159                    return OcrLanguages.Cs;
 160                case "da":
 0161                    return OcrLanguages.Da;
 162                case "nl":
 0163                    return OcrLanguages.Nl;
 164                case "en":
 0165                    return OcrLanguages.En;
 166                case "fi":
 0167                    return OcrLanguages.Fi;
 168                case "fr":
 0169                    return OcrLanguages.Fr;
 170                case "de":
 0171                    return OcrLanguages.De;
 172                case "el":
 0173                    return OcrLanguages.El;
 174                case "hu":
 0175                    return OcrLanguages.Hu;
 176                case "it":
 0177                    return OcrLanguages.It;
 178                case "ja":
 0179                    return OcrLanguages.Ja;
 180                case "ko":
 0181                    return OcrLanguages.Ko;
 182                case "nb":
 0183                    return OcrLanguages.Nb;
 184                case "pl":
 0185                    return OcrLanguages.Pl;
 186                case "pt":
 0187                    return OcrLanguages.Pt;
 188                case "ru":
 0189                    return OcrLanguages.Ru;
 190                case "es":
 0191                    return OcrLanguages.Es;
 192                case "sv":
 0193                    return OcrLanguages.Sv;
 194                case "tr":
 0195                    return OcrLanguages.Tr;
 196                case "ar":
 0197                    return OcrLanguages.Ar;
 198                case "ro":
 0199                    return OcrLanguages.Ro;
 200                case "sr-Cyrl":
 0201                    return OcrLanguages.SrCyrl;
 202                case "sr-Latn":
 0203                    return OcrLanguages.SrLatn;
 204                case "sk":
 0205                    return OcrLanguages.Sk;
 206            }
 0207            return null;
 208        }
 209    }
 210}