You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/04/09 11:01:50 UTC

[camel] 01/10: CAMEL-14868 - Camel-AWS2-*: Where possible, give the possiblity to the end user to pass an AWS Request pojo as body, aws2-ec2

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 824d913535a8f609c434842ea53020d736abccca
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Apr 9 11:11:55 2020 +0200

    CAMEL-14868 - Camel-AWS2-*: Where possible, give the possiblity to the end user to pass an AWS Request pojo as body, aws2-ec2
---
 .../aws2/ec2/AWS2EC2ComponentConfigurer.java       |  5 +++++
 .../aws2/ec2/AWS2EC2EndpointConfigurer.java        |  5 +++++
 .../apache/camel/component/aws2/ec2/aws2-ec2.json  |  2 ++
 .../src/main/docs/aws2-ec2-component.adoc          |  6 ++++--
 .../component/aws2/ec2/AWS2EC2Configuration.java   | 13 ++++++++++++
 .../camel/component/aws2/ec2/AWS2EC2Producer.java  | 18 ++++++++++++++++
 .../dsl/Aws2Ec2ComponentBuilderFactory.java        | 13 ++++++++++++
 .../src/generated/resources/metadata.json          |  3 ++-
 .../dsl/AWS2EC2EndpointBuilderFactory.java         | 24 ++++++++++++++++++++++
 9 files changed, 86 insertions(+), 3 deletions(-)

diff --git a/components/camel-aws2-ec2/src/generated/java/org/apache/camel/component/aws2/ec2/AWS2EC2ComponentConfigurer.java b/components/camel-aws2-ec2/src/generated/java/org/apache/camel/component/aws2/ec2/AWS2EC2ComponentConfigurer.java
index d58b645..40da381 100644
--- a/components/camel-aws2-ec2/src/generated/java/org/apache/camel/component/aws2/ec2/AWS2EC2ComponentConfigurer.java
+++ b/components/camel-aws2-ec2/src/generated/java/org/apache/camel/component/aws2/ec2/AWS2EC2ComponentConfigurer.java
@@ -36,6 +36,8 @@ public class AWS2EC2ComponentConfigurer extends PropertyConfigurerSupport implem
         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.ec2.AWS2EC2Operations.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":
@@ -58,6 +60,7 @@ public class AWS2EC2ComponentConfigurer extends PropertyConfigurerSupport implem
         answer.put("configuration", org.apache.camel.component.aws2.ec2.AWS2EC2Configuration.class);
         answer.put("lazyStartProducer", boolean.class);
         answer.put("operation", org.apache.camel.component.aws2.ec2.AWS2EC2Operations.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);
@@ -80,6 +83,8 @@ public class AWS2EC2ComponentConfigurer extends PropertyConfigurerSupport implem
         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-ec2/src/generated/java/org/apache/camel/component/aws2/ec2/AWS2EC2EndpointConfigurer.java b/components/camel-aws2-ec2/src/generated/java/org/apache/camel/component/aws2/ec2/AWS2EC2EndpointConfigurer.java
index 7339f91..938d932 100644
--- a/components/camel-aws2-ec2/src/generated/java/org/apache/camel/component/aws2/ec2/AWS2EC2EndpointConfigurer.java
+++ b/components/camel-aws2-ec2/src/generated/java/org/apache/camel/component/aws2/ec2/AWS2EC2EndpointConfigurer.java
@@ -28,6 +28,8 @@ public class AWS2EC2EndpointConfigurer extends PropertyConfigurerSupport impleme
         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.ec2.AWS2EC2Operations.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":
@@ -50,6 +52,7 @@ public class AWS2EC2EndpointConfigurer extends PropertyConfigurerSupport impleme
         answer.put("basicPropertyBinding", boolean.class);
         answer.put("lazyStartProducer", boolean.class);
         answer.put("operation", org.apache.camel.component.aws2.ec2.AWS2EC2Operations.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);
