You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2022/03/16 19:13:16 UTC

[camel] 27/33: CAMEL-17792: Add doc about the message headers of camel-aws2-translate

This is an automated email from the ASF dual-hosted git repository.

nfilotto pushed a commit to branch CAMEL-17792/doc-message-headers
in repository https://gitbox.apache.org/repos/asf/camel.git

commit e0a135bd5a97d1bf17d26571cf5c705123cc1c13
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Wed Mar 16 15:46:38 2022 +0100

    CAMEL-17792: Add doc about the message headers of camel-aws2-translate
---
 .../component/aws2/translate/aws2-translate.json     |  6 ++++++
 .../src/main/docs/aws2-translate-component.adoc      | 20 ++++----------------
 .../aws2/translate/Translate2Constants.java          |  6 ++++++
 .../component/aws2/translate/Translate2Endpoint.java |  2 +-
 4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/components/camel-aws/camel-aws2-translate/src/generated/resources/org/apache/camel/component/aws2/translate/aws2-translate.json b/components/camel-aws/camel-aws2-translate/src/generated/resources/org/apache/camel/component/aws2/translate/aws2-translate.json
index 2febb32..8c6724a 100644
--- a/components/camel-aws/camel-aws2-translate/src/generated/resources/org/apache/camel/component/aws2/translate/aws2-translate.json
+++ b/components/camel-aws/camel-aws2-translate/src/generated/resources/org/apache/camel/component/aws2/translate/aws2-translate.json
@@ -42,6 +42,12 @@
     "accessKey": { "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.translate.Translate2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
     "secretKey": { "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.translate.Translate2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
   },
+  "headers": {
+    "CamelAwsTranslateSourceLanguage": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The text source language" },
+    "CamelAwsTranslateTargetLanguage": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The text target language" },
+    "CamelAwsTranslateTerminologyNames": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Collection<String>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The terminologies to use" },
+    "CamelAwsTranslateOperation": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation we want to perform" }
+  },
   "properties": {
     "label": { "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.translate.Translate2Configuration", "configurationField": "configuration", "description": "Logical name" },
     "autodetectSourceLanguage": { "kind": "parameter", "displayName": "Autodetect Source Language", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Being able to autodetect the source language" },
diff --git a/components/camel-aws/camel-aws2-translate/src/main/docs/aws2-translate-component.adoc b/components/camel-aws/camel-aws2-translate/src/main/docs/aws2-translate-component.adoc
index 7bc8531..9c3cc7e 100644
--- a/components/camel-aws/camel-aws2-translate/src/main/docs/aws2-translate-component.adoc
+++ b/components/camel-aws/camel-aws2-translate/src/main/docs/aws2-translate-component.adoc
@@ -64,23 +64,11 @@ You have the possibility of avoiding the usage of explicit static credentials, b
  - Web Identity Token from AWS STS.
  - The shared credentials and config files.
  - Amazon ECS container credentials - loaded from the Amazon ECS if the environment variable AWS_CONTAINER_CREDENTIALS_RELATIVE_URI is set.
- - Amazon EC2 Instance profile credentials. 
+ - Amazon EC2 Instance profile credentials.
 
-
-=== Message headers evaluated by the Translate producer
-
-[width="100%",cols="10%,10%,80%",options="header",]
-|=======================================================================
-|Header |Type |Description
-
-|`CamelAwsTranslateSourceLanguage` |`String` |The text source language
-
-|`CamelAwsTranslateTargetLanguage` |`String` |The text target language
-
-|`CamelAwsTranslateTerminologyNames` |`String` |The terminologies to use
-
-|`CamelAwsTranslateOperation` |`String` |The operation to perform
-|=======================================================================
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
 
 === Translate Producer operations
 
diff --git a/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Constants.java b/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Constants.java
index ed01d8c..2fe9a92 100644
--- a/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Constants.java
+++ b/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Constants.java
@@ -16,12 +16,18 @@
  */
 package org.apache.camel.component.aws2.translate;
 
+import org.apache.camel.spi.Metadata;
+
 /**
  * Constants used in Camel AWS2 Translate module
  */
 public interface Translate2Constants {
+    @Metadata(description = "The text source language", javaType = "String")
     String SOURCE_LANGUAGE = "CamelAwsTranslateSourceLanguage";
+    @Metadata(description = "The text target language", javaType = "String")
     String TARGET_LANGUAGE = "CamelAwsTranslateTargetLanguage";
+    @Metadata(description = "The terminologies to use", javaType = "Collection<String>")
     String TERMINOLOGY_NAMES = "CamelAwsTranslateTerminologyNames";
+    @Metadata(description = "The operation we want to perform", javaType = "String")
     String OPERATION = "CamelAwsTranslateOperation";
 }
diff --git a/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Endpoint.java b/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Endpoint.java
index 4e0c92e..075f43e 100644
--- a/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Endpoint.java
+++ b/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Endpoint.java
@@ -32,7 +32,7 @@ import software.amazon.awssdk.services.translate.TranslateClient;
  * Translate texts using AWS Translate and AWS SDK version 2.x.
  */
 @UriEndpoint(firstVersion = "3.1.0", scheme = "aws2-translate", title = "AWS Translate", syntax = "aws2-translate:label",
-             producerOnly = true, category = { Category.CLOUD, Category.MANAGEMENT })
+             producerOnly = true, category = { Category.CLOUD, Category.MANAGEMENT }, headersClass = Translate2Constants.class)
 public class Translate2Endpoint extends ScheduledPollEndpoint {
 
     private TranslateClient translateClient;