| | 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.Text.Json; |
| | 9 | | using Azure.Core; |
| | 10 | |
|
| | 11 | | namespace Azure.AI.TextAnalytics.Models |
| | 12 | | { |
| | 13 | | internal partial class SentimentConfidenceScorePerLabel |
| | 14 | | { |
| | 15 | | internal static SentimentConfidenceScorePerLabel DeserializeSentimentConfidenceScorePerLabel(JsonElement element |
| | 16 | | { |
| 0 | 17 | | double positive = default; |
| 0 | 18 | | double neutral = default; |
| 0 | 19 | | double negative = default; |
| 0 | 20 | | foreach (var property in element.EnumerateObject()) |
| | 21 | | { |
| 0 | 22 | | if (property.NameEquals("positive")) |
| | 23 | | { |
| 0 | 24 | | positive = property.Value.GetDouble(); |
| 0 | 25 | | continue; |
| | 26 | | } |
| 0 | 27 | | if (property.NameEquals("neutral")) |
| | 28 | | { |
| 0 | 29 | | neutral = property.Value.GetDouble(); |
| 0 | 30 | | continue; |
| | 31 | | } |
| 0 | 32 | | if (property.NameEquals("negative")) |
| | 33 | | { |
| 0 | 34 | | negative = property.Value.GetDouble(); |
| | 35 | | continue; |
| | 36 | | } |
| | 37 | | } |
| 0 | 38 | | return new SentimentConfidenceScorePerLabel(positive, neutral, negative); |
| | 39 | | } |
| | 40 | | } |
| | 41 | | } |