Skip to content

Commit

Permalink
feat(aws-android-sdk-translate): update models to latest (#2940)
Browse files Browse the repository at this point in the history
  • Loading branch information
awsmobilesdk committed Jun 30, 2022
1 parent ebfa9e2 commit 0bcc63c
Show file tree
Hide file tree
Showing 29 changed files with 2,223 additions and 295 deletions.
Expand Up @@ -233,18 +233,17 @@ GetTerminologyResult getTerminology(GetTerminologyRequest getTerminologyRequest)

/**
* <p>
* Creates or updates a custom terminology, depending on whether or not one
* already exists for the given terminology name. Importing a terminology
* with the same name as an existing one will merge the terminologies based
* on the chosen merge strategy. Currently, the only supported merge
* strategy is OVERWRITE, and so the imported terminology will overwrite an
* existing terminology of the same name.
* Creates or updates a custom terminology, depending on whether one already
* exists for the given terminology name. Importing a terminology with the
* same name as an existing one will merge the terminologies based on the
* chosen merge strategy. The only supported merge strategy is OVERWRITE,
* where the imported terminology overwrites the existing terminology of the
* same name.
* </p>
* <p>
* If you import a terminology that overwrites an existing one, the new
* terminology take up to 10 minutes to fully propagate and be available for
* use in a translation due to cache policies with the DataPlane service
* that performs the translations.
* terminology takes up to 10 minutes to fully propagate. After that,
* translations have access to the new terminology.
* </p>
*
* @param importTerminologyRequest
Expand All @@ -265,6 +264,30 @@ GetTerminologyResult getTerminology(GetTerminologyRequest getTerminologyRequest)
ImportTerminologyResult importTerminology(ImportTerminologyRequest importTerminologyRequest)
throws AmazonClientException, AmazonServiceException;

/**
* <p>
* Provides a list of languages (RFC-5646 codes and names) that Amazon
* Translate supports.
* </p>
*
* @param listLanguagesRequest
* @return listLanguagesResult The response from the ListLanguages service
* method, as returned by Amazon Translate.
* @throws InvalidParameterValueException
* @throws TooManyRequestsException
* @throws UnsupportedDisplayLanguageCodeException
* @throws InternalServerException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by Amazon
* Translate indicating either a problem with the data in the
* request, or a server side issue.
*/
ListLanguagesResult listLanguages(ListLanguagesRequest listLanguagesRequest)
throws AmazonClientException, AmazonServiceException;

/**
* <p>
* Provides a list of your parallel data resources in Amazon Translate.
Expand Down
Expand Up @@ -367,18 +367,17 @@ Future<GetTerminologyResult> getTerminologyAsync(GetTerminologyRequest getTermin

/**
* <p>
* Creates or updates a custom terminology, depending on whether or not one
* already exists for the given terminology name. Importing a terminology
* with the same name as an existing one will merge the terminologies based
* on the chosen merge strategy. Currently, the only supported merge
* strategy is OVERWRITE, and so the imported terminology will overwrite an
* existing terminology of the same name.
* Creates or updates a custom terminology, depending on whether one already
* exists for the given terminology name. Importing a terminology with the
* same name as an existing one will merge the terminologies based on the
* chosen merge strategy. The only supported merge strategy is OVERWRITE,
* where the imported terminology overwrites the existing terminology of the
* same name.
* </p>
* <p>
* If you import a terminology that overwrites an existing one, the new
* terminology take up to 10 minutes to fully propagate and be available for
* use in a translation due to cache policies with the DataPlane service
* that performs the translations.
* terminology takes up to 10 minutes to fully propagate. After that,
* translations have access to the new terminology.
* </p>
*
* @param importTerminologyRequest
Expand All @@ -403,18 +402,17 @@ Future<ImportTerminologyResult> importTerminologyAsync(

/**
* <p>
* Creates or updates a custom terminology, depending on whether or not one
* already exists for the given terminology name. Importing a terminology
* with the same name as an existing one will merge the terminologies based
* on the chosen merge strategy. Currently, the only supported merge
* strategy is OVERWRITE, and so the imported terminology will overwrite an
* existing terminology of the same name.
* Creates or updates a custom terminology, depending on whether one already
* exists for the given terminology name. Importing a terminology with the
* same name as an existing one will merge the terminologies based on the
* chosen merge strategy. The only supported merge strategy is OVERWRITE,
* where the imported terminology overwrites the existing terminology of the
* same name.
* </p>
* <p>
* If you import a terminology that overwrites an existing one, the new
* terminology take up to 10 minutes to fully propagate and be available for
* use in a translation due to cache policies with the DataPlane service
* that performs the translations.
* terminology takes up to 10 minutes to fully propagate. After that,
* translations have access to the new terminology.
* </p>
*
* @param importTerminologyRequest
Expand Down Expand Up @@ -442,6 +440,59 @@ Future<ImportTerminologyResult> importTerminologyAsync(
AsyncHandler<ImportTerminologyRequest, ImportTerminologyResult> asyncHandler)
throws AmazonServiceException, AmazonClientException;

/**
* <p>
* Provides a list of languages (RFC-5646 codes and names) that Amazon
* Translate supports.
* </p>
*
* @param listLanguagesRequest
* @return A Java Future object containing the response from the
* ListLanguages service method, as returned by Amazon Translate.
* @throws InvalidParameterValueException
* @throws TooManyRequestsException
* @throws UnsupportedDisplayLanguageCodeException
* @throws InternalServerException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by Amazon
* Translate indicating either a problem with the data in the
* request, or a server side issue.
*/
Future<ListLanguagesResult> listLanguagesAsync(ListLanguagesRequest listLanguagesRequest)
throws AmazonServiceException, AmazonClientException;

/**
* <p>
* Provides a list of languages (RFC-5646 codes and names) that Amazon
* Translate supports.
* </p>
*
* @param listLanguagesRequest
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the
* implementation of the four callback methods in this interface
* to process the operation result or handle the exception.
* @return A Java Future object containing the response from the
* ListLanguages service method, as returned by Amazon Translate.
* @throws InvalidParameterValueException
* @throws TooManyRequestsException
* @throws UnsupportedDisplayLanguageCodeException
* @throws InternalServerException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by Amazon
* Translate indicating either a problem with the data in the
* request, or a server side issue.
*/
Future<ListLanguagesResult> listLanguagesAsync(ListLanguagesRequest listLanguagesRequest,
AsyncHandler<ListLanguagesRequest, ListLanguagesResult> asyncHandler)
throws AmazonServiceException, AmazonClientException;

/**
* <p>
* Provides a list of your parallel data resources in Amazon Translate.
Expand Down
Expand Up @@ -696,18 +696,17 @@ public GetTerminologyResult call() throws Exception {

/**
* <p>
* Creates or updates a custom terminology, depending on whether or not one
* already exists for the given terminology name. Importing a terminology
* with the same name as an existing one will merge the terminologies based
* on the chosen merge strategy. Currently, the only supported merge
* strategy is OVERWRITE, and so the imported terminology will overwrite an
* existing terminology of the same name.
* Creates or updates a custom terminology, depending on whether one already
* exists for the given terminology name. Importing a terminology with the
* same name as an existing one will merge the terminologies based on the
* chosen merge strategy. The only supported merge strategy is OVERWRITE,
* where the imported terminology overwrites the existing terminology of the
* same name.
* </p>
* <p>
* If you import a terminology that overwrites an existing one, the new
* terminology take up to 10 minutes to fully propagate and be available for
* use in a translation due to cache policies with the DataPlane service
* that performs the translations.
* terminology takes up to 10 minutes to fully propagate. After that,
* translations have access to the new terminology.
* </p>
*
* @param importTerminologyRequest
Expand Down Expand Up @@ -738,18 +737,17 @@ public ImportTerminologyResult call() throws Exception {

/**
* <p>
* Creates or updates a custom terminology, depending on whether or not one
* already exists for the given terminology name. Importing a terminology
* with the same name as an existing one will merge the terminologies based
* on the chosen merge strategy. Currently, the only supported merge
* strategy is OVERWRITE, and so the imported terminology will overwrite an
* existing terminology of the same name.
* Creates or updates a custom terminology, depending on whether one already
* exists for the given terminology name. Importing a terminology with the
* same name as an existing one will merge the terminologies based on the
* chosen merge strategy. The only supported merge strategy is OVERWRITE,
* where the imported terminology overwrites the existing terminology of the
* same name.
* </p>
* <p>
* If you import a terminology that overwrites an existing one, the new
* terminology take up to 10 minutes to fully propagate and be available for
* use in a translation due to cache policies with the DataPlane service
* that performs the translations.
* terminology takes up to 10 minutes to fully propagate. After that,
* translations have access to the new terminology.
* </p>
*
* @param importTerminologyRequest
Expand Down Expand Up @@ -787,6 +785,77 @@ public ImportTerminologyResult call() throws Exception {
});
}

/**
* <p>
* Provides a list of languages (RFC-5646 codes and names) that Amazon
* Translate supports.
* </p>
*
* @param listLanguagesRequest
* @return A Java Future object containing the response from the
* ListLanguages service method, as returned by Amazon Translate.
* @throws InvalidParameterValueException
* @throws TooManyRequestsException
* @throws UnsupportedDisplayLanguageCodeException
* @throws InternalServerException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by Amazon
* Translate indicating either a problem with the data in the
* request, or a server side issue.
*/
public Future<ListLanguagesResult> listLanguagesAsync(
final ListLanguagesRequest listLanguagesRequest) throws AmazonServiceException,
AmazonClientException {
return executorService.submit(new Callable<ListLanguagesResult>() {
public ListLanguagesResult call() throws Exception {
return listLanguages(listLanguagesRequest);
}
});
}

/**
* <p>
* Provides a list of languages (RFC-5646 codes and names) that Amazon
* Translate supports.
* </p>
*
* @param listLanguagesRequest
* @return A Java Future object containing the response from the
* ListLanguages service method, as returned by Amazon Translate.
* @throws InvalidParameterValueException
* @throws TooManyRequestsException
* @throws UnsupportedDisplayLanguageCodeException
* @throws InternalServerException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by Amazon
* Translate indicating either a problem with the data in the
* request, or a server side issue.
*/
public Future<ListLanguagesResult> listLanguagesAsync(
final ListLanguagesRequest listLanguagesRequest,
final AsyncHandler<ListLanguagesRequest, ListLanguagesResult> asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable<ListLanguagesResult>() {
public ListLanguagesResult call() throws Exception {
ListLanguagesResult result = null;
try {
result = listLanguages(listLanguagesRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(listLanguagesRequest, result);
return result;
}
});
}

/**
* <p>
* Provides a list of your parallel data resources in Amazon Translate.
Expand Down
Expand Up @@ -337,6 +337,7 @@ private void init() {
jsonErrorUnmarshallers.add(new ServiceUnavailableExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new TextSizeLimitExceededExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new TooManyRequestsExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new UnsupportedDisplayLanguageCodeExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new UnsupportedLanguagePairExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new JsonErrorUnmarshaller());

Expand Down Expand Up @@ -662,18 +663,17 @@ public GetTerminologyResult getTerminology(GetTerminologyRequest getTerminologyR

/**
* <p>
* Creates or updates a custom terminology, depending on whether or not one
* already exists for the given terminology name. Importing a terminology
* with the same name as an existing one will merge the terminologies based
* on the chosen merge strategy. Currently, the only supported merge
* strategy is OVERWRITE, and so the imported terminology will overwrite an
* existing terminology of the same name.
* Creates or updates a custom terminology, depending on whether one already
* exists for the given terminology name. Importing a terminology with the
* same name as an existing one will merge the terminologies based on the
* chosen merge strategy. The only supported merge strategy is OVERWRITE,
* where the imported terminology overwrites the existing terminology of the
* same name.
* </p>
* <p>
* If you import a terminology that overwrites an existing one, the new
* terminology take up to 10 minutes to fully propagate and be available for
* use in a translation due to cache policies with the DataPlane service
* that performs the translations.
* terminology takes up to 10 minutes to fully propagate. After that,
* translations have access to the new terminology.
* </p>
*
* @param importTerminologyRequest
Expand Down Expand Up @@ -722,6 +722,56 @@ public ImportTerminologyResult importTerminology(
}
}

/**
* <p>
* Provides a list of languages (RFC-5646 codes and names) that Amazon
* Translate supports.
* </p>
*
* @param listLanguagesRequest
* @return listLanguagesResult The response from the ListLanguages service
* method, as returned by Amazon Translate.
* @throws InvalidParameterValueException
* @throws TooManyRequestsException
* @throws UnsupportedDisplayLanguageCodeException
* @throws InternalServerException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by Amazon
* Translate indicating either a problem with the data in the
* request, or a server side issue.
*/
public ListLanguagesResult listLanguages(ListLanguagesRequest listLanguagesRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(listLanguagesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request<ListLanguagesRequest> request = null;
Response<ListLanguagesResult> response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListLanguagesRequestMarshaller().marshall(listLanguagesRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller<ListLanguagesResult, JsonUnmarshallerContext> unmarshaller = new ListLanguagesResultJsonUnmarshaller();
JsonResponseHandler<ListLanguagesResult> responseHandler = new JsonResponseHandler<ListLanguagesResult>(
unmarshaller);

response = invoke(request, responseHandler, executionContext);

return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}

/**
* <p>
* Provides a list of your parallel data resources in Amazon Translate.
Expand Down

0 comments on commit 0bcc63c

Please sign in to comment.