Skip to content

Commit

Permalink
[TA] Merge latest Beta version to main (Azure#30394)
Browse files Browse the repository at this point in the history
* [TA] Regenerated based on the new swagger 2022-05-01 (Azure#29479)

* regenerate without any changes

* [TA] Fixed incompatible changes after using the latest swagger SHA (Azure#30278)

* [TA] Added Bespoke methods to SDK (Azure#29589)

* record bespoke methods (Azure#30407)
  • Loading branch information
mssfang authored Aug 11, 2022
1 parent 1d5e372 commit f68a9bf
Show file tree
Hide file tree
Showing 376 changed files with 6,649 additions and 6,246 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ the main ServiceBusClientBuilder. -->
<suppress checks="VisibilityModifier" files="com.azure.search.documents.indexes.FieldBuilderTests.java"/>

<!-- Suppression for bug https://github.com/checkstyle/checkstyle/issues/11001 -->
<suppress checks="ParenPad" files="com.azure.ai.textanalytics.TextAnalyticsClientTestBase" lines="1002, 1006"/>
<suppress checks="ParenPad" files="com.azure.ai.textanalytics.TextAnalyticsClientTestBase" lines="970, 974"/>

<!-- These APIs have already leaked implementation and cannot be changed -->
<suppress checks="com.azure.tools.checkstyle.checks.NoImplInPublicAPI" files="com.azure.messaging.eventhubs.LogPartitionProcessor"/>
Expand Down
9 changes: 9 additions & 0 deletions sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@
## 5.2.0-beta.4 (Unreleased)

### Features Added
- Added bespoke methods for the custom entity recognition, and single-label and multi-label classification features,
such as, `beginRecognizeCustomEntities()`, `beginSingleLabelClassify()` and `beginMultiLabelClassify()`.

### Breaking Changes
- Removed support for `Healthcare FHIR`, and `Extractive Summarization` features.
- Renamed
`SingleCategoryClassifyAction` to `SingleLabelClassifyAction`,
`MultiCategoryClassifyAction` to `MultiLabelClassifyAction`.
- Merged
`SingleCategoryClassifyResultCollection` and `SingleCategoryClassifyResultCollection` to `ClassifyDocumentResultCollection`,
`MultiCategoryClassifyResult` and `SingleCategoryClassifyResult` to `ClassifyDocumentResult`.

### Bugs Fixed

Expand Down
3 changes: 2 additions & 1 deletion sdk/textanalytics/azure-ai-textanalytics/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
<!-- Configures the Java 9+ run to perform the required module exports, opens, and reads that are necessary for testing but shouldn't be part of the module-info. -->
<javaModulesSurefireArgLine>
--add-exports com.azure.core/com.azure.core.implementation.http=ALL-UNNAMED
--add-exports com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED
--add-opens com.azure.ai.textanalytics/com.azure.ai.textanalytics=ALL-UNNAMED
--add-exports com.azure.core/com.azure.core.implementation.http=ALL-UNNAMED
--add-opens com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED
</javaModulesSurefireArgLine>
</properties>

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import com.azure.ai.textanalytics.implementation.models.AnalyzeTextsCancelJobHeaders;
import com.azure.ai.textanalytics.implementation.models.CancelHealthJobHeaders;
import com.azure.ai.textanalytics.implementation.models.Error;
import com.azure.ai.textanalytics.implementation.models.FhirVersion;
import com.azure.ai.textanalytics.implementation.models.HealthcareJobState;
import com.azure.ai.textanalytics.implementation.models.HealthcareLROResult;
import com.azure.ai.textanalytics.implementation.models.HealthcareLROTask;
Expand All @@ -24,6 +23,7 @@
import com.azure.ai.textanalytics.implementation.models.MultiLanguageAnalysisInput;
import com.azure.ai.textanalytics.implementation.models.MultiLanguageBatchInput;
import com.azure.ai.textanalytics.implementation.models.RequestStatistics;
import com.azure.ai.textanalytics.implementation.models.State;
import com.azure.ai.textanalytics.implementation.models.StringIndexType;
import com.azure.ai.textanalytics.models.AnalyzeHealthcareEntitiesOperationDetail;
import com.azure.ai.textanalytics.models.AnalyzeHealthcareEntitiesOptions;
Expand Down Expand Up @@ -62,8 +62,11 @@
import static com.azure.ai.textanalytics.implementation.Utility.parseNextLink;
import static com.azure.ai.textanalytics.implementation.Utility.parseOperationId;
import static com.azure.ai.textanalytics.implementation.Utility.toAnalyzeHealthcareEntitiesResultCollection;
import static com.azure.ai.textanalytics.implementation.Utility.toFhirVersion;
import static com.azure.ai.textanalytics.implementation.Utility.toMultiLanguageInput;
import static com.azure.ai.textanalytics.implementation.models.State.CANCELLED;
import static com.azure.ai.textanalytics.implementation.models.State.NOT_STARTED;
import static com.azure.ai.textanalytics.implementation.models.State.RUNNING;
import static com.azure.ai.textanalytics.implementation.models.State.SUCCEEDED;
import static com.azure.core.util.FluxUtil.monoError;
import static com.azure.core.util.tracing.Tracer.AZ_TRACING_NAMESPACE_KEY;

Expand Down Expand Up @@ -94,7 +97,6 @@ class AnalyzeHealthcareEntityAsyncClient {
final StringIndexType finalStringIndexType = StringIndexType.UTF16CODE_UNIT;
final String finalModelVersion = options.getModelVersion();
final boolean finalLoggingOptOut = options.isServiceLogsDisabled();
final FhirVersion finalFhirVersion = toFhirVersion(options.getFhirVersion());

if (service != null) {
return new PollerFlux<>(
Expand All @@ -107,10 +109,9 @@ class AnalyzeHealthcareEntityAsyncClient {
.setTasks(Arrays.asList(
new HealthcareLROTask().setParameters(
new HealthcareTaskParameters()
.setFhirVersion(finalFhirVersion)
.setStringIndexType(finalStringIndexType)
.setModelVersion(finalModelVersion)
.setLoggingOptOut(finalLoggingOptOut)))),
.setStringIndexType(finalStringIndexType)
.setModelVersion(finalModelVersion)
.setLoggingOptOut(finalLoggingOptOut)))),
finalContext)
.map(healthResponse -> {
final AnalyzeHealthcareEntitiesOperationDetail operationDetail =
Expand Down Expand Up @@ -169,7 +170,6 @@ class AnalyzeHealthcareEntityAsyncClient {
final StringIndexType finalStringIndexType = StringIndexType.UTF16CODE_UNIT;
final String finalModelVersion = options.getModelVersion();
final boolean finalLoggingOptOut = options.isServiceLogsDisabled();
final FhirVersion finalFhirVersion = toFhirVersion(options.getFhirVersion());

if (service != null) {
return new PollerFlux<>(
Expand All @@ -182,10 +182,9 @@ class AnalyzeHealthcareEntityAsyncClient {
.setTasks(Arrays.asList(
new HealthcareLROTask().setParameters(
new HealthcareTaskParameters()
.setFhirVersion(finalFhirVersion)
.setStringIndexType(finalStringIndexType)
.setModelVersion(finalModelVersion)
.setLoggingOptOut(finalLoggingOptOut)))),
.setStringIndexType(finalStringIndexType)
.setModelVersion(finalModelVersion)
.setLoggingOptOut(finalLoggingOptOut)))),
finalContext)
.map(healthResponse -> {
final AnalyzeHealthcareEntitiesOperationDetail operationDetail =
Expand Down Expand Up @@ -491,21 +490,16 @@ private Mono<PollResponse<AnalyzeHealthcareEntitiesOperationDetail>> processAnal
Response<HealthcareJobState> analyzeOperationResultResponse,
PollResponse<AnalyzeHealthcareEntitiesOperationDetail> operationResultPollResponse) {
LongRunningOperationStatus status;
switch (analyzeOperationResultResponse.getValue().getStatus()) {
case NOT_STARTED:
case RUNNING:
status = LongRunningOperationStatus.IN_PROGRESS;
break;
case SUCCEEDED:
status = LongRunningOperationStatus.SUCCESSFULLY_COMPLETED;
break;
case CANCELLED:
status = LongRunningOperationStatus.USER_CANCELLED;
break;
default:
status = LongRunningOperationStatus.fromString(
analyzeOperationResultResponse.getValue().getStatus().toString(), true);
break;
State state = analyzeOperationResultResponse.getValue().getStatus();
if (NOT_STARTED.equals(state) || RUNNING.equals(state)) {
status = LongRunningOperationStatus.IN_PROGRESS;
} else if (SUCCEEDED.equals(state)) {
status = LongRunningOperationStatus.SUCCESSFULLY_COMPLETED;
} else if (CANCELLED.equals(state)) {
status = LongRunningOperationStatus.USER_CANCELLED;
} else {
status = LongRunningOperationStatus.fromString(
analyzeOperationResultResponse.getValue().getStatus().toString(), true);
}

AnalyzeHealthcareEntitiesOperationDetailPropertiesHelper.setCreatedAt(operationResultPollResponse.getValue(),
Expand All @@ -521,27 +515,22 @@ private Mono<PollResponse<AnalyzeHealthcareEntitiesOperationDetail>> processAnal
Response<AnalyzeTextJobState> analyzeOperationResultResponse,
PollResponse<AnalyzeHealthcareEntitiesOperationDetail> operationResultPollResponse) {
LongRunningOperationStatus status;
switch (analyzeOperationResultResponse.getValue().getStatus()) {
case NOT_STARTED:
case RUNNING:
status = LongRunningOperationStatus.IN_PROGRESS;
break;
case SUCCEEDED:
status = LongRunningOperationStatus.SUCCESSFULLY_COMPLETED;
break;
case CANCELLED:
status = LongRunningOperationStatus.USER_CANCELLED;
break;
default:
status = LongRunningOperationStatus.fromString(
analyzeOperationResultResponse.getValue().getStatus().toString(), true);
break;
State state = analyzeOperationResultResponse.getValue().getStatus();
if (NOT_STARTED.equals(state) || RUNNING.equals(state)) {
status = LongRunningOperationStatus.IN_PROGRESS;
} else if (SUCCEEDED.equals(state)) {
status = LongRunningOperationStatus.SUCCESSFULLY_COMPLETED;
} else if (CANCELLED.equals(state)) {
status = LongRunningOperationStatus.USER_CANCELLED;
} else {
status = LongRunningOperationStatus.fromString(
analyzeOperationResultResponse.getValue().getStatus().toString(), true);
}

AnalyzeHealthcareEntitiesOperationDetailPropertiesHelper.setCreatedAt(operationResultPollResponse.getValue(),
analyzeOperationResultResponse.getValue().getCreatedDateTime());
AnalyzeHealthcareEntitiesOperationDetailPropertiesHelper.setLastModifiedAt(
operationResultPollResponse.getValue(), analyzeOperationResultResponse.getValue().getLastUpdateDateTime());
operationResultPollResponse.getValue(), analyzeOperationResultResponse.getValue().getLastUpdatedDateTime());
AnalyzeHealthcareEntitiesOperationDetailPropertiesHelper.setExpiresAt(operationResultPollResponse.getValue(),
analyzeOperationResultResponse.getValue().getExpirationDateTime());
return Mono.just(new PollResponse<>(status, operationResultPollResponse.getValue()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package com.azure.ai.textanalytics;

import com.azure.ai.textanalytics.implementation.MicrosoftCognitiveLanguageServiceImpl;
import com.azure.ai.textanalytics.implementation.MicrosoftCognitiveLanguageServiceTextAnalysisImpl;
import com.azure.ai.textanalytics.implementation.TextAnalyticsClientImpl;
import com.azure.ai.textanalytics.implementation.Utility;
import com.azure.ai.textanalytics.implementation.models.AnalyzeTextSentimentAnalysisInput;
Expand Down Expand Up @@ -36,14 +36,14 @@
class AnalyzeSentimentAsyncClient {
private final ClientLogger logger = new ClientLogger(AnalyzeSentimentAsyncClient.class);
private final TextAnalyticsClientImpl legacyService;
private final MicrosoftCognitiveLanguageServiceImpl service;
private final MicrosoftCognitiveLanguageServiceTextAnalysisImpl service;

AnalyzeSentimentAsyncClient(TextAnalyticsClientImpl legacyService) {
this.legacyService = legacyService;
this.service = null;
}

AnalyzeSentimentAsyncClient(MicrosoftCognitiveLanguageServiceImpl service) {
AnalyzeSentimentAsyncClient(MicrosoftCognitiveLanguageServiceTextAnalysisImpl service) {
this.legacyService = null;
this.service = service;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package com.azure.ai.textanalytics;

import com.azure.ai.textanalytics.implementation.MicrosoftCognitiveLanguageServiceImpl;
import com.azure.ai.textanalytics.implementation.MicrosoftCognitiveLanguageServiceTextAnalysisImpl;
import com.azure.ai.textanalytics.implementation.TextAnalyticsClientImpl;
import com.azure.ai.textanalytics.implementation.Utility;
import com.azure.ai.textanalytics.implementation.models.AnalyzeTextLanguageDetectionInput;
Expand Down Expand Up @@ -36,14 +36,14 @@
class DetectLanguageAsyncClient {
private final ClientLogger logger = new ClientLogger(DetectLanguageAsyncClient.class);
private final TextAnalyticsClientImpl legacyService;
private final MicrosoftCognitiveLanguageServiceImpl service;
private final MicrosoftCognitiveLanguageServiceTextAnalysisImpl service;

DetectLanguageAsyncClient(TextAnalyticsClientImpl legacyService) {
this.legacyService = legacyService;
this.service = null;
}

DetectLanguageAsyncClient(MicrosoftCognitiveLanguageServiceImpl service) {
DetectLanguageAsyncClient(MicrosoftCognitiveLanguageServiceTextAnalysisImpl service) {
this.legacyService = null;
this.service = service;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package com.azure.ai.textanalytics;

import com.azure.ai.textanalytics.implementation.MicrosoftCognitiveLanguageServiceImpl;
import com.azure.ai.textanalytics.implementation.MicrosoftCognitiveLanguageServiceTextAnalysisImpl;
import com.azure.ai.textanalytics.implementation.TextAnalyticsClientImpl;
import com.azure.ai.textanalytics.implementation.Utility;
import com.azure.ai.textanalytics.implementation.models.AnalyzeTextKeyPhraseExtractionInput;
Expand Down Expand Up @@ -41,14 +41,14 @@
class ExtractKeyPhraseAsyncClient {
private final ClientLogger logger = new ClientLogger(ExtractKeyPhraseAsyncClient.class);
private final TextAnalyticsClientImpl legacyService;
private final MicrosoftCognitiveLanguageServiceImpl service;
private final MicrosoftCognitiveLanguageServiceTextAnalysisImpl service;

ExtractKeyPhraseAsyncClient(TextAnalyticsClientImpl legacyService) {
this.legacyService = legacyService;
this.service = null;
}

ExtractKeyPhraseAsyncClient(MicrosoftCognitiveLanguageServiceImpl service) {
ExtractKeyPhraseAsyncClient(MicrosoftCognitiveLanguageServiceTextAnalysisImpl service) {
this.legacyService = null;
this.service = service;
}
Expand Down
Loading

0 comments on commit f68a9bf

Please sign in to comment.