internal static AnalyzeJobErrorsAndStatistics DeserializeAnalyzeJobErrorsAndStatistics(JsonElement element)
        {
            Optional <IReadOnlyList <TextAnalyticsErrorInternal> > errors = default;
            Optional <TextDocumentBatchStatistics> statistics             = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("errors"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <TextAnalyticsErrorInternal> array = new List <TextAnalyticsErrorInternal>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(TextAnalyticsErrorInternal.DeserializeTextAnalyticsErrorInternal(item));
                    }
                    errors = array;
                    continue;
                }
                if (property.NameEquals("statistics"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    statistics = TextDocumentBatchStatistics.DeserializeTextDocumentBatchStatistics(property.Value);
                    continue;
                }
            }
            return(new AnalyzeJobErrorsAndStatistics(Optional.ToList(errors), statistics.Value));
        }
 internal static PreBuiltResult DeserializePreBuiltResult(JsonElement element)
 {
     IList<DocumentError> errors = default;
     Optional<TextDocumentBatchStatistics> statistics = default;
     string modelVersion = default;
     foreach (var property in element.EnumerateObject())
     {
         if (property.NameEquals("errors"))
         {
             List<DocumentError> array = new List<DocumentError>();
             foreach (var item in property.Value.EnumerateArray())
             {
                 array.Add(DocumentError.DeserializeDocumentError(item));
             }
             errors = array;
             continue;
         }
         if (property.NameEquals("statistics"))
         {
             if (property.Value.ValueKind == JsonValueKind.Null)
             {
                 property.ThrowNonNullablePropertyIsNull();
                 continue;
             }
             statistics = TextDocumentBatchStatistics.DeserializeTextDocumentBatchStatistics(property.Value);
             continue;
         }
         if (property.NameEquals("modelVersion"))
         {
             modelVersion = property.Value.GetString();
             continue;
         }
     }
     return new PreBuiltResult(errors, statistics.Value, modelVersion);
 }
 internal SentimentResponse(IReadOnlyList <DocumentSentimentInternal> documents, IReadOnlyList <DocumentError> errors, TextDocumentBatchStatistics statistics, string modelVersion)
 {
     Documents    = documents;
     Errors       = errors;
     Statistics   = statistics;
     ModelVersion = modelVersion;
 }
Exemplo n.º 4
0
 internal ExtractiveSummarizationResult(IReadOnlyList <ExtractedDocumentSummary> documents, IReadOnlyList <DocumentError> errors, TextDocumentBatchStatistics statistics, string modelVersion)
 {
     Documents    = documents;
     Errors       = errors;
     Statistics   = statistics;
     ModelVersion = modelVersion;
 }
 internal EntityLinkingResult(IReadOnlyList <DocumentLinkedEntities> documents, IReadOnlyList <DocumentError> errors, TextDocumentBatchStatistics statistics, string modelVersion)
 {
     Documents    = documents;
     Errors       = errors;
     Statistics   = statistics;
     ModelVersion = modelVersion;
 }
Exemplo n.º 6
0
 internal CustomResult(IList <DocumentError> errors, TextDocumentBatchStatistics statistics, string projectName, string deploymentName)
 {
     Errors         = errors;
     Statistics     = statistics;
     ProjectName    = projectName;
     DeploymentName = deploymentName;
 }
 internal AnalyzeJobState(DateTimeOffset createdDateTime, DateTimeOffset?expirationDateTime, string jobId, DateTimeOffset lastUpdateDateTime, TextAnalyticsOperationStatus status, string displayName, AnalyzeTasks tasks, IReadOnlyList <TextAnalyticsErrorInternal> errors, TextDocumentBatchStatistics statistics, string nextLink) : base(createdDateTime, expirationDateTime, jobId, lastUpdateDateTime, status, displayName)
 {
     Tasks      = tasks;
     Errors     = errors;
     Statistics = statistics;
     NextLink   = nextLink;
 }
 internal HealthcareResult(IReadOnlyList <DocumentHealthcareEntitiesInternal> documents, IReadOnlyList <DocumentError> errors, TextDocumentBatchStatistics statistics, string modelVersion)
 {
     Documents    = documents;
     Errors       = errors;
     Statistics   = statistics;
     ModelVersion = modelVersion;
 }
