コード例 #1
0
        public ExtractiveSummarizationLROResult(DateTimeOffset lastUpdateDateTime, TextAnalyticsOperationStatus status, ExtractiveSummarizationResult results) : base(lastUpdateDateTime, status)
        {
            if (results == null)
            {
                throw new ArgumentNullException(nameof(results));
            }

            Results = results;
            Kind    = AnalyzeTextLROResultsKind.ExtractiveSummarizationLROResults;
        }
コード例 #2
0
        internal static ExtractiveSummarizationTaskResult DeserializeExtractiveSummarizationTaskResult(JsonElement element)
        {
            Optional <ExtractiveSummarizationResult> results = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("results"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    results = ExtractiveSummarizationResult.DeserializeExtractiveSummarizationResult(property.Value);
                    continue;
                }
            }
            return(new ExtractiveSummarizationTaskResult(results.Value));
        }
コード例 #3
0
        internal static ExtractiveSummarizationLROResult DeserializeExtractiveSummarizationLROResult(JsonElement element)
        {
            ExtractiveSummarizationResult 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 = ExtractiveSummarizationResult.DeserializeExtractiveSummarizationResult(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 ExtractiveSummarizationLROResult(lastUpdateDateTime, status, kind, taskName.Value, results));
        }
コード例 #4
0
        internal static ExtractiveSummarizationTasksItem DeserializeExtractiveSummarizationTasksItem(JsonElement element)
        {
            Optional <ExtractiveSummarizationResult> results = default;
            DateTimeOffset               lastUpdateDateTime  = default;
            Optional <string>            taskName            = default;
            TextAnalyticsOperationStatus status = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("results"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    results = ExtractiveSummarizationResult.DeserializeExtractiveSummarizationResult(property.Value);
                    continue;
                }
                if (property.NameEquals("lastUpdateDateTime"))
                {
                    lastUpdateDateTime = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("taskName"))
                {
                    taskName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("status"))
                {
                    status = new TextAnalyticsOperationStatus(property.Value.GetString());
                    continue;
                }
            }
            return(new ExtractiveSummarizationTasksItem(lastUpdateDateTime, taskName.Value, status, results.Value));
        }
コード例 #5
0
 internal ExtractiveSummarizationTasksItem(DateTimeOffset lastUpdateDateTime, string taskName, TextAnalyticsOperationStatus status, ExtractiveSummarizationResult results) : base(lastUpdateDateTime, taskName, status)
 {
     Results = results;
 }
コード例 #6
0
 internal ExtractiveSummarizationLROResult(DateTimeOffset lastUpdateDateTime, TextAnalyticsOperationStatus status, AnalyzeTextLROResultsKind kind, string taskName, ExtractiveSummarizationResult results) : base(lastUpdateDateTime, status, kind, taskName)
 {
     Results = results;
     Kind    = kind;
 }