@@ -72,6 +75,8 @@ public class AWS2EC2EndpointConfigurer extends PropertyConfigurerSupport impleme
         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-ec2/src/generated/resources/org/apache/camel/component/aws2/ec2/aws2-ec2.json b/components/camel-aws2-ec2/src/generated/resources/org/apache/camel/component/aws2/ec2/aws2-ec2.json
index eb1ef0a..3287c8f 100644
--- a/components/camel-aws2-ec2/src/generated/resources/org/apache/camel/component/aws2/ec2/aws2-ec2.json
+++ b/components/camel-aws2-ec2/src/generated/resources/org/apache/camel/component/aws2/ec2/aws2-ec2.json
@@ -26,6 +26,7 @@
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.ec2.AWS2EC2Configuration", "deprecated": false, "secret": false, "description": "The 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": "producer", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.ec2.AWS2EC2Operations", "enum": [ "createAndRunInstances", "startInstances", "stopInstances", "terminateInstances", "describeInstances", "describeInstancesStatus", "rebootInstances", "monitorInstances", "unmonitorInstances", "createTags", "deleteTags" ], "deprecated": false, "deprecationNote": "", "se [...]
+    "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.ec2.AWS2EC2Configuration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
     "proxyHost": { "kind": "property", "displayName": "Proxy Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ec2.AWS2EC2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the EC2 client" },
     "proxyPort": { "kind": "property", "displayName": "Proxy Port", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ec2.AWS2EC2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the EC2 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.ec2.AWS2EC2Configuration", "configurationField": "configuration", "description": "To define a proxy protocol when instantiating the EC2 client" },
@@ -39,6 +40,7 @@
     "amazonEc2Client": { "kind": "parameter", "displayName": "Amazon Ec2 Client", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.ec2.Ec2Client", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ec2.AWS2EC2Configuration", "configurationField": "configuration", "description": "To use a existing configured AmazonEC2Client as client" },
     "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": "producer", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.ec2.AWS2EC2Operations", "enum": [ "createAndRunInstances", "startInstances", "stopInstances", "terminateInstances", "describeInstances", "describeInstancesStatus", "rebootInstances", "monitorInstances", "unmonitorInstances", "createTags", "deleteTags" ], "deprecated": false, "deprecationNote": "", "s [...]
+    "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.ec2.AWS2EC2Configuration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
     "proxyHost": { "kind": "parameter", "displayName": "Proxy Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ec2.AWS2EC2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the EC2 client" },
     "proxyPort": { "kind": "parameter", "displayName": "Proxy Port", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ec2.AWS2EC2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the EC2 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.ec2.AWS2EC2Configuration", "configurationField": "configuration", "description": "To define a proxy protocol when instantiating the EC2 client" },
diff --git a/components/camel-aws2-ec2/src/main/docs/aws2-ec2-component.adoc b/components/camel-aws2-ec2/src/main/docs/aws2-ec2-component.adoc
index 2ff03f2..ca05da4 100644
--- a/components/camel-aws2-ec2/src/main/docs/aws2-ec2-component.adoc
+++ b/components/camel-aws2-ec2/src/main/docs/aws2-ec2-component.adoc
@@ -35,7 +35,7 @@ You can append query options to the URI in the following format,
 
 
 // component options: START
-The AWS 2 EC2 component supports 11 options, which are listed below.
+The AWS 2 EC2 component supports 12 options, which are listed below.
 
 
 
@@ -47,6 +47,7 @@ The AWS 2 EC2 component supports 11 options, which are listed below.
 | *configuration* (producer) | The component configuration |  | AWS2EC2Configuration
 | *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. It can be createAndRunInstances, startInstances, stopInstances, terminateInstances, describeInstances, describeInstancesStatus, rebootInstances, monitorInstances, unmonitorInstances, createTags or deleteTags. The value can be one of: createAndRunInstances, startInstances, stopInstances, terminateInstances, describeInstances, describeInstancesStatus, rebootInstances, monitorInstances, unmonitorInstances, createTags, deleteTag [...]
+| *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 EC2 client |  | String
 | *proxyPort* (producer) | To define a proxy port when instantiating the EC2 client |  | Integer
 | *proxyProtocol* (producer) | To define a proxy protocol when instantiating the EC2 client. The value can be one of: HTTP, HTTPS | HTTPS | Protocol
@@ -78,7 +79,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (11 parameters):
+=== Query Parameters (12 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -88,6 +89,7 @@ with the following path and query parameters:
 | *amazonEc2Client* (producer) | To use a existing configured AmazonEC2Client as client |  | Ec2Client
 | *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. It can be createAndRunInstances, startInstances, stopInstances, terminateInstances, describeInstances, describeInstancesStatus, rebootInstances, monitorInstances, unmonitorInstances, createTags or deleteTags. The value can be one of: createAndRunInstances, startInstances, stopInstances, terminateInstances, describeInstances, describeInstancesStatus, rebootInstances, monitorInstances, unmonitorInstances, createTags, deleteTag [...]
+| *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 EC2 client |  | String
 | *proxyPort* (producer) | To define a proxy port when instantiating the EC2 client |  | Integer
 | *proxyProtocol* (producer) | To define a proxy protocol when instantiating the EC2 client. The value can be one of: HTTP, HTTPS | HTTPS | Protocol
diff --git a/components/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Configuration.java b/components/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Configuration.java
index c76d978..1e88b37 100644
--- a/components/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Configuration.java
+++ b/components/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Configuration.java
@@ -47,6 +47,8 @@ public class AWS2EC2Configuration implements Cloneable {
     private Integer proxyPort;
     @UriParam
     private String region;
+    @UriParam(defaultValue = "false")
+    private boolean pojoRequest;
 
     public Ec2Client getAmazonEc2Client() {
         return amazonEc2Client;
@@ -140,6 +142,17 @@ public class AWS2EC2Configuration implements Cloneable {
     public void setRegion(String region) {
         this.region = region;
     }
+    
+    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;
+    }
 
     // *************************************************
     //
diff --git a/components/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Producer.java b/components/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Producer.java
index 5dd7584..3a64581 100644
--- a/components/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Producer.java
+++ b/components/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Producer.java
@@ -139,6 +139,23 @@ public class AWS2EC2Producer extends DefaultProducer {
     private void createAndRunInstance(Ec2Client ec2Client, Exchange exchange) {
         String ami;
         InstanceType instanceType;
+        if (getConfiguration().isPojoRequest()) {
+            if (ObjectHelper.isNotEmpty(exchange.getIn().getBody())) {
+                if (exchange.getIn().getBody() instanceof RunInstancesRequest) {
+                    Object payload = exchange.getIn().getBody();
+                    RunInstancesResponse result;
+                    try {
+                        result = ec2Client.runInstances((RunInstancesRequest) payload);
+                    } catch (AwsServiceException ase) {
+                        LOG.trace("Run Instances command returned the error code {}", ase.awsErrorDetails().errorCode());
+                        throw ase;
+                    }
+                    LOG.trace("Creating and running instances requests performing");
+                    Message message = getMessageForResponse(exchange);
+                    message.setBody(result);
+                }
+            }    
+        } else {
         RunInstancesRequest.Builder builder = RunInstancesRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(AWS2EC2Constants.IMAGE_ID))) {
             ami = exchange.getIn().getHeader(AWS2EC2Constants.IMAGE_ID, String.class);
@@ -208,6 +225,7 @@ public class AWS2EC2Producer extends DefaultProducer {
         LOG.trace("Creating and running instances with ami [{}] and instance type {}", ami, instanceType);
         Message message = getMessageForResponse(exchange);
         message.setBody(result);
+        }
     }
 
     @SuppressWarnings("unchecked")
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2Ec2ComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2Ec2ComponentBuilderFactory.java
index 80392c9..c31544d 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2Ec2ComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2Ec2ComponentBuilderFactory.java
@@ -125,6 +125,18 @@ public interface Aws2Ec2ComponentBuilderFactory {
             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 Aws2Ec2ComponentBuilder pojoRequest(boolean pojoRequest) {
+            doSetProperty("pojoRequest", pojoRequest);
+            return this;
+        }
+        /**
          * To define a proxy host when instantiating the EC2 client.
          * 
          * The option is a: <code>java.lang.String</code> type.
@@ -228,6 +240,7 @@ public interface Aws2Ec2ComponentBuilderFactory {
             case "configuration": ((AWS2EC2Component) component).setConfiguration((org.apache.camel.component.aws2.ec2.AWS2EC2Configuration) value); return true;
             case "lazyStartProducer": ((AWS2EC2Component) component).setLazyStartProducer((boolean) value); return true;
             case "operation": getOrCreateConfiguration((AWS2EC2Component) component).setOperation((org.apache.camel.component.aws2.ec2.AWS2EC2Operations) value); return true;
+            case "pojoRequest": getOrCreateConfiguration((AWS2EC2Component) component).setPojoRequest((boolean) value); return true;
             case "proxyHost": getOrCreateConfiguration((AWS2EC2Component) component).setProxyHost((java.lang.String) value); return true;
             case "proxyPort": getOrCreateConfiguration((AWS2EC2Component) component).setProxyPort((java.lang.Integer) value); return true;
             case "proxyProtocol": getOrCreateConfiguration((AWS2EC2Component) component).setProxyProtocol((software.amazon.awssdk.core.Protocol) value); return true;
diff --git a/core/camel-componentdsl/src/generated/resources/metadata.json b/core/camel-componentdsl/src/generated/resources/metadata.json
index 4f34764b6..f43f7d6 100644
--- a/core/camel-componentdsl/src/generated/resources/metadata.json
+++ b/core/camel-componentdsl/src/generated/resources/metadata.json
@@ -480,7 +480,6 @@
     "lenientProperties": false,
     "javaType": "org.apache.camel.component.aws2.ec2.AWS2EC2Component",
     "firstVersion": "3.1.0",
-    "supportLevel": "Stable",
     "groupId": "org.apache.camel",
     "artifactId": "camel-aws2-ec2",
     "version": "3.3.0-SNAPSHOT"
@@ -1784,6 +1783,7 @@
     "lenientProperties": false,
     "javaType": "org.apache.camel.component.corda.CordaComponent",
     "firstVersion": "2.23.0",
+    "supportLevel": "Stable",
     "groupId": "org.apache.camel",
     "artifactId": "camel-corda",
     "version": "3.3.0-SNAPSHOT"
@@ -7598,6 +7598,7 @@
     "lenientProperties": false,
     "javaType": "org.apache.camel.component.zookeeper.ZooKeeperComponent",
     "firstVersion": "2.9.0",
+    "supportLevel": "Stable",
     "groupId": "org.apache.camel",
     "artifactId": "camel-zookeeper",
     "version": "3.3.0-SNAPSHOT"
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AWS2EC2EndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AWS2EC2EndpointBuilderFactory.java
index c598f2e..6bf8a63 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AWS2EC2EndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AWS2EC2EndpointBuilderFactory.java
@@ -149,6 +149,30 @@ public interface AWS2EC2EndpointBuilderFactory {
             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 AWS2EC2EndpointBuilder 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 AWS2EC2EndpointBuilder pojoRequest(String pojoRequest) {
+            doSetProperty("pojoRequest", pojoRequest);
+            return this;
+        }
+        /**
          * To define a proxy host when instantiating the EC2 client.
          * 
          * The option is a: <code>java.lang.String</code> type.