Skip to content

Commit 0bcc63c

Browse files
authored
feat(aws-android-sdk-translate): update models to latest (#2940)
1 parent ebfa9e2 commit 0bcc63c

29 files changed

+2223
-295
lines changed

aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/AmazonTranslate.java

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -233,18 +233,17 @@ GetTerminologyResult getTerminology(GetTerminologyRequest getTerminologyRequest)
233233

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

267+
/**
268+
* <p>
269+
* Provides a list of languages (RFC-5646 codes and names) that Amazon
270+
* Translate supports.
271+
* </p>
272+
*
273+
* @param listLanguagesRequest
274+
* @return listLanguagesResult The response from the ListLanguages service
275+
* method, as returned by Amazon Translate.
276+
* @throws InvalidParameterValueException
277+
* @throws TooManyRequestsException
278+
* @throws UnsupportedDisplayLanguageCodeException
279+
* @throws InternalServerException
280+
* @throws AmazonClientException If any internal errors are encountered
281+
* inside the client while attempting to make the request or
282+
* handle the response. For example if a network connection is
283+
* not available.
284+
* @throws AmazonServiceException If an error response is returned by Amazon
285+
* Translate indicating either a problem with the data in the
286+
* request, or a server side issue.
287+
*/
288+
ListLanguagesResult listLanguages(ListLanguagesRequest listLanguagesRequest)
289+
throws AmazonClientException, AmazonServiceException;
290+
268291
/**
269292
* <p>
270293
* Provides a list of your parallel data resources in Amazon Translate.

aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/AmazonTranslateAsync.java

Lines changed: 69 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -367,18 +367,17 @@ Future<GetTerminologyResult> getTerminologyAsync(GetTerminologyRequest getTermin
367367

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

404403
/**
405404
* <p>
406-
* Creates or updates a custom terminology, depending on whether or not one
407-
* already exists for the given terminology name. Importing a terminology
408-
* with the same name as an existing one will merge the terminologies based
409-
* on the chosen merge strategy. Currently, the only supported merge
410-
* strategy is OVERWRITE, and so the imported terminology will overwrite an
411-
* existing terminology of the same name.
405+
* Creates or updates a custom terminology, depending on whether one already
406+
* exists for the given terminology name. Importing a terminology with the
407+
* same name as an existing one will merge the terminologies based on the
408+
* chosen merge strategy. The only supported merge strategy is OVERWRITE,
409+
* where the imported terminology overwrites the existing terminology of the
410+
* same name.
412411
* </p>
413412
* <p>
414413
* If you import a terminology that overwrites an existing one, the new
415-
* terminology take up to 10 minutes to fully propagate and be available for
416-
* use in a translation due to cache policies with the DataPlane service
417-
* that performs the translations.
414+
* terminology takes up to 10 minutes to fully propagate. After that,
415+
* translations have access to the new terminology.
418416
* </p>
419417
*
420418
* @param importTerminologyRequest
@@ -442,6 +440,59 @@ Future<ImportTerminologyResult> importTerminologyAsync(
442440
AsyncHandler<ImportTerminologyRequest, ImportTerminologyResult> asyncHandler)
443441
throws AmazonServiceException, AmazonClientException;
444442

443+
/**
444+
* <p>
445+
* Provides a list of languages (RFC-5646 codes and names) that Amazon
446+
* Translate supports.
447+
* </p>
448+
*
449+
* @param listLanguagesRequest
450+
* @return A Java Future object containing the response from the
451+
* ListLanguages service method, as returned by Amazon Translate.
452+
* @throws InvalidParameterValueException
453+
* @throws TooManyRequestsException
454+
* @throws UnsupportedDisplayLanguageCodeException
455+
* @throws InternalServerException
456+
* @throws AmazonClientException If any internal errors are encountered
457+
* inside the client while attempting to make the request or
458+
* handle the response. For example if a network connection is
459+
* not available.
460+
* @throws AmazonServiceException If an error response is returned by Amazon
461+
* Translate indicating either a problem with the data in the
462+
* request, or a server side issue.
463+
*/
464+
Future<ListLanguagesResult> listLanguagesAsync(ListLanguagesRequest listLanguagesRequest)
465+
throws AmazonServiceException, AmazonClientException;
466+
467+
/**
468+
* <p>
469+
* Provides a list of languages (RFC-5646 codes and names) that Amazon
470+
* Translate supports.
471+
* </p>
472+
*
473+
* @param listLanguagesRequest
474+
* @param asyncHandler Asynchronous callback handler for events in the
475+
* life-cycle of the request. Users could provide the
476+
* implementation of the four callback methods in this interface
477+
* to process the operation result or handle the exception.
478+
* @return A Java Future object containing the response from the
479+
* ListLanguages service method, as returned by Amazon Translate.
480+
* @throws InvalidParameterValueException
481+
* @throws TooManyRequestsException
482+
* @throws UnsupportedDisplayLanguageCodeException
483+
* @throws InternalServerException
484+
* @throws AmazonClientException If any internal errors are encountered
485+
* inside the client while attempting to make the request or
486+
* handle the response. For example if a network connection is
487+
* not available.
488+
* @throws AmazonServiceException If an error response is returned by Amazon
489+
* Translate indicating either a problem with the data in the
490+
* request, or a server side issue.
491+
*/
492+
Future<ListLanguagesResult> listLanguagesAsync(ListLanguagesRequest listLanguagesRequest,
493+
AsyncHandler<ListLanguagesRequest, ListLanguagesResult> asyncHandler)
494+
throws AmazonServiceException, AmazonClientException;
495+
445496
/**
446497
* <p>
447498
* Provides a list of your parallel data resources in Amazon Translate.

aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/AmazonTranslateAsyncClient.java

Lines changed: 87 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -696,18 +696,17 @@ public GetTerminologyResult call() throws Exception {
696696

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

739738
/**
740739
* <p>
741-
* Creates or updates a custom terminology, depending on whether or not one
742-
* already exists for the given terminology name. Importing a terminology
743-
* with the same name as an existing one will merge the terminologies based
744-
* on the chosen merge strategy. Currently, the only supported merge
745-
* strategy is OVERWRITE, and so the imported terminology will overwrite an
746-
* existing terminology of the same name.
740+
* Creates or updates a custom terminology, depending on whether one already
741+
* exists for the given terminology name. Importing a terminology with the
742+
* same name as an existing one will merge the terminologies based on the
743+
* chosen merge strategy. The only supported merge strategy is OVERWRITE,
744+
* where the imported terminology overwrites the existing terminology of the
745+
* same name.
747746
* </p>
748747
* <p>
749748
* If you import a terminology that overwrites an existing one, the new
750-
* terminology take up to 10 minutes to fully propagate and be available for
751-
* use in a translation due to cache policies with the DataPlane service
752-
* that performs the translations.
749+
* terminology takes up to 10 minutes to fully propagate. After that,
750+
* translations have access to the new terminology.
753751
* </p>
754752
*
755753
* @param importTerminologyRequest
@@ -787,6 +785,77 @@ public ImportTerminologyResult call() throws Exception {
787785
});
788786
}
789787

788+
/**
789+
* <p>
790+
* Provides a list of languages (RFC-5646 codes and names) that Amazon
791+
* Translate supports.
792+
* </p>
793+
*
794+
* @param listLanguagesRequest
795+
* @return A Java Future object containing the response from the
796+
* ListLanguages service method, as returned by Amazon Translate.
797+
* @throws InvalidParameterValueException
798+
* @throws TooManyRequestsException
799+
* @throws UnsupportedDisplayLanguageCodeException
800+
* @throws InternalServerException
801+
* @throws AmazonClientException If any internal errors are encountered
802+
* inside the client while attempting to make the request or
803+
* handle the response. For example if a network connection is
804+
* not available.
805+
* @throws AmazonServiceException If an error response is returned by Amazon
806+
* Translate indicating either a problem with the data in the
807+
* request, or a server side issue.
808+
*/
809+
public Future<ListLanguagesResult> listLanguagesAsync(
810+
final ListLanguagesRequest listLanguagesRequest) throws AmazonServiceException,
811+
AmazonClientException {
812+
return executorService.submit(new Callable<ListLanguagesResult>() {
813+
public ListLanguagesResult call() throws Exception {
814+
return listLanguages(listLanguagesRequest);
815+
}
816+
});
817+
}
818+
819+
/**
820+
* <p>
821+
* Provides a list of languages (RFC-5646 codes and names) that Amazon
822+
* Translate supports.
823+
* </p>
824+
*
825+
* @param listLanguagesRequest
826+
* @return A Java Future object containing the response from the
827+
* ListLanguages service method, as returned by Amazon Translate.
828+
* @throws InvalidParameterValueException
829+
* @throws TooManyRequestsException
830+
* @throws UnsupportedDisplayLanguageCodeException
831+
* @throws InternalServerException
832+
* @throws AmazonClientException If any internal errors are encountered
833+
* inside the client while attempting to make the request or
834+
* handle the response. For example if a network connection is
835+
* not available.
836+
* @throws AmazonServiceException If an error response is returned by Amazon
837+
* Translate indicating either a problem with the data in the
838+
* request, or a server side issue.
839+
*/
840+
public Future<ListLanguagesResult> listLanguagesAsync(
841+
final ListLanguagesRequest listLanguagesRequest,
842+
final AsyncHandler<ListLanguagesRequest, ListLanguagesResult> asyncHandler)
843+
throws AmazonServiceException, AmazonClientException {
844+
return executorService.submit(new Callable<ListLanguagesResult>() {
845+
public ListLanguagesResult call() throws Exception {
846+
ListLanguagesResult result = null;
847+
try {
848+
result = listLanguages(listLanguagesRequest);
849+
} catch (Exception ex) {
850+
asyncHandler.onError(ex);
851+
throw ex;
852+
}
853+
asyncHandler.onSuccess(listLanguagesRequest, result);
854+
return result;
855+
}
856+
});
857+
}
858+
790859
/**
791860
* <p>
792861
* Provides a list of your parallel data resources in Amazon Translate.

aws-android-sdk-translate/src/main/java/com/amazonaws/services/translate/AmazonTranslateClient.java

Lines changed: 59 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ private void init() {
337337
jsonErrorUnmarshallers.add(new ServiceUnavailableExceptionUnmarshaller());
338338
jsonErrorUnmarshallers.add(new TextSizeLimitExceededExceptionUnmarshaller());
339339
jsonErrorUnmarshallers.add(new TooManyRequestsExceptionUnmarshaller());
340+
jsonErrorUnmarshallers.add(new UnsupportedDisplayLanguageCodeExceptionUnmarshaller());
340341
jsonErrorUnmarshallers.add(new UnsupportedLanguagePairExceptionUnmarshaller());
341342
jsonErrorUnmarshallers.add(new JsonErrorUnmarshaller());
342343

@@ -662,18 +663,17 @@ public GetTerminologyResult getTerminology(GetTerminologyRequest getTerminologyR
662663

663664
/**
664665
* <p>
665-
* Creates or updates a custom terminology, depending on whether or not one
666-
* already exists for the given terminology name. Importing a terminology
667-
* with the same name as an existing one will merge the terminologies based
668-
* on the chosen merge strategy. Currently, the only supported merge
669-
* strategy is OVERWRITE, and so the imported terminology will overwrite an
670-
* existing terminology of the same name.
666+
* Creates or updates a custom terminology, depending on whether one already
667+
* exists for the given terminology name. Importing a terminology with the
668+
* same name as an existing one will merge the terminologies based on the
669+
* chosen merge strategy. The only supported merge strategy is OVERWRITE,
670+
* where the imported terminology overwrites the existing terminology of the
671+
* same name.
671672
* </p>
672673
* <p>
673674
* If you import a terminology that overwrites an existing one, the new
674-
* terminology take up to 10 minutes to fully propagate and be available for
675-
* use in a translation due to cache policies with the DataPlane service
676-
* that performs the translations.
675+
* terminology takes up to 10 minutes to fully propagate. After that,
676+
* translations have access to the new terminology.
677677
* </p>
678678
*
679679
* @param importTerminologyRequest
@@ -722,6 +722,56 @@ public ImportTerminologyResult importTerminology(
722722
}
723723
}
724724

725+
/**
726+
* <p>
727+
* Provides a list of languages (RFC-5646 codes and names) that Amazon
728+
* Translate supports.
729+
* </p>
730+
*
731+
* @param listLanguagesRequest
732+
* @return listLanguagesResult The response from the ListLanguages service
733+
* method, as returned by Amazon Translate.
734+
* @throws InvalidParameterValueException
735+
* @throws TooManyRequestsException
736+
* @throws UnsupportedDisplayLanguageCodeException
737+
* @throws InternalServerException
738+
* @throws AmazonClientException If any internal errors are encountered
739+
* inside the client while attempting to make the request or
740+
* handle the response. For example if a network connection is
741+
* not available.
742+
* @throws AmazonServiceException If an error response is returned by Amazon
743+
* Translate indicating either a problem with the data in the
744+
* request, or a server side issue.
745+
*/
746+
public ListLanguagesResult listLanguages(ListLanguagesRequest listLanguagesRequest)
747+
throws AmazonServiceException, AmazonClientException {
748+
ExecutionContext executionContext = createExecutionContext(listLanguagesRequest);
749+
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
750+
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
751+
Request<ListLanguagesRequest> request = null;
752+
Response<ListLanguagesResult> response = null;
753+
try {
754+
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
755+
try {
756+
request = new ListLanguagesRequestMarshaller().marshall(listLanguagesRequest);
757+
// Binds the request metrics to the current request.
758+
request.setAWSRequestMetrics(awsRequestMetrics);
759+
} finally {
760+
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
761+
}
762+
Unmarshaller<ListLanguagesResult, JsonUnmarshallerContext> unmarshaller = new ListLanguagesResultJsonUnmarshaller();
763+
JsonResponseHandler<ListLanguagesResult> responseHandler = new JsonResponseHandler<ListLanguagesResult>(
764+
unmarshaller);
765+
766+
response = invoke(request, responseHandler, executionContext);
767+
768+
return response.getAwsResponse();
769+
} finally {
770+
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
771+
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
772+
}
773+
}
774+
725775
/**
726776
* <p>
727777
* Provides a list of your parallel data resources in Amazon Translate.

0 commit comments

Comments
 (0)