| | 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 AspectConfidenceScoreLabel |
| | 14 | | { |
| | 15 | | internal static AspectConfidenceScoreLabel DeserializeAspectConfidenceScoreLabel(JsonElement element) |
| | 16 | | { |
| 0 | 17 | | double positive = default; |
| 0 | 18 | | double negative = default; |
| 0 | 19 | | foreach (var property in element.EnumerateObject()) |
| | 20 | | { |
| 0 | 21 | | if (property.NameEquals("positive")) |
| | 22 | | { |
| 0 | 23 | | positive = property.Value.GetDouble(); |
| 0 | 24 | | continue; |
| | 25 | | } |
| 0 | 26 | | if (property.NameEquals("negative")) |
| | 27 | | { |
| 0 | 28 | | negative = property.Value.GetDouble(); |
| | 29 | | continue; |
| | 30 | | } |
| | 31 | | } |
| 0 | 32 | | return new AspectConfidenceScoreLabel(positive, negative); |
| | 33 | | } |
| | 34 | | } |
| | 35 | | } |