Exemplo n.º 9
0
 internal LanguageResult(IReadOnlyList <DocumentLanguage> documents, IReadOnlyList <DocumentError> errors, TextDocumentBatchStatistics statistics, string modelVersion)
 {
     Documents    = documents;
     Errors       = errors;
     Statistics   = statistics;
     ModelVersion = modelVersion;
 }
 internal CustomEntitiesResult(IReadOnlyList <DocumentEntities> documents, IReadOnlyList <DocumentError> errors, TextDocumentBatchStatistics statistics, string projectName, string deploymentName)
 {
     Documents      = documents;
     Errors         = errors;
     Statistics     = statistics;
     ProjectName    = projectName;
     DeploymentName = deploymentName;
 }
 internal CustomMultiClassificationResult(IReadOnlyList <MultiClassificationDocument> documents, IReadOnlyList <DocumentError> errors, TextDocumentBatchStatistics statistics, string projectName, string deploymentName)
 {
     Documents      = documents;
     Errors         = errors;
     Statistics     = statistics;
     ProjectName    = projectName;
     DeploymentName = deploymentName;
 }
Exemplo n.º 12
0
        internal static CustomMultiClassificationResult DeserializeCustomMultiClassificationResult(JsonElement element)
        {
            IReadOnlyList <MultiClassificationDocument> documents = default;
            IReadOnlyList <DocumentError>          errors         = default;
            Optional <TextDocumentBatchStatistics> statistics     = default;
            string projectName    = default;
            string deploymentName = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("documents"))
                {
                    List <MultiClassificationDocument> array = new List <MultiClassificationDocument>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(MultiClassificationDocument.DeserializeMultiClassificationDocument(item));
                    }
                    documents = array;
                    continue;
                }
                if (property.NameEquals("errors"))
                {
                    List <DocumentError> array = new List <DocumentError>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(DocumentError.DeserializeDocumentError(item));
                    }
                    errors = array;
                    continue;
                }
                if (property.NameEquals("statistics"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    statistics = TextDocumentBatchStatistics.DeserializeTextDocumentBatchStatistics(property.Value);
                    continue;
                }
                if (property.NameEquals("projectName"))
                {
                    projectName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("deploymentName"))
                {
                    deploymentName = property.Value.GetString();
                    continue;
                }
            }
            return(new CustomMultiClassificationResult(documents, errors, statistics.Value, projectName, deploymentName));
        }
Exemplo n.º 13
0
        internal static ExtractiveSummarizationResult DeserializeExtractiveSummarizationResult(JsonElement element)
        {
            IReadOnlyList <ExtractedDocumentSummary> documents  = default;
            IReadOnlyList <DocumentError>            errors     = default;
            Optional <TextDocumentBatchStatistics>   statistics = default;
            string modelVersion = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("documents"))
                {
                    List <ExtractedDocumentSummary> array = new List <ExtractedDocumentSummary>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ExtractedDocumentSummary.DeserializeExtractedDocumentSummary(item));
                    }
                    documents = array;
                    continue;
                }
                if (property.NameEquals("errors"))
                {
                    List <DocumentError> array = new List <DocumentError>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(DocumentError.DeserializeDocumentError(item));
                    }
                    errors = array;
                    continue;
                }
                if (property.NameEquals("statistics"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    statistics = TextDocumentBatchStatistics.DeserializeTextDocumentBatchStatistics(property.Value);
                    continue;
                }
                if (property.NameEquals("modelVersion"))
                {
                    modelVersion = property.Value.GetString();
                    continue;
                }
            }
            return(new ExtractiveSummarizationResult(documents, errors, statistics.Value, modelVersion));
        }
Exemplo n.º 14
0
        internal static AnalyzeTextJobStatistics DeserializeAnalyzeTextJobStatistics(JsonElement element)
        {
            Optional <TextDocumentBatchStatistics> statistics = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("statistics"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    statistics = TextDocumentBatchStatistics.DeserializeTextDocumentBatchStatistics(property.Value);
                    continue;
                }
            }
            return(new AnalyzeTextJobStatistics(statistics.Value));
        }
Exemplo n.º 15
0
        internal static LanguageResult DeserializeLanguageResult(JsonElement element)
        {
            IReadOnlyList <DocumentLanguage>       documents  = default;
            IReadOnlyList <DocumentError>          errors     = default;
            Optional <TextDocumentBatchStatistics> statistics = default;
            string modelVersion = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("documents"))
                {
                    List <DocumentLanguage> array = new List <DocumentLanguage>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(DocumentLanguage.DeserializeDocumentLanguage(item));
                    }
                    documents = array;
                    continue;
                }
                if (property.NameEquals("errors"))
                {
                    List <DocumentError> array = new List <DocumentError>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(DocumentError.DeserializeDocumentError(item));
                    }
                    errors = array;
                    continue;
                }
                if (property.NameEquals("statistics"))
                {
                    statistics = TextDocumentBatchStatistics.DeserializeTextDocumentBatchStatistics(property.Value);
                    continue;
                }
                if (property.NameEquals("modelVersion"))
                {
                    modelVersion = property.Value.GetString();
                    continue;
                }
            }
            return(new LanguageResult(documents, errors, statistics.Value, modelVersion));
        }
