internal static Components1C6O47FSchemasTasksstatePropertiesTasksPropertiesSentimentanalysistasksItemsAllof1 DeserializeComponents1C6O47FSchemasTasksstatePropertiesTasksPropertiesSentimentanalysistasksItemsAllof1(JsonElement element)
        {
            Optional <SentimentResponse> results = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("results"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    results = SentimentResponse.DeserializeSentimentResponse(property.Value);
                    continue;
                }
            }
            return(new Components1C6O47FSchemasTasksstatePropertiesTasksPropertiesSentimentanalysistasksItemsAllof1(results.Value));
        }
        internal static SentimentTaskResult DeserializeSentimentTaskResult(JsonElement element)
        {
            Optional <SentimentResponse> results = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("results"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    results = SentimentResponse.DeserializeSentimentResponse(property.Value);
                    continue;
                }
            }
            return(new SentimentTaskResult(results.Value));
        }
Пример #3
0
        internal static SentimentTaskResult DeserializeSentimentTaskResult(JsonElement element)
        {
            SentimentResponse          results = default;
            AnalyzeTextTaskResultsKind kind    = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("results"))
                {
                    results = SentimentResponse.DeserializeSentimentResponse(property.Value);
                    continue;
                }
                if (property.NameEquals("kind"))
                {
                    kind = new AnalyzeTextTaskResultsKind(property.Value.GetString());
                    continue;
                }
            }
            return(new SentimentTaskResult(kind, results));
        }
        internal static SentimentLROResult DeserializeSentimentLROResult(JsonElement element)
        {
            SentimentResponse            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 = SentimentResponse.DeserializeSentimentResponse(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 SentimentLROResult(lastUpdateDateTime, status, kind, taskName.Value, results));
        }
Пример #5
0
        internal static TasksStateTasksSentimentAnalysisTasksItem DeserializeTasksStateTasksSentimentAnalysisTasksItem(JsonElement element)
        {
            Optional <SentimentResponse> 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 = SentimentResponse.DeserializeSentimentResponse(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 TasksStateTasksSentimentAnalysisTasksItem(lastUpdateDateTime, name.Value, status, results.Value));
        }