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

            Results = results;
            Kind    = AnalyzeTextLROResultsKind.CustomEntityRecognitionLROResults;
        }
コード例 #2
0
        internal static CustomEntitiesTaskResult DeserializeCustomEntitiesTaskResult(JsonElement element)
        {
            Optional <CustomEntitiesResult> results = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("results"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    results = CustomEntitiesResult.DeserializeCustomEntitiesResult(property.Value);
                    continue;
                }
            }
            return(new CustomEntitiesTaskResult(results.Value));
        }
        internal static CustomEntityRecognitionLROResult DeserializeCustomEntityRecognitionLROResult(JsonElement element)
        {
            CustomEntitiesResult         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 = CustomEntitiesResult.DeserializeCustomEntitiesResult(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 CustomEntityRecognitionLROResult(lastUpdateDateTime, status, kind, taskName.Value, results));
        }
コード例 #4
0
 internal CustomEntityRecognitionLROResult(DateTimeOffset lastUpdateDateTime, TextAnalyticsOperationStatus status, AnalyzeTextLROResultsKind kind, string taskName, CustomEntitiesResult results) : base(lastUpdateDateTime, status, kind, taskName)
 {
     Results = results;
     Kind    = kind;
 }