| | 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 SentenceSentimentValueExtensions |
| | 13 | | { |
| 0 | 14 | | public static string ToSerialString(this SentenceSentimentValue value) => value switch |
| 0 | 15 | | { |
| 0 | 16 | | SentenceSentimentValue.Positive => "positive", |
| 0 | 17 | | SentenceSentimentValue.Neutral => "neutral", |
| 0 | 18 | | SentenceSentimentValue.Negative => "negative", |
| 0 | 19 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SentenceSentimentValue value.") |
| 0 | 20 | | }; |
| | 21 | |
|
| | 22 | | public static SentenceSentimentValue ToSentenceSentimentValue(this string value) |
| | 23 | | { |
| 0 | 24 | | if (string.Equals(value, "positive", StringComparison.InvariantCultureIgnoreCase)) return SentenceSentimentV |
| 0 | 25 | | if (string.Equals(value, "neutral", StringComparison.InvariantCultureIgnoreCase)) return SentenceSentimentVa |
| 0 | 26 | | if (string.Equals(value, "negative", StringComparison.InvariantCultureIgnoreCase)) return SentenceSentimentV |
| 0 | 27 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SentenceSentimentValue value."); |
| | 28 | | } |
| | 29 | | } |
| | 30 | | } |