This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit 4462f6d120653a00655cd0c59743d0a8b39273af Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Wed Apr 8 15:23:36 2020 +0200 CAMEL-14868 - Camel-AWS2-*: Where possible, give the possiblity to the end user to pass an AWS Request pojo as body, little example in docs --- .../src/main/docs/aws2-translate-component.adoc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/components/camel-aws2-translate/src/main/docs/aws2-translate-component.adoc b/components/camel-aws2-translate/src/main/docs/aws2-translate-component.adoc index a5393da..99010a7 100644 --- a/components/camel-aws2-translate/src/main/docs/aws2-translate-component.adoc +++ b/components/camel-aws2-translate/src/main/docs/aws2-translate-component.adoc @@ -157,6 +157,20 @@ from("direct:start") As result you'll get an exchange containing the translated text. +== Using a POJO as body + +Sometimes build an AWS Request can be complex, because of multiple options. We introduce the possibility to use a POJO as body. +In AWS Translate the only operation available is TranslateText so you can do something like: + +------------------------------------------------------------------------------------------------------ +from("direct:start") + .setBody(TranslateTextRequest.builder().sourceLanguageCode(Translate2LanguageEnum.ITALIAN.toString()) + .targetLanguageCode(Translate2LanguageEnum.GERMAN.toString()).text("Ciao").build()) + .to("aws2-translate://test?translateClient=#amazonTranslateClient&operation=translateText"); +------------------------------------------------------------------------------------------------------ + +In this way you'll pass the request directly without the need of passing headers and options specifically related to this operation. + Dependencies Maven users will need to add the following dependency to their pom.xml.