gnodet commented on code in PR #22285:
URL: https://github.com/apache/camel/pull/22285#discussion_r2994983417
##########
components/camel-google/camel-google-mail/src/main/docs/google-mail-component.adoc:
##########
@@ -63,6 +63,84 @@ include::partial$component-endpoint-options.adoc[]
include::partial$component-endpoint-headers.adoc[]
// component options: END
+== Data Type Transformer: update-message-labels
+
+The `google-mail:update-message-labels` data type transformer builds a
`ModifyMessageRequest` from exchange variables, resolving label names to Gmail
label IDs automatically.
+
+This is useful for modifying Gmail message labels (categorizing, archiving,
starring, moving, etc.) without manually calling the labels/list API.
+
+=== Exchange Variables
+
+[cols="1,1,3"]
+|===
+| Variable | Type | Description
+
+| `addLabels`
+| `String` (comma-separated) or `List<String>`
+| Label names to add to the message.
+
+| `removeLabels`
+| `String` (comma-separated) or `List<String>`
+| Label names to remove from the message.
+|===
+
+At least one of the two variables must be set.
+
+Both system labels (INBOX, UNREAD, STARRED, SPAM, TRASH, IMPORTANT, etc.) and
custom user-defined labels are resolved via the Gmail labels/list API.
+
+=== Examples
+
+[tabs]
+====
+Java::
++
+[source,java]
+----
+from("google-mail-stream:0")
+ .setVariable("addLabels", constant("Work"))
+ .setVariable("removeLabels", constant("INBOX,UNREAD"))
+ .transformDataType(new DataType("google-mail:update-message-labels"))
+ .to("google-mail:messages/modify");
+----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: "google-mail-stream:0"
+ steps:
+ - setVariable:
+ name: addLabels
+ constant: "Work"
+ - setVariable:
+ name: removeLabels
+ constant: "INBOX,UNREAD"
+ - transformDataType:
Review Comment:
Minor: `toType` is indented 4 spaces from `transformDataType`, but the rest
of the YAML example uses 2-space indentation (e.g.,
`setVariable`/`name`/`constant` above).
```suggestion
- transformDataType:
toType: "google-mail:update-message-labels"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]