Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/textanalytics/azure-ai-textanalytics/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "java",
"TagPrefix": "java/textanalytics/azure-ai-textanalytics",
"Tag": "java/textanalytics/azure-ai-textanalytics_fbd1568119"
"Tag": "java/textanalytics/azure-ai-textanalytics_15b7c8efde"
Comment thread
mssfang marked this conversation as resolved.
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -30,65 +30,79 @@
import com.azure.core.util.serializer.SerializerAdapter;
import reactor.core.publisher.Mono;

/** Initializes a new instance of the MicrosoftCognitiveLanguageServiceTextAnalysis type. */
/**
* Initializes a new instance of the MicrosoftCognitiveLanguageServiceTextAnalysis type.
*/
public final class MicrosoftCognitiveLanguageServiceTextAnalysisImpl {
/** The proxy service used to perform REST calls. */
/**
* The proxy service used to perform REST calls.
*/
private final MicrosoftCognitiveLanguageServiceTextAnalysisService service;

/** Supported Cognitive Services endpoint (e.g., https://<resource-name>.api.cognitiveservices.azure.com). */
/**
* Supported Cognitive Services endpoint (e.g., https://<resource-name>.api.cognitiveservices.azure.com).
*/
private final String endpoint;

/**
* Gets Supported Cognitive Services endpoint (e.g., https://<resource-name>.api.cognitiveservices.azure.com).
*
*
* @return the endpoint value.
*/
public String getEndpoint() {
return this.endpoint;
}

/** Api Version. */
/**
* Api Version.
*/
private final String apiVersion;

/**
* Gets Api Version.
*
*
* @return the apiVersion value.
*/
public String getApiVersion() {
return this.apiVersion;
}

/** The HTTP pipeline to send requests through. */
/**
* The HTTP pipeline to send requests through.
*/
private final HttpPipeline httpPipeline;

/**
* Gets The HTTP pipeline to send requests through.
*
*
* @return the httpPipeline value.
*/
public HttpPipeline getHttpPipeline() {
return this.httpPipeline;
}

/** The serializer to serialize an object into a string. */
/**
* The serializer to serialize an object into a string.
*/
private final SerializerAdapter serializerAdapter;

/**
* Gets The serializer to serialize an object into a string.
*
*
* @return the serializerAdapter value.
*/
public SerializerAdapter getSerializerAdapter() {
return this.serializerAdapter;
}

/** The AnalyzeTextsImpl object to access its operations. */
/**
* The AnalyzeTextsImpl object to access its operations.
*/
private final AnalyzeTextsImpl analyzeTexts;

/**
* Gets the AnalyzeTextsImpl object to access its operations.
*
*
* @return the AnalyzeTextsImpl object.
*/
public AnalyzeTextsImpl getAnalyzeTexts() {
Expand All @@ -97,25 +111,22 @@ public AnalyzeTextsImpl getAnalyzeTexts() {

/**
* Initializes an instance of MicrosoftCognitiveLanguageServiceTextAnalysis client.
*
*
* @param endpoint Supported Cognitive Services endpoint (e.g.,
* https://<resource-name>.api.cognitiveservices.azure.com).
* https://<resource-name>.api.cognitiveservices.azure.com).
* @param apiVersion Api Version.
*/
MicrosoftCognitiveLanguageServiceTextAnalysisImpl(String endpoint, String apiVersion) {
this(
new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(),
JacksonAdapter.createDefaultSerializerAdapter(),
endpoint,
apiVersion);
this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(),
JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion);
}

/**
* Initializes an instance of MicrosoftCognitiveLanguageServiceTextAnalysis client.
*
*
* @param httpPipeline The HTTP pipeline to send requests through.
* @param endpoint Supported Cognitive Services endpoint (e.g.,
* https://<resource-name>.api.cognitiveservices.azure.com).
* https://<resource-name>.api.cognitiveservices.azure.com).
* @param apiVersion Api Version.
*/
MicrosoftCognitiveLanguageServiceTextAnalysisImpl(HttpPipeline httpPipeline, String endpoint, String apiVersion) {
Expand All @@ -124,25 +135,22 @@ public AnalyzeTextsImpl getAnalyzeTexts() {

/**
* Initializes an instance of MicrosoftCognitiveLanguageServiceTextAnalysis client.
*
*
* @param httpPipeline The HTTP pipeline to send requests through.
* @param serializerAdapter The serializer to serialize an object into a string.
* @param endpoint Supported Cognitive Services endpoint (e.g.,
* https://<resource-name>.api.cognitiveservices.azure.com).
* https://<resource-name>.api.cognitiveservices.azure.com).
* @param apiVersion Api Version.
*/
MicrosoftCognitiveLanguageServiceTextAnalysisImpl(
HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, String apiVersion) {
MicrosoftCognitiveLanguageServiceTextAnalysisImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter,
String endpoint, String apiVersion) {
this.httpPipeline = httpPipeline;
this.serializerAdapter = serializerAdapter;
this.endpoint = endpoint;
this.apiVersion = apiVersion;
this.analyzeTexts = new AnalyzeTextsImpl(this);
this.service =
RestProxy.create(
MicrosoftCognitiveLanguageServiceTextAnalysisService.class,
this.httpPipeline,
this.getSerializerAdapter());
this.service = RestProxy.create(MicrosoftCognitiveLanguageServiceTextAnalysisService.class, this.httpPipeline,
this.getSerializerAdapter());
}

/**
Expand All @@ -153,33 +161,25 @@ public AnalyzeTextsImpl getAnalyzeTexts() {
@ServiceInterface(name = "MicrosoftCognitiveLa")
public interface MicrosoftCognitiveLanguageServiceTextAnalysisService {
@Post("/:analyze-text")
@ExpectedResponses({200})
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ErrorResponseException.class)
Mono<Response<AnalyzeTextTaskResult>> analyzeText(
@HostParam("Endpoint") String endpoint,
@QueryParam("api-version") String apiVersion,
@QueryParam("showStats") Boolean showStats,
@BodyParam("application/json") AnalyzeTextTask body,
@HeaderParam("Accept") String accept,
Context context);
Mono<Response<AnalyzeTextTaskResult>> analyzeText(@HostParam("Endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @QueryParam("showStats") Boolean showStats,
@BodyParam("application/json") AnalyzeTextTask body, @HeaderParam("Accept") String accept, Context context);

@Post("/:analyze-text")
@ExpectedResponses({200})
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ErrorResponseException.class)
Response<AnalyzeTextTaskResult> analyzeTextSync(
@HostParam("Endpoint") String endpoint,
@QueryParam("api-version") String apiVersion,
@QueryParam("showStats") Boolean showStats,
@BodyParam("application/json") AnalyzeTextTask body,
@HeaderParam("Accept") String accept,
Context context);
Response<AnalyzeTextTaskResult> analyzeTextSync(@HostParam("Endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @QueryParam("showStats") Boolean showStats,
@BodyParam("application/json") AnalyzeTextTask body, @HeaderParam("Accept") String accept, Context context);
}

/**
* Request text analysis over a collection of documents.
*
* <p>Submit a collection of text documents for analysis. Specify a single unique task to be executed immediately.
*
*
* Submit a collection of text documents for analysis. Specify a single unique task to be executed immediately.
*
* @param body Collection of documents to analyze and a single task to execute.
* @param showStats (Optional) if set to true, response will contain request and document level statistics.
* @throws IllegalArgumentException thrown if parameters fail the validation.
Expand All @@ -191,16 +191,14 @@ Response<AnalyzeTextTaskResult> analyzeTextSync(
public Mono<Response<AnalyzeTextTaskResult>> analyzeTextWithResponseAsync(AnalyzeTextTask body, Boolean showStats) {
final String accept = "application/json";
return FluxUtil.withContext(
context ->
service.analyzeText(
this.getEndpoint(), this.getApiVersion(), showStats, body, accept, context));
context -> service.analyzeText(this.getEndpoint(), this.getApiVersion(), showStats, body, accept, context));
}

/**
* Request text analysis over a collection of documents.
*
* <p>Submit a collection of text documents for analysis. Specify a single unique task to be executed immediately.
*
*
* Submit a collection of text documents for analysis. Specify a single unique task to be executed immediately.
*
* @param body Collection of documents to analyze and a single task to execute.
* @param showStats (Optional) if set to true, response will contain request and document level statistics.
* @param context The context to associate with this operation.
Expand All @@ -210,17 +208,17 @@ public Mono<Response<AnalyzeTextTaskResult>> analyzeTextWithResponseAsync(Analyz
* @return the response body along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<AnalyzeTextTaskResult>> analyzeTextWithResponseAsync(
AnalyzeTextTask body, Boolean showStats, Context context) {
public Mono<Response<AnalyzeTextTaskResult>> analyzeTextWithResponseAsync(AnalyzeTextTask body, Boolean showStats,
Context context) {
final String accept = "application/json";
return service.analyzeText(this.getEndpoint(), this.getApiVersion(), showStats, body, accept, context);
}

/**
* Request text analysis over a collection of documents.
*
* <p>Submit a collection of text documents for analysis. Specify a single unique task to be executed immediately.
*
*
* Submit a collection of text documents for analysis. Specify a single unique task to be executed immediately.
*
* @param body Collection of documents to analyze and a single task to execute.
* @param showStats (Optional) if set to true, response will contain request and document level statistics.
* @throws IllegalArgumentException thrown if parameters fail the validation.
Expand All @@ -235,9 +233,9 @@ public Mono<AnalyzeTextTaskResult> analyzeTextAsync(AnalyzeTextTask body, Boolea

/**
* Request text analysis over a collection of documents.
*
* <p>Submit a collection of text documents for analysis. Specify a single unique task to be executed immediately.
*
*
* Submit a collection of text documents for analysis. Specify a single unique task to be executed immediately.
*
* @param body Collection of documents to analyze and a single task to execute.
* @param showStats (Optional) if set to true, response will contain request and document level statistics.
* @param context The context to associate with this operation.
Expand All @@ -253,9 +251,9 @@ public Mono<AnalyzeTextTaskResult> analyzeTextAsync(AnalyzeTextTask body, Boolea

/**
* Request text analysis over a collection of documents.
*
* <p>Submit a collection of text documents for analysis. Specify a single unique task to be executed immediately.
*
*
* Submit a collection of text documents for analysis. Specify a single unique task to be executed immediately.
*
* @param body Collection of documents to analyze and a single task to execute.
* @param showStats (Optional) if set to true, response will contain request and document level statistics.
* @param context The context to associate with this operation.
Expand All @@ -265,17 +263,17 @@ public Mono<AnalyzeTextTaskResult> analyzeTextAsync(AnalyzeTextTask body, Boolea
* @return the response body along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<AnalyzeTextTaskResult> analyzeTextWithResponse(
AnalyzeTextTask body, Boolean showStats, Context context) {
public Response<AnalyzeTextTaskResult> analyzeTextWithResponse(AnalyzeTextTask body, Boolean showStats,
Context context) {
final String accept = "application/json";
return service.analyzeTextSync(this.getEndpoint(), this.getApiVersion(), showStats, body, accept, context);
}

/**
* Request text analysis over a collection of documents.
*
* <p>Submit a collection of text documents for analysis. Specify a single unique task to be executed immediately.
*
*
* Submit a collection of text documents for analysis. Specify a single unique task to be executed immediately.
*
* @param body Collection of documents to analyze and a single task to execute.
* @param showStats (Optional) if set to true, response will contain request and document level statistics.
* @throws IllegalArgumentException thrown if parameters fail the validation.
Expand Down
Loading