internal static DocumentHealthcareEntitiesInternal DeserializeDocumentHealthcareEntitiesInternal(JsonElement element)
        {
            string id = default;
            IReadOnlyList <HealthcareEntityInternal>     entities   = default;
            IReadOnlyList <HealthcareRelationInternal>   relations  = default;
            IReadOnlyList <TextAnalyticsWarningInternal> warnings   = default;
            Optional <TextDocumentStatistics>            statistics = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("entities"))
                {
                    List <HealthcareEntityInternal> array = new List <HealthcareEntityInternal>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(HealthcareEntityInternal.DeserializeHealthcareEntityInternal(item));
                    }
                    entities = array;
                    continue;
                }
                if (property.NameEquals("relations"))
                {
                    List <HealthcareRelationInternal> array = new List <HealthcareRelationInternal>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(HealthcareRelationInternal.DeserializeHealthcareRelationInternal(item));
                    }
                    relations = array;
                    continue;
                }
                if (property.NameEquals("warnings"))
                {
                    List <TextAnalyticsWarningInternal> array = new List <TextAnalyticsWarningInternal>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(TextAnalyticsWarningInternal.DeserializeTextAnalyticsWarningInternal(item));
                    }
                    warnings = array;
                    continue;
                }
                if (property.NameEquals("statistics"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    statistics = TextDocumentStatistics.DeserializeTextDocumentStatistics(property.Value);
                    continue;
                }
            }
            return(new DocumentHealthcareEntitiesInternal(id, entities, relations, warnings, Optional.ToNullable(statistics)));
        }
示例#2
0
 internal TextAnalyticsWarning(TextAnalyticsWarningInternal warning)
 {
     WarningCode = warning.Code;
     Message     = warning.Message;
 }
示例#3
0
 internal TextAnalyticsWarning(TextAnalyticsWarningInternal warning)
     : this(warning.Code, warning.Message)
 {
 }