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 2025/09/16 13:01:51 UTC
(camel) 01/01: CAMEL-22178 - Create AWS Textract component
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch CAMEL-22178
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 99e585556a2288836d9a613ddd29c0a350a72484
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Sep 16 14:59:38 2025 +0200
CAMEL-22178 - Create AWS Textract component
Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
bom/camel-bom/pom.xml | 5 +
catalog/camel-allcomponents/pom.xml | 5 +
.../org/apache/camel/catalog/components.properties | 1 +
.../camel/catalog/components/aws2-textract.json | 87 +++
components/camel-aws/camel-aws2-textract/pom.xml | 79 +++
.../textract/Textract2ComponentConfigurer.java | 198 ++++++
.../aws2/textract/Textract2EndpointConfigurer.java | 170 +++++
.../aws2/textract/Textract2EndpointUriFactory.java | 95 +++
.../component/aws2/textract/aws2-textract.json | 87 +++
.../services/org/apache/camel/component.properties | 7 +
.../org/apache/camel/component/aws2-textract | 2 +
.../camel/configurer/aws2-textract-component | 2 +
.../apache/camel/configurer/aws2-textract-endpoint | 2 +
.../apache/camel/urifactory/aws2-textract-endpoint | 2 +
.../aws2/textract/Textract2Component.java | 72 ++
.../aws2/textract/Textract2Configuration.java | 318 +++++++++
.../aws2/textract/Textract2Constants.java | 41 ++
.../component/aws2/textract/Textract2Endpoint.java | 108 +++
.../aws2/textract/Textract2Operations.java | 30 +
.../component/aws2/textract/Textract2Producer.java | 559 +++++++++++++++
.../textract/Textract2ProducerHealthCheck.java | 90 +++
.../textract/client/Textract2ClientFactory.java | 50 ++
.../textract/client/Textract2InternalClient.java | 30 +
.../client/impl/Textract2ClientIAMOptimized.java | 94 +++
.../impl/Textract2ClientIAMProfileOptimized.java | 99 +++
.../impl/Textract2ClientSessionTokenImpl.java | 111 +++
.../client/impl/Textract2ClientStandardImpl.java | 109 +++
.../aws2/textract/AmazonAWSTextractMock.java | 59 ++
.../aws2/textract/Textract2ClientFactoryTest.java | 60 ++
.../aws2/textract/Textract2ProducerTest.java | 132 ++++
.../integration/Textract2DetectTextIT.java | 67 ++
.../src/test/resources/log4j2.properties | 28 +
components/camel-aws/pom.xml | 1 +
.../org/apache/camel/main/components.properties | 1 +
.../modules/ROOT/examples/json/aws2-textract.json | 1 +
.../component/ComponentsBuilderFactory.java | 14 +
.../dsl/Aws2TextractComponentBuilderFactory.java | 536 +++++++++++++++
.../builder/endpoint/EndpointBuilderFactory.java | 1 +
.../camel/builder/endpoint/EndpointBuilders.java | 1 +
.../builder/endpoint/StaticEndpointBuilders.java | 42 ++
.../dsl/Textract2EndpointBuilderFactory.java | 748 +++++++++++++++++++++
.../camel-component-known-dependencies.properties | 1 +
parent/pom.xml | 5 +
.../apache/camel/maven/packaging/MojoHelper.java | 3 +-
44 files changed, 4152 insertions(+), 1 deletion(-)
diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml
index 0fc8f0b14ca..d55e0645f4a 100644
--- a/bom/camel-bom/pom.xml
+++ b/bom/camel-bom/pom.xml
@@ -251,6 +251,11 @@
<artifactId>camel-aws2-sts</artifactId>
<version>4.15.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-aws2-textract</artifactId>
+ <version>4.15.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-aws2-timestream</artifactId>
diff --git a/catalog/camel-allcomponents/pom.xml b/catalog/camel-allcomponents/pom.xml
index 096e27da9c9..ae7a64e1d47 100644
--- a/catalog/camel-allcomponents/pom.xml
+++ b/catalog/camel-allcomponents/pom.xml
@@ -251,6 +251,11 @@
<artifactId>camel-aws2-sts</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-aws2-textract</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-aws2-timestream</artifactId>
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
index bf628cfc0c8..36fe0d7330d 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
@@ -35,6 +35,7 @@ aws2-sns
aws2-sqs
aws2-step-functions
aws2-sts
+aws2-textract
aws2-timestream
aws2-translate
azure-cosmosdb
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-textract.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-textract.json
new file mode 100644
index 00000000000..8a5ed70868f
--- /dev/null
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-textract.json
@@ -0,0 +1,87 @@
+{
+ "component": {
+ "kind": "component",
+ "name": "aws2-textract",
+ "title": "AWS Textract",
+ "description": "Extract text and data from documents using AWS Textract and AWS SDK version 2.x.",
+ "deprecated": false,
+ "firstVersion": "4.15.0",
+ "label": "cloud,document",
+ "javaType": "org.apache.camel.component.aws2.textract.Textract2Component",
+ "supportLevel": "Preview",
+ "groupId": "org.apache.camel",
+ "artifactId": "camel-aws2-textract",
+ "version": "4.15.0-SNAPSHOT",
+ "scheme": "aws2-textract",
+ "extendsScheme": "",
+ "syntax": "aws2-textract:label",
+ "async": false,
+ "api": false,
+ "consumerOnly": false,
+ "producerOnly": true,
+ "lenientProperties": false,
+ "browsable": false,
+ "remote": true
+ },
+ "componentProperties": {
+ "configuration": { "index": 0, "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.textract.Textract2Configuration", "deprecated": false, "autowired": false, "secret": false, "description": "Component configuration" },
+ "lazyStartProducer": { "index": 1, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 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 [...]
+ "operation": { "index": 2, "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.textract.Textract2Operations", "enum": [ "detectDocumentText", "analyzeDocument", "analyzeExpense", "startDocumentTextDetection", "startDocumentAnalysis", "startExpenseAnalysis", "getDocumentTextDetection", "getDocumentAnalysis", "getExpenseAnalysis" ], "deprecated": false, "deprecationNote": "", [...]
+ "overrideEndpoint": { "index": 3, "kind": "property", "displayName": "Override Endpoint", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Set the need for overriding the endpoint. This option needs to be used in comb [...]
+ "pojoRequest": { "index": 4, "kind": "property", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
+ "region": { "index": 5, "kind": "property", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "enum": [ "ap-south-2", "ap-south-1", "eu-south-1", "eu-south-2", "us-gov-east-1", "me-central-1", "il-central-1", "ca-central-1", "eu-central-1", "us-iso-west-1", "eu-central-2", "eu-isoe-west-1", "us-west-1", "us-west-2", "af-south-1", "eu-north-1", "eu-west-3", "eu-west-2", "eu-west-1", "ap-northeast-3", "ap-nor [...]
+ "s3Bucket": { "index": 6, "kind": "property", "displayName": "S3 Bucket", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "The S3 bucket name for document location" },
+ "s3Object": { "index": 7, "kind": "property", "displayName": "S3 Object", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "The S3 object name for document location" },
+ "s3ObjectVersion": { "index": 8, "kind": "property", "displayName": "S3 Object Version", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "The S3 object version for document location" },
+ "uriEndpointOverride": { "index": 9, "kind": "property", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with over [...]
+ "autowiredEnabled": { "index": 10, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching [...]
+ "textractClient": { "index": 11, "kind": "property", "displayName": "Textract Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.textract.TextractClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "To use an existing configur [...]
+ "healthCheckConsumerEnabled": { "index": 12, "kind": "property", "displayName": "Health Check Consumer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all consumer based health checks from this component" },
+ "healthCheckProducerEnabled": { "index": 13, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on produce [...]
+ "proxyHost": { "index": 14, "kind": "property", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the Textract client" },
+ "proxyPort": { "index": 15, "kind": "property", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the Textract client" },
+ "proxyProtocol": { "index": 16, "kind": "property", "displayName": "Proxy Protocol", "group": "proxy", "label": "proxy", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "To define a proxy prot [...]
+ "accessKey": { "index": 17, "kind": "property", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
+ "profileCredentialsName": { "index": 18, "kind": "property", "displayName": "Profile Credentials Name", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "If using a profile credentials provider this parameter will set the pro [...]
+ "secretKey": { "index": 19, "kind": "property", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" },
+ "sessionToken": { "index": 20, "kind": "property", "displayName": "Session Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Amazon AWS Session Token" },
+ "trustAllCertificates": { "index": 21, "kind": "property", "displayName": "Trust All Certificates", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding t [...]
+ "useDefaultCredentialsProvider": { "index": 22, "kind": "property", "displayName": "Use Default Credentials Provider", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Set whether the Textract client should ex [...]
+ "useProfileCredentialsProvider": { "index": 23, "kind": "property", "displayName": "Use Profile Credentials Provider", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Set whether the Textract client should ex [...]
+ "useSessionCredentials": { "index": 24, "kind": "property", "displayName": "Use Session Credentials", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Set whether the Textract client should expect to use Sessi [...]
+ },
+ "headers": {
+ "CamelAwsTextractOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation we want to perform", "constantName": "org.apache.camel.component.aws2.textract.Textract2Constants#OPERATION" },
+ "CamelAwsTextractS3Bucket": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The S3 bucket name", "constantName": "org.apache.camel.component.aws2.textract.Textract2Constants#S3_BUCKET" },
+ "CamelAwsTextractS3Object": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The S3 object name", "constantName": "org.apache.camel.component.aws2.textract.Textract2Constants#S3_OBJECT" },
+ "CamelAwsTextractS3ObjectVersion": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The S3 object version", "constantName": "org.apache.camel.component.aws2.textract.Textract2Constants#S3_OBJECT_VERSION" },
+ "CamelAwsTextractJobId": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The job ID for async operations", "constantName": "org.apache.camel.component.aws2.textract.Textract2Constants#JOB_ID" },
+ "CamelAwsTextractMaxResults": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The max results to return", "constantName": "org.apache.camel.component.aws2.textract.Textract2Constants#MAX_RESULTS" },
+ "CamelAwsTextractNextToken": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The next token for pagination", "constantName": "org.apache.camel.component.aws2.textract.Textract2Constants#NEXT_TOKEN" },
+ "CamelAwsTextractFeatureTypes": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "List<FeatureType>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The feature types for document analysis", "constantName": "org.apache.camel.component.aws2.textract.Textract2Constants#FEATURE_TYPES" }
+ },
+ "properties": {
+ "label": { "index": 0, "kind": "path", "displayName": "Label", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Logical name" },
+ "operation": { "index": 1, "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.textract.Textract2Operations", "enum": [ "detectDocumentText", "analyzeDocument", "analyzeExpense", "startDocumentTextDetection", "startDocumentAnalysis", "startExpenseAnalysis", "getDocumentTextDetection", "getDocumentAnalysis", "getExpenseAnalysis" ], "deprecated": false, "deprecationNote": "", [...]
+ "overrideEndpoint": { "index": 2, "kind": "parameter", "displayName": "Override Endpoint", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Set the need for overriding the endpoint. This option needs to be used in com [...]
+ "pojoRequest": { "index": 3, "kind": "parameter", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
+ "region": { "index": 4, "kind": "parameter", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "enum": [ "ap-south-2", "ap-south-1", "eu-south-1", "eu-south-2", "us-gov-east-1", "me-central-1", "il-central-1", "ca-central-1", "eu-central-1", "us-iso-west-1", "eu-central-2", "eu-isoe-west-1", "us-west-1", "us-west-2", "af-south-1", "eu-north-1", "eu-west-3", "eu-west-2", "eu-west-1", "ap-northeast-3", "ap-no [...]
+ "s3Bucket": { "index": 5, "kind": "parameter", "displayName": "S3 Bucket", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "The S3 bucket name for document location" },
+ "s3Object": { "index": 6, "kind": "parameter", "displayName": "S3 Object", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "The S3 object name for document location" },
+ "s3ObjectVersion": { "index": 7, "kind": "parameter", "displayName": "S3 Object Version", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "The S3 object version for document location" },
+ "uriEndpointOverride": { "index": 8, "kind": "parameter", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with ove [...]
+ "lazyStartProducer": { "index": 9, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 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 produc [...]
+ "textractClient": { "index": 10, "kind": "parameter", "displayName": "Textract Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.textract.TextractClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "To use an existing configu [...]
+ "proxyHost": { "index": 11, "kind": "parameter", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the Textract client" },
+ "proxyPort": { "index": 12, "kind": "parameter", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the Textract client" },
+ "proxyProtocol": { "index": 13, "kind": "parameter", "displayName": "Proxy Protocol", "group": "proxy", "label": "proxy", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "To define a proxy pro [...]
+ "accessKey": { "index": 14, "kind": "parameter", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
+ "profileCredentialsName": { "index": 15, "kind": "parameter", "displayName": "Profile Credentials Name", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "If using a profile credentials provider this parameter will set the pr [...]
+ "secretKey": { "index": 16, "kind": "parameter", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" },
+ "sessionToken": { "index": 17, "kind": "parameter", "displayName": "Session Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Amazon AWS Session Token" },
+ "trustAllCertificates": { "index": 18, "kind": "parameter", "displayName": "Trust All Certificates", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding [...]
+ "useDefaultCredentialsProvider": { "index": 19, "kind": "parameter", "displayName": "Use Default Credentials Provider", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Set whether the Textract client should e [...]
+ "useProfileCredentialsProvider": { "index": 20, "kind": "parameter", "displayName": "Use Profile Credentials Provider", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Set whether the Textract client should e [...]
+ "useSessionCredentials": { "index": 21, "kind": "parameter", "displayName": "Use Session Credentials", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Set whether the Textract client should expect to use Sess [...]
+ }
+}
diff --git a/components/camel-aws/camel-aws2-textract/pom.xml b/components/camel-aws/camel-aws2-textract/pom.xml
new file mode 100644
index 00000000000..90001ddbe97
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/pom.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-aws-parent</artifactId>
+ <version>4.15.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-aws2-textract</artifactId>
+ <packaging>jar</packaging>
+
+ <name>Camel :: AWS2 Textract</name>
+ <description>Extract text and data from documents using AWS Textract Service</description>
+
+ <properties>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-support</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>software.amazon.awssdk</groupId>
+ <artifactId>textract</artifactId>
+ <version>${aws-java-sdk2-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>software.amazon.awssdk</groupId>
+ <artifactId>sts</artifactId>
+ <version>${aws-java-sdk2-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>software.amazon.awssdk</groupId>
+ <artifactId>apache-client</artifactId>
+ <version>${aws-java-sdk2-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-health</artifactId>
+ </dependency>
+
+ <!-- for testing -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test-spring-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- test infra -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test-infra-aws-v2</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
diff --git a/components/camel-aws/camel-aws2-textract/src/generated/java/org/apache/camel/component/aws2/textract/Textract2ComponentConfigurer.java b/components/camel-aws/camel-aws2-textract/src/generated/java/org/apache/camel/component/aws2/textract/Textract2ComponentConfigurer.java
new file mode 100644
index 00000000000..8de21d94549
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/generated/java/org/apache/camel/component/aws2/textract/Textract2ComponentConfigurer.java
@@ -0,0 +1,198 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.component.aws2.textract;
+
+import javax.annotation.processing.Generated;
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
+import org.apache.camel.spi.PropertyConfigurerGetter;
+import org.apache.camel.spi.ConfigurerStrategy;
+import org.apache.camel.spi.GeneratedPropertyConfigurer;
+import org.apache.camel.util.CaseInsensitiveMap;
+import org.apache.camel.support.component.PropertyConfigurerSupport;
+
+/**
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@Generated("org.apache.camel.maven.packaging.EndpointSchemaGeneratorMojo")
+@SuppressWarnings("unchecked")
+public class Textract2ComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
+
+ private org.apache.camel.component.aws2.textract.Textract2Configuration getOrCreateConfiguration(Textract2Component target) {
+ if (target.getConfiguration() == null) {
+ target.setConfiguration(new org.apache.camel.component.aws2.textract.Textract2Configuration());
+ }
+ return target.getConfiguration();
+ }
+
+ @Override
+ public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
+ Textract2Component target = (Textract2Component) obj;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "accesskey":
+ case "accessKey": getOrCreateConfiguration(target).setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
+ case "autowiredenabled":
+ case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
+ case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.aws2.textract.Textract2Configuration.class, value)); return true;
+ case "healthcheckconsumerenabled":
+ case "healthCheckConsumerEnabled": target.setHealthCheckConsumerEnabled(property(camelContext, boolean.class, value)); return true;
+ case "healthcheckproducerenabled":
+ case "healthCheckProducerEnabled": target.setHealthCheckProducerEnabled(property(camelContext, boolean.class, value)); return true;
+ 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.textract.Textract2Operations.class, value)); return true;
+ case "overrideendpoint":
+ case "overrideEndpoint": getOrCreateConfiguration(target).setOverrideEndpoint(property(camelContext, boolean.class, value)); return true;
+ case "pojorequest":
+ case "pojoRequest": getOrCreateConfiguration(target).setPojoRequest(property(camelContext, boolean.class, value)); return true;
+ case "profilecredentialsname":
+ case "profileCredentialsName": getOrCreateConfiguration(target).setProfileCredentialsName(property(camelContext, java.lang.String.class, value)); return true;
+ case "proxyhost":
+ case "proxyHost": getOrCreateConfiguration(target).setProxyHost(property(camelContext, java.lang.String.class, value)); return true;
+ case "proxyport":
+ case "proxyPort": getOrCreateConfiguration(target).setProxyPort(property(camelContext, java.lang.Integer.class, value)); return true;
+ case "proxyprotocol":
+ case "proxyProtocol": getOrCreateConfiguration(target).setProxyProtocol(property(camelContext, software.amazon.awssdk.core.Protocol.class, value)); return true;
+ case "region": getOrCreateConfiguration(target).setRegion(property(camelContext, java.lang.String.class, value)); return true;
+ case "s3bucket":
+ case "s3Bucket": getOrCreateConfiguration(target).setS3Bucket(property(camelContext, java.lang.String.class, value)); return true;
+ case "s3object":
+ case "s3Object": getOrCreateConfiguration(target).setS3Object(property(camelContext, java.lang.String.class, value)); return true;
+ case "s3objectversion":
+ case "s3ObjectVersion": getOrCreateConfiguration(target).setS3ObjectVersion(property(camelContext, java.lang.String.class, value)); return true;
+ case "secretkey":
+ case "secretKey": getOrCreateConfiguration(target).setSecretKey(property(camelContext, java.lang.String.class, value)); return true;
+ case "sessiontoken":
+ case "sessionToken": getOrCreateConfiguration(target).setSessionToken(property(camelContext, java.lang.String.class, value)); return true;
+ case "textractclient":
+ case "textractClient": getOrCreateConfiguration(target).setTextractClient(property(camelContext, software.amazon.awssdk.services.textract.TextractClient.class, value)); return true;
+ case "trustallcertificates":
+ case "trustAllCertificates": getOrCreateConfiguration(target).setTrustAllCertificates(property(camelContext, boolean.class, value)); return true;
+ case "uriendpointoverride":
+ case "uriEndpointOverride": getOrCreateConfiguration(target).setUriEndpointOverride(property(camelContext, java.lang.String.class, value)); return true;
+ case "usedefaultcredentialsprovider":
+ case "useDefaultCredentialsProvider": getOrCreateConfiguration(target).setUseDefaultCredentialsProvider(property(camelContext, boolean.class, value)); return true;
+ case "useprofilecredentialsprovider":
+ case "useProfileCredentialsProvider": getOrCreateConfiguration(target).setUseProfileCredentialsProvider(property(camelContext, boolean.class, value)); return true;
+ case "usesessioncredentials":
+ case "useSessionCredentials": getOrCreateConfiguration(target).setUseSessionCredentials(property(camelContext, boolean.class, value)); return true;
+ default: return false;
+ }
+ }
+
+ @Override
+ public String[] getAutowiredNames() {
+ return new String[]{"textractClient"};
+ }
+
+ @Override
+ public Class<?> getOptionType(String name, boolean ignoreCase) {
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "accesskey":
+ case "accessKey": return java.lang.String.class;
+ case "autowiredenabled":
+ case "autowiredEnabled": return boolean.class;
+ case "configuration": return org.apache.camel.component.aws2.textract.Textract2Configuration.class;
+ case "healthcheckconsumerenabled":
+ case "healthCheckConsumerEnabled": return boolean.class;
+ case "healthcheckproducerenabled":
+ case "healthCheckProducerEnabled": return boolean.class;
+ case "lazystartproducer":
+ case "lazyStartProducer": return boolean.class;
+ case "operation": return org.apache.camel.component.aws2.textract.Textract2Operations.class;
+ case "overrideendpoint":
+ case "overrideEndpoint": return boolean.class;
+ case "pojorequest":
+ case "pojoRequest": return boolean.class;
+ case "profilecredentialsname":
+ case "profileCredentialsName": return java.lang.String.class;
+ case "proxyhost":
+ case "proxyHost": return java.lang.String.class;
+ case "proxyport":
+ case "proxyPort": return java.lang.Integer.class;
+ case "proxyprotocol":
+ case "proxyProtocol": return software.amazon.awssdk.core.Protocol.class;
+ case "region": return java.lang.String.class;
+ case "s3bucket":
+ case "s3Bucket": return java.lang.String.class;
+ case "s3object":
+ case "s3Object": return java.lang.String.class;
+ case "s3objectversion":
+ case "s3ObjectVersion": return java.lang.String.class;
+ case "secretkey":
+ case "secretKey": return java.lang.String.class;
+ case "sessiontoken":
+ case "sessionToken": return java.lang.String.class;
+ case "textractclient":
+ case "textractClient": return software.amazon.awssdk.services.textract.TextractClient.class;
+ case "trustallcertificates":
+ case "trustAllCertificates": return boolean.class;
+ case "uriendpointoverride":
+ case "uriEndpointOverride": return java.lang.String.class;
+ case "usedefaultcredentialsprovider":
+ case "useDefaultCredentialsProvider": return boolean.class;
+ case "useprofilecredentialsprovider":
+ case "useProfileCredentialsProvider": return boolean.class;
+ case "usesessioncredentials":
+ case "useSessionCredentials": return boolean.class;
+ default: return null;
+ }
+ }
+
+ @Override
+ public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
+ Textract2Component target = (Textract2Component) obj;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "accesskey":
+ case "accessKey": return getOrCreateConfiguration(target).getAccessKey();
+ case "autowiredenabled":
+ case "autowiredEnabled": return target.isAutowiredEnabled();
+ case "configuration": return target.getConfiguration();
+ case "healthcheckconsumerenabled":
+ case "healthCheckConsumerEnabled": return target.isHealthCheckConsumerEnabled();
+ case "healthcheckproducerenabled":
+ case "healthCheckProducerEnabled": return target.isHealthCheckProducerEnabled();
+ case "lazystartproducer":
+ case "lazyStartProducer": return target.isLazyStartProducer();
+ case "operation": return getOrCreateConfiguration(target).getOperation();
+ case "overrideendpoint":
+ case "overrideEndpoint": return getOrCreateConfiguration(target).isOverrideEndpoint();
+ case "pojorequest":
+ case "pojoRequest": return getOrCreateConfiguration(target).isPojoRequest();
+ case "profilecredentialsname":
+ case "profileCredentialsName": return getOrCreateConfiguration(target).getProfileCredentialsName();
+ case "proxyhost":
+ case "proxyHost": return getOrCreateConfiguration(target).getProxyHost();
+ case "proxyport":
+ case "proxyPort": return getOrCreateConfiguration(target).getProxyPort();
+ case "proxyprotocol":
+ case "proxyProtocol": return getOrCreateConfiguration(target).getProxyProtocol();
+ case "region": return getOrCreateConfiguration(target).getRegion();
+ case "s3bucket":
+ case "s3Bucket": return getOrCreateConfiguration(target).getS3Bucket();
+ case "s3object":
+ case "s3Object": return getOrCreateConfiguration(target).getS3Object();
+ case "s3objectversion":
+ case "s3ObjectVersion": return getOrCreateConfiguration(target).getS3ObjectVersion();
+ case "secretkey":
+ case "secretKey": return getOrCreateConfiguration(target).getSecretKey();
+ case "sessiontoken":
+ case "sessionToken": return getOrCreateConfiguration(target).getSessionToken();
+ case "textractclient":
+ case "textractClient": return getOrCreateConfiguration(target).getTextractClient();
+ case "trustallcertificates":
+ case "trustAllCertificates": return getOrCreateConfiguration(target).isTrustAllCertificates();
+ case "uriendpointoverride":
+ case "uriEndpointOverride": return getOrCreateConfiguration(target).getUriEndpointOverride();
+ case "usedefaultcredentialsprovider":
+ case "useDefaultCredentialsProvider": return getOrCreateConfiguration(target).isUseDefaultCredentialsProvider();
+ case "useprofilecredentialsprovider":
+ case "useProfileCredentialsProvider": return getOrCreateConfiguration(target).isUseProfileCredentialsProvider();
+ case "usesessioncredentials":
+ case "useSessionCredentials": return getOrCreateConfiguration(target).isUseSessionCredentials();
+ default: return null;
+ }
+ }
+}
+
diff --git a/components/camel-aws/camel-aws2-textract/src/generated/java/org/apache/camel/component/aws2/textract/Textract2EndpointConfigurer.java b/components/camel-aws/camel-aws2-textract/src/generated/java/org/apache/camel/component/aws2/textract/Textract2EndpointConfigurer.java
new file mode 100644
index 00000000000..6bb96174342
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/generated/java/org/apache/camel/component/aws2/textract/Textract2EndpointConfigurer.java
@@ -0,0 +1,170 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.component.aws2.textract;
+
+import javax.annotation.processing.Generated;
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
+import org.apache.camel.spi.PropertyConfigurerGetter;
+import org.apache.camel.spi.ConfigurerStrategy;
+import org.apache.camel.spi.GeneratedPropertyConfigurer;
+import org.apache.camel.util.CaseInsensitiveMap;
+import org.apache.camel.support.component.PropertyConfigurerSupport;
+
+/**
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@Generated("org.apache.camel.maven.packaging.EndpointSchemaGeneratorMojo")
+@SuppressWarnings("unchecked")
+public class Textract2EndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
+
+ @Override
+ public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
+ Textract2Endpoint target = (Textract2Endpoint) obj;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "accesskey":
+ case "accessKey": target.getConfiguration().setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
+ 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.textract.Textract2Operations.class, value)); return true;
+ case "overrideendpoint":
+ case "overrideEndpoint": target.getConfiguration().setOverrideEndpoint(property(camelContext, boolean.class, value)); return true;
+ case "pojorequest":
+ case "pojoRequest": target.getConfiguration().setPojoRequest(property(camelContext, boolean.class, value)); return true;
+ case "profilecredentialsname":
+ case "profileCredentialsName": target.getConfiguration().setProfileCredentialsName(property(camelContext, java.lang.String.class, value)); return true;
+ case "proxyhost":
+ case "proxyHost": target.getConfiguration().setProxyHost(property(camelContext, java.lang.String.class, value)); return true;
+ case "proxyport":
+ case "proxyPort": target.getConfiguration().setProxyPort(property(camelContext, java.lang.Integer.class, value)); return true;
+ case "proxyprotocol":
+ case "proxyProtocol": target.getConfiguration().setProxyProtocol(property(camelContext, software.amazon.awssdk.core.Protocol.class, value)); return true;
+ case "region": target.getConfiguration().setRegion(property(camelContext, java.lang.String.class, value)); return true;
+ case "s3bucket":
+ case "s3Bucket": target.getConfiguration().setS3Bucket(property(camelContext, java.lang.String.class, value)); return true;
+ case "s3object":
+ case "s3Object": target.getConfiguration().setS3Object(property(camelContext, java.lang.String.class, value)); return true;
+ case "s3objectversion":
+ case "s3ObjectVersion": target.getConfiguration().setS3ObjectVersion(property(camelContext, java.lang.String.class, value)); return true;
+ case "secretkey":
+ case "secretKey": target.getConfiguration().setSecretKey(property(camelContext, java.lang.String.class, value)); return true;
+ case "sessiontoken":
+ case "sessionToken": target.getConfiguration().setSessionToken(property(camelContext, java.lang.String.class, value)); return true;
+ case "textractclient":
+ case "textractClient": target.getConfiguration().setTextractClient(property(camelContext, software.amazon.awssdk.services.textract.TextractClient.class, value)); return true;
+ case "trustallcertificates":
+ case "trustAllCertificates": target.getConfiguration().setTrustAllCertificates(property(camelContext, boolean.class, value)); return true;
+ case "uriendpointoverride":
+ case "uriEndpointOverride": target.getConfiguration().setUriEndpointOverride(property(camelContext, java.lang.String.class, value)); return true;
+ case "usedefaultcredentialsprovider":
+ case "useDefaultCredentialsProvider": target.getConfiguration().setUseDefaultCredentialsProvider(property(camelContext, boolean.class, value)); return true;
+ case "useprofilecredentialsprovider":
+ case "useProfileCredentialsProvider": target.getConfiguration().setUseProfileCredentialsProvider(property(camelContext, boolean.class, value)); return true;
+ case "usesessioncredentials":
+ case "useSessionCredentials": target.getConfiguration().setUseSessionCredentials(property(camelContext, boolean.class, value)); return true;
+ default: return false;
+ }
+ }
+
+ @Override
+ public String[] getAutowiredNames() {
+ return new String[]{"textractClient"};
+ }
+
+ @Override
+ public Class<?> getOptionType(String name, boolean ignoreCase) {
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "accesskey":
+ case "accessKey": return java.lang.String.class;
+ case "lazystartproducer":
+ case "lazyStartProducer": return boolean.class;
+ case "operation": return org.apache.camel.component.aws2.textract.Textract2Operations.class;
+ case "overrideendpoint":
+ case "overrideEndpoint": return boolean.class;
+ case "pojorequest":
+ case "pojoRequest": return boolean.class;
+ case "profilecredentialsname":
+ case "profileCredentialsName": return java.lang.String.class;
+ case "proxyhost":
+ case "proxyHost": return java.lang.String.class;
+ case "proxyport":
+ case "proxyPort": return java.lang.Integer.class;
+ case "proxyprotocol":
+ case "proxyProtocol": return software.amazon.awssdk.core.Protocol.class;
+ case "region": return java.lang.String.class;
+ case "s3bucket":
+ case "s3Bucket": return java.lang.String.class;
+ case "s3object":
+ case "s3Object": return java.lang.String.class;
+ case "s3objectversion":
+ case "s3ObjectVersion": return java.lang.String.class;
+ case "secretkey":
+ case "secretKey": return java.lang.String.class;
+ case "sessiontoken":
+ case "sessionToken": return java.lang.String.class;
+ case "textractclient":
+ case "textractClient": return software.amazon.awssdk.services.textract.TextractClient.class;
+ case "trustallcertificates":
+ case "trustAllCertificates": return boolean.class;
+ case "uriendpointoverride":
+ case "uriEndpointOverride": return java.lang.String.class;
+ case "usedefaultcredentialsprovider":
+ case "useDefaultCredentialsProvider": return boolean.class;
+ case "useprofilecredentialsprovider":
+ case "useProfileCredentialsProvider": return boolean.class;
+ case "usesessioncredentials":
+ case "useSessionCredentials": return boolean.class;
+ default: return null;
+ }
+ }
+
+ @Override
+ public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
+ Textract2Endpoint target = (Textract2Endpoint) obj;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "accesskey":
+ case "accessKey": return target.getConfiguration().getAccessKey();
+ case "lazystartproducer":
+ case "lazyStartProducer": return target.isLazyStartProducer();
+ case "operation": return target.getConfiguration().getOperation();
+ case "overrideendpoint":
+ case "overrideEndpoint": return target.getConfiguration().isOverrideEndpoint();
+ case "pojorequest":
+ case "pojoRequest": return target.getConfiguration().isPojoRequest();
+ case "profilecredentialsname":
+ case "profileCredentialsName": return target.getConfiguration().getProfileCredentialsName();
+ case "proxyhost":
+ case "proxyHost": return target.getConfiguration().getProxyHost();
+ case "proxyport":
+ case "proxyPort": return target.getConfiguration().getProxyPort();
+ case "proxyprotocol":
+ case "proxyProtocol": return target.getConfiguration().getProxyProtocol();
+ case "region": return target.getConfiguration().getRegion();
+ case "s3bucket":
+ case "s3Bucket": return target.getConfiguration().getS3Bucket();
+ case "s3object":
+ case "s3Object": return target.getConfiguration().getS3Object();
+ case "s3objectversion":
+ case "s3ObjectVersion": return target.getConfiguration().getS3ObjectVersion();
+ case "secretkey":
+ case "secretKey": return target.getConfiguration().getSecretKey();
+ case "sessiontoken":
+ case "sessionToken": return target.getConfiguration().getSessionToken();
+ case "textractclient":
+ case "textractClient": return target.getConfiguration().getTextractClient();
+ case "trustallcertificates":
+ case "trustAllCertificates": return target.getConfiguration().isTrustAllCertificates();
+ case "uriendpointoverride":
+ case "uriEndpointOverride": return target.getConfiguration().getUriEndpointOverride();
+ case "usedefaultcredentialsprovider":
+ case "useDefaultCredentialsProvider": return target.getConfiguration().isUseDefaultCredentialsProvider();
+ case "useprofilecredentialsprovider":
+ case "useProfileCredentialsProvider": return target.getConfiguration().isUseProfileCredentialsProvider();
+ case "usesessioncredentials":
+ case "useSessionCredentials": return target.getConfiguration().isUseSessionCredentials();
+ default: return null;
+ }
+ }
+}
+
diff --git a/components/camel-aws/camel-aws2-textract/src/generated/java/org/apache/camel/component/aws2/textract/Textract2EndpointUriFactory.java b/components/camel-aws/camel-aws2-textract/src/generated/java/org/apache/camel/component/aws2/textract/Textract2EndpointUriFactory.java
new file mode 100644
index 00000000000..0f696451a24
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/generated/java/org/apache/camel/component/aws2/textract/Textract2EndpointUriFactory.java
@@ -0,0 +1,95 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.component.aws2.textract;
+
+import javax.annotation.processing.Generated;
+import java.net.URISyntaxException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.camel.spi.EndpointUriFactory;
+
+/**
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@Generated("org.apache.camel.maven.packaging.GenerateEndpointUriFactoryMojo")
+public class Textract2EndpointUriFactory extends org.apache.camel.support.component.EndpointUriFactorySupport implements EndpointUriFactory {
+
+ private static final String BASE = ":label";
+
+ private static final Set<String> PROPERTY_NAMES;
+ private static final Set<String> SECRET_PROPERTY_NAMES;
+ private static final Set<String> MULTI_VALUE_PREFIXES;
+ static {
+ Set<String> props = new HashSet<>(22);
+ props.add("accessKey");
+ props.add("label");
+ props.add("lazyStartProducer");
+ props.add("operation");
+ props.add("overrideEndpoint");
+ props.add("pojoRequest");
+ props.add("profileCredentialsName");
+ props.add("proxyHost");
+ props.add("proxyPort");
+ props.add("proxyProtocol");
+ props.add("region");
+ props.add("s3Bucket");
+ props.add("s3Object");
+ props.add("s3ObjectVersion");
+ props.add("secretKey");
+ props.add("sessionToken");
+ props.add("textractClient");
+ props.add("trustAllCertificates");
+ props.add("uriEndpointOverride");
+ props.add("useDefaultCredentialsProvider");
+ props.add("useProfileCredentialsProvider");
+ props.add("useSessionCredentials");
+ PROPERTY_NAMES = Collections.unmodifiableSet(props);
+ Set<String> secretProps = new HashSet<>(3);
+ secretProps.add("accessKey");
+ secretProps.add("secretKey");
+ secretProps.add("sessionToken");
+ SECRET_PROPERTY_NAMES = Collections.unmodifiableSet(secretProps);
+ MULTI_VALUE_PREFIXES = Collections.emptySet();
+ }
+
+ @Override
+ public boolean isEnabled(String scheme) {
+ return "aws2-textract".equals(scheme);
+ }
+
+ @Override
+ public String buildUri(String scheme, Map<String, Object> properties, boolean encode) throws URISyntaxException {
+ String syntax = scheme + BASE;
+ String uri = syntax;
+
+ Map<String, Object> copy = new HashMap<>(properties);
+
+ uri = buildPathParameter(syntax, uri, "label", null, true, copy);
+ uri = buildQueryParameters(uri, copy, encode);
+ return uri;
+ }
+
+ @Override
+ public Set<String> propertyNames() {
+ return PROPERTY_NAMES;
+ }
+
+ @Override
+ public Set<String> secretPropertyNames() {
+ return SECRET_PROPERTY_NAMES;
+ }
+
+ @Override
+ public Set<String> multiValuePrefixes() {
+ return MULTI_VALUE_PREFIXES;
+ }
+
+ @Override
+ public boolean isLenientProperties() {
+ return false;
+ }
+}
+
diff --git a/components/camel-aws/camel-aws2-textract/src/generated/resources/META-INF/org/apache/camel/component/aws2/textract/aws2-textract.json b/components/camel-aws/camel-aws2-textract/src/generated/resources/META-INF/org/apache/camel/component/aws2/textract/aws2-textract.json
new file mode 100644
index 00000000000..8a5ed70868f
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/generated/resources/META-INF/org/apache/camel/component/aws2/textract/aws2-textract.json
@@ -0,0 +1,87 @@
+{
+ "component": {
+ "kind": "component",
+ "name": "aws2-textract",
+ "title": "AWS Textract",
+ "description": "Extract text and data from documents using AWS Textract and AWS SDK version 2.x.",
+ "deprecated": false,
+ "firstVersion": "4.15.0",
+ "label": "cloud,document",
+ "javaType": "org.apache.camel.component.aws2.textract.Textract2Component",
+ "supportLevel": "Preview",
+ "groupId": "org.apache.camel",
+ "artifactId": "camel-aws2-textract",
+ "version": "4.15.0-SNAPSHOT",
+ "scheme": "aws2-textract",
+ "extendsScheme": "",
+ "syntax": "aws2-textract:label",
+ "async": false,
+ "api": false,
+ "consumerOnly": false,
+ "producerOnly": true,
+ "lenientProperties": false,
+ "browsable": false,
+ "remote": true
+ },
+ "componentProperties": {
+ "configuration": { "index": 0, "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.textract.Textract2Configuration", "deprecated": false, "autowired": false, "secret": false, "description": "Component configuration" },
+ "lazyStartProducer": { "index": 1, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 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 [...]
+ "operation": { "index": 2, "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.textract.Textract2Operations", "enum": [ "detectDocumentText", "analyzeDocument", "analyzeExpense", "startDocumentTextDetection", "startDocumentAnalysis", "startExpenseAnalysis", "getDocumentTextDetection", "getDocumentAnalysis", "getExpenseAnalysis" ], "deprecated": false, "deprecationNote": "", [...]
+ "overrideEndpoint": { "index": 3, "kind": "property", "displayName": "Override Endpoint", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Set the need for overriding the endpoint. This option needs to be used in comb [...]
+ "pojoRequest": { "index": 4, "kind": "property", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
+ "region": { "index": 5, "kind": "property", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "enum": [ "ap-south-2", "ap-south-1", "eu-south-1", "eu-south-2", "us-gov-east-1", "me-central-1", "il-central-1", "ca-central-1", "eu-central-1", "us-iso-west-1", "eu-central-2", "eu-isoe-west-1", "us-west-1", "us-west-2", "af-south-1", "eu-north-1", "eu-west-3", "eu-west-2", "eu-west-1", "ap-northeast-3", "ap-nor [...]
+ "s3Bucket": { "index": 6, "kind": "property", "displayName": "S3 Bucket", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "The S3 bucket name for document location" },
+ "s3Object": { "index": 7, "kind": "property", "displayName": "S3 Object", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "The S3 object name for document location" },
+ "s3ObjectVersion": { "index": 8, "kind": "property", "displayName": "S3 Object Version", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "The S3 object version for document location" },
+ "uriEndpointOverride": { "index": 9, "kind": "property", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with over [...]
+ "autowiredEnabled": { "index": 10, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching [...]
+ "textractClient": { "index": 11, "kind": "property", "displayName": "Textract Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.textract.TextractClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "To use an existing configur [...]
+ "healthCheckConsumerEnabled": { "index": 12, "kind": "property", "displayName": "Health Check Consumer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all consumer based health checks from this component" },
+ "healthCheckProducerEnabled": { "index": 13, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on produce [...]
+ "proxyHost": { "index": 14, "kind": "property", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the Textract client" },
+ "proxyPort": { "index": 15, "kind": "property", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the Textract client" },
+ "proxyProtocol": { "index": 16, "kind": "property", "displayName": "Proxy Protocol", "group": "proxy", "label": "proxy", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "To define a proxy prot [...]
+ "accessKey": { "index": 17, "kind": "property", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
+ "profileCredentialsName": { "index": 18, "kind": "property", "displayName": "Profile Credentials Name", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "If using a profile credentials provider this parameter will set the pro [...]
+ "secretKey": { "index": 19, "kind": "property", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" },
+ "sessionToken": { "index": 20, "kind": "property", "displayName": "Session Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Amazon AWS Session Token" },
+ "trustAllCertificates": { "index": 21, "kind": "property", "displayName": "Trust All Certificates", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding t [...]
+ "useDefaultCredentialsProvider": { "index": 22, "kind": "property", "displayName": "Use Default Credentials Provider", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Set whether the Textract client should ex [...]
+ "useProfileCredentialsProvider": { "index": 23, "kind": "property", "displayName": "Use Profile Credentials Provider", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Set whether the Textract client should ex [...]
+ "useSessionCredentials": { "index": 24, "kind": "property", "displayName": "Use Session Credentials", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Set whether the Textract client should expect to use Sessi [...]
+ },
+ "headers": {
+ "CamelAwsTextractOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation we want to perform", "constantName": "org.apache.camel.component.aws2.textract.Textract2Constants#OPERATION" },
+ "CamelAwsTextractS3Bucket": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The S3 bucket name", "constantName": "org.apache.camel.component.aws2.textract.Textract2Constants#S3_BUCKET" },
+ "CamelAwsTextractS3Object": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The S3 object name", "constantName": "org.apache.camel.component.aws2.textract.Textract2Constants#S3_OBJECT" },
+ "CamelAwsTextractS3ObjectVersion": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The S3 object version", "constantName": "org.apache.camel.component.aws2.textract.Textract2Constants#S3_OBJECT_VERSION" },
+ "CamelAwsTextractJobId": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The job ID for async operations", "constantName": "org.apache.camel.component.aws2.textract.Textract2Constants#JOB_ID" },
+ "CamelAwsTextractMaxResults": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The max results to return", "constantName": "org.apache.camel.component.aws2.textract.Textract2Constants#MAX_RESULTS" },
+ "CamelAwsTextractNextToken": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The next token for pagination", "constantName": "org.apache.camel.component.aws2.textract.Textract2Constants#NEXT_TOKEN" },
+ "CamelAwsTextractFeatureTypes": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "List<FeatureType>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The feature types for document analysis", "constantName": "org.apache.camel.component.aws2.textract.Textract2Constants#FEATURE_TYPES" }
+ },
+ "properties": {
+ "label": { "index": 0, "kind": "path", "displayName": "Label", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Logical name" },
+ "operation": { "index": 1, "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.textract.Textract2Operations", "enum": [ "detectDocumentText", "analyzeDocument", "analyzeExpense", "startDocumentTextDetection", "startDocumentAnalysis", "startExpenseAnalysis", "getDocumentTextDetection", "getDocumentAnalysis", "getExpenseAnalysis" ], "deprecated": false, "deprecationNote": "", [...]
+ "overrideEndpoint": { "index": 2, "kind": "parameter", "displayName": "Override Endpoint", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Set the need for overriding the endpoint. This option needs to be used in com [...]
+ "pojoRequest": { "index": 3, "kind": "parameter", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
+ "region": { "index": 4, "kind": "parameter", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "enum": [ "ap-south-2", "ap-south-1", "eu-south-1", "eu-south-2", "us-gov-east-1", "me-central-1", "il-central-1", "ca-central-1", "eu-central-1", "us-iso-west-1", "eu-central-2", "eu-isoe-west-1", "us-west-1", "us-west-2", "af-south-1", "eu-north-1", "eu-west-3", "eu-west-2", "eu-west-1", "ap-northeast-3", "ap-no [...]
+ "s3Bucket": { "index": 5, "kind": "parameter", "displayName": "S3 Bucket", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "The S3 bucket name for document location" },
+ "s3Object": { "index": 6, "kind": "parameter", "displayName": "S3 Object", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "The S3 object name for document location" },
+ "s3ObjectVersion": { "index": 7, "kind": "parameter", "displayName": "S3 Object Version", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "The S3 object version for document location" },
+ "uriEndpointOverride": { "index": 8, "kind": "parameter", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with ove [...]
+ "lazyStartProducer": { "index": 9, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 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 produc [...]
+ "textractClient": { "index": 10, "kind": "parameter", "displayName": "Textract Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.textract.TextractClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "To use an existing configu [...]
+ "proxyHost": { "index": 11, "kind": "parameter", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the Textract client" },
+ "proxyPort": { "index": 12, "kind": "parameter", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the Textract client" },
+ "proxyProtocol": { "index": 13, "kind": "parameter", "displayName": "Proxy Protocol", "group": "proxy", "label": "proxy", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "To define a proxy pro [...]
+ "accessKey": { "index": 14, "kind": "parameter", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
+ "profileCredentialsName": { "index": 15, "kind": "parameter", "displayName": "Profile Credentials Name", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "If using a profile credentials provider this parameter will set the pr [...]
+ "secretKey": { "index": 16, "kind": "parameter", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" },
+ "sessionToken": { "index": 17, "kind": "parameter", "displayName": "Session Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Amazon AWS Session Token" },
+ "trustAllCertificates": { "index": 18, "kind": "parameter", "displayName": "Trust All Certificates", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding [...]
+ "useDefaultCredentialsProvider": { "index": 19, "kind": "parameter", "displayName": "Use Default Credentials Provider", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Set whether the Textract client should e [...]
+ "useProfileCredentialsProvider": { "index": 20, "kind": "parameter", "displayName": "Use Profile Credentials Provider", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Set whether the Textract client should e [...]
+ "useSessionCredentials": { "index": 21, "kind": "parameter", "displayName": "Use Session Credentials", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.textract.Textract2Configuration", "configurationField": "configuration", "description": "Set whether the Textract client should expect to use Sess [...]
+ }
+}
diff --git a/components/camel-aws/camel-aws2-textract/src/generated/resources/META-INF/services/org/apache/camel/component.properties b/components/camel-aws/camel-aws2-textract/src/generated/resources/META-INF/services/org/apache/camel/component.properties
new file mode 100644
index 00000000000..656b5188077
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/generated/resources/META-INF/services/org/apache/camel/component.properties
@@ -0,0 +1,7 @@
+# Generated by camel build tools - do NOT edit this file!
+components=aws2-textract
+groupId=org.apache.camel
+artifactId=camel-aws2-textract
+version=4.15.0-SNAPSHOT
+projectName=Camel :: AWS2 Textract
+projectDescription=Extract text and data from documents using AWS Textract Service
diff --git a/components/camel-aws/camel-aws2-textract/src/generated/resources/META-INF/services/org/apache/camel/component/aws2-textract b/components/camel-aws/camel-aws2-textract/src/generated/resources/META-INF/services/org/apache/camel/component/aws2-textract
new file mode 100644
index 00000000000..482c72b1f1c
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/generated/resources/META-INF/services/org/apache/camel/component/aws2-textract
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.aws2.textract.Textract2Component
diff --git a/components/camel-aws/camel-aws2-textract/src/generated/resources/META-INF/services/org/apache/camel/configurer/aws2-textract-component b/components/camel-aws/camel-aws2-textract/src/generated/resources/META-INF/services/org/apache/camel/configurer/aws2-textract-component
new file mode 100644
index 00000000000..8f0fe236ca5
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/generated/resources/META-INF/services/org/apache/camel/configurer/aws2-textract-component
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.aws2.textract.Textract2ComponentConfigurer
diff --git a/components/camel-aws/camel-aws2-textract/src/generated/resources/META-INF/services/org/apache/camel/configurer/aws2-textract-endpoint b/components/camel-aws/camel-aws2-textract/src/generated/resources/META-INF/services/org/apache/camel/configurer/aws2-textract-endpoint
new file mode 100644
index 00000000000..0975abcbc8e
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/generated/resources/META-INF/services/org/apache/camel/configurer/aws2-textract-endpoint
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.aws2.textract.Textract2EndpointConfigurer
diff --git a/components/camel-aws/camel-aws2-textract/src/generated/resources/META-INF/services/org/apache/camel/urifactory/aws2-textract-endpoint b/components/camel-aws/camel-aws2-textract/src/generated/resources/META-INF/services/org/apache/camel/urifactory/aws2-textract-endpoint
new file mode 100644
index 00000000000..2755086ed86
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/generated/resources/META-INF/services/org/apache/camel/urifactory/aws2-textract-endpoint
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.aws2.textract.Textract2EndpointUriFactory
diff --git a/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/Textract2Component.java b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/Textract2Component.java
new file mode 100644
index 00000000000..98f61260d99
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/Textract2Component.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.textract;
+
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Endpoint;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.annotations.Component;
+import org.apache.camel.support.HealthCheckComponent;
+
+/**
+ * For working with Amazon Textract SDK v2.
+ */
+@Component("aws2-textract")
+public class Textract2Component extends HealthCheckComponent {
+
+ @Metadata
+ private Textract2Configuration configuration = new Textract2Configuration();
+
+ public Textract2Component() {
+ this(null);
+ }
+
+ public Textract2Component(CamelContext context) {
+ super(context);
+ }
+
+ @Override
+ protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
+ Textract2Configuration configuration
+ = this.configuration != null ? this.configuration.copy() : new Textract2Configuration();
+
+ Textract2Endpoint endpoint = new Textract2Endpoint(uri, this, configuration);
+ setProperties(endpoint, parameters);
+ if (Boolean.FALSE.equals(configuration.isUseDefaultCredentialsProvider())
+ && Boolean.FALSE.equals(configuration.isUseProfileCredentialsProvider())
+ && Boolean.FALSE.equals(configuration.isUseSessionCredentials())
+ && configuration.getTextractClient() == null
+ && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) {
+ throw new IllegalArgumentException(
+ "useDefaultCredentialsProvider is set to false, useProfileCredentialsProvider is set to false, useSessionCredentials is set to false, Amazon Textract client or accessKey and secretKey must be specified");
+ }
+ return endpoint;
+ }
+
+ public Textract2Configuration getConfiguration() {
+ return configuration;
+ }
+
+ /**
+ * Component configuration
+ */
+ public void setConfiguration(Textract2Configuration configuration) {
+ this.configuration = configuration;
+ }
+}
diff --git a/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/Textract2Configuration.java b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/Textract2Configuration.java
new file mode 100644
index 00000000000..f6ccb29221d
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/Textract2Configuration.java
@@ -0,0 +1,318 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.textract;
+
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriParams;
+import org.apache.camel.spi.UriPath;
+import software.amazon.awssdk.core.Protocol;
+import software.amazon.awssdk.services.textract.TextractClient;
+
+@UriParams
+public class Textract2Configuration implements Cloneable {
+
+ @UriPath(description = "Logical name")
+ @Metadata(required = true)
+ private String label;
+ @UriParam(label = "advanced")
+ @Metadata(autowired = true)
+ private TextractClient textractClient;
+ @UriParam(label = "security", secret = true)
+ private String accessKey;
+ @UriParam(label = "security", secret = true)
+ private String secretKey;
+ @UriParam(label = "security", secret = true)
+ private String sessionToken;
+ @UriParam(defaultValue = "detectDocumentText")
+ @Metadata(required = true)
+ private Textract2Operations operation = Textract2Operations.detectDocumentText;
+ @UriParam(label = "proxy", enums = "HTTP,HTTPS", defaultValue = "HTTPS")
+ private Protocol proxyProtocol = Protocol.HTTPS;
+ @UriParam(label = "proxy")
+ private String proxyHost;
+ @UriParam(label = "proxy")
+ private Integer proxyPort;
+ @UriParam(enums = "ap-south-2,ap-south-1,eu-south-1,eu-south-2,us-gov-east-1,me-central-1,il-central-1,ca-central-1,eu-central-1,us-iso-west-1,eu-central-2,eu-isoe-west-1,us-west-1,us-west-2,af-south-1,eu-north-1,eu-west-3,eu-west-2,eu-west-1,ap-northeast-3,ap-northeast-2,ap-northeast-1,me-south-1,sa-east-1,ap-east-1,cn-north-1,ca-west-1,us-gov-west-1,ap-southeast-1,ap-southeast-2,us-iso-east-1,ap-southeast-3,ap-southeast-4,us-east-1,us-east-2,cn-northwest-1,us-isob-east-1,aws-global [...]
+ private String region;
+ @UriParam
+ private boolean pojoRequest;
+ @UriParam(label = "security")
+ private boolean trustAllCertificates;
+ @UriParam
+ private boolean overrideEndpoint;
+ @UriParam
+ private String uriEndpointOverride;
+ @UriParam(label = "security")
+ private boolean useDefaultCredentialsProvider;
+ @UriParam(label = "security")
+ private boolean useProfileCredentialsProvider;
+ @UriParam(label = "security")
+ private boolean useSessionCredentials;
+ @UriParam(label = "security")
+ private String profileCredentialsName;
+ @UriParam
+ private String s3Bucket;
+ @UriParam
+ private String s3Object;
+ @UriParam
+ private String s3ObjectVersion;
+
+ public TextractClient getTextractClient() {
+ return textractClient;
+ }
+
+ /**
+ * To use an existing configured AWS Textract client
+ */
+ public void setTextractClient(TextractClient textractClient) {
+ this.textractClient = textractClient;
+ }
+
+ public String getAccessKey() {
+ return accessKey;
+ }
+
+ /**
+ * Amazon AWS Access Key
+ */
+ public void setAccessKey(String accessKey) {
+ this.accessKey = accessKey;
+ }
+
+ public String getSecretKey() {
+ return secretKey;
+ }
+
+ /**
+ * Amazon AWS Secret Key
+ */
+ public void setSecretKey(String secretKey) {
+ this.secretKey = secretKey;
+ }
+
+ public String getSessionToken() {
+ return sessionToken;
+ }
+
+ /**
+ * Amazon AWS Session Token
+ */
+ public void setSessionToken(String sessionToken) {
+ this.sessionToken = sessionToken;
+ }
+
+ public Textract2Operations getOperation() {
+ return operation;
+ }
+
+ /**
+ * The operation to perform
+ */
+ public void setOperation(Textract2Operations operation) {
+ this.operation = operation;
+ }
+
+ public Protocol getProxyProtocol() {
+ return proxyProtocol;
+ }
+
+ /**
+ * To define a proxy protocol when instantiating the Textract client
+ */
+ public void setProxyProtocol(Protocol proxyProtocol) {
+ this.proxyProtocol = proxyProtocol;
+ }
+
+ public String getProxyHost() {
+ return proxyHost;
+ }
+
+ /**
+ * To define a proxy host when instantiating the Textract client
+ */
+ public void setProxyHost(String proxyHost) {
+ this.proxyHost = proxyHost;
+ }
+
+ public Integer getProxyPort() {
+ return proxyPort;
+ }
+
+ /**
+ * To define a proxy port when instantiating the Textract client
+ */
+ public void setProxyPort(Integer proxyPort) {
+ this.proxyPort = proxyPort;
+ }
+
+ public String getRegion() {
+ return region;
+ }
+
+ /**
+ * The region in which Textract client needs to work. When using this parameter, the configuration will expect the
+ * lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU_WEST_1.id()
+ */
+ 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;
+ }
+
+ public boolean isTrustAllCertificates() {
+ return trustAllCertificates;
+ }
+
+ /**
+ * If we want to trust all certificates in case of overriding the endpoint
+ */
+ public void setTrustAllCertificates(boolean trustAllCertificates) {
+ this.trustAllCertificates = trustAllCertificates;
+ }
+
+ public boolean isOverrideEndpoint() {
+ return overrideEndpoint;
+ }
+
+ /**
+ * Set the need for overriding the endpoint. This option needs to be used in combination with uriEndpointOverride
+ * option
+ */
+ public void setOverrideEndpoint(boolean overrideEndpoint) {
+ this.overrideEndpoint = overrideEndpoint;
+ }
+
+ public String getUriEndpointOverride() {
+ return uriEndpointOverride;
+ }
+
+ /**
+ * Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option
+ */
+ public void setUriEndpointOverride(String uriEndpointOverride) {
+ this.uriEndpointOverride = uriEndpointOverride;
+ }
+
+ public boolean isUseDefaultCredentialsProvider() {
+ return useDefaultCredentialsProvider;
+ }
+
+ /**
+ * Set whether the Textract client should expect to load credentials through a default credentials provider or to
+ * expect static credentials to be passed in.
+ */
+ public void setUseDefaultCredentialsProvider(boolean useDefaultCredentialsProvider) {
+ this.useDefaultCredentialsProvider = useDefaultCredentialsProvider;
+ }
+
+ public boolean isUseProfileCredentialsProvider() {
+ return useProfileCredentialsProvider;
+ }
+
+ /**
+ * Set whether the Textract client should expect to load credentials through a profile credentials provider.
+ */
+ public void setUseProfileCredentialsProvider(boolean useProfileCredentialsProvider) {
+ this.useProfileCredentialsProvider = useProfileCredentialsProvider;
+ }
+
+ public boolean isUseSessionCredentials() {
+ return useSessionCredentials;
+ }
+
+ /**
+ * Set whether the Textract client should expect to use Session Credentials. This is useful in situation in which
+ * the user needs to assume a IAM role for doing operations in Textract.
+ */
+ public void setUseSessionCredentials(boolean useSessionCredentials) {
+ this.useSessionCredentials = useSessionCredentials;
+ }
+
+ public String getProfileCredentialsName() {
+ return profileCredentialsName;
+ }
+
+ /**
+ * If using a profile credentials provider this parameter will set the profile name.
+ */
+ public void setProfileCredentialsName(String profileCredentialsName) {
+ this.profileCredentialsName = profileCredentialsName;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ /**
+ * A logical name to use.
+ */
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+ public String getS3Bucket() {
+ return s3Bucket;
+ }
+
+ /**
+ * The S3 bucket name for document location
+ */
+ public void setS3Bucket(String s3Bucket) {
+ this.s3Bucket = s3Bucket;
+ }
+
+ public String getS3Object() {
+ return s3Object;
+ }
+
+ /**
+ * The S3 object name for document location
+ */
+ public void setS3Object(String s3Object) {
+ this.s3Object = s3Object;
+ }
+
+ public String getS3ObjectVersion() {
+ return s3ObjectVersion;
+ }
+
+ /**
+ * The S3 object version for document location
+ */
+ public void setS3ObjectVersion(String s3ObjectVersion) {
+ this.s3ObjectVersion = s3ObjectVersion;
+ }
+
+ public Textract2Configuration copy() {
+ try {
+ return (Textract2Configuration) super.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new RuntimeCamelException(e);
+ }
+ }
+}
diff --git a/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/Textract2Constants.java b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/Textract2Constants.java
new file mode 100644
index 00000000000..159b5a1ebdf
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/Textract2Constants.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.textract;
+
+import org.apache.camel.spi.Metadata;
+
+/**
+ * Constants used in Camel AWS2 Textract module
+ */
+public interface Textract2Constants {
+ @Metadata(description = "The operation we want to perform", javaType = "String")
+ String OPERATION = "CamelAwsTextractOperation";
+ @Metadata(description = "The S3 bucket name", javaType = "String")
+ String S3_BUCKET = "CamelAwsTextractS3Bucket";
+ @Metadata(description = "The S3 object name", javaType = "String")
+ String S3_OBJECT = "CamelAwsTextractS3Object";
+ @Metadata(description = "The S3 object version", javaType = "String")
+ String S3_OBJECT_VERSION = "CamelAwsTextractS3ObjectVersion";
+ @Metadata(description = "The job ID for async operations", javaType = "String")
+ String JOB_ID = "CamelAwsTextractJobId";
+ @Metadata(description = "The max results to return", javaType = "Integer")
+ String MAX_RESULTS = "CamelAwsTextractMaxResults";
+ @Metadata(description = "The next token for pagination", javaType = "String")
+ String NEXT_TOKEN = "CamelAwsTextractNextToken";
+ @Metadata(description = "The feature types for document analysis", javaType = "List<FeatureType>")
+ String FEATURE_TYPES = "CamelAwsTextractFeatureTypes";
+}
diff --git a/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/Textract2Endpoint.java b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/Textract2Endpoint.java
new file mode 100644
index 00000000000..1c3bab7ab0f
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/Textract2Endpoint.java
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.textract;
+
+import org.apache.camel.Category;
+import org.apache.camel.Component;
+import org.apache.camel.Consumer;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.component.aws2.textract.client.Textract2ClientFactory;
+import org.apache.camel.spi.EndpointServiceLocation;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.support.ScheduledPollEndpoint;
+import org.apache.camel.util.ObjectHelper;
+import software.amazon.awssdk.services.textract.TextractClient;
+
+/**
+ * Extract text and data from documents using AWS Textract and AWS SDK version 2.x.
+ */
+@UriEndpoint(firstVersion = "4.15.0", scheme = "aws2-textract", title = "AWS Textract", syntax = "aws2-textract:label",
+ producerOnly = true, category = { Category.CLOUD, Category.DOCUMENT }, headersClass = Textract2Constants.class)
+public class Textract2Endpoint extends ScheduledPollEndpoint implements EndpointServiceLocation {
+
+ private TextractClient textractClient;
+
+ @UriParam
+ private Textract2Configuration configuration;
+
+ public Textract2Endpoint(String uri, Component component, Textract2Configuration configuration) {
+ super(uri, component);
+ this.configuration = configuration;
+ }
+
+ @Override
+ public Consumer createConsumer(Processor processor) throws Exception {
+ throw new UnsupportedOperationException("You cannot receive messages from this endpoint");
+ }
+
+ @Override
+ public Producer createProducer() throws Exception {
+ return new Textract2Producer(this);
+ }
+
+ @Override
+ public Textract2Component getComponent() {
+ return (Textract2Component) super.getComponent();
+ }
+
+ @Override
+ public void doStart() throws Exception {
+ super.doStart();
+
+ textractClient
+ = configuration.getTextractClient() != null
+ ? configuration.getTextractClient()
+ : Textract2ClientFactory.getTextractClient(configuration).getTextractClient();
+ }
+
+ @Override
+ public void doStop() throws Exception {
+ if (ObjectHelper.isEmpty(configuration.getTextractClient())) {
+ if (textractClient != null) {
+ textractClient.close();
+ }
+ }
+ super.doStop();
+ }
+
+ public Textract2Configuration getConfiguration() {
+ return configuration;
+ }
+
+ public TextractClient getTextractClient() {
+ return textractClient;
+ }
+
+ @Override
+ public String getServiceUrl() {
+ if (!configuration.isOverrideEndpoint()) {
+ if (ObjectHelper.isNotEmpty(configuration.getRegion())) {
+ return configuration.getRegion();
+ }
+ } else if (ObjectHelper.isNotEmpty(configuration.getUriEndpointOverride())) {
+ return configuration.getUriEndpointOverride();
+ }
+ return null;
+ }
+
+ @Override
+ public String getServiceProtocol() {
+ return "textract";
+ }
+}
diff --git a/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/Textract2Operations.java b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/Textract2Operations.java
new file mode 100644
index 00000000000..675006cfa91
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/Textract2Operations.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.textract;
+
+public enum Textract2Operations {
+
+ detectDocumentText,
+ analyzeDocument,
+ analyzeExpense,
+ startDocumentTextDetection,
+ startDocumentAnalysis,
+ startExpenseAnalysis,
+ getDocumentTextDetection,
+ getDocumentAnalysis,
+ getExpenseAnalysis
+}
diff --git a/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/Textract2Producer.java b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/Textract2Producer.java
new file mode 100644
index 00000000000..7a696da02ef
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/Textract2Producer.java
@@ -0,0 +1,559 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.textract;
+
+import java.util.List;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.InvalidPayloadException;
+import org.apache.camel.Message;
+import org.apache.camel.health.HealthCheck;
+import org.apache.camel.health.HealthCheckHelper;
+import org.apache.camel.health.WritableHealthCheckRepository;
+import org.apache.camel.support.DefaultProducer;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.util.URISupport;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.awscore.exception.AwsServiceException;
+import software.amazon.awssdk.core.SdkBytes;
+import software.amazon.awssdk.services.textract.TextractClient;
+import software.amazon.awssdk.services.textract.model.*;
+
+/**
+ * A Producer which sends messages to the Amazon Textract Service SDK v2 <a href="http://aws.amazon.com/textract/">AWS
+ * Textract</a>
+ */
+public class Textract2Producer extends DefaultProducer {
+
+ private static final Logger LOG = LoggerFactory.getLogger(Textract2Producer.class);
+ private transient String textractProducerToString;
+ private HealthCheck producerHealthCheck;
+ private WritableHealthCheckRepository healthCheckRepository;
+
+ public Textract2Producer(Endpoint endpoint) {
+ super(endpoint);
+ }
+
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ switch (determineOperation(exchange)) {
+ case detectDocumentText:
+ detectDocumentText(getEndpoint().getTextractClient(), exchange);
+ break;
+ case analyzeDocument:
+ analyzeDocument(getEndpoint().getTextractClient(), exchange);
+ break;
+ case analyzeExpense:
+ analyzeExpense(getEndpoint().getTextractClient(), exchange);
+ break;
+ case startDocumentTextDetection:
+ startDocumentTextDetection(getEndpoint().getTextractClient(), exchange);
+ break;
+ case startDocumentAnalysis:
+ startDocumentAnalysis(getEndpoint().getTextractClient(), exchange);
+ break;
+ case startExpenseAnalysis:
+ startExpenseAnalysis(getEndpoint().getTextractClient(), exchange);
+ break;
+ case getDocumentTextDetection:
+ getDocumentTextDetection(getEndpoint().getTextractClient(), exchange);
+ break;
+ case getDocumentAnalysis:
+ getDocumentAnalysis(getEndpoint().getTextractClient(), exchange);
+ break;
+ case getExpenseAnalysis:
+ getExpenseAnalysis(getEndpoint().getTextractClient(), exchange);
+ break;
+ default:
+ throw new IllegalArgumentException("Unsupported operation");
+ }
+ }
+
+ private Textract2Operations determineOperation(Exchange exchange) {
+ Textract2Operations operation = exchange.getIn().getHeader(Textract2Constants.OPERATION, Textract2Operations.class);
+ if (operation == null) {
+ operation = getConfiguration().getOperation();
+ }
+ return operation;
+ }
+
+ protected Textract2Configuration getConfiguration() {
+ return getEndpoint().getConfiguration();
+ }
+
+ @Override
+ public String toString() {
+ if (textractProducerToString == null) {
+ textractProducerToString = "TextractProducer[" + URISupport.sanitizeUri(getEndpoint().getEndpointUri()) + "]";
+ }
+ return textractProducerToString;
+ }
+
+ @Override
+ public Textract2Endpoint getEndpoint() {
+ return (Textract2Endpoint) super.getEndpoint();
+ }
+
+ private void detectDocumentText(TextractClient textractClient, Exchange exchange) throws InvalidPayloadException {
+ if (getConfiguration().isPojoRequest()) {
+ Object payload = exchange.getIn().getMandatoryBody();
+ if (payload instanceof DetectDocumentTextRequest) {
+ DetectDocumentTextResponse result;
+ try {
+ result = textractClient.detectDocumentText((DetectDocumentTextRequest) payload);
+ } catch (AwsServiceException ase) {
+ LOG.trace("Detect Document Text command returned the error code {}", ase.awsErrorDetails().errorCode());
+ throw ase;
+ }
+ Message message = getMessageForResponse(exchange);
+ message.setBody(result);
+ }
+ } else {
+ DetectDocumentTextRequest.Builder request = DetectDocumentTextRequest.builder();
+ Document document = createDocumentFromExchange(exchange);
+ request.document(document);
+
+ DetectDocumentTextResponse result;
+ try {
+ result = textractClient.detectDocumentText(request.build());
+ } catch (AwsServiceException ase) {
+ LOG.trace("Detect Document Text command returned the error code {}", ase.awsErrorDetails().errorCode());
+ throw ase;
+ }
+ Message message = getMessageForResponse(exchange);
+ message.setBody(result);
+ }
+ }
+
+ private void analyzeDocument(TextractClient textractClient, Exchange exchange) throws InvalidPayloadException {
+ if (getConfiguration().isPojoRequest()) {
+ Object payload = exchange.getIn().getMandatoryBody();
+ if (payload instanceof AnalyzeDocumentRequest) {
+ AnalyzeDocumentResponse result;
+ try {
+ result = textractClient.analyzeDocument((AnalyzeDocumentRequest) payload);
+ } catch (AwsServiceException ase) {
+ LOG.trace("Analyze Document command returned the error code {}", ase.awsErrorDetails().errorCode());
+ throw ase;
+ }
+ Message message = getMessageForResponse(exchange);
+ message.setBody(result);
+ }
+ } else {
+ AnalyzeDocumentRequest.Builder request = AnalyzeDocumentRequest.builder();
+ Document document = createDocumentFromExchange(exchange);
+ request.document(document);
+
+ // Get feature types from headers or default to TABLES and FORMS
+ @SuppressWarnings("unchecked")
+ List<FeatureType> featureTypes = exchange.getIn().getHeader(Textract2Constants.FEATURE_TYPES, List.class);
+ if (featureTypes != null && !featureTypes.isEmpty()) {
+ request.featureTypes(featureTypes);
+ } else {
+ request.featureTypes(FeatureType.TABLES, FeatureType.FORMS);
+ }
+
+ AnalyzeDocumentResponse result;
+ try {
+ result = textractClient.analyzeDocument(request.build());
+ } catch (AwsServiceException ase) {
+ LOG.trace("Analyze Document command returned the error code {}", ase.awsErrorDetails().errorCode());
+ throw ase;
+ }
+ Message message = getMessageForResponse(exchange);
+ message.setBody(result);
+ }
+ }
+
+ private void analyzeExpense(TextractClient textractClient, Exchange exchange) throws InvalidPayloadException {
+ if (getConfiguration().isPojoRequest()) {
+ Object payload = exchange.getIn().getMandatoryBody();
+ if (payload instanceof AnalyzeExpenseRequest) {
+ AnalyzeExpenseResponse result;
+ try {
+ result = textractClient.analyzeExpense((AnalyzeExpenseRequest) payload);
+ } catch (AwsServiceException ase) {
+ LOG.trace("Analyze Expense command returned the error code {}", ase.awsErrorDetails().errorCode());
+ throw ase;
+ }
+ Message message = getMessageForResponse(exchange);
+ message.setBody(result);
+ }
+ } else {
+ AnalyzeExpenseRequest.Builder request = AnalyzeExpenseRequest.builder();
+ Document document = createDocumentFromExchange(exchange);
+ request.document(document);
+
+ AnalyzeExpenseResponse result;
+ try {
+ result = textractClient.analyzeExpense(request.build());
+ } catch (AwsServiceException ase) {
+ LOG.trace("Analyze Expense command returned the error code {}", ase.awsErrorDetails().errorCode());
+ throw ase;
+ }
+ Message message = getMessageForResponse(exchange);
+ message.setBody(result);
+ }
+ }
+
+ private void startDocumentTextDetection(TextractClient textractClient, Exchange exchange) throws InvalidPayloadException {
+ if (getConfiguration().isPojoRequest()) {
+ Object payload = exchange.getIn().getMandatoryBody();
+ if (payload instanceof StartDocumentTextDetectionRequest) {
+ StartDocumentTextDetectionResponse result;
+ try {
+ result = textractClient.startDocumentTextDetection((StartDocumentTextDetectionRequest) payload);
+ } catch (AwsServiceException ase) {
+ LOG.trace("Start Document Text Detection command returned the error code {}",
+ ase.awsErrorDetails().errorCode());
+ throw ase;
+ }
+ Message message = getMessageForResponse(exchange);
+ message.setBody(result);
+ }
+ } else {
+ StartDocumentTextDetectionRequest.Builder request = StartDocumentTextDetectionRequest.builder();
+ DocumentLocation documentLocation = createDocumentLocationFromExchange(exchange);
+ request.documentLocation(documentLocation);
+
+ StartDocumentTextDetectionResponse result;
+ try {
+ result = textractClient.startDocumentTextDetection(request.build());
+ } catch (AwsServiceException ase) {
+ LOG.trace("Start Document Text Detection command returned the error code {}",
+ ase.awsErrorDetails().errorCode());
+ throw ase;
+ }
+ Message message = getMessageForResponse(exchange);
+ message.setBody(result);
+ }
+ }
+
+ private void startDocumentAnalysis(TextractClient textractClient, Exchange exchange) throws InvalidPayloadException {
+ if (getConfiguration().isPojoRequest()) {
+ Object payload = exchange.getIn().getMandatoryBody();
+ if (payload instanceof StartDocumentAnalysisRequest) {
+ StartDocumentAnalysisResponse result;
+ try {
+ result = textractClient.startDocumentAnalysis((StartDocumentAnalysisRequest) payload);
+ } catch (AwsServiceException ase) {
+ LOG.trace("Start Document Analysis command returned the error code {}", ase.awsErrorDetails().errorCode());
+ throw ase;
+ }
+ Message message = getMessageForResponse(exchange);
+ message.setBody(result);
+ }
+ } else {
+ StartDocumentAnalysisRequest.Builder request = StartDocumentAnalysisRequest.builder();
+ DocumentLocation documentLocation = createDocumentLocationFromExchange(exchange);
+ request.documentLocation(documentLocation);
+
+ @SuppressWarnings("unchecked")
+ List<FeatureType> featureTypes = exchange.getIn().getHeader(Textract2Constants.FEATURE_TYPES, List.class);
+ if (featureTypes != null && !featureTypes.isEmpty()) {
+ request.featureTypes(featureTypes);
+ } else {
+ request.featureTypes(FeatureType.TABLES, FeatureType.FORMS);
+ }
+
+ StartDocumentAnalysisResponse result;
+ try {
+ result = textractClient.startDocumentAnalysis(request.build());
+ } catch (AwsServiceException ase) {
+ LOG.trace("Start Document Analysis command returned the error code {}", ase.awsErrorDetails().errorCode());
+ throw ase;
+ }
+ Message message = getMessageForResponse(exchange);
+ message.setBody(result);
+ }
+ }
+
+ private void startExpenseAnalysis(TextractClient textractClient, Exchange exchange) throws InvalidPayloadException {
+ if (getConfiguration().isPojoRequest()) {
+ Object payload = exchange.getIn().getMandatoryBody();
+ if (payload instanceof StartExpenseAnalysisRequest) {
+ StartExpenseAnalysisResponse result;
+ try {
+ result = textractClient.startExpenseAnalysis((StartExpenseAnalysisRequest) payload);
+ } catch (AwsServiceException ase) {
+ LOG.trace("Start Expense Analysis command returned the error code {}", ase.awsErrorDetails().errorCode());
+ throw ase;
+ }
+ Message message = getMessageForResponse(exchange);
+ message.setBody(result);
+ }
+ } else {
+ StartExpenseAnalysisRequest.Builder request = StartExpenseAnalysisRequest.builder();
+ DocumentLocation documentLocation = createDocumentLocationFromExchange(exchange);
+ request.documentLocation(documentLocation);
+
+ StartExpenseAnalysisResponse result;
+ try {
+ result = textractClient.startExpenseAnalysis(request.build());
+ } catch (AwsServiceException ase) {
+ LOG.trace("Start Expense Analysis command returned the error code {}", ase.awsErrorDetails().errorCode());
+ throw ase;
+ }
+ Message message = getMessageForResponse(exchange);
+ message.setBody(result);
+ }
+ }
+
+ private void getDocumentTextDetection(TextractClient textractClient, Exchange exchange) throws InvalidPayloadException {
+ if (getConfiguration().isPojoRequest()) {
+ Object payload = exchange.getIn().getMandatoryBody();
+ if (payload instanceof GetDocumentTextDetectionRequest) {
+ GetDocumentTextDetectionResponse result;
+ try {
+ result = textractClient.getDocumentTextDetection((GetDocumentTextDetectionRequest) payload);
+ } catch (AwsServiceException ase) {
+ LOG.trace("Get Document Text Detection command returned the error code {}",
+ ase.awsErrorDetails().errorCode());
+ throw ase;
+ }
+ Message message = getMessageForResponse(exchange);
+ message.setBody(result);
+ }
+ } else {
+ GetDocumentTextDetectionRequest.Builder request = GetDocumentTextDetectionRequest.builder();
+
+ String jobId = exchange.getIn().getHeader(Textract2Constants.JOB_ID, String.class);
+ if (ObjectHelper.isEmpty(jobId)) {
+ jobId = exchange.getIn().getBody(String.class);
+ }
+ if (ObjectHelper.isEmpty(jobId)) {
+ throw new IllegalArgumentException("Job ID must be specified in header or body");
+ }
+ request.jobId(jobId);
+
+ Integer maxResults = exchange.getIn().getHeader(Textract2Constants.MAX_RESULTS, Integer.class);
+ if (maxResults != null) {
+ request.maxResults(maxResults);
+ }
+
+ String nextToken = exchange.getIn().getHeader(Textract2Constants.NEXT_TOKEN, String.class);
+ if (ObjectHelper.isNotEmpty(nextToken)) {
+ request.nextToken(nextToken);
+ }
+
+ GetDocumentTextDetectionResponse result;
+ try {
+ result = textractClient.getDocumentTextDetection(request.build());
+ } catch (AwsServiceException ase) {
+ LOG.trace("Get Document Text Detection command returned the error code {}", ase.awsErrorDetails().errorCode());
+ throw ase;
+ }
+ Message message = getMessageForResponse(exchange);
+ message.setBody(result);
+ }
+ }
+
+ private void getDocumentAnalysis(TextractClient textractClient, Exchange exchange) throws InvalidPayloadException {
+ if (getConfiguration().isPojoRequest()) {
+ Object payload = exchange.getIn().getMandatoryBody();
+ if (payload instanceof GetDocumentAnalysisRequest) {
+ GetDocumentAnalysisResponse result;
+ try {
+ result = textractClient.getDocumentAnalysis((GetDocumentAnalysisRequest) payload);
+ } catch (AwsServiceException ase) {
+ LOG.trace("Get Document Analysis command returned the error code {}", ase.awsErrorDetails().errorCode());
+ throw ase;
+ }
+ Message message = getMessageForResponse(exchange);
+ message.setBody(result);
+ }
+ } else {
+ GetDocumentAnalysisRequest.Builder request = GetDocumentAnalysisRequest.builder();
+
+ String jobId = exchange.getIn().getHeader(Textract2Constants.JOB_ID, String.class);
+ if (ObjectHelper.isEmpty(jobId)) {
+ jobId = exchange.getIn().getBody(String.class);
+ }
+ if (ObjectHelper.isEmpty(jobId)) {
+ throw new IllegalArgumentException("Job ID must be specified in header or body");
+ }
+ request.jobId(jobId);
+
+ Integer maxResults = exchange.getIn().getHeader(Textract2Constants.MAX_RESULTS, Integer.class);
+ if (maxResults != null) {
+ request.maxResults(maxResults);
+ }
+
+ String nextToken = exchange.getIn().getHeader(Textract2Constants.NEXT_TOKEN, String.class);
+ if (ObjectHelper.isNotEmpty(nextToken)) {
+ request.nextToken(nextToken);
+ }
+
+ GetDocumentAnalysisResponse result;
+ try {
+ result = textractClient.getDocumentAnalysis(request.build());
+ } catch (AwsServiceException ase) {
+ LOG.trace("Get Document Analysis command returned the error code {}", ase.awsErrorDetails().errorCode());
+ throw ase;
+ }
+ Message message = getMessageForResponse(exchange);
+ message.setBody(result);
+ }
+ }
+
+ private void getExpenseAnalysis(TextractClient textractClient, Exchange exchange) throws InvalidPayloadException {
+ if (getConfiguration().isPojoRequest()) {
+ Object payload = exchange.getIn().getMandatoryBody();
+ if (payload instanceof GetExpenseAnalysisRequest) {
+ GetExpenseAnalysisResponse result;
+ try {
+ result = textractClient.getExpenseAnalysis((GetExpenseAnalysisRequest) payload);
+ } catch (AwsServiceException ase) {
+ LOG.trace("Get Expense Analysis command returned the error code {}", ase.awsErrorDetails().errorCode());
+ throw ase;
+ }
+ Message message = getMessageForResponse(exchange);
+ message.setBody(result);
+ }
+ } else {
+ GetExpenseAnalysisRequest.Builder request = GetExpenseAnalysisRequest.builder();
+
+ String jobId = exchange.getIn().getHeader(Textract2Constants.JOB_ID, String.class);
+ if (ObjectHelper.isEmpty(jobId)) {
+ jobId = exchange.getIn().getBody(String.class);
+ }
+ if (ObjectHelper.isEmpty(jobId)) {
+ throw new IllegalArgumentException("Job ID must be specified in header or body");
+ }
+ request.jobId(jobId);
+
+ Integer maxResults = exchange.getIn().getHeader(Textract2Constants.MAX_RESULTS, Integer.class);
+ if (maxResults != null) {
+ request.maxResults(maxResults);
+ }
+
+ String nextToken = exchange.getIn().getHeader(Textract2Constants.NEXT_TOKEN, String.class);
+ if (ObjectHelper.isNotEmpty(nextToken)) {
+ request.nextToken(nextToken);
+ }
+
+ GetExpenseAnalysisResponse result;
+ try {
+ result = textractClient.getExpenseAnalysis(request.build());
+ } catch (AwsServiceException ase) {
+ LOG.trace("Get Expense Analysis command returned the error code {}", ase.awsErrorDetails().errorCode());
+ throw ase;
+ }
+ Message message = getMessageForResponse(exchange);
+ message.setBody(result);
+ }
+ }
+
+ private Document createDocumentFromExchange(Exchange exchange) throws InvalidPayloadException {
+ // Check if we have S3 location in configuration or headers
+ String s3Bucket = getConfiguration().getS3Bucket();
+ String s3Object = getConfiguration().getS3Object();
+
+ if (ObjectHelper.isEmpty(s3Bucket)) {
+ s3Bucket = exchange.getIn().getHeader(Textract2Constants.S3_BUCKET, String.class);
+ }
+ if (ObjectHelper.isEmpty(s3Object)) {
+ s3Object = exchange.getIn().getHeader(Textract2Constants.S3_OBJECT, String.class);
+ }
+
+ if (ObjectHelper.isNotEmpty(s3Bucket) && ObjectHelper.isNotEmpty(s3Object)) {
+ S3Object.Builder s3ObjectBuilder = S3Object.builder()
+ .bucket(s3Bucket)
+ .name(s3Object);
+
+ String s3ObjectVersion = getConfiguration().getS3ObjectVersion();
+ if (ObjectHelper.isEmpty(s3ObjectVersion)) {
+ s3ObjectVersion = exchange.getIn().getHeader(Textract2Constants.S3_OBJECT_VERSION, String.class);
+ }
+ if (ObjectHelper.isNotEmpty(s3ObjectVersion)) {
+ s3ObjectBuilder.version(s3ObjectVersion);
+ }
+
+ return Document.builder()
+ .s3Object(s3ObjectBuilder.build())
+ .build();
+ } else {
+ // Use bytes from message body
+ byte[] documentBytes = exchange.getIn().getMandatoryBody(byte[].class);
+ return Document.builder()
+ .bytes(SdkBytes.fromByteArray(documentBytes))
+ .build();
+ }
+ }
+
+ private DocumentLocation createDocumentLocationFromExchange(Exchange exchange) {
+ String s3Bucket = getConfiguration().getS3Bucket();
+ String s3Object = getConfiguration().getS3Object();
+
+ if (ObjectHelper.isEmpty(s3Bucket)) {
+ s3Bucket = exchange.getIn().getHeader(Textract2Constants.S3_BUCKET, String.class);
+ }
+ if (ObjectHelper.isEmpty(s3Object)) {
+ s3Object = exchange.getIn().getHeader(Textract2Constants.S3_OBJECT, String.class);
+ }
+
+ if (ObjectHelper.isEmpty(s3Bucket) || ObjectHelper.isEmpty(s3Object)) {
+ throw new IllegalArgumentException("S3 bucket and object must be specified for async operations");
+ }
+
+ S3Object.Builder s3ObjectBuilder = S3Object.builder()
+ .bucket(s3Bucket)
+ .name(s3Object);
+
+ String s3ObjectVersion = getConfiguration().getS3ObjectVersion();
+ if (ObjectHelper.isEmpty(s3ObjectVersion)) {
+ s3ObjectVersion = exchange.getIn().getHeader(Textract2Constants.S3_OBJECT_VERSION, String.class);
+ }
+ if (ObjectHelper.isNotEmpty(s3ObjectVersion)) {
+ s3ObjectBuilder.version(s3ObjectVersion);
+ }
+
+ return DocumentLocation.builder()
+ .s3Object(s3ObjectBuilder.build())
+ .build();
+ }
+
+ public static Message getMessageForResponse(final Exchange exchange) {
+ return exchange.getMessage();
+ }
+
+ @Override
+ protected void doStart() throws Exception {
+ // health-check is optional so discover and resolve
+ healthCheckRepository = HealthCheckHelper.getHealthCheckRepository(
+ getEndpoint().getCamelContext(),
+ "producers",
+ WritableHealthCheckRepository.class);
+
+ if (healthCheckRepository != null) {
+ String id = getEndpoint().getId();
+ producerHealthCheck = new Textract2ProducerHealthCheck(getEndpoint(), id);
+ producerHealthCheck.setEnabled(getEndpoint().getComponent().isHealthCheckProducerEnabled());
+ healthCheckRepository.addHealthCheck(producerHealthCheck);
+ }
+ }
+
+ @Override
+ protected void doStop() throws Exception {
+ if (healthCheckRepository != null && producerHealthCheck != null) {
+ healthCheckRepository.removeHealthCheck(producerHealthCheck);
+ producerHealthCheck = null;
+ }
+ }
+}
diff --git a/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/Textract2ProducerHealthCheck.java b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/Textract2ProducerHealthCheck.java
new file mode 100644
index 00000000000..5dc04f71c0d
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/Textract2ProducerHealthCheck.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.aws2.textract;
+
+import java.util.Map;
+
+import org.apache.camel.health.HealthCheckResultBuilder;
+import org.apache.camel.impl.health.AbstractHealthCheck;
+import org.apache.camel.util.ObjectHelper;
+import software.amazon.awssdk.awscore.exception.AwsServiceException;
+import software.amazon.awssdk.core.SdkBytes;
+import software.amazon.awssdk.regions.Region;
+import software.amazon.awssdk.services.textract.TextractClient;
+import software.amazon.awssdk.services.textract.model.DetectDocumentTextRequest;
+import software.amazon.awssdk.services.textract.model.Document;
+
+public class Textract2ProducerHealthCheck extends AbstractHealthCheck {
+
+ private final Textract2Endpoint textract2Endpoint;
+
+ public Textract2ProducerHealthCheck(Textract2Endpoint textract2Endpoint, String clientId) {
+ super("camel", "producer:aws2-textract-" + clientId);
+ this.textract2Endpoint = textract2Endpoint;
+ }
+
+ @Override
+ protected void doCall(HealthCheckResultBuilder builder, Map<String, Object> options) {
+ Textract2Configuration configuration = textract2Endpoint.getConfiguration();
+ if (ObjectHelper.isNotEmpty(configuration.getRegion())) {
+ if (!TextractClient.serviceMetadata().regions().contains(Region.of(configuration.getRegion()))) {
+ builder.message("The service is not supported in this region");
+ builder.down();
+ return;
+ }
+ }
+ try {
+ TextractClient textractClient = textract2Endpoint.getTextractClient();
+ // Create a minimal test request to verify the client is working
+ byte[] testData = "test".getBytes();
+ Document testDocument = Document.builder()
+ .bytes(SdkBytes.fromByteArray(testData))
+ .build();
+ DetectDocumentTextRequest testRequest = DetectDocumentTextRequest.builder()
+ .document(testDocument)
+ .build();
+
+ // This will likely fail because "test" is not a valid document, but it will validate credentials and connectivity
+ textractClient.detectDocumentText(testRequest);
+ } catch (AwsServiceException e) {
+ // For health check, we consider certain errors as "healthy" since they indicate the service is reachable
+ if ("InvalidParameterException".equals(e.awsErrorDetails().errorCode()) ||
+ "UnsupportedDocumentException".equals(e.awsErrorDetails().errorCode())) {
+ // These errors mean the service is reachable but our test document is invalid - this is expected
+ builder.up();
+ return;
+ }
+
+ builder.message(e.getMessage());
+ builder.error(e);
+ if (ObjectHelper.isNotEmpty(e.statusCode())) {
+ builder.detail(SERVICE_STATUS_CODE, e.statusCode());
+ }
+ if (ObjectHelper.isNotEmpty(e.awsErrorDetails().errorCode())) {
+ builder.detail(SERVICE_ERROR_CODE, e.awsErrorDetails().errorCode());
+ }
+ builder.down();
+ return;
+ } catch (Exception e) {
+ builder.error(e);
+ builder.down();
+ return;
+ }
+ builder.up();
+ }
+}
diff --git a/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/client/Textract2ClientFactory.java b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/client/Textract2ClientFactory.java
new file mode 100644
index 00000000000..802c9a1930a
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/client/Textract2ClientFactory.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.textract.client;
+
+import org.apache.camel.component.aws2.textract.Textract2Configuration;
+import org.apache.camel.component.aws2.textract.client.impl.Textract2ClientIAMOptimized;
+import org.apache.camel.component.aws2.textract.client.impl.Textract2ClientIAMProfileOptimized;
+import org.apache.camel.component.aws2.textract.client.impl.Textract2ClientSessionTokenImpl;
+import org.apache.camel.component.aws2.textract.client.impl.Textract2ClientStandardImpl;
+
+/**
+ * Factory class to return the correct type of AWS Textract client.
+ */
+public final class Textract2ClientFactory {
+
+ private Textract2ClientFactory() {
+ }
+
+ /**
+ * Return the correct aws Textract client (based on remote vs local).
+ *
+ * @param configuration configuration
+ * @return TextractClient
+ */
+ public static Textract2InternalClient getTextractClient(Textract2Configuration configuration) {
+ if (Boolean.TRUE.equals(configuration.isUseDefaultCredentialsProvider())) {
+ return new Textract2ClientIAMOptimized(configuration);
+ } else if (Boolean.TRUE.equals(configuration.isUseProfileCredentialsProvider())) {
+ return new Textract2ClientIAMProfileOptimized(configuration);
+ } else if (Boolean.TRUE.equals(configuration.isUseSessionCredentials())) {
+ return new Textract2ClientSessionTokenImpl(configuration);
+ } else {
+ return new Textract2ClientStandardImpl(configuration);
+ }
+ }
+}
diff --git a/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/client/Textract2InternalClient.java b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/client/Textract2InternalClient.java
new file mode 100644
index 00000000000..542334e5a96
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/client/Textract2InternalClient.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.textract.client;
+
+import software.amazon.awssdk.services.textract.TextractClient;
+
+public interface Textract2InternalClient {
+
+ /**
+ * Returns a Textract client after a factory method determines which one to return.
+ *
+ * @return TextractClient textractClient
+ */
+ TextractClient getTextractClient();
+
+}
diff --git a/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/client/impl/Textract2ClientIAMOptimized.java b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/client/impl/Textract2ClientIAMOptimized.java
new file mode 100644
index 00000000000..993a9c4e3c3
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/client/impl/Textract2ClientIAMOptimized.java
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.textract.client.impl;
+
+import java.net.URI;
+
+import org.apache.camel.component.aws2.textract.Textract2Configuration;
+import org.apache.camel.component.aws2.textract.client.Textract2InternalClient;
+import org.apache.camel.util.ObjectHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.http.SdkHttpClient;
+import software.amazon.awssdk.http.SdkHttpConfigurationOption;
+import software.amazon.awssdk.http.apache.ApacheHttpClient;
+import software.amazon.awssdk.http.apache.ProxyConfiguration;
+import software.amazon.awssdk.regions.Region;
+import software.amazon.awssdk.services.textract.TextractClient;
+import software.amazon.awssdk.services.textract.TextractClientBuilder;
+import software.amazon.awssdk.utils.AttributeMap;
+
+/**
+ * Manage an AWS Textract client for all users to use. This implementation is for remote instances to manage the
+ * credentials on their own (eliminating credential rotations)
+ */
+public class Textract2ClientIAMOptimized implements Textract2InternalClient {
+ private static final Logger LOG = LoggerFactory.getLogger(Textract2ClientIAMOptimized.class);
+ private Textract2Configuration configuration;
+
+ /**
+ * Constructor that uses the config file.
+ */
+ public Textract2ClientIAMOptimized(Textract2Configuration configuration) {
+ LOG.trace("Creating an AWS Textract client for working on AWS Services");
+ this.configuration = configuration;
+ }
+
+ /**
+ * Getting the Textract aws client that is used.
+ *
+ * @return Amazon Textract Client.
+ */
+ @Override
+ public TextractClient getTextractClient() {
+ TextractClient client = null;
+ TextractClientBuilder clientBuilder = TextractClient.builder();
+ ProxyConfiguration.Builder proxyConfig = null;
+ ApacheHttpClient.Builder httpClientBuilder = null;
+
+ if (ObjectHelper.isNotEmpty(configuration.getProxyHost()) && ObjectHelper.isNotEmpty(configuration.getProxyPort())) {
+ proxyConfig = ProxyConfiguration.builder();
+ URI proxyEndpoint = URI.create(configuration.getProxyProtocol() + "://" + configuration.getProxyHost() + ":"
+ + configuration.getProxyPort());
+ proxyConfig.endpoint(proxyEndpoint);
+ httpClientBuilder = ApacheHttpClient.builder().proxyConfiguration(proxyConfig.build());
+ clientBuilder = clientBuilder.httpClientBuilder(httpClientBuilder);
+ }
+ if (ObjectHelper.isNotEmpty(configuration.getRegion())) {
+ clientBuilder = clientBuilder.region(Region.of(configuration.getRegion()));
+ }
+ if (configuration.isOverrideEndpoint()) {
+ clientBuilder.endpointOverride(URI.create(configuration.getUriEndpointOverride()));
+ }
+ if (configuration.isTrustAllCertificates()) {
+ if (httpClientBuilder == null) {
+ httpClientBuilder = ApacheHttpClient.builder();
+ }
+ SdkHttpClient ahc = httpClientBuilder.buildWithDefaults(AttributeMap
+ .builder()
+ .put(
+ SdkHttpConfigurationOption.TRUST_ALL_CERTIFICATES,
+ Boolean.TRUE)
+ .build());
+ // set created http client to use instead of builder
+ clientBuilder.httpClient(ahc);
+ clientBuilder.httpClientBuilder(null);
+ }
+ client = clientBuilder.build();
+ return client;
+ }
+}
diff --git a/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/client/impl/Textract2ClientIAMProfileOptimized.java b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/client/impl/Textract2ClientIAMProfileOptimized.java
new file mode 100644
index 00000000000..2fda5e334fe
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/client/impl/Textract2ClientIAMProfileOptimized.java
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.textract.client.impl;
+
+import java.net.URI;
+
+import org.apache.camel.component.aws2.textract.Textract2Configuration;
+import org.apache.camel.component.aws2.textract.client.Textract2InternalClient;
+import org.apache.camel.util.ObjectHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider;
+import software.amazon.awssdk.http.SdkHttpClient;
+import software.amazon.awssdk.http.SdkHttpConfigurationOption;
+import software.amazon.awssdk.http.apache.ApacheHttpClient;
+import software.amazon.awssdk.http.apache.ProxyConfiguration;
+import software.amazon.awssdk.regions.Region;
+import software.amazon.awssdk.services.textract.TextractClient;
+import software.amazon.awssdk.services.textract.TextractClientBuilder;
+import software.amazon.awssdk.utils.AttributeMap;
+
+/**
+ * Manage an AWS Textract client for all users to use. This implementation is for remote instances to manage the
+ * credentials on their own (eliminating credential rotations)
+ */
+public class Textract2ClientIAMProfileOptimized implements Textract2InternalClient {
+ private static final Logger LOG = LoggerFactory.getLogger(Textract2ClientIAMProfileOptimized.class);
+ private Textract2Configuration configuration;
+
+ /**
+ * Constructor that uses the config file.
+ */
+ public Textract2ClientIAMProfileOptimized(Textract2Configuration configuration) {
+ LOG.trace("Creating an AWS Textract client for working on AWS Services");
+ this.configuration = configuration;
+ }
+
+ /**
+ * Getting the Textract aws client that is used.
+ *
+ * @return Amazon Textract Client.
+ */
+ @Override
+ public TextractClient getTextractClient() {
+ TextractClient client = null;
+ TextractClientBuilder clientBuilder = TextractClient.builder();
+ ProxyConfiguration.Builder proxyConfig = null;
+ ApacheHttpClient.Builder httpClientBuilder = null;
+
+ if (ObjectHelper.isNotEmpty(configuration.getProxyHost()) && ObjectHelper.isNotEmpty(configuration.getProxyPort())) {
+ proxyConfig = ProxyConfiguration.builder();
+ URI proxyEndpoint = URI.create(configuration.getProxyProtocol() + "://" + configuration.getProxyHost() + ":"
+ + configuration.getProxyPort());
+ proxyConfig.endpoint(proxyEndpoint);
+ httpClientBuilder = ApacheHttpClient.builder().proxyConfiguration(proxyConfig.build());
+ clientBuilder = clientBuilder.httpClientBuilder(httpClientBuilder);
+ }
+ if (configuration.getProfileCredentialsName() != null) {
+ clientBuilder = clientBuilder.httpClientBuilder(httpClientBuilder)
+ .credentialsProvider(ProfileCredentialsProvider.create(configuration.getProfileCredentialsName()));
+ }
+ if (ObjectHelper.isNotEmpty(configuration.getRegion())) {
+ clientBuilder = clientBuilder.region(Region.of(configuration.getRegion()));
+ }
+ if (configuration.isOverrideEndpoint()) {
+ clientBuilder.endpointOverride(URI.create(configuration.getUriEndpointOverride()));
+ }
+ if (configuration.isTrustAllCertificates()) {
+ if (httpClientBuilder == null) {
+ httpClientBuilder = ApacheHttpClient.builder();
+ }
+ SdkHttpClient ahc = httpClientBuilder.buildWithDefaults(AttributeMap
+ .builder()
+ .put(
+ SdkHttpConfigurationOption.TRUST_ALL_CERTIFICATES,
+ Boolean.TRUE)
+ .build());
+ // set created http client to use instead of builder
+ clientBuilder.httpClient(ahc);
+ clientBuilder.httpClientBuilder(null);
+ }
+ client = clientBuilder.build();
+ return client;
+ }
+}
diff --git a/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/client/impl/Textract2ClientSessionTokenImpl.java b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/client/impl/Textract2ClientSessionTokenImpl.java
new file mode 100644
index 00000000000..40f49927cc0
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/client/impl/Textract2ClientSessionTokenImpl.java
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.textract.client.impl;
+
+import java.net.URI;
+
+import org.apache.camel.component.aws2.textract.Textract2Configuration;
+import org.apache.camel.component.aws2.textract.client.Textract2InternalClient;
+import org.apache.camel.util.ObjectHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.auth.credentials.AwsSessionCredentials;
+import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
+import software.amazon.awssdk.http.SdkHttpClient;
+import software.amazon.awssdk.http.SdkHttpConfigurationOption;
+import software.amazon.awssdk.http.apache.ApacheHttpClient;
+import software.amazon.awssdk.http.apache.ProxyConfiguration;
+import software.amazon.awssdk.regions.Region;
+import software.amazon.awssdk.services.textract.TextractClient;
+import software.amazon.awssdk.services.textract.TextractClientBuilder;
+import software.amazon.awssdk.utils.AttributeMap;
+
+/**
+ * Manage an AWS Textract client for all users to use. This implementation is for local instances to use a static and
+ * solid credential set.
+ */
+public class Textract2ClientSessionTokenImpl implements Textract2InternalClient {
+ private static final Logger LOG = LoggerFactory.getLogger(Textract2ClientSessionTokenImpl.class);
+ private Textract2Configuration configuration;
+
+ /**
+ * Constructor that uses the config file.
+ */
+ public Textract2ClientSessionTokenImpl(Textract2Configuration configuration) {
+ LOG.trace("Creating an AWS Textract manager using static credentials.");
+ this.configuration = configuration;
+ }
+
+ /**
+ * Getting the Textract aws client that is used.
+ *
+ * @return Amazon Textract Client.
+ */
+ @Override
+ public TextractClient getTextractClient() {
+ TextractClient client = null;
+ TextractClientBuilder clientBuilder = TextractClient.builder();
+ ProxyConfiguration.Builder proxyConfig = null;
+ ApacheHttpClient.Builder httpClientBuilder = null;
+ boolean isClientConfigFound = false;
+ if (ObjectHelper.isNotEmpty(configuration.getProxyHost()) && ObjectHelper.isNotEmpty(configuration.getProxyPort())) {
+ proxyConfig = ProxyConfiguration.builder();
+ URI proxyEndpoint = URI.create(configuration.getProxyProtocol() + "://" + configuration.getProxyHost() + ":"
+ + configuration.getProxyPort());
+ proxyConfig.endpoint(proxyEndpoint);
+ httpClientBuilder = ApacheHttpClient.builder().proxyConfiguration(proxyConfig.build());
+ isClientConfigFound = true;
+ }
+ if (configuration.getAccessKey() != null && configuration.getSecretKey() != null
+ && configuration.getSessionToken() != null) {
+ AwsSessionCredentials cred = AwsSessionCredentials.create(configuration.getAccessKey(),
+ configuration.getSecretKey(), configuration.getSessionToken());
+ if (isClientConfigFound) {
+ clientBuilder = clientBuilder.httpClientBuilder(httpClientBuilder)
+ .credentialsProvider(StaticCredentialsProvider.create(cred));
+ } else {
+ clientBuilder = clientBuilder.credentialsProvider(StaticCredentialsProvider.create(cred));
+ }
+ } else {
+ if (!isClientConfigFound) {
+ clientBuilder = clientBuilder.httpClientBuilder(httpClientBuilder);
+ }
+ }
+ if (ObjectHelper.isNotEmpty(configuration.getRegion())) {
+ clientBuilder = clientBuilder.region(Region.of(configuration.getRegion()));
+ }
+ if (configuration.isOverrideEndpoint()) {
+ clientBuilder.endpointOverride(URI.create(configuration.getUriEndpointOverride()));
+ }
+ if (configuration.isTrustAllCertificates()) {
+ if (httpClientBuilder == null) {
+ httpClientBuilder = ApacheHttpClient.builder();
+ }
+ SdkHttpClient ahc = httpClientBuilder.buildWithDefaults(AttributeMap
+ .builder()
+ .put(
+ SdkHttpConfigurationOption.TRUST_ALL_CERTIFICATES,
+ Boolean.TRUE)
+ .build());
+ // set created http client to use instead of builder
+ clientBuilder.httpClient(ahc);
+ clientBuilder.httpClientBuilder(null);
+ }
+ client = clientBuilder.build();
+ return client;
+ }
+}
diff --git a/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/client/impl/Textract2ClientStandardImpl.java b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/client/impl/Textract2ClientStandardImpl.java
new file mode 100644
index 00000000000..3cac3b0116c
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/main/java/org/apache/camel/component/aws2/textract/client/impl/Textract2ClientStandardImpl.java
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.textract.client.impl;
+
+import java.net.URI;
+
+import org.apache.camel.component.aws2.textract.Textract2Configuration;
+import org.apache.camel.component.aws2.textract.client.Textract2InternalClient;
+import org.apache.camel.util.ObjectHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
+import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
+import software.amazon.awssdk.http.SdkHttpClient;
+import software.amazon.awssdk.http.SdkHttpConfigurationOption;
+import software.amazon.awssdk.http.apache.ApacheHttpClient;
+import software.amazon.awssdk.http.apache.ProxyConfiguration;
+import software.amazon.awssdk.regions.Region;
+import software.amazon.awssdk.services.textract.TextractClient;
+import software.amazon.awssdk.services.textract.TextractClientBuilder;
+import software.amazon.awssdk.utils.AttributeMap;
+
+/**
+ * Manage an AWS Textract client for all users to use. This implementation is for local instances to use a static and
+ * solid credential set.
+ */
+public class Textract2ClientStandardImpl implements Textract2InternalClient {
+ private static final Logger LOG = LoggerFactory.getLogger(Textract2ClientStandardImpl.class);
+ private Textract2Configuration configuration;
+
+ /**
+ * Constructor that uses the config file.
+ */
+ public Textract2ClientStandardImpl(Textract2Configuration configuration) {
+ LOG.trace("Creating an AWS Textract manager using static credentials.");
+ this.configuration = configuration;
+ }
+
+ /**
+ * Getting the Textract aws client that is used.
+ *
+ * @return Amazon Textract Client.
+ */
+ @Override
+ public TextractClient getTextractClient() {
+ TextractClient client = null;
+ TextractClientBuilder clientBuilder = TextractClient.builder();
+ ProxyConfiguration.Builder proxyConfig = null;
+ ApacheHttpClient.Builder httpClientBuilder = null;
+ boolean isClientConfigFound = false;
+ if (ObjectHelper.isNotEmpty(configuration.getProxyHost()) && ObjectHelper.isNotEmpty(configuration.getProxyPort())) {
+ proxyConfig = ProxyConfiguration.builder();
+ URI proxyEndpoint = URI.create(configuration.getProxyProtocol() + "://" + configuration.getProxyHost() + ":"
+ + configuration.getProxyPort());
+ proxyConfig.endpoint(proxyEndpoint);
+ httpClientBuilder = ApacheHttpClient.builder().proxyConfiguration(proxyConfig.build());
+ isClientConfigFound = true;
+ }
+ if (configuration.getAccessKey() != null && configuration.getSecretKey() != null) {
+ AwsBasicCredentials cred = AwsBasicCredentials.create(configuration.getAccessKey(), configuration.getSecretKey());
+ if (isClientConfigFound) {
+ clientBuilder = clientBuilder.httpClientBuilder(httpClientBuilder)
+ .credentialsProvider(StaticCredentialsProvider.create(cred));
+ } else {
+ clientBuilder = clientBuilder.credentialsProvider(StaticCredentialsProvider.create(cred));
+ }
+ } else {
+ if (!isClientConfigFound) {
+ clientBuilder = clientBuilder.httpClientBuilder(httpClientBuilder);
+ }
+ }
+ if (ObjectHelper.isNotEmpty(configuration.getRegion())) {
+ clientBuilder = clientBuilder.region(Region.of(configuration.getRegion()));
+ }
+ if (configuration.isOverrideEndpoint()) {
+ clientBuilder.endpointOverride(URI.create(configuration.getUriEndpointOverride()));
+ }
+ if (configuration.isTrustAllCertificates()) {
+ if (httpClientBuilder == null) {
+ httpClientBuilder = ApacheHttpClient.builder();
+ }
+ SdkHttpClient ahc = httpClientBuilder.buildWithDefaults(AttributeMap
+ .builder()
+ .put(
+ SdkHttpConfigurationOption.TRUST_ALL_CERTIFICATES,
+ Boolean.TRUE)
+ .build());
+ // set created http client to use instead of builder
+ clientBuilder.httpClient(ahc);
+ clientBuilder.httpClientBuilder(null);
+ }
+ client = clientBuilder.build();
+ return client;
+ }
+}
diff --git a/components/camel-aws/camel-aws2-textract/src/test/java/org/apache/camel/component/aws2/textract/AmazonAWSTextractMock.java b/components/camel-aws/camel-aws2-textract/src/test/java/org/apache/camel/component/aws2/textract/AmazonAWSTextractMock.java
new file mode 100644
index 00000000000..16adc175bc5
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/test/java/org/apache/camel/component/aws2/textract/AmazonAWSTextractMock.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.textract;
+
+import java.util.Collections;
+
+import software.amazon.awssdk.services.textract.TextractClient;
+import software.amazon.awssdk.services.textract.TextractServiceClientConfiguration;
+import software.amazon.awssdk.services.textract.model.Block;
+import software.amazon.awssdk.services.textract.model.BlockType;
+import software.amazon.awssdk.services.textract.model.DetectDocumentTextRequest;
+import software.amazon.awssdk.services.textract.model.DetectDocumentTextResponse;
+
+public class AmazonAWSTextractMock implements TextractClient {
+
+ @Override
+ public DetectDocumentTextResponse detectDocumentText(DetectDocumentTextRequest request) {
+ Block block = Block.builder()
+ .blockType(BlockType.LINE)
+ .text("Mock detected text")
+ .build();
+
+ DetectDocumentTextResponse result = DetectDocumentTextResponse.builder()
+ .blocks(Collections.singletonList(block))
+ .build();
+ return result;
+ }
+
+ @Override
+ public TextractServiceClientConfiguration serviceClientConfiguration() {
+ return null;
+ }
+
+ @Override
+ public String serviceName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void close() {
+ // TODO Auto-generated method stub
+
+ }
+}
diff --git a/components/camel-aws/camel-aws2-textract/src/test/java/org/apache/camel/component/aws2/textract/Textract2ClientFactoryTest.java b/components/camel-aws/camel-aws2-textract/src/test/java/org/apache/camel/component/aws2/textract/Textract2ClientFactoryTest.java
new file mode 100644
index 00000000000..29e9314c6ab
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/test/java/org/apache/camel/component/aws2/textract/Textract2ClientFactoryTest.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.textract;
+
+import org.apache.camel.component.aws2.textract.client.Textract2ClientFactory;
+import org.apache.camel.component.aws2.textract.client.Textract2InternalClient;
+import org.apache.camel.component.aws2.textract.client.impl.Textract2ClientIAMOptimized;
+import org.apache.camel.component.aws2.textract.client.impl.Textract2ClientSessionTokenImpl;
+import org.apache.camel.component.aws2.textract.client.impl.Textract2ClientStandardImpl;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class Textract2ClientFactoryTest {
+
+ @Test
+ public void getStandardTextractClientDefault() {
+ Textract2Configuration textract2Configuration = new Textract2Configuration();
+ Textract2InternalClient textractClient = Textract2ClientFactory.getTextractClient(textract2Configuration);
+ assertTrue(textractClient instanceof Textract2ClientStandardImpl);
+ }
+
+ @Test
+ public void getStandardTextractClient() {
+ Textract2Configuration textract2Configuration = new Textract2Configuration();
+ textract2Configuration.setUseDefaultCredentialsProvider(false);
+ Textract2InternalClient textractClient = Textract2ClientFactory.getTextractClient(textract2Configuration);
+ assertTrue(textractClient instanceof Textract2ClientStandardImpl);
+ }
+
+ @Test
+ public void getTextractOptimizedIAMClient() {
+ Textract2Configuration textract2Configuration = new Textract2Configuration();
+ textract2Configuration.setUseDefaultCredentialsProvider(true);
+ Textract2InternalClient textractClient = Textract2ClientFactory.getTextractClient(textract2Configuration);
+ assertTrue(textractClient instanceof Textract2ClientIAMOptimized);
+ }
+
+ @Test
+ public void getTextractSessionTokenClient() {
+ Textract2Configuration textract2Configuration = new Textract2Configuration();
+ textract2Configuration.setUseSessionCredentials(true);
+ Textract2InternalClient textractClient = Textract2ClientFactory.getTextractClient(textract2Configuration);
+ assertTrue(textractClient instanceof Textract2ClientSessionTokenImpl);
+ }
+}
diff --git a/components/camel-aws/camel-aws2-textract/src/test/java/org/apache/camel/component/aws2/textract/Textract2ProducerTest.java b/components/camel-aws/camel-aws2-textract/src/test/java/org/apache/camel/component/aws2/textract/Textract2ProducerTest.java
new file mode 100644
index 00000000000..189f8c801fe
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/test/java/org/apache/camel/component/aws2/textract/Textract2ProducerTest.java
@@ -0,0 +1,132 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.textract;
+
+import org.apache.camel.BindToRegistry;
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+import software.amazon.awssdk.core.SdkBytes;
+import software.amazon.awssdk.services.textract.model.DetectDocumentTextRequest;
+import software.amazon.awssdk.services.textract.model.DetectDocumentTextResponse;
+import software.amazon.awssdk.services.textract.model.Document;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+public class Textract2ProducerTest extends CamelTestSupport {
+
+ @BindToRegistry("amazonTextractClient")
+ AmazonAWSTextractMock clientMock = new AmazonAWSTextractMock();
+
+ @EndpointInject("mock:result")
+ private MockEndpoint mock;
+
+ @Test
+ public void detectDocumentTextTest() throws Exception {
+
+ mock.expectedMessageCount(1);
+ Exchange exchange = template.request("direct:detectDocumentText", new Processor() {
+ @Override
+ public void process(Exchange exchange) {
+ exchange.getIn().setHeader(Textract2Constants.S3_BUCKET, "testbucket");
+ exchange.getIn().setHeader(Textract2Constants.S3_OBJECT, "testobject.pdf");
+ exchange.getIn().setBody("test document content");
+ }
+ });
+
+ MockEndpoint.assertIsSatisfied(context);
+
+ DetectDocumentTextResponse resultGet = exchange.getIn().getBody(DetectDocumentTextResponse.class);
+ assertNotNull(resultGet);
+ assertNotNull(resultGet.blocks());
+ assertEquals(1, resultGet.blocks().size());
+ assertEquals("Mock detected text", resultGet.blocks().get(0).text());
+
+ }
+
+ @Test
+ public void detectDocumentTextPojoTest() throws Exception {
+
+ mock.expectedMessageCount(1);
+ Exchange exchange = template.request("direct:detectDocumentTextPojo", new Processor() {
+ @Override
+ public void process(Exchange exchange) {
+ Document document = Document.builder()
+ .bytes(SdkBytes.fromByteArray("test document content".getBytes()))
+ .build();
+
+ exchange.getIn()
+ .setBody(DetectDocumentTextRequest.builder()
+ .document(document)
+ .build());
+ }
+ });
+
+ MockEndpoint.assertIsSatisfied(context);
+
+ DetectDocumentTextResponse resultGet = exchange.getIn().getBody(DetectDocumentTextResponse.class);
+ assertNotNull(resultGet);
+ assertNotNull(resultGet.blocks());
+ assertEquals(1, resultGet.blocks().size());
+ assertEquals("Mock detected text", resultGet.blocks().get(0).text());
+
+ }
+
+ @Test
+ public void detectDocumentTextTestOptions() throws Exception {
+
+ mock.expectedMessageCount(1);
+ Exchange exchange = template.request("direct:detectDocumentTextOptions", new Processor() {
+ @Override
+ public void process(Exchange exchange) {
+ exchange.getIn().setBody("test document content");
+ }
+ });
+
+ MockEndpoint.assertIsSatisfied(context);
+
+ DetectDocumentTextResponse resultGet = exchange.getIn().getBody(DetectDocumentTextResponse.class);
+ assertNotNull(resultGet);
+ assertNotNull(resultGet.blocks());
+ assertEquals(1, resultGet.blocks().size());
+ assertEquals("Mock detected text", resultGet.blocks().get(0).text());
+
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:detectDocumentText")
+ .to("aws2-textract://test?textractClient=#amazonTextractClient&operation=detectDocumentText")
+ .to("mock:result");
+ from("direct:detectDocumentTextPojo").to(
+ "aws2-textract://test?textractClient=#amazonTextractClient&operation=detectDocumentText&pojoRequest=true")
+ .to("mock:result");
+ from("direct:detectDocumentTextOptions").to(
+ "aws2-textract://test?textractClient=#amazonTextractClient&operation=detectDocumentText&s3Bucket=testbucket&s3Object=testobject.pdf")
+ .to("mock:result");
+ }
+ };
+ }
+}
diff --git a/components/camel-aws/camel-aws2-textract/src/test/java/org/apache/camel/component/aws2/textract/integration/Textract2DetectTextIT.java b/components/camel-aws/camel-aws2-textract/src/test/java/org/apache/camel/component/aws2/textract/integration/Textract2DetectTextIT.java
new file mode 100644
index 00000000000..5d5509aaa4f
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/test/java/org/apache/camel/component/aws2/textract/integration/Textract2DetectTextIT.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.textract.integration;
+
+import java.util.concurrent.TimeUnit;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.testcontainers.shaded.org.awaitility.Awaitility;
+import software.amazon.awssdk.services.textract.model.DetectDocumentTextResponse;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+@Disabled("Must be manually tested.")
+public class Textract2DetectTextIT extends CamelTestSupport {
+
+ @EndpointInject("direct:start")
+ private ProducerTemplate template;
+
+ @EndpointInject("mock:result")
+ private MockEndpoint result;
+
+ protected RouteBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+
+ @Override
+ public void configure() {
+ from("direct:start")
+ .to("aws2-textract://pippo?useDefaultCredentialsProvider=true®ion=eu-west-1&s3Bucket=kamelets-demo&s3Object=SinglePage.pdf&operation=detectDocumentText")
+ .to("mock:result");
+ }
+ };
+ }
+
+ @Test
+ public void testDetectText() throws InterruptedException {
+ result.expectedMessageCount(1);
+
+ DetectDocumentTextResponse s = (DetectDocumentTextResponse) template.requestBody("direct:start", "peppe");
+
+ Awaitility.await().atMost(20, TimeUnit.SECONDS)
+ .untilAsserted(() -> assertEquals(1, result.getExchanges().size()));
+
+ assertTrue(s.hasBlocks());
+ assertTrue(s.documentMetadata().pages() >= 1);
+ }
+}
diff --git a/components/camel-aws/camel-aws2-textract/src/test/resources/log4j2.properties b/components/camel-aws/camel-aws2-textract/src/test/resources/log4j2.properties
new file mode 100644
index 00000000000..36b760459b3
--- /dev/null
+++ b/components/camel-aws/camel-aws2-textract/src/test/resources/log4j2.properties
@@ -0,0 +1,28 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+appender.file.type = File
+appender.file.name = file
+appender.file.fileName = target/camel-aws2-textract-test.log
+appender.file.layout.type = PatternLayout
+appender.file.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
+appender.out.type = Console
+appender.out.name = out
+appender.out.layout.type = PatternLayout
+appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
+rootLogger.level = INFO
+rootLogger.appenderRef.file.ref = file
diff --git a/components/camel-aws/pom.xml b/components/camel-aws/pom.xml
index 1074afeeed8..711c788be0d 100644
--- a/components/camel-aws/pom.xml
+++ b/components/camel-aws/pom.xml
@@ -63,6 +63,7 @@
<module>camel-aws2-sqs</module>
<module>camel-aws2-step-functions</module>
<module>camel-aws2-sts</module>
+ <module>camel-aws2-textract</module>
<module>camel-aws2-timestream</module>
<module>camel-aws2-translate</module>
<module>camel-aws-xray</module>
diff --git a/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties b/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties
index bf628cfc0c8..36fe0d7330d 100644
--- a/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties
+++ b/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties
@@ -35,6 +35,7 @@ aws2-sns
aws2-sqs
aws2-step-functions
aws2-sts
+aws2-textract
aws2-timestream
aws2-translate
azure-cosmosdb
diff --git a/docs/components/modules/ROOT/examples/json/aws2-textract.json b/docs/components/modules/ROOT/examples/json/aws2-textract.json
new file mode 120000
index 00000000000..ff373edf449
--- /dev/null
+++ b/docs/components/modules/ROOT/examples/json/aws2-textract.json
@@ -0,0 +1 @@
+../../../../../../components/camel-aws/camel-aws2-textract/src/generated/resources/META-INF/org/apache/camel/component/aws2/textract/aws2-textract.json
\ No newline at end of file
diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
index 55c769a6472..52836dd0ad7 100644
--- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
+++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
@@ -529,6 +529,20 @@ public interface ComponentsBuilderFactory {
static Aws2StsComponentBuilderFactory.Aws2StsComponentBuilder aws2Sts() {
return Aws2StsComponentBuilderFactory.aws2Sts();
}
+ /**
+ * AWS Textract (camel-aws2-textract)
+ * Extract text and data from documents using AWS Textract and AWS SDK
+ * version 2.x.
+ *
+ * Category: cloud,document
+ * Since: 4.15
+ * Maven coordinates: org.apache.camel:camel-aws2-textract
+ *
+ * @return the dsl builder
+ */
+ static Aws2TextractComponentBuilderFactory.Aws2TextractComponentBuilder aws2Textract() {
+ return Aws2TextractComponentBuilderFactory.aws2Textract();
+ }
/**
* AWS Timestream (camel-aws2-timestream)
* Write records and execute queries on AWS time-series database
diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2TextractComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2TextractComponentBuilderFactory.java
new file mode 100644
index 00000000000..079968f4c73
--- /dev/null
+++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2TextractComponentBuilderFactory.java
@@ -0,0 +1,536 @@
+/* Generated by camel build tools - do NOT edit this file! */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.builder.component.dsl;
+
+import javax.annotation.processing.Generated;
+import org.apache.camel.Component;
+import org.apache.camel.builder.component.AbstractComponentBuilder;
+import org.apache.camel.builder.component.ComponentBuilder;
+import org.apache.camel.component.aws2.textract.Textract2Component;
+
+/**
+ * Extract text and data from documents using AWS Textract and AWS SDK version
+ * 2.x.
+ *
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@Generated("org.apache.camel.maven.packaging.ComponentDslMojo")
+public interface Aws2TextractComponentBuilderFactory {
+
+ /**
+ * AWS Textract (camel-aws2-textract)
+ * Extract text and data from documents using AWS Textract and AWS SDK
+ * version 2.x.
+ *
+ * Category: cloud,document
+ * Since: 4.15
+ * Maven coordinates: org.apache.camel:camel-aws2-textract
+ *
+ * @return the dsl builder
+ */
+ static Aws2TextractComponentBuilder aws2Textract() {
+ return new Aws2TextractComponentBuilderImpl();
+ }
+
+ /**
+ * Builder for the AWS Textract component.
+ */
+ interface Aws2TextractComponentBuilder extends ComponentBuilder<Textract2Component> {
+
+ /**
+ * Component configuration.
+ *
+ * The option is a:
+ * <code>org.apache.camel.component.aws2.textract.Textract2Configuration</code> type.
+ *
+ * Group: producer
+ *
+ * @param configuration the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder configuration(org.apache.camel.component.aws2.textract.Textract2Configuration configuration) {
+ doSetProperty("configuration", configuration);
+ return this;
+ }
+
+
+ /**
+ * 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 starting the
+ * producer may take a little time and prolong the total processing time
+ * of the processing.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: producer
+ *
+ * @param lazyStartProducer the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder lazyStartProducer(boolean lazyStartProducer) {
+ doSetProperty("lazyStartProducer", lazyStartProducer);
+ return this;
+ }
+
+
+ /**
+ * The operation to perform.
+ *
+ * The option is a:
+ * <code>org.apache.camel.component.aws2.textract.Textract2Operations</code> type.
+ *
+ * Default: detectDocumentText
+ * Group: producer
+ *
+ * @param operation the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder operation(org.apache.camel.component.aws2.textract.Textract2Operations operation) {
+ doSetProperty("operation", operation);
+ return this;
+ }
+
+
+ /**
+ * Set the need for overriding the endpoint. This option needs to be
+ * used in combination with uriEndpointOverride option.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: producer
+ *
+ * @param overrideEndpoint the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder overrideEndpoint(boolean overrideEndpoint) {
+ doSetProperty("overrideEndpoint", overrideEndpoint);
+ 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
+ *
+ * @param pojoRequest the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder pojoRequest(boolean pojoRequest) {
+ doSetProperty("pojoRequest", pojoRequest);
+ return this;
+ }
+
+ /**
+ * The region in which Textract client needs to work. When using this
+ * parameter, the configuration will expect the lowercase name of the
+ * region (for example ap-east-1) You'll need to use the name
+ * Region.EU_WEST_1.id().
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer
+ *
+ * @param region the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder region(java.lang.String region) {
+ doSetProperty("region", region);
+ return this;
+ }
+
+ /**
+ * The S3 bucket name for document location.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer
+ *
+ * @param s3Bucket the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder s3Bucket(java.lang.String s3Bucket) {
+ doSetProperty("s3Bucket", s3Bucket);
+ return this;
+ }
+
+ /**
+ * The S3 object name for document location.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer
+ *
+ * @param s3Object the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder s3Object(java.lang.String s3Object) {
+ doSetProperty("s3Object", s3Object);
+ return this;
+ }
+
+ /**
+ * The S3 object version for document location.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer
+ *
+ * @param s3ObjectVersion the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder s3ObjectVersion(java.lang.String s3ObjectVersion) {
+ doSetProperty("s3ObjectVersion", s3ObjectVersion);
+ return this;
+ }
+
+ /**
+ * Set the overriding uri endpoint. This option needs to be used in
+ * combination with overrideEndpoint option.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer
+ *
+ * @param uriEndpointOverride the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder uriEndpointOverride(java.lang.String uriEndpointOverride) {
+ doSetProperty("uriEndpointOverride", uriEndpointOverride);
+ return this;
+ }
+
+
+ /**
+ * Whether autowiring is enabled. This is used for automatic autowiring
+ * options (the option must be marked as autowired) by looking up in the
+ * registry to find if there is a single instance of matching type,
+ * which then gets configured on the component. This can be used for
+ * automatic configuring JDBC data sources, JMS connection factories,
+ * AWS Clients, etc.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: true
+ * Group: advanced
+ *
+ * @param autowiredEnabled the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder autowiredEnabled(boolean autowiredEnabled) {
+ doSetProperty("autowiredEnabled", autowiredEnabled);
+ return this;
+ }
+
+ /**
+ * To use an existing configured AWS Textract client.
+ *
+ * The option is a:
+ * <code>software.amazon.awssdk.services.textract.TextractClient</code> type.
+ *
+ * Group: advanced
+ *
+ * @param textractClient the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder textractClient(software.amazon.awssdk.services.textract.TextractClient textractClient) {
+ doSetProperty("textractClient", textractClient);
+ return this;
+ }
+
+
+ /**
+ * Used for enabling or disabling all consumer based health checks from
+ * this component.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: true
+ * Group: health
+ *
+ * @param healthCheckConsumerEnabled the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder healthCheckConsumerEnabled(boolean healthCheckConsumerEnabled) {
+ doSetProperty("healthCheckConsumerEnabled", healthCheckConsumerEnabled);
+ return this;
+ }
+
+
+ /**
+ * Used for enabling or disabling all producer based health checks from
+ * this component. Notice: Camel has by default disabled all producer
+ * based health-checks. You can turn on producer checks globally by
+ * setting camel.health.producersEnabled=true.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: true
+ * Group: health
+ *
+ * @param healthCheckProducerEnabled the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder healthCheckProducerEnabled(boolean healthCheckProducerEnabled) {
+ doSetProperty("healthCheckProducerEnabled", healthCheckProducerEnabled);
+ return this;
+ }
+
+ /**
+ * To define a proxy host when instantiating the Textract client.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: proxy
+ *
+ * @param proxyHost the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder proxyHost(java.lang.String proxyHost) {
+ doSetProperty("proxyHost", proxyHost);
+ return this;
+ }
+
+ /**
+ * To define a proxy port when instantiating the Textract client.
+ *
+ * The option is a: <code>java.lang.Integer</code> type.
+ *
+ * Group: proxy
+ *
+ * @param proxyPort the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder proxyPort(java.lang.Integer proxyPort) {
+ doSetProperty("proxyPort", proxyPort);
+ return this;
+ }
+
+
+ /**
+ * To define a proxy protocol when instantiating the Textract client.
+ *
+ * The option is a:
+ * <code>software.amazon.awssdk.core.Protocol</code> type.
+ *
+ * Default: HTTPS
+ * Group: proxy
+ *
+ * @param proxyProtocol the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder proxyProtocol(software.amazon.awssdk.core.Protocol proxyProtocol) {
+ doSetProperty("proxyProtocol", proxyProtocol);
+ return this;
+ }
+
+ /**
+ * Amazon AWS Access Key.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: security
+ *
+ * @param accessKey the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder accessKey(java.lang.String accessKey) {
+ doSetProperty("accessKey", accessKey);
+ return this;
+ }
+
+ /**
+ * If using a profile credentials provider this parameter will set the
+ * profile name.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: security
+ *
+ * @param profileCredentialsName the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder profileCredentialsName(java.lang.String profileCredentialsName) {
+ doSetProperty("profileCredentialsName", profileCredentialsName);
+ return this;
+ }
+
+ /**
+ * Amazon AWS Secret Key.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: security
+ *
+ * @param secretKey the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder secretKey(java.lang.String secretKey) {
+ doSetProperty("secretKey", secretKey);
+ return this;
+ }
+
+ /**
+ * Amazon AWS Session Token.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: security
+ *
+ * @param sessionToken the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder sessionToken(java.lang.String sessionToken) {
+ doSetProperty("sessionToken", sessionToken);
+ return this;
+ }
+
+
+ /**
+ * If we want to trust all certificates in case of overriding the
+ * endpoint.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: security
+ *
+ * @param trustAllCertificates the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder trustAllCertificates(boolean trustAllCertificates) {
+ doSetProperty("trustAllCertificates", trustAllCertificates);
+ return this;
+ }
+
+
+ /**
+ * Set whether the Textract client should expect to load credentials
+ * through a default credentials provider or to expect static
+ * credentials to be passed in.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: security
+ *
+ * @param useDefaultCredentialsProvider the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder useDefaultCredentialsProvider(boolean useDefaultCredentialsProvider) {
+ doSetProperty("useDefaultCredentialsProvider", useDefaultCredentialsProvider);
+ return this;
+ }
+
+
+ /**
+ * Set whether the Textract client should expect to load credentials
+ * through a profile credentials provider.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: security
+ *
+ * @param useProfileCredentialsProvider the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder useProfileCredentialsProvider(boolean useProfileCredentialsProvider) {
+ doSetProperty("useProfileCredentialsProvider", useProfileCredentialsProvider);
+ return this;
+ }
+
+
+ /**
+ * Set whether the Textract client should expect to use Session
+ * Credentials. This is useful in situation in which the user needs to
+ * assume a IAM role for doing operations in Textract.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: security
+ *
+ * @param useSessionCredentials the value to set
+ * @return the dsl builder
+ */
+ default Aws2TextractComponentBuilder useSessionCredentials(boolean useSessionCredentials) {
+ doSetProperty("useSessionCredentials", useSessionCredentials);
+ return this;
+ }
+ }
+
+ class Aws2TextractComponentBuilderImpl
+ extends AbstractComponentBuilder<Textract2Component>
+ implements Aws2TextractComponentBuilder {
+ @Override
+ protected Textract2Component buildConcreteComponent() {
+ return new Textract2Component();
+ }
+ private org.apache.camel.component.aws2.textract.Textract2Configuration getOrCreateConfiguration(Textract2Component component) {
+ if (component.getConfiguration() == null) {
+ component.setConfiguration(new org.apache.camel.component.aws2.textract.Textract2Configuration());
+ }
+ return component.getConfiguration();
+ }
+ @Override
+ protected boolean setPropertyOnComponent(
+ Component component,
+ String name,
+ Object value) {
+ switch (name) {
+ case "configuration": ((Textract2Component) component).setConfiguration((org.apache.camel.component.aws2.textract.Textract2Configuration) value); return true;
+ case "lazyStartProducer": ((Textract2Component) component).setLazyStartProducer((boolean) value); return true;
+ case "operation": getOrCreateConfiguration((Textract2Component) component).setOperation((org.apache.camel.component.aws2.textract.Textract2Operations) value); return true;
+ case "overrideEndpoint": getOrCreateConfiguration((Textract2Component) component).setOverrideEndpoint((boolean) value); return true;
+ case "pojoRequest": getOrCreateConfiguration((Textract2Component) component).setPojoRequest((boolean) value); return true;
+ case "region": getOrCreateConfiguration((Textract2Component) component).setRegion((java.lang.String) value); return true;
+ case "s3Bucket": getOrCreateConfiguration((Textract2Component) component).setS3Bucket((java.lang.String) value); return true;
+ case "s3Object": getOrCreateConfiguration((Textract2Component) component).setS3Object((java.lang.String) value); return true;
+ case "s3ObjectVersion": getOrCreateConfiguration((Textract2Component) component).setS3ObjectVersion((java.lang.String) value); return true;
+ case "uriEndpointOverride": getOrCreateConfiguration((Textract2Component) component).setUriEndpointOverride((java.lang.String) value); return true;
+ case "autowiredEnabled": ((Textract2Component) component).setAutowiredEnabled((boolean) value); return true;
+ case "textractClient": getOrCreateConfiguration((Textract2Component) component).setTextractClient((software.amazon.awssdk.services.textract.TextractClient) value); return true;
+ case "healthCheckConsumerEnabled": ((Textract2Component) component).setHealthCheckConsumerEnabled((boolean) value); return true;
+ case "healthCheckProducerEnabled": ((Textract2Component) component).setHealthCheckProducerEnabled((boolean) value); return true;
+ case "proxyHost": getOrCreateConfiguration((Textract2Component) component).setProxyHost((java.lang.String) value); return true;
+ case "proxyPort": getOrCreateConfiguration((Textract2Component) component).setProxyPort((java.lang.Integer) value); return true;
+ case "proxyProtocol": getOrCreateConfiguration((Textract2Component) component).setProxyProtocol((software.amazon.awssdk.core.Protocol) value); return true;
+ case "accessKey": getOrCreateConfiguration((Textract2Component) component).setAccessKey((java.lang.String) value); return true;
+ case "profileCredentialsName": getOrCreateConfiguration((Textract2Component) component).setProfileCredentialsName((java.lang.String) value); return true;
+ case "secretKey": getOrCreateConfiguration((Textract2Component) component).setSecretKey((java.lang.String) value); return true;
+ case "sessionToken": getOrCreateConfiguration((Textract2Component) component).setSessionToken((java.lang.String) value); return true;
+ case "trustAllCertificates": getOrCreateConfiguration((Textract2Component) component).setTrustAllCertificates((boolean) value); return true;
+ case "useDefaultCredentialsProvider": getOrCreateConfiguration((Textract2Component) component).setUseDefaultCredentialsProvider((boolean) value); return true;
+ case "useProfileCredentialsProvider": getOrCreateConfiguration((Textract2Component) component).setUseProfileCredentialsProvider((boolean) value); return true;
+ case "useSessionCredentials": getOrCreateConfiguration((Textract2Component) component).setUseSessionCredentials((boolean) value); return true;
+ default: return false;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
index 106269f574c..a6213f4e7ea 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
@@ -342,6 +342,7 @@ public interface EndpointBuilderFactory
org.apache.camel.builder.endpoint.dsl.TahuHostEndpointBuilderFactory.TahuHostBuilders,
org.apache.camel.builder.endpoint.dsl.TelegramEndpointBuilderFactory.TelegramBuilders,
org.apache.camel.builder.endpoint.dsl.TensorFlowServingEndpointBuilderFactory.TensorFlowServingBuilders,
+ org.apache.camel.builder.endpoint.dsl.Textract2EndpointBuilderFactory.Textract2Builders,
org.apache.camel.builder.endpoint.dsl.ThriftEndpointBuilderFactory.ThriftBuilders,
org.apache.camel.builder.endpoint.dsl.ThymeleafEndpointBuilderFactory.ThymeleafBuilders,
org.apache.camel.builder.endpoint.dsl.TikaEndpointBuilderFactory.TikaBuilders,
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java
index 5004eb391b7..d8de23991c8 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java
@@ -339,6 +339,7 @@ public interface EndpointBuilders
org.apache.camel.builder.endpoint.dsl.TahuHostEndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.TelegramEndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.TensorFlowServingEndpointBuilderFactory,
+ org.apache.camel.builder.endpoint.dsl.Textract2EndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.ThriftEndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.ThymeleafEndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.TikaEndpointBuilderFactory,
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
index 5e10cfa93a7..ed80e4da70f 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
@@ -1576,6 +1576,48 @@ public class StaticEndpointBuilders {
public static STS2EndpointBuilderFactory.STS2EndpointBuilder aws2Sts(String componentName, String path) {
return STS2EndpointBuilderFactory.endpointBuilder(componentName, path);
}
+ /**
+ * AWS Textract (camel-aws2-textract)
+ * Extract text and data from documents using AWS Textract and AWS SDK
+ * version 2.x.
+ *
+ * Category: cloud,document
+ * Since: 4.15
+ * Maven coordinates: org.apache.camel:camel-aws2-textract
+ *
+ * Syntax: <code>aws2-textract:label</code>
+ *
+ * Path parameter: label (required)
+ * Logical name
+ *
+ * @param path label
+ * @return the dsl builder
+ */
+ public static Textract2EndpointBuilderFactory.Textract2EndpointBuilder aws2Textract(String path) {
+ return aws2Textract("aws2-textract", path);
+ }
+ /**
+ * AWS Textract (camel-aws2-textract)
+ * Extract text and data from documents using AWS Textract and AWS SDK
+ * version 2.x.
+ *
+ * Category: cloud,document
+ * Since: 4.15
+ * Maven coordinates: org.apache.camel:camel-aws2-textract
+ *
+ * Syntax: <code>aws2-textract:label</code>
+ *
+ * Path parameter: label (required)
+ * Logical name
+ *
+ * @param componentName to use a custom component name for the endpoint
+ * instead of the default name
+ * @param path label
+ * @return the dsl builder
+ */
+ public static Textract2EndpointBuilderFactory.Textract2EndpointBuilder aws2Textract(String componentName, String path) {
+ return Textract2EndpointBuilderFactory.endpointBuilder(componentName, path);
+ }
/**
* AWS Timestream (camel-aws2-timestream)
* Write records and execute queries on AWS time-series database
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Textract2EndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Textract2EndpointBuilderFactory.java
new file mode 100644
index 00000000000..45c2f8746cb
--- /dev/null
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Textract2EndpointBuilderFactory.java
@@ -0,0 +1,748 @@
+/* Generated by camel build tools - do NOT edit this file! */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.builder.endpoint.dsl;
+
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.function.*;
+import java.util.stream.*;
+import javax.annotation.processing.Generated;
+import org.apache.camel.builder.EndpointConsumerBuilder;
+import org.apache.camel.builder.EndpointProducerBuilder;
+import org.apache.camel.builder.endpoint.AbstractEndpointBuilder;
+
+/**
+ * Extract text and data from documents using AWS Textract and AWS SDK version
+ * 2.x.
+ *
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@Generated("org.apache.camel.maven.packaging.EndpointDslMojo")
+public interface Textract2EndpointBuilderFactory {
+
+ /**
+ * Builder for endpoint for the AWS Textract component.
+ */
+ public interface Textract2EndpointBuilder
+ extends
+ EndpointProducerBuilder {
+ default AdvancedTextract2EndpointBuilder advanced() {
+ return (AdvancedTextract2EndpointBuilder) this;
+ }
+
+ /**
+ * The operation to perform.
+ *
+ * The option is a:
+ * <code>org.apache.camel.component.aws2.textract.Textract2Operations</code> type.
+ *
+ * Required: true
+ * Default: detectDocumentText
+ * Group: producer
+ *
+ * @param operation the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder operation(org.apache.camel.component.aws2.textract.Textract2Operations operation) {
+ doSetProperty("operation", operation);
+ return this;
+ }
+ /**
+ * The operation to perform.
+ *
+ * The option will be converted to a
+ * <code>org.apache.camel.component.aws2.textract.Textract2Operations</code> type.
+ *
+ * Required: true
+ * Default: detectDocumentText
+ * Group: producer
+ *
+ * @param operation the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder operation(String operation) {
+ doSetProperty("operation", operation);
+ return this;
+ }
+ /**
+ * Set the need for overriding the endpoint. This option needs to be
+ * used in combination with uriEndpointOverride option.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: producer
+ *
+ * @param overrideEndpoint the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder overrideEndpoint(boolean overrideEndpoint) {
+ doSetProperty("overrideEndpoint", overrideEndpoint);
+ return this;
+ }
+ /**
+ * Set the need for overriding the endpoint. This option needs to be
+ * used in combination with uriEndpointOverride option.
+ *
+ * The option will be converted to a <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: producer
+ *
+ * @param overrideEndpoint the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder overrideEndpoint(String overrideEndpoint) {
+ doSetProperty("overrideEndpoint", overrideEndpoint);
+ 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
+ *
+ * @param pojoRequest the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder 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
+ *
+ * @param pojoRequest the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder pojoRequest(String pojoRequest) {
+ doSetProperty("pojoRequest", pojoRequest);
+ return this;
+ }
+ /**
+ * The region in which Textract client needs to work. When using this
+ * parameter, the configuration will expect the lowercase name of the
+ * region (for example ap-east-1) You'll need to use the name
+ * Region.EU_WEST_1.id().
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer
+ *
+ * @param region the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder region(String region) {
+ doSetProperty("region", region);
+ return this;
+ }
+ /**
+ * The S3 bucket name for document location.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer
+ *
+ * @param s3Bucket the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder s3Bucket(String s3Bucket) {
+ doSetProperty("s3Bucket", s3Bucket);
+ return this;
+ }
+ /**
+ * The S3 object name for document location.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer
+ *
+ * @param s3Object the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder s3Object(String s3Object) {
+ doSetProperty("s3Object", s3Object);
+ return this;
+ }
+ /**
+ * The S3 object version for document location.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer
+ *
+ * @param s3ObjectVersion the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder s3ObjectVersion(String s3ObjectVersion) {
+ doSetProperty("s3ObjectVersion", s3ObjectVersion);
+ return this;
+ }
+ /**
+ * Set the overriding uri endpoint. This option needs to be used in
+ * combination with overrideEndpoint option.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer
+ *
+ * @param uriEndpointOverride the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder uriEndpointOverride(String uriEndpointOverride) {
+ doSetProperty("uriEndpointOverride", uriEndpointOverride);
+ return this;
+ }
+ /**
+ * To define a proxy host when instantiating the Textract client.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: proxy
+ *
+ * @param proxyHost the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder proxyHost(String proxyHost) {
+ doSetProperty("proxyHost", proxyHost);
+ return this;
+ }
+ /**
+ * To define a proxy port when instantiating the Textract client.
+ *
+ * The option is a: <code>java.lang.Integer</code> type.
+ *
+ * Group: proxy
+ *
+ * @param proxyPort the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder proxyPort(Integer proxyPort) {
+ doSetProperty("proxyPort", proxyPort);
+ return this;
+ }
+ /**
+ * To define a proxy port when instantiating the Textract client.
+ *
+ * The option will be converted to a <code>java.lang.Integer</code>
+ * type.
+ *
+ * Group: proxy
+ *
+ * @param proxyPort the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder proxyPort(String proxyPort) {
+ doSetProperty("proxyPort", proxyPort);
+ return this;
+ }
+ /**
+ * To define a proxy protocol when instantiating the Textract client.
+ *
+ * The option is a: <code>software.amazon.awssdk.core.Protocol</code>
+ * type.
+ *
+ * Default: HTTPS
+ * Group: proxy
+ *
+ * @param proxyProtocol the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder proxyProtocol(software.amazon.awssdk.core.Protocol proxyProtocol) {
+ doSetProperty("proxyProtocol", proxyProtocol);
+ return this;
+ }
+ /**
+ * To define a proxy protocol when instantiating the Textract client.
+ *
+ * The option will be converted to a
+ * <code>software.amazon.awssdk.core.Protocol</code> type.
+ *
+ * Default: HTTPS
+ * Group: proxy
+ *
+ * @param proxyProtocol the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder proxyProtocol(String proxyProtocol) {
+ doSetProperty("proxyProtocol", proxyProtocol);
+ return this;
+ }
+ /**
+ * Amazon AWS Access Key.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: security
+ *
+ * @param accessKey the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder accessKey(String accessKey) {
+ doSetProperty("accessKey", accessKey);
+ return this;
+ }
+ /**
+ * If using a profile credentials provider this parameter will set the
+ * profile name.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: security
+ *
+ * @param profileCredentialsName the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder profileCredentialsName(String profileCredentialsName) {
+ doSetProperty("profileCredentialsName", profileCredentialsName);
+ return this;
+ }
+ /**
+ * Amazon AWS Secret Key.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: security
+ *
+ * @param secretKey the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder secretKey(String secretKey) {
+ doSetProperty("secretKey", secretKey);
+ return this;
+ }
+ /**
+ * Amazon AWS Session Token.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: security
+ *
+ * @param sessionToken the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder sessionToken(String sessionToken) {
+ doSetProperty("sessionToken", sessionToken);
+ return this;
+ }
+ /**
+ * If we want to trust all certificates in case of overriding the
+ * endpoint.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: security
+ *
+ * @param trustAllCertificates the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder trustAllCertificates(boolean trustAllCertificates) {
+ doSetProperty("trustAllCertificates", trustAllCertificates);
+ return this;
+ }
+ /**
+ * If we want to trust all certificates in case of overriding the
+ * endpoint.
+ *
+ * The option will be converted to a <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: security
+ *
+ * @param trustAllCertificates the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder trustAllCertificates(String trustAllCertificates) {
+ doSetProperty("trustAllCertificates", trustAllCertificates);
+ return this;
+ }
+ /**
+ * Set whether the Textract client should expect to load credentials
+ * through a default credentials provider or to expect static
+ * credentials to be passed in.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: security
+ *
+ * @param useDefaultCredentialsProvider the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder useDefaultCredentialsProvider(boolean useDefaultCredentialsProvider) {
+ doSetProperty("useDefaultCredentialsProvider", useDefaultCredentialsProvider);
+ return this;
+ }
+ /**
+ * Set whether the Textract client should expect to load credentials
+ * through a default credentials provider or to expect static
+ * credentials to be passed in.
+ *
+ * The option will be converted to a <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: security
+ *
+ * @param useDefaultCredentialsProvider the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder useDefaultCredentialsProvider(String useDefaultCredentialsProvider) {
+ doSetProperty("useDefaultCredentialsProvider", useDefaultCredentialsProvider);
+ return this;
+ }
+ /**
+ * Set whether the Textract client should expect to load credentials
+ * through a profile credentials provider.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: security
+ *
+ * @param useProfileCredentialsProvider the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder useProfileCredentialsProvider(boolean useProfileCredentialsProvider) {
+ doSetProperty("useProfileCredentialsProvider", useProfileCredentialsProvider);
+ return this;
+ }
+ /**
+ * Set whether the Textract client should expect to load credentials
+ * through a profile credentials provider.
+ *
+ * The option will be converted to a <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: security
+ *
+ * @param useProfileCredentialsProvider the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder useProfileCredentialsProvider(String useProfileCredentialsProvider) {
+ doSetProperty("useProfileCredentialsProvider", useProfileCredentialsProvider);
+ return this;
+ }
+ /**
+ * Set whether the Textract client should expect to use Session
+ * Credentials. This is useful in situation in which the user needs to
+ * assume a IAM role for doing operations in Textract.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: security
+ *
+ * @param useSessionCredentials the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder useSessionCredentials(boolean useSessionCredentials) {
+ doSetProperty("useSessionCredentials", useSessionCredentials);
+ return this;
+ }
+ /**
+ * Set whether the Textract client should expect to use Session
+ * Credentials. This is useful in situation in which the user needs to
+ * assume a IAM role for doing operations in Textract.
+ *
+ * The option will be converted to a <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: security
+ *
+ * @param useSessionCredentials the value to set
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder useSessionCredentials(String useSessionCredentials) {
+ doSetProperty("useSessionCredentials", useSessionCredentials);
+ return this;
+ }
+ }
+
+ /**
+ * Advanced builder for endpoint for the AWS Textract component.
+ */
+ public interface AdvancedTextract2EndpointBuilder
+ extends
+ EndpointProducerBuilder {
+ default Textract2EndpointBuilder basic() {
+ return (Textract2EndpointBuilder) this;
+ }
+
+ /**
+ * 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 starting the
+ * producer may take a little time and prolong the total processing time
+ * of the processing.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: producer (advanced)
+ *
+ * @param lazyStartProducer the value to set
+ * @return the dsl builder
+ */
+ default AdvancedTextract2EndpointBuilder lazyStartProducer(boolean lazyStartProducer) {
+ doSetProperty("lazyStartProducer", lazyStartProducer);
+ return this;
+ }
+ /**
+ * 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 starting the
+ * producer may take a little time and prolong the total processing time
+ * of the processing.
+ *
+ * The option will be converted to a <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: producer (advanced)
+ *
+ * @param lazyStartProducer the value to set
+ * @return the dsl builder
+ */
+ default AdvancedTextract2EndpointBuilder lazyStartProducer(String lazyStartProducer) {
+ doSetProperty("lazyStartProducer", lazyStartProducer);
+ return this;
+ }
+ /**
+ * To use an existing configured AWS Textract client.
+ *
+ * The option is a:
+ * <code>software.amazon.awssdk.services.textract.TextractClient</code>
+ * type.
+ *
+ * Group: advanced
+ *
+ * @param textractClient the value to set
+ * @return the dsl builder
+ */
+ default AdvancedTextract2EndpointBuilder textractClient(software.amazon.awssdk.services.textract.TextractClient textractClient) {
+ doSetProperty("textractClient", textractClient);
+ return this;
+ }
+ /**
+ * To use an existing configured AWS Textract client.
+ *
+ * The option will be converted to a
+ * <code>software.amazon.awssdk.services.textract.TextractClient</code>
+ * type.
+ *
+ * Group: advanced
+ *
+ * @param textractClient the value to set
+ * @return the dsl builder
+ */
+ default AdvancedTextract2EndpointBuilder textractClient(String textractClient) {
+ doSetProperty("textractClient", textractClient);
+ return this;
+ }
+ }
+
+ public interface Textract2Builders {
+ /**
+ * AWS Textract (camel-aws2-textract)
+ * Extract text and data from documents using AWS Textract and AWS SDK
+ * version 2.x.
+ *
+ * Category: cloud,document
+ * Since: 4.15
+ * Maven coordinates: org.apache.camel:camel-aws2-textract
+ *
+ * @return the dsl builder for the headers' name.
+ */
+ default Textract2HeaderNameBuilder aws2Textract() {
+ return Textract2HeaderNameBuilder.INSTANCE;
+ }
+ /**
+ * AWS Textract (camel-aws2-textract)
+ * Extract text and data from documents using AWS Textract and AWS SDK
+ * version 2.x.
+ *
+ * Category: cloud,document
+ * Since: 4.15
+ * Maven coordinates: org.apache.camel:camel-aws2-textract
+ *
+ * Syntax: <code>aws2-textract:label</code>
+ *
+ * Path parameter: label (required)
+ * Logical name
+ *
+ * @param path label
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder aws2Textract(String path) {
+ return Textract2EndpointBuilderFactory.endpointBuilder("aws2-textract", path);
+ }
+ /**
+ * AWS Textract (camel-aws2-textract)
+ * Extract text and data from documents using AWS Textract and AWS SDK
+ * version 2.x.
+ *
+ * Category: cloud,document
+ * Since: 4.15
+ * Maven coordinates: org.apache.camel:camel-aws2-textract
+ *
+ * Syntax: <code>aws2-textract:label</code>
+ *
+ * Path parameter: label (required)
+ * Logical name
+ *
+ * @param componentName to use a custom component name for the endpoint
+ * instead of the default name
+ * @param path label
+ * @return the dsl builder
+ */
+ default Textract2EndpointBuilder aws2Textract(String componentName, String path) {
+ return Textract2EndpointBuilderFactory.endpointBuilder(componentName, path);
+ }
+
+ }
+ /**
+ * The builder of headers' name for the AWS Textract component.
+ */
+ public static class Textract2HeaderNameBuilder {
+ /**
+ * The internal instance of the builder used to access to all the
+ * methods representing the name of headers.
+ */
+ private static final Textract2HeaderNameBuilder INSTANCE = new Textract2HeaderNameBuilder();
+
+ /**
+ * The operation we want to perform.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: producer
+ *
+ * @return the name of the header {@code AwsTextractOperation}.
+ */
+ public String awsTextractOperation() {
+ return "CamelAwsTextractOperation";
+ }
+ /**
+ * The S3 bucket name.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: producer
+ *
+ * @return the name of the header {@code AwsTextractS3Bucket}.
+ */
+ public String awsTextractS3Bucket() {
+ return "CamelAwsTextractS3Bucket";
+ }
+ /**
+ * The S3 object name.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: producer
+ *
+ * @return the name of the header {@code AwsTextractS3Object}.
+ */
+ public String awsTextractS3Object() {
+ return "CamelAwsTextractS3Object";
+ }
+ /**
+ * The S3 object version.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: producer
+ *
+ * @return the name of the header {@code AwsTextractS3ObjectVersion}.
+ */
+ public String awsTextractS3ObjectVersion() {
+ return "CamelAwsTextractS3ObjectVersion";
+ }
+ /**
+ * The job ID for async operations.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: producer
+ *
+ * @return the name of the header {@code AwsTextractJobId}.
+ */
+ public String awsTextractJobId() {
+ return "CamelAwsTextractJobId";
+ }
+ /**
+ * The max results to return.
+ *
+ * The option is a: {@code Integer} type.
+ *
+ * Group: producer
+ *
+ * @return the name of the header {@code AwsTextractMaxResults}.
+ */
+ public String awsTextractMaxResults() {
+ return "CamelAwsTextractMaxResults";
+ }
+ /**
+ * The next token for pagination.
+ *
+ * The option is a: {@code String} type.
+ *
+ * Group: producer
+ *
+ * @return the name of the header {@code AwsTextractNextToken}.
+ */
+ public String awsTextractNextToken() {
+ return "CamelAwsTextractNextToken";
+ }
+ /**
+ * The feature types for document analysis.
+ *
+ * The option is a: {@code List<FeatureType>} type.
+ *
+ * Group: producer
+ *
+ * @return the name of the header {@code AwsTextractFeatureTypes}.
+ */
+ public String awsTextractFeatureTypes() {
+ return "CamelAwsTextractFeatureTypes";
+ }
+ }
+ static Textract2EndpointBuilder endpointBuilder(String componentName, String path) {
+ class Textract2EndpointBuilderImpl extends AbstractEndpointBuilder implements Textract2EndpointBuilder, AdvancedTextract2EndpointBuilder {
+ public Textract2EndpointBuilderImpl(String path) {
+ super(componentName, path);
+ }
+ }
+ return new Textract2EndpointBuilderImpl(path);
+ }
+}
\ No newline at end of file
diff --git a/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties b/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties
index 04cb4c4e4db..1d7fe0d3db2 100644
--- a/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties
+++ b/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties
@@ -54,6 +54,7 @@ org.apache.camel.component.aws2.sns.Sns2Component=camel:aws2-sns
org.apache.camel.component.aws2.sqs.Sqs2Component=camel:aws2-sqs
org.apache.camel.component.aws2.stepfunctions.StepFunctions2Component=camel:aws2-step-functions
org.apache.camel.component.aws2.sts.STS2Component=camel:aws2-sts
+org.apache.camel.component.aws2.textract.Textract2Component=camel:aws2-textract
org.apache.camel.component.aws2.timestream.Timestream2Component=camel:aws2-timestream
org.apache.camel.component.aws2.translate.Translate2Component=camel:aws2-translate
org.apache.camel.component.azure.cosmosdb.CosmosDbComponent=camel:azure-cosmosdb
diff --git a/parent/pom.xml b/parent/pom.xml
index e893cbfcb4c..a71a8395866 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -902,6 +902,11 @@
<artifactId>camel-aws2-sts</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-aws2-textract</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-aws2-timestream</artifactId>
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/MojoHelper.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/MojoHelper.java
index b6d1dfea680..c5eb126fbcf 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/MojoHelper.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/MojoHelper.java
@@ -114,7 +114,8 @@ public final class MojoHelper {
dir.resolve("camel-aws2-sts"),
dir.resolve("camel-aws2-timestream"), dir.resolve("camel-aws2-translate"),
dir.resolve("camel-aws-xray"), dir.resolve("camel-aws-secrets-manager"),
- dir.resolve("camel-aws-cloudtrail"), dir.resolve("camel-aws-config"), dir.resolve("camel-aws-bedrock"));
+ dir.resolve("camel-aws-cloudtrail"), dir.resolve("camel-aws-config"), dir.resolve("camel-aws-bedrock"),
+ dir.resolve("camel-aws2-textract"));
case "camel-vertx":
return Arrays.asList(dir.resolve("camel-vertx"),
dir.resolve("camel-vertx-http"),