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 828dcfc502738aa71b3619eb6954383a45ad4771
Author: Andrea Cosentino <anco...@gmail.com>
AuthorDate: Wed Apr 8 14:37:11 2020 +0200

    CAMEL-14868 - Camel-AWS2-*: Where possible, give the possiblity to the end 
user to pass an AWS Request pojo as body, aws-translate
---
 .../translate/Translate2ComponentConfigurer.java   |  5 +++++
 .../translate/Translate2EndpointConfigurer.java    |  5 +++++
 .../component/aws2/translate/aws2-translate.json   |  2 ++
 .../src/main/docs/aws2-translate-component.adoc    |  6 ++++--
 .../aws2/translate/Translate2Configuration.java    | 15 ++++++++++++-
 .../aws2/translate/Translate2Producer.java         | 15 +++++++++++++
 .../aws2/translate/Translate2ProducerTest.java     | 21 ++++++++++++++++++
 .../Translate2ProducerIntegrationTest.java         | 25 ++++++++++++++++++++--
 .../dsl/Aws2TranslateComponentBuilderFactory.java  | 13 +++++++++++
 .../dsl/Translate2EndpointBuilderFactory.java      | 24 +++++++++++++++++++++
 10 files changed, 126 insertions(+), 5 deletions(-)

diff --git 
a/components/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2ComponentConfigurer.java
 
b/components/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2ComponentConfigurer.java
index 13dbc6e..e0a9aff 100644
--- 
a/components/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2ComponentConfigurer.java
+++ 
b/components/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2ComponentConfigurer.java
@@ -36,6 +36,8 @@ public class Translate2ComponentConfigurer extends 
PropertyConfigurerSupport imp
         case "lazystartproducer":
         case "lazyStartProducer": 
target.setLazyStartProducer(property(camelContext, boolean.class, value)); 
return true;
         case "operation": 
getOrCreateConfiguration(target).setOperation(property(camelContext, 
org.apache.camel.component.aws2.translate.Translate2Operations.class, value)); 
return true;
+        case "pojorequest":
+        case "pojoRequest": 
getOrCreateConfiguration(target).setPojoRequest(property(camelContext, 
boolean.class, value)); return true;
         case "proxyhost":
         case "proxyHost": 
getOrCreateConfiguration(target).setProxyHost(property(camelContext, 
java.lang.String.class, value)); return true;
         case "proxyport":
@@ -64,6 +66,7 @@ public class Translate2ComponentConfigurer extends 
PropertyConfigurerSupport imp
         answer.put("configuration", 
org.apache.camel.component.aws2.translate.Translate2Configuration.class);
         answer.put("lazyStartProducer", boolean.class);
         answer.put("operation", 
org.apache.camel.component.aws2.translate.Translate2Operations.class);
+        answer.put("pojoRequest", boolean.class);
         answer.put("proxyHost", java.lang.String.class);
         answer.put("proxyPort", java.lang.Integer.class);
         answer.put("proxyProtocol", 
software.amazon.awssdk.core.Protocol.class);
@@ -89,6 +92,8 @@ public class Translate2ComponentConfigurer extends 
PropertyConfigurerSupport imp
         case "lazystartproducer":
         case "lazyStartProducer": return target.isLazyStartProducer();
         case "operation": return 
getOrCreateConfiguration(target).getOperation();
+        case "pojorequest":
+        case "pojoRequest": return 
getOrCreateConfiguration(target).isPojoRequest();
         case "proxyhost":
         case "proxyHost": return 
getOrCreateConfiguration(target).getProxyHost();
         case "proxyport":
diff --git 
a/components/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2EndpointConfigurer.java
 
b/components/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2EndpointConfigurer.java
index ae6023c..470a91e 100644
--- 
a/components/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2EndpointConfigurer.java
+++ 
b/components/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2EndpointConfigurer.java
@@ -28,6 +28,8 @@ public class Translate2EndpointConfigurer extends 
PropertyConfigurerSupport impl
         case "lazystartproducer":
         case "lazyStartProducer": 
target.setLazyStartProducer(property(camelContext, boolean.class, value)); 
return true;
         case "operation": 
