< Summary

Class:Microsoft.Azure.CognitiveServices.Vision.ComputerVision.Models.VisualFeatureTypesEnumExtension
Assembly:Microsoft.Azure.CognitiveServices.Vision.ComputerVision
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.ComputerVision\src\Generated\Models\VisualFeatureTypes.cs
Covered lines:0
Uncovered lines:21
Coverable lines:21
Total lines:102
Line coverage:0% (0 of 21)
Covered branches:0
Total branches:54
Branch coverage:0% (0 of 54)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.ComputerVision\src\Generated\Models\VisualFeatureTypes.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 VisualFeatureTypes.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum VisualFeatureTypes
 23    {
 24        [EnumMember(Value = "ImageType")]
 25        ImageType,
 26        [EnumMember(Value = "Faces")]
 27        Faces,
 28        [EnumMember(Value = "Adult")]
 29        Adult,
 30        [EnumMember(Value = "Categories")]
 31        Categories,
 32        [EnumMember(Value = "Color")]
 33        Color,
 34        [EnumMember(Value = "Tags")]
 35        Tags,
 36        [EnumMember(Value = "Description")]
 37        Description,
 38        [EnumMember(Value = "Objects")]
 39        Objects,
 40        [EnumMember(Value = "Brands")]
 41        Brands
 42    }
 43    internal static class VisualFeatureTypesEnumExtension
 44    {
 45        internal static string ToSerializedValue(this VisualFeatureTypes? value)
 46        {
 047            return value == null ? null : ((VisualFeatureTypes)value).ToSerializedValue();
 48        }
 49
 50        internal static string ToSerializedValue(this VisualFeatureTypes value)
 51        {
 52            switch( value )
 53            {
 54                case VisualFeatureTypes.ImageType:
 055                    return "ImageType";
 56                case VisualFeatureTypes.Faces:
 057                    return "Faces";
 58                case VisualFeatureTypes.Adult:
 059                    return "Adult";
 60                case VisualFeatureTypes.Categories:
 061                    return "Categories";
 62                case VisualFeatureTypes.Color:
 063                    return "Color";
 64                case VisualFeatureTypes.Tags:
 065                    return "Tags";
 66                case VisualFeatureTypes.Description:
 067                    return "Description";
 68                case VisualFeatureTypes.Objects:
 069                    return "Objects";
 70                case VisualFeatureTypes.Brands:
 071                    return "Brands";
 72            }
 073            return null;
 74        }
 75
 76        internal static VisualFeatureTypes? ParseVisualFeatureTypes(this string value)
 77        {
 78            switch( value )
 79            {
 80                case "ImageType":
 081                    return VisualFeatureTypes.ImageType;
 82                case "Faces":
 083                    return VisualFeatureTypes.Faces;
 84                case "Adult":
 085                    return VisualFeatureTypes.Adult;
 86                case "Categories":
 087                    return VisualFeatureTypes.Categories;
 88                case "Color":
 089                    return VisualFeatureTypes.Color;
 90                case "Tags":
 091                    return VisualFeatureTypes.Tags;
 92                case "Description":
 093                    return VisualFeatureTypes.Description;
 94                case "Objects":
 095                    return VisualFeatureTypes.Objects;
 96                case "Brands":
 097                    return VisualFeatureTypes.Brands;
 98            }
 099            return null;
 100        }
 101    }
 102}