| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System; |
| | 9 | |
|
| | 10 | | namespace Azure.AI.TextAnalytics.Models |
| | 11 | | { |
| | 12 | | internal static class InnerErrorCodeValueExtensions |
| | 13 | | { |
| 0 | 14 | | public static string ToSerialString(this InnerErrorCodeValue value) => value switch |
| 0 | 15 | | { |
| 0 | 16 | | InnerErrorCodeValue.InvalidParameterValue => "invalidParameterValue", |
| 0 | 17 | | InnerErrorCodeValue.InvalidRequestBodyFormat => "invalidRequestBodyFormat", |
| 0 | 18 | | InnerErrorCodeValue.EmptyRequest => "emptyRequest", |
| 0 | 19 | | InnerErrorCodeValue.MissingInputRecords => "missingInputRecords", |
| 0 | 20 | | InnerErrorCodeValue.InvalidDocument => "invalidDocument", |
| 0 | 21 | | InnerErrorCodeValue.ModelVersionIncorrect => "modelVersionIncorrect", |
| 0 | 22 | | InnerErrorCodeValue.InvalidDocumentBatch => "invalidDocumentBatch", |
| 0 | 23 | | InnerErrorCodeValue.UnsupportedLanguageCode => "unsupportedLanguageCode", |
| 0 | 24 | | InnerErrorCodeValue.InvalidCountryHint => "invalidCountryHint", |
| 0 | 25 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown InnerErrorCodeValue value.") |
| 0 | 26 | | }; |
| | 27 | |
|
| | 28 | | public static InnerErrorCodeValue ToInnerErrorCodeValue(this string value) |
| | 29 | | { |
| 0 | 30 | | if (string.Equals(value, "invalidParameterValue", StringComparison.InvariantCultureIgnoreCase)) return Inner |
| 0 | 31 | | if (string.Equals(value, "invalidRequestBodyFormat", StringComparison.InvariantCultureIgnoreCase)) return In |
| 0 | 32 | | if (string.Equals(value, "emptyRequest", StringComparison.InvariantCultureIgnoreCase)) return InnerErrorCode |
| 0 | 33 | | if (string.Equals(value, "missingInputRecords", StringComparison.InvariantCultureIgnoreCase)) return InnerEr |
| 0 | 34 | | if (string.Equals(value, "invalidDocument", StringComparison.InvariantCultureIgnoreCase)) return InnerErrorC |
| 0 | 35 | | if (string.Equals(value, "modelVersionIncorrect", StringComparison.InvariantCultureIgnoreCase)) return Inner |
| 0 | 36 | | if (string.Equals(value, "invalidDocumentBatch", StringComparison.InvariantCultureIgnoreCase)) return InnerE |
| 0 | 37 | | if (string.Equals(value, "unsupportedLanguageCode", StringComparison.InvariantCultureIgnoreCase)) return Inn |
| 0 | 38 | | if (string.Equals(value, "invalidCountryHint", StringComparison.InvariantCultureIgnoreCase)) return InnerErr |
| 0 | 39 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown InnerErrorCodeValue value."); |
| | 40 | | } |
| | 41 | | } |
| | 42 | | } |