Skip to content

Commit

Permalink
Generated from 13411c151dab802079cfcae45d36391590e14715 (#2985)
Browse files Browse the repository at this point in the history
Update readme.md
  • Loading branch information
AutorestCI authored Feb 28, 2019
1 parent 61f4dcb commit 4856661
Show file tree
Hide file tree
Showing 44 changed files with 9,327 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.cognitiveservices.translatortext;

import com.microsoft.azure.AzureClient;
import com.microsoft.rest.RestClient;

/**
* The interface for TranslatorTextClient class.
*/
public interface TranslatorTextClient {
/**
* Gets the REST client.
*
* @return the {@link RestClient} object.
*/
RestClient restClient();

/**
* Gets the {@link AzureClient} used for long running operations.
* @return the azure client;
*/
AzureClient getAzureClient();

/**
* Gets the User-Agent header for the client.
*
* @return the user agent string.
*/
String userAgent();

/**
* Gets Supported Cognitive Services endpoints.
*
* @return the endpoint value.
*/
String endpoint();

/**
* Sets Supported Cognitive Services endpoints.
*
* @param endpoint the endpoint value.
* @return the service client itself
*/
TranslatorTextClient withEndpoint(String endpoint);

/**
* Gets Version of the API requested by the client. Value must be **3.0**..
*
* @return the apiVersion value.
*/
String apiVersion();

/**
* Gets The preferred language for the response..
*
* @return the acceptLanguage value.
*/
String acceptLanguage();

/**
* Sets The preferred language for the response..
*
* @param acceptLanguage the acceptLanguage value.
* @return the service client itself
*/
TranslatorTextClient withAcceptLanguage(String acceptLanguage);

/**
* Gets The retry timeout in seconds for Long Running Operations. Default value is 30..
*
* @return the longRunningOperationRetryTimeout value.
*/
int longRunningOperationRetryTimeout();

/**
* Sets The retry timeout in seconds for Long Running Operations. Default value is 30..
*
* @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value.
* @return the service client itself
*/
TranslatorTextClient withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout);

/**
* Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true..
*
* @return the generateClientRequestId value.
*/
boolean generateClientRequestId();

/**
* Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true..
*
* @param generateClientRequestId the generateClientRequestId value.
* @return the service client itself
*/
TranslatorTextClient withGenerateClientRequestId(boolean generateClientRequestId);

/**
* Gets the Translators object to access its operations.
* @return the Translators object.
*/
Translators translators();

}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.cognitiveservices.translatortext.implementation;

import com.microsoft.azure.AzureClient;
import com.microsoft.azure.AzureServiceClient;
import com.microsoft.azure.cognitiveservices.translatortext.Translators;
import com.microsoft.azure.cognitiveservices.translatortext.TranslatorTextClient;
import com.microsoft.rest.credentials.ServiceClientCredentials;
import com.microsoft.rest.RestClient;

/**
* Initializes a new instance of the TranslatorTextClientImpl class.
*/
public class TranslatorTextClientImpl extends AzureServiceClient implements TranslatorTextClient {
/** the {@link AzureClient} used for long running operations. */
private AzureClient azureClient;

/**
* Gets the {@link AzureClient} used for long running operations.
* @return the azure client;
*/
public AzureClient getAzureClient() {
return this.azureClient;
}

/** Supported Cognitive Services endpoints. */
private String endpoint;

/**
* Gets Supported Cognitive Services endpoints.
*
* @return the endpoint value.
*/
public String endpoint() {
return this.endpoint;
}

/**
* Sets Supported Cognitive Services endpoints.
*
* @param endpoint the endpoint value.
* @return the service client itself
*/
public TranslatorTextClientImpl withEndpoint(String endpoint) {
this.endpoint = endpoint;
return this;
}

/** Version of the API requested by the client. Value must be **3.0**. */
private String apiVersion;

/**
* Gets Version of the API requested by the client. Value must be **3.0**.
*
* @return the apiVersion value.
*/
public String apiVersion() {
return this.apiVersion;
}

/** The preferred language for the response. */
private String acceptLanguage;

/**
* Gets The preferred language for the response.
*
* @return the acceptLanguage value.
*/
public String acceptLanguage() {
return this.acceptLanguage;
}

/**
* Sets The preferred language for the response.
*
* @param acceptLanguage the acceptLanguage value.
* @return the service client itself
*/
public TranslatorTextClientImpl withAcceptLanguage(String acceptLanguage) {
this.acceptLanguage = acceptLanguage;
return this;
}

/** The retry timeout in seconds for Long Running Operations. Default value is 30. */
private int longRunningOperationRetryTimeout;

/**
* Gets The retry timeout in seconds for Long Running Operations. Default value is 30.
*
* @return the longRunningOperationRetryTimeout value.
*/
public int longRunningOperationRetryTimeout() {
return this.longRunningOperationRetryTimeout;
}

/**
* Sets The retry timeout in seconds for Long Running Operations. Default value is 30.
*
* @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value.
* @return the service client itself
*/
public TranslatorTextClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) {
this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout;
return this;
}

/** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */
private boolean generateClientRequestId;

/**
* Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
*
* @return the generateClientRequestId value.
*/
public boolean generateClientRequestId() {
return this.generateClientRequestId;
}

/**
* Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
*
* @param generateClientRequestId the generateClientRequestId value.
* @return the service client itself
*/
public TranslatorTextClientImpl withGenerateClientRequestId(boolean generateClientRequestId) {
this.generateClientRequestId = generateClientRequestId;
return this;
}

/**
* The Translators object to access its operations.
*/
private Translators translators;

/**
* Gets the Translators object to access its operations.
* @return the Translators object.
*/
public Translators translators() {
return this.translators;
}

/**
* Initializes an instance of TranslatorTextClient client.
*
* @param credentials the management credentials for Azure
*/
public TranslatorTextClientImpl(ServiceClientCredentials credentials) {
this("https://{Endpoint}", credentials);
}

/**
* Initializes an instance of TranslatorTextClient client.
*
* @param baseUrl the base URL of the host
* @param credentials the management credentials for Azure
*/
private TranslatorTextClientImpl(String baseUrl, ServiceClientCredentials credentials) {
super(baseUrl, credentials);
initialize();
}

/**
* Initializes an instance of TranslatorTextClient client.
*
* @param restClient the REST client to connect to Azure.
*/
public TranslatorTextClientImpl(RestClient restClient) {
super(restClient);
initialize();
}

protected void initialize() {
this.apiVersion = "3.0";
this.acceptLanguage = "en-US";
this.longRunningOperationRetryTimeout = 30;
this.generateClientRequestId = true;
this.translators = new TranslatorsImpl(restClient().retrofit(), this);
this.azureClient = new AzureClient(this);
}

/**
* Gets the User-Agent header for the client.
*
* @return the user agent string.
*/
@Override
public String userAgent() {
return String.format("%s (%s, %s)", super.userAgent(), "TranslatorTextClient", "3.0");
}
}
Loading

0 comments on commit 4856661

Please sign in to comment.