public CustomEntityRecognitionLROResult(DateTimeOffset lastUpdateDateTime, TextAnalyticsOperationStatus status, CustomEntitiesResult results) : base(lastUpdateDateTime, status) { if (results == null) { throw new ArgumentNullException(nameof(results)); } Results = results; Kind = AnalyzeTextLROResultsKind.CustomEntityRecognitionLROResults; }
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)); }
internal CustomEntityRecognitionLROResult(DateTimeOffset lastUpdateDateTime, TextAnalyticsOperationStatus status, AnalyzeTextLROResultsKind kind, string taskName, CustomEntitiesResult results) : base(lastUpdateDateTime, status, kind, taskName) { Results = results; Kind = kind; }