< Summary

Class:Microsoft.Azure.CognitiveServices.Vision.Face.Models.FaceAttributeTypeEnumExtension
Assembly:Microsoft.Azure.CognitiveServices.Vision.Face
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.Face\src\Generated\Models\FaceAttributeType.cs
Covered lines:0
Uncovered lines:31
Coverable lines:31
Total lines:132
Line coverage:0% (0 of 31)
Covered branches:0
Total branches:83
Branch coverage:0% (0 of 83)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.Face\src\Generated\Models\FaceAttributeType.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.Face.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 FaceAttributeType.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum FaceAttributeType
 23    {
 24        [EnumMember(Value = "age")]
 25        Age,
 26        [EnumMember(Value = "gender")]
 27        Gender,
 28        [EnumMember(Value = "headPose")]
 29        HeadPose,
 30        [EnumMember(Value = "smile")]
 31        Smile,
 32        [EnumMember(Value = "facialHair")]
 33        FacialHair,
 34        [EnumMember(Value = "glasses")]
 35        Glasses,
 36        [EnumMember(Value = "emotion")]
 37        Emotion,
 38        [EnumMember(Value = "hair")]
 39        Hair,
 40        [EnumMember(Value = "makeup")]
 41        Makeup,
 42        [EnumMember(Value = "occlusion")]
 43        Occlusion,
 44        [EnumMember(Value = "accessories")]
 45        Accessories,
 46        [EnumMember(Value = "blur")]
 47        Blur,
 48        [EnumMember(Value = "exposure")]
 49        Exposure,
 50        [EnumMember(Value = "noise")]
 51        Noise
 52    }
 53    internal static class FaceAttributeTypeEnumExtension
 54    {
 55        internal static string ToSerializedValue(this FaceAttributeType? value)
 56        {
 057            return value == null ? null : ((FaceAttributeType)value).ToSerializedValue();
 58        }
 59
 60        internal static string ToSerializedValue(this FaceAttributeType value)
 61        {
 62            switch( value )
 63            {
 64                case FaceAttributeType.Age:
 065                    return "age";
 66                case FaceAttributeType.Gender:
 067                    return "gender";
 68                case FaceAttributeType.HeadPose:
 069                    return "headPose";
 70                case FaceAttributeType.Smile:
 071                    return "smile";
 72                case FaceAttributeType.FacialHair:
 073                    return "facialHair";
 74                case FaceAttributeType.Glasses:
 075                    return "glasses";
 76                case FaceAttributeType.Emotion:
 077                    return "emotion";
 78                case FaceAttributeType.Hair:
 079                    return "hair";
 80                case FaceAttributeType.Makeup:
 081                    return "makeup";
 82                case FaceAttributeType.Occlusion:
 083                    return "occlusion";
 84                case FaceAttributeType.Accessories:
 085                    return "accessories";
 86                case FaceAttributeType.Blur:
 087                    return "blur";
 88                case FaceAttributeType.Exposure:
 089                    return "exposure";
 90                case FaceAttributeType.Noise:
 091                    return "noise";
 92            }
 093            return null;
 94        }
 95
 96        internal static FaceAttributeType? ParseFaceAttributeType(this string value)
 97        {
 98            switch( value )
 99            {
 100                case "age":
 0101                    return FaceAttributeType.Age;
 102                case "gender":
 0103                    return FaceAttributeType.Gender;
 104                case "headPose":
 0105                    return FaceAttributeType.HeadPose;
 106                case "smile":
 0107                    return FaceAttributeType.Smile;
 108                case "facialHair":
 0109                    return FaceAttributeType.FacialHair;
 110                case "glasses":
 0111                    return FaceAttributeType.Glasses;
 112                case "emotion":
 0113                    return FaceAttributeType.Emotion;
 114                case "hair":
 0115                    return FaceAttributeType.Hair;
 116                case "makeup":
 0117                    return FaceAttributeType.Makeup;
 118                case "occlusion":
 0119                    return FaceAttributeType.Occlusion;
 120                case "accessories":
 0121                    return FaceAttributeType.Accessories;
 122                case "blur":
 0123                    return FaceAttributeType.Blur;
 124                case "exposure":
 0125                    return FaceAttributeType.Exposure;
 126                case "noise":
 0127                    return FaceAttributeType.Noise;
 128            }
 0129            return null;
 130        }
 131    }
 132}