Exemplo n.º 16
0
 internal EntitiesResult(IList <DocumentError> errors, TextDocumentBatchStatistics statistics, string modelVersion, IList <EntitiesResultDocumentsItem> documents) : base(errors, statistics, modelVersion)
 {
     Documents = documents;
 }
Exemplo n.º 17
0
 internal AnalyzeJobErrorsAndStatistics(IReadOnlyList <TextAnalyticsErrorInternal> errors, TextDocumentBatchStatistics statistics)
 {
     Errors     = errors;
     Statistics = statistics;
 }
Exemplo n.º 18
0
        internal static AnalyzeJobState DeserializeAnalyzeJobState(JsonElement element)
        {
            AnalyzeTasks tasks = default;
            Optional <IReadOnlyList <TextAnalyticsErrorInternal> > errors = default;
            Optional <TextDocumentBatchStatistics> statistics             = default;
            Optional <string>         nextLink           = default;
            Optional <string>         displayName        = default;
            DateTimeOffset            createdDateTime    = default;
            Optional <DateTimeOffset> expirationDateTime = default;
            string         jobId = default;
            DateTimeOffset lastUpdateDateTime   = default;
            TextAnalyticsOperationStatus status = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("tasks"))
                {
                    tasks = AnalyzeTasks.DeserializeAnalyzeTasks(property.Value);
                    continue;
                }
                if (property.NameEquals("errors"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <TextAnalyticsErrorInternal> array = new List <TextAnalyticsErrorInternal>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(TextAnalyticsErrorInternal.DeserializeTextAnalyticsErrorInternal(item));
                    }
                    errors = array;
                    continue;
                }
                if (property.NameEquals("statistics"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    statistics = TextDocumentBatchStatistics.DeserializeTextDocumentBatchStatistics(property.Value);
                    continue;
                }
                if (property.NameEquals("@nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("displayName"))
                {
                    displayName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("createdDateTime"))
                {
                    createdDateTime = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("expirationDateTime"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    expirationDateTime = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("jobId"))
                {
                    jobId = 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 AnalyzeJobState(createdDateTime, Optional.ToNullable(expirationDateTime), jobId, lastUpdateDateTime, status, displayName.Value, tasks, Optional.ToList(errors), statistics.Value, nextLink.Value));
        }
 internal ExtractiveSummarizationResult(IList <DocumentError> errors, TextDocumentBatchStatistics statistics, string modelVersion, IList <ExtractiveSummarizationResultDocumentsItem> documents) : base(errors, statistics, modelVersion)
 {
     Documents = documents;
 }
Exemplo n.º 20
0
 internal AnalyzeTextJobState(string displayName, DateTimeOffset createdDateTime, DateTimeOffset?expirationDateTime, Guid jobId, DateTimeOffset lastUpdateDateTime, TextAnalyticsOperationStatus status, IReadOnlyList <Error> errors, string nextLink, AnalyzeTasks tasks, TextDocumentBatchStatistics statistics) : base(displayName, createdDateTime, expirationDateTime, jobId, lastUpdateDateTime, status, errors, nextLink)
 {
     Tasks      = tasks;
     Statistics = statistics;
 }
Exemplo n.º 21
0
 internal AnalyzeTextJobStatistics(TextDocumentBatchStatistics statistics)
 {
     Statistics = statistics;
 }
Exemplo n.º 22
0
 internal CustomEntitiesResult(IList <DocumentError> errors, TextDocumentBatchStatistics statistics, string projectName, string deploymentName, IList <CustomEntitiesResultDocumentsItem> documents) : base(errors, statistics, projectName, deploymentName)
 {
     Documents = documents;
 }
 internal CustomMultiLabelClassificationResult(IList <DocumentError> errors, TextDocumentBatchStatistics statistics, string projectName, string deploymentName, IList <CustomMultiLabelClassificationResultDocumentsItem> documents) : base(errors, statistics, projectName, deploymentName)
 {
     Documents = documents;
 }
Exemplo n.º 24
0
 internal PreBuiltResult(IList <DocumentError> errors, TextDocumentBatchStatistics statistics, string modelVersion)
 {
     Errors       = errors;
     Statistics   = statistics;
     ModelVersion = modelVersion;
 }
Exemplo n.º 25
0
 internal SentimentResponse(IList <DocumentError> errors, TextDocumentBatchStatistics statistics, string modelVersion, IList <SentimentResponseDocumentsItem> documents) : base(errors, statistics, modelVersion)
 {
     Documents = documents;
 }
Exemplo n.º 26
0
 internal LanguageDetectionResult(IList <DocumentError> errors, TextDocumentBatchStatistics statistics, string modelVersion, IList <LanguageDetectionDocumentResult> documents) : base(errors, statistics, modelVersion)
 {
     Documents = documents;
 }