target.getConfiguration().setOperation(property(camelContext, 
org.apache.camel.component.aws2.translate.Translate2Operations.class, value)); 
return true;
+        case "pojorequest":
+        case "pojoRequest": 
target.getConfiguration().setPojoRequest(property(camelContext, boolean.class, 
value)); return true;
         case "proxyhost":
         case "proxyHost": 
target.getConfiguration().setProxyHost(property(camelContext, 
java.lang.String.class, value)); return true;
         case "proxyport":
@@ -56,6 +58,7 @@ public class Translate2EndpointConfigurer extends 
PropertyConfigurerSupport impl
         answer.put("basicPropertyBinding", boolean.class);
         answer.put("lazyStartProducer", boolean.class);
         answer.put("operation", 
org.apache.camel.component.aws2.translate.Translate2Operations.class);
+        answer.put("pojoRequest", boolean.class);
         answer.put("proxyHost", java.lang.String.class);
         answer.put("proxyPort", java.lang.Integer.class);
         answer.put("proxyProtocol", 
software.amazon.awssdk.core.Protocol.class);
@@ -81,6 +84,8 @@ public class Translate2EndpointConfigurer extends 
PropertyConfigurerSupport impl
         case "lazystartproducer":
         case "lazyStartProducer": return target.isLazyStartProducer();
         case "operation": return target.getConfiguration().getOperation();
+        case "pojorequest":
+        case "pojoRequest": return target.getConfiguration().isPojoRequest();
         case "proxyhost":
         case "proxyHost": return target.getConfiguration().getProxyHost();
         case "proxyport":
diff --git 
a/components/camel-aws2-translate/src/generated/resources/org/apache/camel/component/aws2/translate/aws2-translate.json
 
