예제 #1
0
        internal static EntityRecognitionTasksItemProperties DeserializeEntityRecognitionTasksItemProperties(JsonElement element)
        {
            EntitiesResult results = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("results"))
                {
                    results = EntitiesResult.DeserializeEntitiesResult(property.Value);
                    continue;
                }
            }
            return(new EntityRecognitionTasksItemProperties(results));
        }
        internal static EntitiesTaskResult DeserializeEntitiesTaskResult(JsonElement element)
        {
            Optional <EntitiesResult> results = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("results"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    results = EntitiesResult.DeserializeEntitiesResult(property.Value);
                    continue;
                }
            }
            return(new EntitiesTaskResult(results.Value));
        }
예제 #3
0
        internal static Components15Gvwi3SchemasTasksstatePropertiesTasksPropertiesEntityrecognitiontasksItemsAllof1 DeserializeComponents15Gvwi3SchemasTasksstatePropertiesTasksPropertiesEntityrecognitiontasksItemsAllof1(JsonElement element)
        {
            Optional <EntitiesResult> results = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("results"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    results = EntitiesResult.DeserializeEntitiesResult(property.Value);
                    continue;
                }
            }
            return(new Components15Gvwi3SchemasTasksstatePropertiesTasksPropertiesEntityrecognitiontasksItemsAllof1(results.Value));
        }
        internal static EntitiesTaskResult DeserializeEntitiesTaskResult(JsonElement element)
        {
            EntitiesResult             results = default;
            AnalyzeTextTaskResultsKind kind    = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("results"))
                {
                    results = EntitiesResult.DeserializeEntitiesResult(property.Value);
                    continue;
                }
                if (property.NameEquals("kind"))
                {
                    kind = new AnalyzeTextTaskResultsKind(property.Value.GetString());
                    continue;
                }
            }
            return(new EntitiesTaskResult(kind, results));
        }
        internal static EntityRecognitionLROResult DeserializeEntityRecognitionLROResult(JsonElement element)
        {
            EntitiesResult               results            = default;
            AnalyzeTextLROResultsKind    kind               = default;
            Optional <string>            taskName           = default;
            DateTimeOffset               lastUpdateDateTime = default;
            TextAnalyticsOperationStatus status             = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("results"))
                {
                    results = EntitiesResult.DeserializeEntitiesResult(property.Value);
                    continue;
                }
                if (property.NameEquals("kind"))
                {
                    kind = new AnalyzeTextLROResultsKind(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("taskName"))
                {
                    taskName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("lastUpdateDateTime"))
                {
                    lastUpdateDateTime = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("status"))
                {
                    status = new TextAnalyticsOperationStatus(property.Value.GetString());
                    continue;
                }
            }
            return(new EntityRecognitionLROResult(lastUpdateDateTime, status, kind, taskName.Value, results));
        }
예제 #6
0
        internal static EntityRecognitionTasksItem DeserializeEntityRecognitionTasksItem(JsonElement element)
        {
            Optional <EntitiesResult>    results            = default;
            DateTimeOffset               lastUpdateDateTime = default;
            Optional <string>            name   = default;
            TextAnalyticsOperationStatus status = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("results"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    results = EntitiesResult.DeserializeEntitiesResult(property.Value);
                    continue;
                }
                if (property.NameEquals("lastUpdateDateTime"))
                {
                    lastUpdateDateTime = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("status"))
                {
                    status = new TextAnalyticsOperationStatus(property.Value.GetString());
                    continue;
                }
            }
            return(new EntityRecognitionTasksItem(lastUpdateDateTime, name.Value, status, results.Value));
        }