Skip to content

Commit

Permalink
regenerate without any changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mssfang committed Aug 3, 2022
1 parent 74f940e commit 31d2099
Show file tree
Hide file tree
Showing 26 changed files with 747 additions and 203 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ public final class AnalyzeTextsImpl {
private final AnalyzeTextsService service;

/** The service client containing this operation class. */
private final MicrosoftCognitiveLanguageServiceImpl client;
private final MicrosoftCognitiveLanguageServiceTextAnalysisImpl client;

/**
* Initializes an instance of AnalyzeTextsImpl.
*
* @param client the instance of the service client containing this operation class.
*/
public AnalyzeTextsImpl(MicrosoftCognitiveLanguageServiceImpl client) {
AnalyzeTextsImpl(MicrosoftCognitiveLanguageServiceTextAnalysisImpl client) {
this.service =
RestProxy.create(AnalyzeTextsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
this.client = client;
}

/**
* The interface defining all the services for MicrosoftCognitiveLanguageServiceAnalyzeTexts to be used by the proxy
* service to perform REST calls.
* The interface defining all the services for MicrosoftCognitiveLanguageServiceTextAnalysisAnalyzeTexts to be used
* by the proxy service to perform REST calls.
*/
@Host("{Endpoint}/language")
@ServiceInterface(name = "MicrosoftCognitiveLa")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.ai.textanalytics.implementation;

import com.azure.ai.textanalytics.implementation.models.AnalyzeTextTask;
import com.azure.ai.textanalytics.implementation.models.AnalyzeTextTaskResult;
import com.azure.ai.textanalytics.implementation.models.ErrorResponseException;
import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.Post;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.policy.CookiePolicy;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.util.Context;
import com.azure.core.util.serializer.JacksonAdapter;
import com.azure.core.util.serializer.SerializerAdapter;
import reactor.core.publisher.Mono;

/** Initializes a new instance of the MicrosoftCognitiveLanguageServiceTextAnalysis type. */
public final class MicrosoftCognitiveLanguageServiceTextAnalysisImpl {
/** 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). */
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. */
private final String apiVersion;

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

/** 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. */
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. */
private final AnalyzeTextsImpl analyzeTexts;

/**
* Gets the AnalyzeTextsImpl object to access its operations.
*
* @return the AnalyzeTextsImpl object.
*/
public AnalyzeTextsImpl getAnalyzeTexts() {
return this.analyzeTexts;
}

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

/**
* 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).
* @param apiVersion Api Version.
*/
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());
}

/**
* The interface defining all the services for MicrosoftCognitiveLanguageServiceTextAnalysis to be used by the proxy
* service to perform REST calls.
*/
@Host("{Endpoint}/language")
@ServiceInterface(name = "MicrosoftCognitiveLa")
public interface MicrosoftCognitiveLanguageServiceTextAnalysisService {
@Post("/:analyze-text")
@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);
}

/**
* 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.
*
* @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.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ErrorResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @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) {
final String accept = "application/json";
return service.analyzeText(this.getEndpoint(), this.getApiVersion(), showStats, body, accept, context);
}
}
Loading

0 comments on commit 31d2099

Please sign in to comment.