b/components/camel-aws2-translate/src/generated/resources/org/apache/camel/component/aws2/translate/aws2-translate.json
index 7b5ca39..a21d458 100644
--- 
a/components/camel-aws2-translate/src/generated/resources/org/apache/camel/component/aws2/translate/aws2-translate.json
+++ 
b/components/camel-aws2-translate/src/generated/resources/org/apache/camel/component/aws2/translate/aws2-translate.json
@@ -25,6 +25,7 @@
     "configuration": { "kind": "property", "displayName": "Configuration", 
"group": "producer", "label": "", "required": false, "type": "object", 
"javaType": 
"org.apache.camel.component.aws2.translate.Translate2Configuration", 
"deprecated": false, "secret": false, "description": "Component configuration" 
},
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start 
Producer", "group": "producer", "label": "producer", "required": false, "type": 
"boolean", "javaType": "boolean", "deprecated": false, "secret": false, 
"defaultValue": false, "description": "Whether the producer should be started 
lazy (on the first message). By starting lazy you can use this to allow 
CamelContext and routes to startup in situations where a producer may otherwise 
fail during starting and cause the r [...]
     "operation": { "kind": "property", "displayName": "Operation", "group": 
"producer", "label": "", "required": true, "type": "object", "javaType": 
"org.apache.camel.component.aws2.translate.Translate2Operations", "enum": [ 
"translateText" ], "deprecated": false, "deprecationNote": "", "secret": false, 
"defaultValue": "translateText", "configurationClass": 
"org.apache.camel.component.aws2.translate.Translate2Configuration", 
"configurationField": "configuration", "description": "The oper [...]
+    "pojoRequest": { "kind": "property", "displayName": "Pojo Request", 
"group": "producer", "label": "", "required": false, "type": "boolean", 
"javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": 
"false", "configurationClass": 
"org.apache.camel.component.aws2.translate.Translate2Configuration", 
"configurationField": "configuration", "description": "If we want to use a POJO 
request as body or not" },
     "proxyHost": { "kind": "property", "displayName": "Proxy Host", "group": 
"producer", "label": "", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "secret": false, "configurationClass": 
"org.apache.camel.component.aws2.translate.Translate2Configuration", 
"configurationField": "configuration", "description": "To define a proxy host 
when instantiating the Translate client" },
     "proxyPort": { "kind": "property", "displayName": "Proxy Port", "group": 
"producer", "label": "", "required": false, "type": "integer", "javaType": 
"java.lang.Integer", "deprecated": false, "secret": false, 
"configurationClass": 
"org.apache.camel.component.aws2.translate.Translate2Configuration", 
"configurationField": "configuration", "description": "To define a proxy port 
when instantiating the Translate client" },
     "proxyProtocol": { "kind": "property", "displayName": "Proxy Protocol", 
"group": "producer", "label": "", "required": false, "type": "object", 
"javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" 
], "deprecated": false, "secret": false, "defaultValue": "HTTPS", 
"configurationClass": 
"org.apache.camel.component.aws2.translate.Translate2Configuration", 
"configurationField": "configuration", "description": "To define a proxy 
protocol when instantiating the Trans [...]
@@ -41,6 +42,7 @@
     "autodetectSourceLanguage": { "kind": "parameter", "displayName": 
"Autodetect Source Language", "group": "producer", "label": "", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": 
false, "defaultValue": "false", "configurationClass": 
"org.apache.camel.component.aws2.translate.Translate2Configuration", 
"configurationField": "configuration", "description": "Being able to autodetect 
the source language" },
     "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start 
Producer", "group": "producer", "label": "producer", "required": false, "type": 
"boolean", "javaType": "boolean", "deprecated": false, "secret": false, 
"defaultValue": false, "description": "Whether the producer should be started 
lazy (on the first message). By starting lazy you can use this to allow 
CamelContext and routes to startup in situations where a producer may otherwise 
fail during starting and cause the  [...]
     "operation": { "kind": "parameter", "displayName": "Operation", "group": 
"producer", "label": "", "required": true, "type": "object", "javaType": 
"org.apache.camel.component.aws2.translate.Translate2Operations", "enum": [ 
"translateText" ], "deprecated": false, "deprecationNote": "", "secret": false, 
"defaultValue": "translateText", "configurationClass": 
"org.apache.camel.component.aws2.translate.Translate2Configuration", 
"configurationField": "configuration", "description": "The ope [...]
+    "pojoRequest": { "kind": "parameter", "displayName": "Pojo Request", 
"group": "producer", "label": "", "required": false, "type": "boolean", 
"javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": 
"false", "configurationClass": 
"org.apache.camel.component.aws2.translate.Translate2Configuration", 
"configurationField": "configuration", "description": "If we want to use a POJO 
request as body or not" },
     "proxyHost": { "kind": "parameter", "displayName": "Proxy Host", "group": 
"producer", "label": "", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "secret": false, "configurationClass": 
"org.apache.camel.component.aws2.translate.Translate2Configuration", 
"configurationField": "configuration", "description": "To define a proxy host 
when instantiating the Translate client" },
     "proxyPort": { "kind": "parameter", "displayName": "Proxy Port", "group": 
"producer", "label": "", "required": false, "type": "integer", "javaType": 
"java.lang.Integer", "deprecated": false, "secret": false, 
"configurationClass": 
"org.apache.camel.component.aws2.translate.Translate2Configuration", 
"configurationField": "configuration", "description": "To define a proxy port 
when instantiating the Translate client" },
     "proxyProtocol": { "kind": "parameter", "displayName": "Proxy Protocol", 
"group": "producer", "label": "", "required": false, "type": "object", 
"javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" 
], "deprecated": false, "secret": false, "defaultValue": "HTTPS", 
"configurationClass": 
"org.apache.camel.component.aws2.translate.Translate2Configuration", 
"configurationField": "configuration", "description": "To define a proxy 
protocol when instantiating the Tran [...]
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 9d59877..a5393da 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
@@ -36,7 +36,7 @@ You can append query options to the URI in the following 
format,
 
 
 // component options: START
-The AWS 2 Translate component supports 14 options, which are listed below.
+The AWS 2 Translate component supports 15 options, which are listed below.
 
 
 
@@ -47,6 +47,7 @@ The AWS 2 Translate component supports 14 options, which are 
listed below.
 | *configuration* (producer) | Component configuration |  | 
Translate2Configuration
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy 
(on the first message). By starting lazy you can use this to allow CamelContext 
and routes to startup in situations where a producer may otherwise fail during 
starting and cause the route to fail being started. By deferring this startup 
to be lazy then the startup failure can be handled during routing messages via 
Camel's routing error handlers. Beware that when the first message is processed 
then creating and [...]
 | *operation* (producer) | *Required* The operation to perform. The value can 
be one of: translateText | translateText | Translate2Operations
+| *pojoRequest* (producer) | If we want to use a POJO request as body or not | 
false | boolean
 | *proxyHost* (producer) | To define a proxy host when instantiating the 
Translate client |  | String
 | *proxyPort* (producer) | To define a proxy port when instantiating the 
Translate client |  | Integer
 | *proxyProtocol* (producer) | To define a proxy protocol when instantiating 
the Translate client. The value can be one of: HTTP, HTTPS | HTTPS | Protocol
@@ -82,7 +83,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (14 parameters):
+=== Query Parameters (15 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -91,6 +92,7 @@ with the following path and query parameters:
 | *autodetectSourceLanguage* (producer) | Being able to autodetect the source 
language | false | boolean
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy 
(on the first message). By starting lazy you can use this to allow CamelContext 
and routes to startup in situations where a producer may otherwise fail during 
starting and cause the route to fail being started. By deferring this startup 
to be lazy then the startup failure can be handled during routing messages via 
Camel's routing error handlers. Beware that when the first message is processed 
then creating and [...]
 | *operation* (producer) | *Required* The operation to perform. The value can 
be one of: translateText | translateText | Translate2Operations
+| *pojoRequest* (producer) | If we want to use a POJO request as body or not | 
false | boolean
 | *proxyHost* (producer) | To define a proxy host when instantiating the 
Translate client |  | String
 | *proxyPort* (producer) | To define a proxy port when instantiating the 
Translate client |  | Integer
 | *proxyProtocol* (producer) | To define a proxy protocol when instantiating 
the Translate client. The value can be one of: HTTP, HTTPS | HTTPS | Protocol
diff --git 
a/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Configuration.java
 
b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Configuration.java
index 60017e3..c0152ed 100644
--- 
a/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Configuration.java
+++ 
b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Configuration.java
@@ -53,6 +53,8 @@ public class Translate2Configuration implements Cloneable {
     private String region;
     @UriParam(defaultValue = "false")
     private boolean autodetectSourceLanguage;
+    @UriParam(defaultValue = "false")
+    private boolean pojoRequest;
 
     public TranslateClient getTranslateClient() {
         return translateClient;
@@ -177,12 +179,23 @@ public class Translate2Configuration implements Cloneable 
{
     public void setTargetLanguage(String targetLanguage) {
         this.targetLanguage = targetLanguage;
     }
+    
+    public boolean isPojoRequest() {
+               return pojoRequest;
+       }
+    
+    /**
+     * If we want to use a POJO request as body or not
+     */
+       public void setPojoRequest(boolean pojoRequest) {
+               this.pojoRequest = pojoRequest;
+       }
 
     // *************************************************
     //
     // *************************************************
 
-    public Translate2Configuration copy() {
+       public Translate2Configuration copy() {
         try {
             return (Translate2Configuration)super.clone();
         } catch (CloneNotSupportedException e) {
diff --git 
a/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Producer.java
 
b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Producer.java
index c5a0a44..ddd593f 100644
--- 
a/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Producer.java
+++ 
b/components/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Producer.java
@@ -82,6 +82,20 @@ public class Translate2Producer extends DefaultProducer {
     }
 
     private void translateText(TranslateClient translateClient, Exchange 
exchange) {
+       if (getConfiguration().isPojoRequest()) {
+       if (exchange.getIn().getBody() instanceof TranslateTextRequest) {
+               Object payload = exchange.getIn().getBody();
+               TranslateTextResponse result;
+               try {
+                   result = 
translateClient.translateText((TranslateTextRequest) payload);
+               } catch (AwsServiceException ase) {
+                   LOG.trace("Translate Text command returned the error code 
{}", ase.awsErrorDetails().errorCode());
+                   throw ase;
+               }
+               Message message = getMessageForResponse(exchange);
+               message.setBody(result.translatedText());
+       }
+       } else {
         Builder request = TranslateTextRequest.builder();
         if (!getConfiguration().isAutodetectSourceLanguage()) {
             if (ObjectHelper.isEmpty(getConfiguration().getSourceLanguage()) 
&& ObjectHelper.isEmpty(getConfiguration().getTargetLanguage())) {
@@ -124,6 +138,7 @@ public class Translate2Producer extends DefaultProducer {
         }
         Message message = getMessageForResponse(exchange);
         message.setBody(result.translatedText());
+       }
     }
 
     public static Message getMessageForResponse(final Exchange exchange) {
diff --git 
a/components/camel-aws2-translate/src/test/java/org/apache/camel/component/aws2/translate/Translate2ProducerTest.java
 
b/components/camel-aws2-translate/src/test/java/org/apache/camel/component/aws2/translate/Translate2ProducerTest.java
index 385bc30..9716f3c 100644
--- 
a/components/camel-aws2-translate/src/test/java/org/apache/camel/component/aws2/translate/Translate2ProducerTest.java
+++ 
b/components/camel-aws2-translate/src/test/java/org/apache/camel/component/aws2/translate/Translate2ProducerTest.java
@@ -25,6 +25,8 @@ import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.Test;
 
+import software.amazon.awssdk.services.translate.model.TranslateTextRequest;
+
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
 public class Translate2ProducerTest extends CamelTestSupport {
@@ -54,6 +56,24 @@ public class Translate2ProducerTest extends CamelTestSupport 
{
         assertEquals("Hello", resultGet);
 
     }
+    
+    @Test
+    public void translateTextPojoTest() throws Exception {
+
+        mock.expectedMessageCount(1);
+        Exchange exchange = template.request("direct:translatePojoText", new 
Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                
exchange.getIn().setBody(TranslateTextRequest.builder().sourceLanguageCode(Translate2LanguageEnum.ITALIAN.toString()).targetLanguageCode(Translate2LanguageEnum.ENGLISH.toString()).text("ciao").build());
+            }
+        });
+
+        assertMockEndpointsSatisfied();
+
+        String resultGet = exchange.getIn().getBody(String.class);
+        assertEquals("Hello", resultGet);
+
+    }
 
     @Test
     public void translateTextTestOptions() throws Exception {
@@ -79,6 +99,7 @@ public class Translate2ProducerTest extends CamelTestSupport {
             @Override
             public void configure() throws Exception {
                 
from("direct:translateText").to("aws2-translate://test?translateClient=#amazonTranslateClient&operation=translateText").to("mock:result");
+                
from("direct:translatePojoText").to("aws2-translate://test?translateClient=#amazonTranslateClient&operation=translateText&pojoRequest=true").to("mock:result");
                 
from("direct:translateTextOptions").to("aws2-translate://test?translateClient=#amazonTranslateClient&operation=translateText&sourceLanguage=it&targetLanguage=en")
                     .to("mock:result");
             }
diff --git 
a/components/camel-aws2-translate/src/test/java/org/apache/camel/component/aws2/translate/integration/Translate2ProducerIntegrationTest.java
 
b/components/camel-aws2-translate/src/test/java/org/apache/camel/component/aws2/translate/integration/Translate2ProducerIntegrationTest.java
index 5a06526..6d7f0e3 100644
--- 
a/components/camel-aws2-translate/src/test/java/org/apache/camel/component/aws2/translate/integration/Translate2ProducerIntegrationTest.java
+++ 
b/components/camel-aws2-translate/src/test/java/org/apache/camel/component/aws2/translate/integration/Translate2ProducerIntegrationTest.java
@@ -28,6 +28,8 @@ import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 
+import software.amazon.awssdk.services.translate.model.TranslateTextRequest;
+
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
 @Disabled("This test must be manually started, you need to specify AWS 
Credentials")
@@ -55,6 +57,24 @@ public class Translate2ProducerIntegrationTest extends 
CamelTestSupport {
         String resultGet = (String)exchange.getIn().getBody();
         assertEquals("Hallo, Miss.", resultGet);
     }
+    
+    @Test
+    public void translateTextPojoTest() throws Exception {
+
+        mock.expectedMessageCount(1);
+        Exchange exchange = template.request("direct:translateTextPojo", new 
Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+              
+                
exchange.getIn().setBody(TranslateTextRequest.builder().sourceLanguageCode(Translate2LanguageEnum.ITALIAN.toString()).targetLanguageCode(Translate2LanguageEnum.GERMAN.toString()).text("Ciao
 Signorina").build());
+            }
+        });
+
+        assertMockEndpointsSatisfied();
+
+        String resultGet = (String)exchange.getIn().getBody();
+        assertEquals("Hallo, Miss.", resultGet);
+    }
 
     @Test
     public void translateTextAutodetectSourceTest() throws Exception {
@@ -80,9 +100,10 @@ public class Translate2ProducerIntegrationTest extends 
CamelTestSupport {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                
from("direct:translateText").to("aws2-translate://test?accessKey=RAW(xxxx)&secretKey=RAW(xxxx)&region=eu-west-1&operation=translateText").to("mock:result");
+                
from("direct:translateText").to("aws2-translate://test?accessKey=RAW(xxxx)&secretKey=RAW(yyyy)&region=eu-west-1&operation=translateText").to("mock:result");
                 from("direct:translateTextAuto")
-                    
.to("aws2-translate://test?accessKey=RAW(xxxx)&secretKey=RAW(xxxx)&region=eu-west-1&operation=translateText&autodetectSourceLanguage=true").to("mock:result");
+                    
.to("aws2-translate://test?accessKey=RAW(xxxx)&secretKey=RAW(yyyy)&region=eu-west-1&operation=translateText&autodetectSourceLanguage=true").to("mock:result");
+                
from("direct:translateTextPojo").to("aws2-translate://test?accessKey=RAW(xxxx)&secretKey=RAW(yyyy)&region=eu-west-1&operation=translateText&pojoRequest=true").to("mock:result");
             }
         };
     }
diff --git 
a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2TranslateComponentBuilderFactory.java
 
b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2TranslateComponentBuilderFactory.java
index 549b727..6cbd5c4 100644
--- 
a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2TranslateComponentBuilderFactory.java
+++ 
b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2TranslateComponentBuilderFactory.java
@@ -110,6 +110,18 @@ public interface Aws2TranslateComponentBuilderFactory {
             return this;
         }
         /**
+         * If we want to use a POJO request as body or not.
+         * 
+         * The option is a: <code>boolean</code> type.
+         * 
+         * Default: false
+         * Group: producer
+         */
+        default Aws2TranslateComponentBuilder pojoRequest(boolean pojoRequest) 
{
+            doSetProperty("pojoRequest", pojoRequest);
+            return this;
+        }
+        /**
          * To define a proxy host when instantiating the Translate client.
          * 
          * The option is a: <code>java.lang.String</code> type.
@@ -264,6 +276,7 @@ public interface Aws2TranslateComponentBuilderFactory {
             case "configuration": ((Translate2Component) 
component).setConfiguration((org.apache.camel.component.aws2.translate.Translate2Configuration)
 value); return true;
             case "lazyStartProducer": ((Translate2Component) 
component).setLazyStartProducer((boolean) value); return true;
             case "operation": getOrCreateConfiguration((Translate2Component) 
component).setOperation((org.apache.camel.component.aws2.translate.Translate2Operations)
 value); return true;
+            case "pojoRequest": getOrCreateConfiguration((Translate2Component) 
component).setPojoRequest((boolean) value); return true;
             case "proxyHost": getOrCreateConfiguration((Translate2Component) 
component).setProxyHost((java.lang.String) value); return true;
             case "proxyPort": getOrCreateConfiguration((Translate2Component) 
component).setProxyPort((java.lang.Integer) value); return true;
             case "proxyProtocol": 
getOrCreateConfiguration((Translate2Component) 
component).setProxyProtocol((software.amazon.awssdk.core.Protocol) value); 
return true;
diff --git 
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Translate2EndpointBuilderFactory.java
 
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Translate2EndpointBuilderFactory.java
index 8653ecd..649405a 100644
--- 
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Translate2EndpointBuilderFactory.java
+++ 
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Translate2EndpointBuilderFactory.java
@@ -137,6 +137,30 @@ public interface Translate2EndpointBuilderFactory {
             return this;
         }
         /**
+         * If we want to use a POJO request as body or not.
+         * 
+         * The option is a: <code>boolean</code> type.
+         * 
+         * Default: false
+         * Group: producer
+         */
+        default Translate2EndpointBuilder pojoRequest(boolean pojoRequest) {
+            doSetProperty("pojoRequest", pojoRequest);
+            return this;
+        }
+        /**
+         * If we want to use a POJO request as body or not.
+         * 
+         * The option will be converted to a <code>boolean</code> type.
+         * 
+         * Default: false
+         * Group: producer
+         */
+        default Translate2EndpointBuilder pojoRequest(String pojoRequest) {
+            doSetProperty("pojoRequest", pojoRequest);
+            return this;
+        }
+        /**
          * To define a proxy host when instantiating the Translate client.
          * 
          * The option is a: <code>java.lang.String</code> type.

Reply via email to