| | 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 | |
|
| | 7 | | namespace 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 ErrorCode. |
| | 16 | | /// </summary> |
| | 17 | | [JsonConverter(typeof(StringEnumConverter))] |
| | 18 | | public enum ErrorCode |
| | 19 | | { |
| | 20 | | [EnumMember(Value = "None")] |
| | 21 | | None, |
| | 22 | | [EnumMember(Value = "ServerError")] |
| | 23 | | ServerError, |
| | 24 | | [EnumMember(Value = "InvalidRequest")] |
| | 25 | | InvalidRequest, |
| | 26 | | [EnumMember(Value = "RateLimitExceeded")] |
| | 27 | | RateLimitExceeded, |
| | 28 | | [EnumMember(Value = "InvalidAuthorization")] |
| | 29 | | InvalidAuthorization, |
| | 30 | | [EnumMember(Value = "InsufficientAuthorization")] |
| | 31 | | InsufficientAuthorization |
| | 32 | | } |
| | 33 | | internal static class ErrorCodeEnumExtension |
| | 34 | | { |
| | 35 | | internal static string ToSerializedValue(this ErrorCode? value) |
| | 36 | | { |
| 0 | 37 | | return value == null ? null : ((ErrorCode)value).ToSerializedValue(); |
| | 38 | | } |
| | 39 | |
|
| | 40 | | internal static string ToSerializedValue(this ErrorCode value) |
| | 41 | | { |
| | 42 | | switch( value ) |
| | 43 | | { |
| | 44 | | case ErrorCode.None: |
| 0 | 45 | | return "None"; |
| | 46 | | case ErrorCode.ServerError: |
| 0 | 47 | | return "ServerError"; |
| | 48 | | case ErrorCode.InvalidRequest: |
| 0 | 49 | | return "InvalidRequest"; |
| | 50 | | case ErrorCode.RateLimitExceeded: |
| 0 | 51 | | return "RateLimitExceeded"; |
| | 52 | | case ErrorCode.InvalidAuthorization: |
| 0 | 53 | | return "InvalidAuthorization"; |
| | 54 | | case ErrorCode.InsufficientAuthorization: |
| 0 | 55 | | return "InsufficientAuthorization"; |
| | 56 | | } |
| 0 | 57 | | return null; |
| | 58 | | } |
| | 59 | |
|
| | 60 | | internal static ErrorCode? ParseErrorCode(this string value) |
| | 61 | | { |
| | 62 | | switch( value ) |
| | 63 | | { |
| | 64 | | case "None": |
| 0 | 65 | | return ErrorCode.None; |
| | 66 | | case "ServerError": |
| 0 | 67 | | return ErrorCode.ServerError; |
| | 68 | | case "InvalidRequest": |
| 0 | 69 | | return ErrorCode.InvalidRequest; |
| | 70 | | case "RateLimitExceeded": |
| 0 | 71 | | return ErrorCode.RateLimitExceeded; |
| | 72 | | case "InvalidAuthorization": |
| 0 | 73 | | return ErrorCode.InvalidAuthorization; |
| | 74 | | case "InsufficientAuthorization": |
| 0 | 75 | | return ErrorCode.InsufficientAuthorization; |
| | 76 | | } |
| 0 | 77 | | return null; |
| | 78 | | } |
| | 79 | | } |
| | 80 | | } |