This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 76c1feebbc31de5f460f1fe842a9a5737be554b6 Author: Claus Ibsen <[email protected]> AuthorDate: Sat Oct 24 19:57:06 2026 +0200 CAMEL-24961: Catalog body types for salesforce, servicenow, zendesk, twilio, stripe and seven more SaaS components (#28410) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../org/apache/camel/catalog/components/box.json | 5 ++ .../apache/camel/catalog/components/braintree.json | 4 + .../apache/camel/catalog/components/clickup.json | 4 + .../apache/camel/catalog/components/cm-sms.json | 4 + .../camel/catalog/components/salesforce.json | 5 ++ .../camel/catalog/components/servicenow.json | 4 + .../apache/camel/catalog/components/stripe.json | 4 + .../apache/camel/catalog/components/twilio.json | 5 ++ .../apache/camel/catalog/components/whatsapp.json | 4 + .../apache/camel/catalog/components/wordpress.json | 5 ++ .../apache/camel/catalog/components/workday.json | 4 + .../apache/camel/catalog/components/zendesk.json | 5 ++ .../camel/catalog/docs/stripe-component.adoc | 5 ++ .../org/apache/camel/component/box/box.json | 5 ++ .../apache/camel/component/box/BoxEndpoint.java | 21 +++++ .../camel/component/braintree/braintree.json | 4 + .../component/braintree/BraintreeEndpoint.java | 19 +++++ .../apache/camel/component/clickup/clickup.json | 4 + .../camel/component/clickup/ClickUpEndpoint.java | 11 +++ .../org/apache/camel/component/cm/cm-sms.json | 4 + .../org/apache/camel/component/cm/CMEndpoint.java | 11 +++ .../camel/component/salesforce/salesforce.json | 5 ++ .../component/salesforce/SalesforceEndpoint.java | 95 ++++++++++++++++++++++ .../camel/component/servicenow/servicenow.json | 4 + .../component/servicenow/ServiceNowEndpoint.java | 20 +++++ .../org/apache/camel/component/stripe/stripe.json | 4 + .../src/main/docs/stripe-component.adoc | 5 ++ .../camel/component/stripe/StripeEndpoint.java | 13 +++ .../org/apache/camel/component/twilio/twilio.json | 5 ++ .../camel/component/twilio/TwilioEndpoint.java | 18 ++++ .../apache/camel/component/whatsapp/whatsapp.json | 4 + .../camel/component/whatsapp/WhatsAppEndpoint.java | 12 +++ .../camel/component/wordpress/wordpress.json | 5 ++ .../component/wordpress/WordpressEndpoint.java | 20 +++++ .../apache/camel/component/workday/workday.json | 4 + .../camel/component/workday/WorkdayEndpoint.java | 10 +++ .../apache/camel/component/zendesk/zendesk.json | 5 ++ .../camel/component/zendesk/ZendeskEndpoint.java | 24 ++++++ 38 files changed, 390 insertions(+) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/box.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/box.json index 22ad3a82b62d..c15f1e4cd453 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/box.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/box.json @@ -48,6 +48,11 @@ "headers": { "CamelBox.": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The prefix of the headers that carry the parameters of the API method: the header CamelBox.fileName holds the fileName parameter.", "constantName": "org.apache.camel.component.box.internal.BoxConstants#PROPERTY_PREFIX" } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "pojo" ], "javaType": "com.box.sdk.BoxEvent", "description": "events\/listen is the only consumer: one message per event of the Box event stream, a BoxEvent" }, + "producerIn": { "carriers": [ "any" ], "dependsOn": [ "inBody" ], "description": "The body is used only when inBody names a parameter of the method, and must then be of the type of that parameter: an InputStream for content of files\/uploadFile and fileContent of files\/uploadNewFileVersion (convertBodyTo java.io.InputStream after a file consumer), or text for an id such as fileId. Without inBody the arguments come from the options and the CamelBox. headers" }, + "producerOut": { "carriers": [ "pojo", "list", "null" ], "description": "The return value of the method: a Box SDK object, such as the BoxFile of files\/uploadFile, the BoxFolder of folders\/createFolder or the Info of files\/getFileInfo; a Collection or a List for the methods that list, such as folders\/getFolderItems; null for the deletes and the other methods without a result. files\/downloadFile writes the content to the OutputStream of the output option or the CamelBox.output he [...] + }, "properties": { "apiName": { "index": 0, "kind": "path", "displayName": "Api Name", "group": "common", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.box.internal.BoxApiName", "enum": [ "COLLABORATIONS", "COMMENTS", "EVENT_LOGS", "FILES", "FOLDERS", "GROUPS", "EVENTS", "SEARCH", "TASKS", "USERS" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.box.BoxConfiguration", "configura [...] "methodName": { "index": 1, "kind": "path", "displayName": "Method Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.box.BoxConfiguration", "configurationField": "configuration", "description": "What sub operation to use for the selected operation" }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/braintree.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/braintree.json index b2a14dd61629..be531e6b10e1 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/braintree.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/braintree.json @@ -29,6 +29,10 @@ "autowiredEnabled": { "index": 1, "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 t [...] "configuration": { "index": 2, "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.braintree.BraintreeConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Component configuration" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ], "dependsOn": [ "inBody" ], "description": "The body is used only when inBody names a parameter of the method, and must then be of the type of that parameter: a request object such as the TransactionRequest for request of transaction\/sale, or text for an id. A Map or JSON or XML text is not turned into a request: build it first. Without inBody the arguments come from the options and the CamelBraintree. headers" }, + "producerOut": { "carriers": [ "pojo", "iterator", "list", "text" ], "description": "The return value of the method: a Result for the methods that change data, such as transaction\/sale, which does not fail the exchange when Braintree rejects the request: isSuccess() is then false and the errors are in the Result; the model object of a find, such as a Customer; a ResourceCollection for search and customer\/all, which fetches the records while it is iterated; a List for plan\/all; tex [...] + }, "properties": { "apiName": { "index": 0, "kind": "path", "displayName": "Api Name", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.braintree.internal.BraintreeApiName", "enum": [ "ADD_ON", "ADDRESS", "CLIENT_TOKEN", "CREDIT_CARD_VERIFICATION", "CUSTOMER", "DISCOUNT", "DISPUTE", "DOCUMENT_UPLOAD", "MERCHANT_ACCOUNT", "PAYMENT_METHOD", "PAYMENT_METHOD_NONCE", "OAUTH", "PLAN", "REPORT", "SETTLEMENT_BATCH_SUMMARY", "SUBSCRIPTION", "TRANSACTION [...] "methodName": { "index": 1, "kind": "path", "displayName": "Method Name", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "accept", "addFileEvidence", "addTextEvidence", "cancel", "cancelRelease", "cloneTransaction", "create", "createForCurrency", "credit", "delete", "fetchMerchantAccounts", "finalize", "find", "generate", "grant", "holdInEscrow", "parse", "refund", "releaseFromEscrow", "removeEvidence", "retryCharge", "re [...] diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/clickup.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/clickup.json index e55de30e5251..976407830b2e 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/clickup.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/clickup.json @@ -27,6 +27,10 @@ "bridgeErrorHandler": { "index": 0, "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the like [...] "autowiredEnabled": { "index": 1, "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 t [...] }, + "bodyTypes": { + "consumerOut": { "carriers": [ "pojo" ], "javaType": "org.apache.camel.component.clickup.model.TaskTimeTrackedUpdatedEvent", "description": "The event that ClickUp posts to the webhook, the only kind supported: an event of another kind, or one without a valid x-signature, fails with 500 and does not reach the route" }, + "consumerReply": { "carriers": [ "any" ], "description": "The body at the end of the route is not sent: ClickUp gets 204 without a body, or 500 when the route fails" } + }, "properties": { "workspaceId": { "index": 0, "kind": "path", "displayName": "Workspace Id", "group": "consumer", "label": "", "required": true, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.clickup.ClickUpConfiguration", "configurationField": "configuration", "description": "The WorkspaceID." }, "events": { "index": 1, "kind": "parameter", "displayName": "Events", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.clickup.ClickUpConfiguration", "configurationField": "configuration", "description": "The comma separated list of events to which the webhook must subscribe" }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cm-sms.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cm-sms.json index 49ffb5192549..7938c783b1d0 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cm-sms.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cm-sms.json @@ -27,6 +27,10 @@ "lazyStartProducer": { "index": 0, "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 [...] "autowiredEnabled": { "index": 1, "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 t [...] }, + "bodyTypes": { + "producerIn": { "carriers": [ "pojo" ], "javaType": "org.apache.camel.component.cm.client.SMSMessage", "description": "The SMS as an org.apache.camel.component.cm.client.SMSMessage with the text and the E.164 phone number; text, a Map or no body fails. A message that fails its validation, such as a phone number not in E.164 form, fails" }, + "producerOut": { "carriers": [ "unchanged" ], "description": "The body is left as it was; the call returns nothing and a rejected message fails the exchange" } + }, "properties": { "host": { "index": 0, "kind": "path", "displayName": "Host", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "SMS Provider HOST with scheme" }, "defaultFrom": { "index": 1, "kind": "parameter", "displayName": "Default From", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.cm.CMConfiguration", "configurationField": "configuration", "description": "This is the sender name. The maximum length is 11 characters." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/salesforce.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/salesforce.json index e9899ee4170b..14820edd6d69 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/salesforce.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/salesforce.json @@ -160,6 +160,11 @@ "CamelSalesforcePubSubRpcId": { "index": 21, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Pub\/Sub API rpc id.", "constantName": "org.apache.camel.component.salesforce.SalesforceConstants#HEADER_SALESFORCE_PUBSUB_RPC_ID" }, "CamelSalesforceQueryResultTotalSize": { "index": 22, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Total number of records matching a query.", "constantName": "org.apache.camel.component.salesforce.SalesforceConstants#HEADER_SALESFORCE_QUERY_RESULT_TOTAL_SIZE" } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "map", "pojo" ], "byOption": [ { "option": "operationName", "value": "pubSubSubscribe", "carriers": [ "pojo" ] }, { "option": "rawPayload", "value": "true", "carriers": [ "text", "pojo" ] }, { "option": "pubSubDeserializeType", "value": "JSON", "carriers": [ "text", "map", "pojo" ] } ], "description": "The subscribe operation gives a push topic record as a Map, or an object of sObjectClass (or the DTO of sObjectName), a platform event (\/event\/) as a P [...] + "producerIn": { "carriers": [ "text", "bytes", "stream", "file", "pojo", "list", "map", "null" ], "description": "The REST operations send a generated DTO (an AbstractSObjectBase) as JSON, or JSON text, bytes, a stream or a file as is; a Map or another object is sent as its toString, not as JSON: marshal it first. Text in the body is the id, SOQL or SOSL when the option or header is not set. apexCall takes a Map as query parameters; bulk operations take a JobInfo, BatchInfo or Job, a [...] + "producerOut": { "carriers": [ "pojo", "list", "map", "stream", "unchanged", "null" ], "dependsOn": [ "streamQueryResult", "notFoundBehaviour" ], "byOption": [ { "option": "operationName", "value": "createSObject", "carriers": [ "pojo" ], "javaType": "org.apache.camel.component.salesforce.api.dto.CreateSObjectResult" }, { "option": "operationName", "value": "upsertSObject", "carriers": [ "pojo", "unchanged" ] }, { "option": "operationName", "value": "updateSObject", "carriers": [ "un [...] + }, "properties": { "operationName": { "index": 0, "kind": "path", "displayName": "Operation Name", "group": "common", "label": "common", "required": true, "type": "enum", "javaType": "org.apache.camel.component.salesforce.internal.OperationName", "enum": [ "getVersions", "getResources", "getGlobalObjects", "getBasicInfo", "getDescription", "getSObject", "createSObject", "updateSObject", "deleteSObject", "getSObjectWithId", "upsertSObject", "deleteSObjectWithId", "getBlobField", "query", "queryMore", "q [...] "topicName": { "index": 1, "kind": "path", "displayName": "Topic Name", "group": "producer", "label": "consumer,producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the topic\/channel to use" }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/servicenow.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/servicenow.json index 4ff649960f69..4dae6294110a 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/servicenow.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/servicenow.json @@ -139,6 +139,10 @@ "CamelServiceNowDataSource": { "index": 61, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The sys param data source.", "constantName": "org.apache.camel.component.servicenow.ServiceNowConstants#SYSPARM_DATA_SOURCE" }, "CamelServiceNowTopLevelOnly": { "index": 62, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Gets only those categories whose parent is a catalog.", "constantName": "org.apache.camel.component.servicenow.ServiceNowConstants#SYSPARM_TOP_LEVEL_ONLY" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "map", "pojo", "text", "bytes", "stream", "file", "null" ], "description": "The record to create, modify or update must be an instance of the request model: a Map by default, an object of the class set with models or requestModels or the CamelServiceNowRequestModel header, or JSON text with a String model; another body fails. An attachment upload sends the body as a stream, with its content type in the CamelServiceNowContentType header. A retrieve or del [...] + "producerOut": { "carriers": [ "map", "list", "pojo", "text", "stream", "unchanged" ], "description": "The result of the call: a Map of the record, or a List of Maps for many, or objects of the response model class set with models or responseModels or the CamelServiceNowResponseModel header (the JSON text with a String model). The content of an attachment is an InputStream. A response with no content, such as a delete, leaves the body; the paging offsets and the other response fields [...] + }, "properties": { "instanceName": { "index": 0, "kind": "path", "displayName": "Instance Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The ServiceNow instance name" }, "display": { "index": 1, "kind": "parameter", "displayName": "Display", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "false", "true", "all" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.servicenow.ServiceNowConfiguration", "configurationField": "configuration", "description": "Set this parameter to true to return only scorecards wh [...] diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/stripe.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/stripe.json index 5cc0a3782f9b..44cb1b4cc4be 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/stripe.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/stripe.json @@ -34,6 +34,10 @@ "CamelStripeMethod": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The method to invoke (create, retrieve, update, delete, list, cancel, capture)", "constantName": "org.apache.camel.component.stripe.StripeConstants#METHOD_HEADER" }, "CamelStripeObjectId": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The ID of the object to retrieve, update, or delete", "constantName": "org.apache.camel.component.stripe.StripeConstants#OBJECT_ID" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "map", "text", "null" ], "description": "The request parameters of the call: a Map, or a JSON object as text; null for none. Bytes, a stream or a POJO fails: convert it to a String first. retrieve, delete and cancel ignore the body; they and update and capture take the id of the object from the CamelStripeObjectId header" }, + "producerOut": { "carriers": [ "pojo" ], "description": "The Stripe object the call returns, such as a com.stripe.model.Customer; list gives a collection of them, such as a CustomerCollection, with the objects in its data" } + }, "properties": { "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.stripe.StripeOperation", "enum": [ "charges", "customers", "paymentIntents", "paymentMethods", "refunds", "subscriptions", "invoices", "products", "prices", "balanceTransactions" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.compon [...] "lazyStartProducer": { "index": 1, "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 [...] diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/twilio.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/twilio.json index 4ac25db9e67a..adde04cae41a 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/twilio.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/twilio.json @@ -34,6 +34,11 @@ "password": { "index": 6, "kind": "property", "displayName": "Password", "group": "security", "label": "common,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Auth token for the account." }, "username": { "index": 7, "kind": "property", "displayName": "Username", "group": "security", "label": "common,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "The account to use." } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "pojo" ], "description": "One message per poll with the resource of the method, such as the Message of message\/fetch. read is split into one message per resource, and all its pages are read" }, + "producerIn": { "carriers": [ "any" ], "dependsOn": [ "inBody" ], "description": "The body is used only when inBody names a parameter of the method, and must then be of the type of that parameter: text for body of message\/create or for a sid such as pathSid, a com.twilio.type.PhoneNumber for to and from. Without inBody the arguments come from the options and the CamelTwilio. headers" }, + "producerOut": { "carriers": [ "pojo", "iterator", "value" ], "description": "The resource of the method, such as the Message of message\/create and message\/fetch or the Call of call\/create. read gives a ResourceSet, which reads the next pages from Twilio while it is iterated, and delete a Boolean" } + }, "properties": { "apiName": { "index": 0, "kind": "path", "displayName": "Api Name", "group": "common", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.twilio.internal.TwilioApiName", "enum": [ "ACCOUNT", "ADDRESS", "APPLICATION", "AVAILABLE_PHONE_NUMBER_COUNTRY", "CALL", "CONFERENCE", "CONNECT_APP", "INCOMING_PHONE_NUMBER", "KEY", "MESSAGE", "NEW_KEY", "NEW_SIGNING_KEY", "NOTIFICATION", "OUTGOING_CALLER_ID", "QUEUE", "RECORDING", "SHORT_CODE", "SIGNING_KEY", "T [...] "methodName": { "index": 1, "kind": "path", "displayName": "Method Name", "group": "common", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "create", "delete", "fetch", "read", "update" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.twilio.TwilioConfiguration", "configurationField": "configuration", "description": "What sub operation to use for the selected [...] diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/whatsapp.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/whatsapp.json index c8e3b3faaa71..ed03ad118418 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/whatsapp.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/whatsapp.json @@ -37,6 +37,10 @@ "CamelWhatsAppPhoneNumberId": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Phone Number ID taken from WhatsApp Meta for Developers Dashboard", "constantName": "org.apache.camel.component.whatsapp.WhatsAppConstants#WHATSAPP_PHONE_NUMBER_ID" }, "CamelWhatsAppRecipientPhoneNumberId": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Recipient phone number associated with Phone Number ID", "constantName": "org.apache.camel.component.whatsapp.WhatsAppConstants#WHATSAPP_RECIPIENT_PHONE_NUMBER_ID" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "pojo", "null" ], "description": "A request of org.apache.camel.component.whatsapp.model: a TextMessageRequest, MediaMessageRequest, LocationMessageRequest, ContactMessageRequest, InteractiveMessageRequest or TemplateMessageRequest to send a message, or an UploadMediaRequest to upload a media file. Text, bytes, a Map or another POJO fails: build the request. No body sends nothing" }, + "producerOut": { "carriers": [ "pojo", "unchanged" ], "description": "The org.apache.camel.component.whatsapp.model.MessageResponse of WhatsApp, with the ids of the messages sent, or the id of the media uploaded. No body is left as it is" } + }, "properties": { "phoneNumberId": { "index": 0, "kind": "path", "displayName": "Phone Number Id", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.whatsapp.WhatsAppConfiguration", "configurationField": "configuration", "description": "The phone number ID taken from whatsapp-business dashboard." }, "lazyStartProducer": { "index": 1, "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 [...] diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/wordpress.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/wordpress.json index 1d809bab3b42..0c421197ddc7 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/wordpress.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/wordpress.json @@ -39,6 +39,11 @@ "healthCheckProducerEnabled": { "index": 12, "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 [...] "password": { "index": 13, "kind": "property", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.wordpress.WordpressConfiguration", "configurationField": "configuration", "description": "Password from authorized user" } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "pojo" ], "byOption": [ { "option": "operation", "value": "post", "carriers": [ "pojo" ], "javaType": "org.apache.camel.component.wordpress.api.model.Post" }, { "option": "operation", "value": "user", "carriers": [ "pojo" ], "javaType": "org.apache.camel.component.wordpress.api.model.User" } ], "description": "One message per post or user of the search at every poll, the same ones again on the next poll, or the one of the id option: a Post or a User of [...] + "producerIn": { "carriers": [ "pojo" ], "byOption": [ { "option": "operationDetail", "value": "delete", "carriers": [ "any" ] } ], "description": "The Post or User (org.apache.camel.component.wordpress.api.model) to create, or to update with the id option: JSON text, a Map or another body fails, so unmarshal it to the class first. A delete does not read the body" }, + "producerOut": { "carriers": [ "pojo" ], "description": "The Post or User that WordPress answers: the one created, updated or deleted" } + }, "properties": { "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "common", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "post", "user" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The endpoint operation." }, "operationDetail": { "index": 1, "kind": "path", "displayName": "Operation Detail", "group": "common", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "delete" ], "deprecated": false, "autowired": false, "secret": false, "description": "The second part of an endpoint operation. Needed only when endpoint semantic is not enough, like wordpress:post:delete" }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/workday.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/workday.json index 010778298e86..6e3a5ca6d9b6 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/workday.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/workday.json @@ -30,6 +30,10 @@ "headers": { "CamelWorkdayURL": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The workday URL", "constantName": "org.apache.camel.component.workday.producer.WorkdayDefaultProducer#WORKDAY_URL_HEADER" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ], "description": "The body is not read: the report or the API resource is the path, and the report parameters are the other options of the endpoint" }, + "producerOut": { "carriers": [ "text" ], "javaType": "java.lang.String", "format": "json", "description": "The JSON that Workday answers, as text: the report (in the reportFormat) or the API resource; unmarshal it to work with its fields. The URL called is in the CamelWorkdayURL header" } + }, "properties": { "entity": { "index": 0, "kind": "path", "displayName": "Entity", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.workday.WorkdayConfiguration.Entity", "enum": [ "report", "commonAPI" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.workday.WorkdayConfiguration", "configurationField": "workdayConfiguration", "description": "The entity to be r [...] "path": { "index": 1, "kind": "path", "displayName": "Path", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.workday.WorkdayConfiguration", "configurationField": "workdayConfiguration", "description": "The API path to access an entity structure." }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/zendesk.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/zendesk.json index b91156d47faa..e9856b162293 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/zendesk.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/zendesk.json @@ -36,6 +36,11 @@ "token": { "index": 8, "kind": "property", "displayName": "Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "The security token." }, "username": { "index": 9, "kind": "property", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "The user name." } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "pojo", "map" ], "description": "One message per poll with the return value of the method: a Zendesk model object, such as the Ticket of getTicket. An Iterable or a List, such as the tickets of getTickets, is split into one message per element, and all its pages are read. getIncrementalTicketsResult gives a Map" }, + "producerIn": { "carriers": [ "any" ], "dependsOn": [ "inBody" ], "description": "The body is used only when inBody names a parameter of the method, and must then be of the type of that parameter: a Zendesk model object such as a Ticket for ticket of createTicket, a Long for id, or a byte[] for content of createUpload. JSON text or a Map is not turned into a model object: build it first. Without inBody the arguments come from the options and the CamelZendesk. headers" }, + "producerOut": { "carriers": [ "pojo", "iterator", "list", "map", "null" ], "description": "The return value of the method: a Zendesk model object, such as the Ticket of getTicket and createTicket; an Iterable for the methods that list, such as getTickets, which reads the pages from Zendesk while it is iterated, with split for example; a List for some, such as the tags of addTagToTicket; a ListenableFuture for the Async methods; a Map for getIncrementalTicketsResult; null for the met [...] + }, "properties": { "methodName": { "index": 0, "kind": "path", "displayName": "Method Name", "group": "common", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.zendesk.internal.ZendeskApiMethod", "enum": [ "ADD_TAG_TO_ORGANISATIONS", "ADD_TAG_TO_TICKET", "ADD_TAG_TO_TOPICS", "ASSOCIATE_ATTACHMENTS_TO_ARTICLE", "CHANGE_USER_PASSWORD", "CREATE_ARTICLE", "CREATE_ARTICLE_1", "CREATE_ARTICLE_TRANSLATION", "CREATE_AUTOMATION", "CREATE_CATEGORY", "CREATE_CATEGORY_TRANSLA [...] "inBody": { "index": 1, "kind": "parameter", "displayName": "In Body", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the name of a parameter to be passed in the exchange In Body" }, diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/stripe-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/stripe-component.adoc index 93cc4991d8fc..6c76349fc9a9 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/stripe-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/stripe-component.adoc @@ -232,6 +232,7 @@ mvn camel:run -DSTRIPE_API_KEY=sk_test_... == Usage Examples The Stripe component accepts both Map objects and JSON strings as input, providing flexibility for different integration scenarios. +Other bodies, such as the byte array or stream of an HTTP request, are not converted: convert them to a String first. === Creating a Customer @@ -330,6 +331,7 @@ Java:: [source,java] ---- from("rest:post:/payments") + .convertBodyTo(String.class) .log("Received payment request: ${body}") .to("stripe:paymentIntents?apiKey={{stripe.apiKey}}") .log("Payment intent created: ${body.id}"); @@ -341,6 +343,7 @@ XML:: ---- <route> <from uri="rest:post:/payments"/> + <convertBodyTo type="java.lang.String"/> <log message="Received payment request: ${body}"/> <to uri="stripe:paymentIntents?apiKey={{stripe.apiKey}}"/> <log message="Payment intent created: ${body.id}"/> @@ -355,6 +358,8 @@ YAML:: from: uri: rest:post:/payments steps: + - convertBodyTo: + type: java.lang.String - log: message: "Received payment request: ${body}" - to: diff --git a/components/camel-box/camel-box-component/src/generated/resources/META-INF/org/apache/camel/component/box/box.json b/components/camel-box/camel-box-component/src/generated/resources/META-INF/org/apache/camel/component/box/box.json index 22ad3a82b62d..c15f1e4cd453 100644 --- a/components/camel-box/camel-box-component/src/generated/resources/META-INF/org/apache/camel/component/box/box.json +++ b/components/camel-box/camel-box-component/src/generated/resources/META-INF/org/apache/camel/component/box/box.json @@ -48,6 +48,11 @@ "headers": { "CamelBox.": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The prefix of the headers that carry the parameters of the API method: the header CamelBox.fileName holds the fileName parameter.", "constantName": "org.apache.camel.component.box.internal.BoxConstants#PROPERTY_PREFIX" } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "pojo" ], "javaType": "com.box.sdk.BoxEvent", "description": "events\/listen is the only consumer: one message per event of the Box event stream, a BoxEvent" }, + "producerIn": { "carriers": [ "any" ], "dependsOn": [ "inBody" ], "description": "The body is used only when inBody names a parameter of the method, and must then be of the type of that parameter: an InputStream for content of files\/uploadFile and fileContent of files\/uploadNewFileVersion (convertBodyTo java.io.InputStream after a file consumer), or text for an id such as fileId. Without inBody the arguments come from the options and the CamelBox. headers" }, + "producerOut": { "carriers": [ "pojo", "list", "null" ], "description": "The return value of the method: a Box SDK object, such as the BoxFile of files\/uploadFile, the BoxFolder of folders\/createFolder or the Info of files\/getFileInfo; a Collection or a List for the methods that list, such as folders\/getFolderItems; null for the deletes and the other methods without a result. files\/downloadFile writes the content to the OutputStream of the output option or the CamelBox.output he [...] + }, "properties": { "apiName": { "index": 0, "kind": "path", "displayName": "Api Name", "group": "common", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.box.internal.BoxApiName", "enum": [ "COLLABORATIONS", "COMMENTS", "EVENT_LOGS", "FILES", "FOLDERS", "GROUPS", "EVENTS", "SEARCH", "TASKS", "USERS" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.box.BoxConfiguration", "configura [...] "methodName": { "index": 1, "kind": "path", "displayName": "Method Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.box.BoxConfiguration", "configurationField": "configuration", "description": "What sub operation to use for the selected operation" }, diff --git a/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxEndpoint.java b/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxEndpoint.java index 66e9231ef9f2..2522af8c5fad 100644 --- a/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxEndpoint.java +++ b/components/camel-box/camel-box-component/src/main/java/org/apache/camel/component/box/BoxEndpoint.java @@ -38,6 +38,9 @@ import org.apache.camel.component.box.internal.BoxApiName; import org.apache.camel.component.box.internal.BoxConnectionHelper; import org.apache.camel.component.box.internal.BoxConstants; import org.apache.camel.component.box.internal.BoxPropertiesHelper; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; @@ -54,6 +57,24 @@ import org.apache.camel.support.component.ApiMethodPropertiesHelper; headersClass = BoxConstants.class) @Metadata(excludeProperties = "startScheduler,initialDelay,delay,timeUnit,useFixedDelay,pollStrategy,runLoggingLevel,sendEmptyMessageWhenIdle" + ",greedy,scheduler,schedulerProperties,scheduledExecutorService,backoffMultiplier,backoffIdleThreshold,backoffErrorThreshold,repeatCount,bridgeErrorHandler") +@BodyTypes(consumerOut = @BodyType(value = Carrier.POJO, javaType = "com.box.sdk.BoxEvent", + description = "events/listen is the only consumer: one message per event of the Box" + + " event stream, a BoxEvent"), + producerIn = @BodyType(value = Carrier.ANY, dependsOn = "inBody", + description = "The body is used only when inBody names a parameter of the method, and" + + " must then be of the type of that parameter: an InputStream for content" + + " of files/uploadFile and fileContent of files/uploadNewFileVersion" + + " (convertBodyTo java.io.InputStream after a file consumer), or text for" + + " an id such as fileId. Without inBody the arguments come from the" + + " options and the CamelBox. headers"), + producerOut = @BodyType(value = { Carrier.POJO, Carrier.LIST, Carrier.NULL }, + description = "The return value of the method: a Box SDK object, such as the BoxFile of" + + " files/uploadFile, the BoxFolder of folders/createFolder or the Info of" + + " files/getFileInfo; a Collection or a List for the methods that list," + + " such as folders/getFolderItems; null for the deletes and the other" + + " methods without a result. files/downloadFile writes the content to the" + + " OutputStream of the output option or the CamelBox.output header and" + + " gives that OutputStream, not the content")) public class BoxEndpoint extends AbstractApiEndpoint<BoxApiName, BoxConfiguration> { @UriParam diff --git a/components/camel-braintree/src/generated/resources/META-INF/org/apache/camel/component/braintree/braintree.json b/components/camel-braintree/src/generated/resources/META-INF/org/apache/camel/component/braintree/braintree.json index b2a14dd61629..be531e6b10e1 100644 --- a/components/camel-braintree/src/generated/resources/META-INF/org/apache/camel/component/braintree/braintree.json +++ b/components/camel-braintree/src/generated/resources/META-INF/org/apache/camel/component/braintree/braintree.json @@ -29,6 +29,10 @@ "autowiredEnabled": { "index": 1, "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 t [...] "configuration": { "index": 2, "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.braintree.BraintreeConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Component configuration" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ], "dependsOn": [ "inBody" ], "description": "The body is used only when inBody names a parameter of the method, and must then be of the type of that parameter: a request object such as the TransactionRequest for request of transaction\/sale, or text for an id. A Map or JSON or XML text is not turned into a request: build it first. Without inBody the arguments come from the options and the CamelBraintree. headers" }, + "producerOut": { "carriers": [ "pojo", "iterator", "list", "text" ], "description": "The return value of the method: a Result for the methods that change data, such as transaction\/sale, which does not fail the exchange when Braintree rejects the request: isSuccess() is then false and the errors are in the Result; the model object of a find, such as a Customer; a ResourceCollection for search and customer\/all, which fetches the records while it is iterated; a List for plan\/all; tex [...] + }, "properties": { "apiName": { "index": 0, "kind": "path", "displayName": "Api Name", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.braintree.internal.BraintreeApiName", "enum": [ "ADD_ON", "ADDRESS", "CLIENT_TOKEN", "CREDIT_CARD_VERIFICATION", "CUSTOMER", "DISCOUNT", "DISPUTE", "DOCUMENT_UPLOAD", "MERCHANT_ACCOUNT", "PAYMENT_METHOD", "PAYMENT_METHOD_NONCE", "OAUTH", "PLAN", "REPORT", "SETTLEMENT_BATCH_SUMMARY", "SUBSCRIPTION", "TRANSACTION [...] "methodName": { "index": 1, "kind": "path", "displayName": "Method Name", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "accept", "addFileEvidence", "addTextEvidence", "cancel", "cancelRelease", "cloneTransaction", "create", "createForCurrency", "credit", "delete", "fetchMerchantAccounts", "finalize", "find", "generate", "grant", "holdInEscrow", "parse", "refund", "releaseFromEscrow", "removeEvidence", "retryCharge", "re [...] diff --git a/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeEndpoint.java b/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeEndpoint.java index 28df31f72d45..23508a91bedc 100644 --- a/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeEndpoint.java +++ b/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeEndpoint.java @@ -29,6 +29,9 @@ import org.apache.camel.component.braintree.internal.BraintreeApiCollection; import org.apache.camel.component.braintree.internal.BraintreeApiName; import org.apache.camel.component.braintree.internal.BraintreeConstants; import org.apache.camel.component.braintree.internal.BraintreePropertiesHelper; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; import org.apache.camel.support.component.AbstractApiEndpoint; @@ -42,6 +45,22 @@ import org.apache.camel.support.component.ApiMethodPropertiesHelper; producerOnly = true, apiSyntax = "apiName/methodName", category = { Category.SAAS, Category.FINANCE }) +@BodyTypes(producerIn = @BodyType(value = Carrier.ANY, dependsOn = "inBody", + description = "The body is used only when inBody names a parameter of the method, and" + + " must then be of the type of that parameter: a request object such as" + + " the TransactionRequest for request of transaction/sale, or text for an" + + " id. A Map or JSON or XML text is not turned into a request: build it" + + " first. Without inBody the arguments come from the options and the" + + " CamelBraintree. headers"), + producerOut = @BodyType(value = { Carrier.POJO, Carrier.ITERATOR, Carrier.LIST, Carrier.TEXT }, + description = "The return value of the method: a Result for the methods that change" + + " data, such as transaction/sale, which does not fail the exchange when" + + " Braintree rejects the request: isSuccess() is then false and the" + + " errors are in the Result; the model object of a find, such as a" + + " Customer; a ResourceCollection for search and customer/all, which" + + " fetches the records while it is iterated; a List for plan/all; text" + + " for clientToken/generate, oauth/connectUrl and" + + " webhookNotification/verify")) public class BraintreeEndpoint extends AbstractApiEndpoint<BraintreeApiName, BraintreeConfiguration> { @UriParam diff --git a/components/camel-clickup/src/generated/resources/META-INF/org/apache/camel/component/clickup/clickup.json b/components/camel-clickup/src/generated/resources/META-INF/org/apache/camel/component/clickup/clickup.json index e55de30e5251..976407830b2e 100644 --- a/components/camel-clickup/src/generated/resources/META-INF/org/apache/camel/component/clickup/clickup.json +++ b/components/camel-clickup/src/generated/resources/META-INF/org/apache/camel/component/clickup/clickup.json @@ -27,6 +27,10 @@ "bridgeErrorHandler": { "index": 0, "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the like [...] "autowiredEnabled": { "index": 1, "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 t [...] }, + "bodyTypes": { + "consumerOut": { "carriers": [ "pojo" ], "javaType": "org.apache.camel.component.clickup.model.TaskTimeTrackedUpdatedEvent", "description": "The event that ClickUp posts to the webhook, the only kind supported: an event of another kind, or one without a valid x-signature, fails with 500 and does not reach the route" }, + "consumerReply": { "carriers": [ "any" ], "description": "The body at the end of the route is not sent: ClickUp gets 204 without a body, or 500 when the route fails" } + }, "properties": { "workspaceId": { "index": 0, "kind": "path", "displayName": "Workspace Id", "group": "consumer", "label": "", "required": true, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.clickup.ClickUpConfiguration", "configurationField": "configuration", "description": "The WorkspaceID." }, "events": { "index": 1, "kind": "parameter", "displayName": "Events", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.clickup.ClickUpConfiguration", "configurationField": "configuration", "description": "The comma separated list of events to which the webhook must subscribe" }, diff --git a/components/camel-clickup/src/main/java/org/apache/camel/component/clickup/ClickUpEndpoint.java b/components/camel-clickup/src/main/java/org/apache/camel/component/clickup/ClickUpEndpoint.java index 5a0932c37481..bbb46365671d 100644 --- a/components/camel-clickup/src/main/java/org/apache/camel/component/clickup/ClickUpEndpoint.java +++ b/components/camel-clickup/src/main/java/org/apache/camel/component/clickup/ClickUpEndpoint.java @@ -29,6 +29,9 @@ import org.apache.camel.component.clickup.service.ClickUpServiceApiImpl; import org.apache.camel.component.clickup.service.ClickUpWebhookService; import org.apache.camel.component.webhook.WebhookCapableEndpoint; import org.apache.camel.component.webhook.WebhookConfiguration; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; import org.apache.camel.support.DefaultEndpoint; @@ -44,6 +47,14 @@ import org.slf4j.LoggerFactory; syntax = "clickup:workspaceId", category = { Category.CLOUD }, consumerOnly = true) +@BodyTypes(consumerOut = @BodyType(value = Carrier.POJO, + javaType = "org.apache.camel.component.clickup.model.TaskTimeTrackedUpdatedEvent", + description = "The event that ClickUp posts to the webhook, the only kind supported: an event" + + " of another kind, or one without a valid x-signature, fails with 500 and" + + " does not reach the route"), + consumerReply = @BodyType(value = Carrier.ANY, + description = "The body at the end of the route is not sent: ClickUp gets 204 without a" + + " body, or 500 when the route fails")) public class ClickUpEndpoint extends DefaultEndpoint implements WebhookCapableEndpoint { private static final Logger LOG = LoggerFactory.getLogger(ClickUpEndpoint.class); diff --git a/components/camel-cm-sms/src/generated/resources/META-INF/org/apache/camel/component/cm/cm-sms.json b/components/camel-cm-sms/src/generated/resources/META-INF/org/apache/camel/component/cm/cm-sms.json index 49ffb5192549..7938c783b1d0 100644 --- a/components/camel-cm-sms/src/generated/resources/META-INF/org/apache/camel/component/cm/cm-sms.json +++ b/components/camel-cm-sms/src/generated/resources/META-INF/org/apache/camel/component/cm/cm-sms.json @@ -27,6 +27,10 @@ "lazyStartProducer": { "index": 0, "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 [...] "autowiredEnabled": { "index": 1, "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 t [...] }, + "bodyTypes": { + "producerIn": { "carriers": [ "pojo" ], "javaType": "org.apache.camel.component.cm.client.SMSMessage", "description": "The SMS as an org.apache.camel.component.cm.client.SMSMessage with the text and the E.164 phone number; text, a Map or no body fails. A message that fails its validation, such as a phone number not in E.164 form, fails" }, + "producerOut": { "carriers": [ "unchanged" ], "description": "The body is left as it was; the call returns nothing and a rejected message fails the exchange" } + }, "properties": { "host": { "index": 0, "kind": "path", "displayName": "Host", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "SMS Provider HOST with scheme" }, "defaultFrom": { "index": 1, "kind": "parameter", "displayName": "Default From", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.cm.CMConfiguration", "configurationField": "configuration", "description": "This is the sender name. The maximum length is 11 characters." }, diff --git a/components/camel-cm-sms/src/main/java/org/apache/camel/component/cm/CMEndpoint.java b/components/camel-cm-sms/src/main/java/org/apache/camel/component/cm/CMEndpoint.java index 57c19f301484..a40591b2bd20 100644 --- a/components/camel-cm-sms/src/main/java/org/apache/camel/component/cm/CMEndpoint.java +++ b/components/camel-cm-sms/src/main/java/org/apache/camel/component/cm/CMEndpoint.java @@ -22,6 +22,9 @@ import org.apache.camel.Category; import org.apache.camel.Consumer; import org.apache.camel.ExchangePattern; import org.apache.camel.Processor; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.EndpointServiceLocation; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; @@ -38,6 +41,14 @@ import org.apache.hc.client5.http.impl.classic.HttpClientBuilder; */ @UriEndpoint(firstVersion = "2.18.0", scheme = "cm-sms", title = "CM SMS Gateway", syntax = "cm-sms:host", category = { Category.MOBILE }, producerOnly = true) +@BodyTypes(producerIn = @BodyType(value = Carrier.POJO, javaType = "org.apache.camel.component.cm.client.SMSMessage", + description = "The SMS as an org.apache.camel.component.cm.client.SMSMessage with" + + " the text and the E.164 phone number; text, a Map or no body" + + " fails. A message that fails its validation, such as a phone" + + " number not in E.164 form, fails"), + producerOut = @BodyType(value = Carrier.UNCHANGED, + description = "The body is left as it was; the call returns nothing and a" + + " rejected message fails the exchange")) public class CMEndpoint extends DefaultEndpoint implements EndpointServiceLocation { @UriPath diff --git a/components/camel-salesforce/camel-salesforce-component/src/generated/resources/META-INF/org/apache/camel/component/salesforce/salesforce.json b/components/camel-salesforce/camel-salesforce-component/src/generated/resources/META-INF/org/apache/camel/component/salesforce/salesforce.json index e9899ee4170b..14820edd6d69 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/generated/resources/META-INF/org/apache/camel/component/salesforce/salesforce.json +++ b/components/camel-salesforce/camel-salesforce-component/src/generated/resources/META-INF/org/apache/camel/component/salesforce/salesforce.json @@ -160,6 +160,11 @@ "CamelSalesforcePubSubRpcId": { "index": 21, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Pub\/Sub API rpc id.", "constantName": "org.apache.camel.component.salesforce.SalesforceConstants#HEADER_SALESFORCE_PUBSUB_RPC_ID" }, "CamelSalesforceQueryResultTotalSize": { "index": 22, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Total number of records matching a query.", "constantName": "org.apache.camel.component.salesforce.SalesforceConstants#HEADER_SALESFORCE_QUERY_RESULT_TOTAL_SIZE" } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "map", "pojo" ], "byOption": [ { "option": "operationName", "value": "pubSubSubscribe", "carriers": [ "pojo" ] }, { "option": "rawPayload", "value": "true", "carriers": [ "text", "pojo" ] }, { "option": "pubSubDeserializeType", "value": "JSON", "carriers": [ "text", "map", "pojo" ] } ], "description": "The subscribe operation gives a push topic record as a Map, or an object of sObjectClass (or the DTO of sObjectName), a platform event (\/event\/) as a P [...] + "producerIn": { "carriers": [ "text", "bytes", "stream", "file", "pojo", "list", "map", "null" ], "description": "The REST operations send a generated DTO (an AbstractSObjectBase) as JSON, or JSON text, bytes, a stream or a file as is; a Map or another object is sent as its toString, not as JSON: marshal it first. Text in the body is the id, SOQL or SOSL when the option or header is not set. apexCall takes a Map as query parameters; bulk operations take a JobInfo, BatchInfo or Job, a [...] + "producerOut": { "carriers": [ "pojo", "list", "map", "stream", "unchanged", "null" ], "dependsOn": [ "streamQueryResult", "notFoundBehaviour" ], "byOption": [ { "option": "operationName", "value": "createSObject", "carriers": [ "pojo" ], "javaType": "org.apache.camel.component.salesforce.api.dto.CreateSObjectResult" }, { "option": "operationName", "value": "upsertSObject", "carriers": [ "pojo", "unchanged" ] }, { "option": "operationName", "value": "updateSObject", "carriers": [ "un [...] + }, "properties": { "operationName": { "index": 0, "kind": "path", "displayName": "Operation Name", "group": "common", "label": "common", "required": true, "type": "enum", "javaType": "org.apache.camel.component.salesforce.internal.OperationName", "enum": [ "getVersions", "getResources", "getGlobalObjects", "getBasicInfo", "getDescription", "getSObject", "createSObject", "updateSObject", "deleteSObject", "getSObjectWithId", "upsertSObject", "deleteSObjectWithId", "getBlobField", "query", "queryMore", "q [...] "topicName": { "index": 1, "kind": "path", "displayName": "Topic Name", "group": "producer", "label": "consumer,producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the topic\/channel to use" }, diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpoint.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpoint.java index b4747b5402ef..ca427742ab57 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpoint.java +++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpoint.java @@ -24,6 +24,9 @@ import org.apache.camel.Processor; import org.apache.camel.Producer; import org.apache.camel.component.salesforce.internal.OperationName; import org.apache.camel.component.salesforce.internal.streaming.SubscriptionHelper; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; @@ -39,6 +42,98 @@ import org.slf4j.LoggerFactory; @UriEndpoint(firstVersion = "2.12.0", scheme = "salesforce", title = "Salesforce", syntax = "salesforce:operationName:topicName", category = { Category.CLOUD, Category.SAAS }, headersClass = SalesforceConstants.class) +@BodyTypes(consumerOut = @BodyType(value = { Carrier.MAP, Carrier.POJO }, + byOption = { + @BodyType.When(option = "operationName", value = "pubSubSubscribe", + carriers = Carrier.POJO), + @BodyType.When(option = "rawPayload", value = "true", + carriers = { Carrier.TEXT, Carrier.POJO }), + @BodyType.When(option = "pubSubDeserializeType", value = "JSON", + carriers = { Carrier.TEXT, Carrier.MAP, Carrier.POJO }) }, + description = "The subscribe operation gives a push topic record as a Map, or an object of" + + " sObjectClass (or the DTO of sObjectName), a platform event (/event/)" + + " as a PlatformEvent, and a change event (/data/) as a Map of the" + + " changed fields, with the replay id and the change event header in" + + " headers; rawPayload=true gives the JSON text instead. pubSubSubscribe" + + " gives an Avro GenericRecord or SpecificRecord, an object of" + + " pubSubPojoClass with POJO, or JSON text with JSON"), + producerIn = @BodyType(value = { + Carrier.TEXT, Carrier.BYTES, Carrier.STREAM, Carrier.FILE, Carrier.POJO, Carrier.LIST, Carrier.MAP, + Carrier.NULL }, + description = "The REST operations send a generated DTO (an AbstractSObjectBase) as" + + " JSON, or JSON text, bytes, a stream or a file as is; a Map or another" + + " object is sent as its toString, not as JSON: marshal it first. Text in" + + " the body is the id, SOQL or SOSL when the option or header is not set." + + " apexCall takes a Map as query parameters; bulk operations take a" + + " JobInfo, BatchInfo or Job, and createBatch the CSV or XML records as a" + + " stream; composite operations an SObjectComposite, SObjectBatch or" + + " SObjectTree, the SObject collections a List of DTOs; pubSubPublish a" + + " List of events; raw the request as a stream"), + producerOut = @BodyType(value = { + Carrier.POJO, Carrier.LIST, Carrier.MAP, Carrier.STREAM, Carrier.UNCHANGED, Carrier.NULL }, + dependsOn = { "streamQueryResult", "notFoundBehaviour" }, + byOption = { + @BodyType.When(option = "operationName", value = "createSObject", + carriers = Carrier.POJO, + javaType = "org.apache.camel.component.salesforce.api.dto.CreateSObjectResult"), + @BodyType.When(option = "operationName", value = "upsertSObject", + carriers = { Carrier.POJO, Carrier.UNCHANGED }), + @BodyType.When(option = "operationName", value = "updateSObject", + carriers = Carrier.UNCHANGED), + @BodyType.When(option = "operationName", value = "deleteSObject", + carriers = Carrier.UNCHANGED), + @BodyType.When(option = "operationName", value = "deleteSObjectWithId", + carriers = Carrier.UNCHANGED), + @BodyType.When(option = "operationName", value = "getSObject", + carriers = Carrier.POJO), + @BodyType.When(option = "operationName", value = "getSObjectWithId", + carriers = Carrier.POJO), + @BodyType.When(option = "operationName", value = "query", + carriers = { Carrier.POJO, Carrier.STREAM }), + @BodyType.When(option = "operationName", value = "queryAll", + carriers = { Carrier.POJO, Carrier.STREAM }), + @BodyType.When(option = "operationName", value = "queryMore", + carriers = { Carrier.POJO, Carrier.STREAM }), + @BodyType.When(option = "operationName", value = "getBlobField", + carriers = Carrier.STREAM), + @BodyType.When(option = "operationName", value = "getVersions", + carriers = Carrier.LIST), + @BodyType.When(option = "operationName", value = "apexCall", + carriers = { + Carrier.POJO, Carrier.MAP, Carrier.STREAM, + Carrier.UNCHANGED }), + @BodyType.When(option = "operationName", value = "raw", + carriers = { Carrier.STREAM, Carrier.NULL }), + @BodyType.When(option = "operationName", + value = "compositeCreateSObjectCollections", + carriers = Carrier.LIST), + @BodyType.When(option = "operationName", + value = "compositeUpdateSObjectCollections", + carriers = Carrier.LIST), + @BodyType.When(option = "operationName", + value = "compositeUpsertSObjectCollections", + carriers = Carrier.LIST), + @BodyType.When(option = "operationName", + value = "compositeRetrieveSObjectCollections", + carriers = Carrier.LIST), + @BodyType.When(option = "operationName", + value = "compositeDeleteSObjectCollections", + carriers = Carrier.LIST), + @BodyType.When(option = "operationName", value = "pubSubPublish", + carriers = Carrier.LIST), + @BodyType.When(option = "rawPayload", value = "true", + carriers = { + Carrier.STREAM, Carrier.POJO, Carrier.LIST, + Carrier.UNCHANGED, Carrier.NULL }) }, + description = "The response as a DTO: a CreateSObjectResult, the SObject DTO of" + + " sObjectName or sObjectClass, a QueryRecords class for a query (an" + + " Iterator of the records with streamQueryResult=true), JobInfo or Job" + + " for bulk, a List for getVersions, the collections and pubSubPublish;" + + " a DTO class that is not in packages fails: set sObjectClass or use" + + " rawPayload. getBlobField, raw and the bulk results give a stream;" + + " an update or delete with no content leaves the body. rawPayload=true" + + " gives the JSON of the REST, apexCall and composite responses as a" + + " stream; format=JSON or XML only sets the content type of raw")) public class SalesforceEndpoint extends DefaultEndpoint { private static final Logger LOG = LoggerFactory.getLogger(SalesforceEndpoint.class); diff --git a/components/camel-servicenow/camel-servicenow-component/src/generated/resources/META-INF/org/apache/camel/component/servicenow/servicenow.json b/components/camel-servicenow/camel-servicenow-component/src/generated/resources/META-INF/org/apache/camel/component/servicenow/servicenow.json index 4ff649960f69..4dae6294110a 100644 --- a/components/camel-servicenow/camel-servicenow-component/src/generated/resources/META-INF/org/apache/camel/component/servicenow/servicenow.json +++ b/components/camel-servicenow/camel-servicenow-component/src/generated/resources/META-INF/org/apache/camel/component/servicenow/servicenow.json @@ -139,6 +139,10 @@ "CamelServiceNowDataSource": { "index": 61, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The sys param data source.", "constantName": "org.apache.camel.component.servicenow.ServiceNowConstants#SYSPARM_DATA_SOURCE" }, "CamelServiceNowTopLevelOnly": { "index": 62, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Gets only those categories whose parent is a catalog.", "constantName": "org.apache.camel.component.servicenow.ServiceNowConstants#SYSPARM_TOP_LEVEL_ONLY" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "map", "pojo", "text", "bytes", "stream", "file", "null" ], "description": "The record to create, modify or update must be an instance of the request model: a Map by default, an object of the class set with models or requestModels or the CamelServiceNowRequestModel header, or JSON text with a String model; another body fails. An attachment upload sends the body as a stream, with its content type in the CamelServiceNowContentType header. A retrieve or del [...] + "producerOut": { "carriers": [ "map", "list", "pojo", "text", "stream", "unchanged" ], "description": "The result of the call: a Map of the record, or a List of Maps for many, or objects of the response model class set with models or responseModels or the CamelServiceNowResponseModel header (the JSON text with a String model). The content of an attachment is an InputStream. A response with no content, such as a delete, leaves the body; the paging offsets and the other response fields [...] + }, "properties": { "instanceName": { "index": 0, "kind": "path", "displayName": "Instance Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The ServiceNow instance name" }, "display": { "index": 1, "kind": "parameter", "displayName": "Display", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "false", "true", "all" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.servicenow.ServiceNowConfiguration", "configurationField": "configuration", "description": "Set this parameter to true to return only scorecards wh [...] diff --git a/components/camel-servicenow/camel-servicenow-component/src/main/java/org/apache/camel/component/servicenow/ServiceNowEndpoint.java b/components/camel-servicenow/camel-servicenow-component/src/main/java/org/apache/camel/component/servicenow/ServiceNowEndpoint.java index ad7af9c01178..b578c175f1fb 100644 --- a/components/camel-servicenow/camel-servicenow-component/src/main/java/org/apache/camel/component/servicenow/ServiceNowEndpoint.java +++ b/components/camel-servicenow/camel-servicenow-component/src/main/java/org/apache/camel/component/servicenow/ServiceNowEndpoint.java @@ -20,6 +20,9 @@ import org.apache.camel.Category; import org.apache.camel.Consumer; import org.apache.camel.Processor; import org.apache.camel.Producer; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; @@ -34,6 +37,23 @@ import org.slf4j.LoggerFactory; @UriEndpoint(firstVersion = "2.18.0", scheme = "servicenow", title = "ServiceNow", syntax = "servicenow:instanceName", producerOnly = true, category = { Category.API, Category.CLOUD, Category.MANAGEMENT }, headersClass = ServiceNowConstants.class) +@BodyTypes(producerIn = @BodyType(value = { + Carrier.MAP, Carrier.POJO, Carrier.TEXT, Carrier.BYTES, Carrier.STREAM, Carrier.FILE, Carrier.NULL }, + description = "The record to create, modify or update must be an instance of the request" + + " model: a Map by default, an object of the class set with models or" + + " requestModels or the CamelServiceNowRequestModel header, or JSON text" + + " with a String model; another body fails. An attachment upload sends the" + + " body as a stream, with its content type in the CamelServiceNowContentType" + + " header. A retrieve or delete does not read the body: the action, table" + + " and sys_id are headers"), + producerOut = @BodyType(value = { + Carrier.MAP, Carrier.LIST, Carrier.POJO, Carrier.TEXT, Carrier.STREAM, Carrier.UNCHANGED }, + description = "The result of the call: a Map of the record, or a List of Maps for many," + + " or objects of the response model class set with models or" + + " responseModels or the CamelServiceNowResponseModel header (the JSON" + + " text with a String model). The content of an attachment is an" + + " InputStream. A response with no content, such as a delete, leaves the" + + " body; the paging offsets and the other response fields are headers")) public class ServiceNowEndpoint extends DefaultEndpoint { private static final Logger LOGGER = LoggerFactory.getLogger(ServiceNowEndpoint.class); diff --git a/components/camel-stripe/src/generated/resources/META-INF/org/apache/camel/component/stripe/stripe.json b/components/camel-stripe/src/generated/resources/META-INF/org/apache/camel/component/stripe/stripe.json index 5cc0a3782f9b..44cb1b4cc4be 100644 --- a/components/camel-stripe/src/generated/resources/META-INF/org/apache/camel/component/stripe/stripe.json +++ b/components/camel-stripe/src/generated/resources/META-INF/org/apache/camel/component/stripe/stripe.json @@ -34,6 +34,10 @@ "CamelStripeMethod": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The method to invoke (create, retrieve, update, delete, list, cancel, capture)", "constantName": "org.apache.camel.component.stripe.StripeConstants#METHOD_HEADER" }, "CamelStripeObjectId": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The ID of the object to retrieve, update, or delete", "constantName": "org.apache.camel.component.stripe.StripeConstants#OBJECT_ID" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "map", "text", "null" ], "description": "The request parameters of the call: a Map, or a JSON object as text; null for none. Bytes, a stream or a POJO fails: convert it to a String first. retrieve, delete and cancel ignore the body; they and update and capture take the id of the object from the CamelStripeObjectId header" }, + "producerOut": { "carriers": [ "pojo" ], "description": "The Stripe object the call returns, such as a com.stripe.model.Customer; list gives a collection of them, such as a CustomerCollection, with the objects in its data" } + }, "properties": { "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.stripe.StripeOperation", "enum": [ "charges", "customers", "paymentIntents", "paymentMethods", "refunds", "subscriptions", "invoices", "products", "prices", "balanceTransactions" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.compon [...] "lazyStartProducer": { "index": 1, "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 [...] diff --git a/components/camel-stripe/src/main/docs/stripe-component.adoc b/components/camel-stripe/src/main/docs/stripe-component.adoc index 93cc4991d8fc..6c76349fc9a9 100644 --- a/components/camel-stripe/src/main/docs/stripe-component.adoc +++ b/components/camel-stripe/src/main/docs/stripe-component.adoc @@ -232,6 +232,7 @@ mvn camel:run -DSTRIPE_API_KEY=sk_test_... == Usage Examples The Stripe component accepts both Map objects and JSON strings as input, providing flexibility for different integration scenarios. +Other bodies, such as the byte array or stream of an HTTP request, are not converted: convert them to a String first. === Creating a Customer @@ -330,6 +331,7 @@ Java:: [source,java] ---- from("rest:post:/payments") + .convertBodyTo(String.class) .log("Received payment request: ${body}") .to("stripe:paymentIntents?apiKey={{stripe.apiKey}}") .log("Payment intent created: ${body.id}"); @@ -341,6 +343,7 @@ XML:: ---- <route> <from uri="rest:post:/payments"/> + <convertBodyTo type="java.lang.String"/> <log message="Received payment request: ${body}"/> <to uri="stripe:paymentIntents?apiKey={{stripe.apiKey}}"/> <log message="Payment intent created: ${body.id}"/> @@ -355,6 +358,8 @@ YAML:: from: uri: rest:post:/payments steps: + - convertBodyTo: + type: java.lang.String - log: message: "Received payment request: ${body}" - to: diff --git a/components/camel-stripe/src/main/java/org/apache/camel/component/stripe/StripeEndpoint.java b/components/camel-stripe/src/main/java/org/apache/camel/component/stripe/StripeEndpoint.java index 075638a4b129..8043256f51a8 100644 --- a/components/camel-stripe/src/main/java/org/apache/camel/component/stripe/StripeEndpoint.java +++ b/components/camel-stripe/src/main/java/org/apache/camel/component/stripe/StripeEndpoint.java @@ -20,6 +20,9 @@ import org.apache.camel.Category; import org.apache.camel.Consumer; import org.apache.camel.Processor; import org.apache.camel.Producer; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.EndpointServiceLocation; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; @@ -30,6 +33,16 @@ import org.apache.camel.support.DefaultEndpoint; */ @UriEndpoint(firstVersion = "4.17.0", scheme = "stripe", title = "Stripe", syntax = "stripe:operation", category = { Category.SAAS, Category.FINANCE }, producerOnly = true, headersClass = StripeConstants.class) +@BodyTypes(producerIn = @BodyType(value = { Carrier.MAP, Carrier.TEXT, Carrier.NULL }, + description = "The request parameters of the call: a Map, or a JSON object as" + + " text; null for none. Bytes, a stream or a POJO fails: convert it" + + " to a String first. retrieve, delete and cancel ignore the body;" + + " they and update and capture take the id of the object from the" + + " CamelStripeObjectId header"), + producerOut = @BodyType(value = Carrier.POJO, + description = "The Stripe object the call returns, such as a" + + " com.stripe.model.Customer; list gives a collection of them, such" + + " as a CustomerCollection, with the objects in its data")) public class StripeEndpoint extends DefaultEndpoint implements EndpointServiceLocation { @UriParam diff --git a/components/camel-twilio/src/generated/resources/META-INF/org/apache/camel/component/twilio/twilio.json b/components/camel-twilio/src/generated/resources/META-INF/org/apache/camel/component/twilio/twilio.json index 4ac25db9e67a..adde04cae41a 100644 --- a/components/camel-twilio/src/generated/resources/META-INF/org/apache/camel/component/twilio/twilio.json +++ b/components/camel-twilio/src/generated/resources/META-INF/org/apache/camel/component/twilio/twilio.json @@ -34,6 +34,11 @@ "password": { "index": 6, "kind": "property", "displayName": "Password", "group": "security", "label": "common,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "Auth token for the account." }, "username": { "index": 7, "kind": "property", "displayName": "Username", "group": "security", "label": "common,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "The account to use." } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "pojo" ], "description": "One message per poll with the resource of the method, such as the Message of message\/fetch. read is split into one message per resource, and all its pages are read" }, + "producerIn": { "carriers": [ "any" ], "dependsOn": [ "inBody" ], "description": "The body is used only when inBody names a parameter of the method, and must then be of the type of that parameter: text for body of message\/create or for a sid such as pathSid, a com.twilio.type.PhoneNumber for to and from. Without inBody the arguments come from the options and the CamelTwilio. headers" }, + "producerOut": { "carriers": [ "pojo", "iterator", "value" ], "description": "The resource of the method, such as the Message of message\/create and message\/fetch or the Call of call\/create. read gives a ResourceSet, which reads the next pages from Twilio while it is iterated, and delete a Boolean" } + }, "properties": { "apiName": { "index": 0, "kind": "path", "displayName": "Api Name", "group": "common", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.twilio.internal.TwilioApiName", "enum": [ "ACCOUNT", "ADDRESS", "APPLICATION", "AVAILABLE_PHONE_NUMBER_COUNTRY", "CALL", "CONFERENCE", "CONNECT_APP", "INCOMING_PHONE_NUMBER", "KEY", "MESSAGE", "NEW_KEY", "NEW_SIGNING_KEY", "NOTIFICATION", "OUTGOING_CALLER_ID", "QUEUE", "RECORDING", "SHORT_CODE", "SIGNING_KEY", "T [...] "methodName": { "index": 1, "kind": "path", "displayName": "Method Name", "group": "common", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "create", "delete", "fetch", "read", "update" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.twilio.TwilioConfiguration", "configurationField": "configuration", "description": "What sub operation to use for the selected [...] diff --git a/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioEndpoint.java b/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioEndpoint.java index eb014c663344..0bdae7c1cf6f 100644 --- a/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioEndpoint.java +++ b/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioEndpoint.java @@ -32,6 +32,9 @@ import org.apache.camel.component.twilio.internal.TwilioApiName; import org.apache.camel.component.twilio.internal.TwilioConstants; import org.apache.camel.component.twilio.internal.TwilioPropertiesHelper; import org.apache.camel.spi.BeanIntrospection; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.EndpointServiceLocation; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; @@ -46,6 +49,21 @@ import org.apache.camel.support.component.ApiMethodPropertiesHelper; @UriEndpoint(firstVersion = "2.20.0", scheme = "twilio", title = "Twilio", syntax = "twilio:apiName/methodName", apiSyntax = "apiName/methodName", category = { Category.API, Category.MESSAGING, Category.CLOUD }) +@BodyTypes(consumerOut = @BodyType(value = Carrier.POJO, + description = "One message per poll with the resource of the method, such as the" + + " Message of message/fetch. read is split into one message per resource," + + " and all its pages are read"), + producerIn = @BodyType(value = Carrier.ANY, dependsOn = "inBody", + description = "The body is used only when inBody names a parameter of the method, and" + + " must then be of the type of that parameter: text for body of" + + " message/create or for a sid such as pathSid, a" + + " com.twilio.type.PhoneNumber for to and from. Without inBody the" + + " arguments come from the options and the CamelTwilio. headers"), + producerOut = @BodyType(value = { Carrier.POJO, Carrier.ITERATOR, Carrier.VALUE }, + description = "The resource of the method, such as the Message of message/create and" + + " message/fetch or the Call of call/create. read gives a ResourceSet," + + " which reads the next pages from Twilio while it is iterated, and" + + " delete a Boolean")) public class TwilioEndpoint extends AbstractApiEndpoint<TwilioApiName, TwilioConfiguration> implements EndpointServiceLocation { protected static final Map<String, String> EXECUTOR_METHOD_MAP; diff --git a/components/camel-whatsapp/src/generated/resources/META-INF/org/apache/camel/component/whatsapp/whatsapp.json b/components/camel-whatsapp/src/generated/resources/META-INF/org/apache/camel/component/whatsapp/whatsapp.json index c8e3b3faaa71..ed03ad118418 100644 --- a/components/camel-whatsapp/src/generated/resources/META-INF/org/apache/camel/component/whatsapp/whatsapp.json +++ b/components/camel-whatsapp/src/generated/resources/META-INF/org/apache/camel/component/whatsapp/whatsapp.json @@ -37,6 +37,10 @@ "CamelWhatsAppPhoneNumberId": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Phone Number ID taken from WhatsApp Meta for Developers Dashboard", "constantName": "org.apache.camel.component.whatsapp.WhatsAppConstants#WHATSAPP_PHONE_NUMBER_ID" }, "CamelWhatsAppRecipientPhoneNumberId": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Recipient phone number associated with Phone Number ID", "constantName": "org.apache.camel.component.whatsapp.WhatsAppConstants#WHATSAPP_RECIPIENT_PHONE_NUMBER_ID" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "pojo", "null" ], "description": "A request of org.apache.camel.component.whatsapp.model: a TextMessageRequest, MediaMessageRequest, LocationMessageRequest, ContactMessageRequest, InteractiveMessageRequest or TemplateMessageRequest to send a message, or an UploadMediaRequest to upload a media file. Text, bytes, a Map or another POJO fails: build the request. No body sends nothing" }, + "producerOut": { "carriers": [ "pojo", "unchanged" ], "description": "The org.apache.camel.component.whatsapp.model.MessageResponse of WhatsApp, with the ids of the messages sent, or the id of the media uploaded. No body is left as it is" } + }, "properties": { "phoneNumberId": { "index": 0, "kind": "path", "displayName": "Phone Number Id", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.whatsapp.WhatsAppConfiguration", "configurationField": "configuration", "description": "The phone number ID taken from whatsapp-business dashboard." }, "lazyStartProducer": { "index": 1, "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 [...] diff --git a/components/camel-whatsapp/src/main/java/org/apache/camel/component/whatsapp/WhatsAppEndpoint.java b/components/camel-whatsapp/src/main/java/org/apache/camel/component/whatsapp/WhatsAppEndpoint.java index 9902ce8bfabc..17f3ed125acf 100644 --- a/components/camel-whatsapp/src/main/java/org/apache/camel/component/whatsapp/WhatsAppEndpoint.java +++ b/components/camel-whatsapp/src/main/java/org/apache/camel/component/whatsapp/WhatsAppEndpoint.java @@ -28,6 +28,9 @@ import org.apache.camel.Producer; import org.apache.camel.component.webhook.WebhookCapableEndpoint; import org.apache.camel.component.webhook.WebhookConfiguration; import org.apache.camel.component.whatsapp.service.WhatsAppServiceRestAPIAdapter; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; import org.apache.camel.support.ScheduledPollEndpoint; @@ -43,6 +46,15 @@ import org.slf4j.LoggerFactory; Category.CLOUD, Category.API, Category.CHAT }, headersClass = WhatsAppConstants.class) +@BodyTypes(producerIn = @BodyType(value = { Carrier.POJO, Carrier.NULL }, + description = "A request of org.apache.camel.component.whatsapp.model: a TextMessageRequest," + + " MediaMessageRequest, LocationMessageRequest, ContactMessageRequest," + + " InteractiveMessageRequest or TemplateMessageRequest to send a message, or an" + + " UploadMediaRequest to upload a media file. Text, bytes, a Map or another" + + " POJO fails: build the request. No body sends nothing"), + producerOut = @BodyType(value = { Carrier.POJO, Carrier.UNCHANGED }, + description = "The org.apache.camel.component.whatsapp.model.MessageResponse of WhatsApp, with the ids of the messages sent, or the id" + + " of the media uploaded. No body is left as it is")) public class WhatsAppEndpoint extends ScheduledPollEndpoint implements WebhookCapableEndpoint { private static final Logger LOG = LoggerFactory.getLogger(WhatsAppEndpoint.class); diff --git a/components/camel-wordpress/src/generated/resources/META-INF/org/apache/camel/component/wordpress/wordpress.json b/components/camel-wordpress/src/generated/resources/META-INF/org/apache/camel/component/wordpress/wordpress.json index 1d809bab3b42..0c421197ddc7 100644 --- a/components/camel-wordpress/src/generated/resources/META-INF/org/apache/camel/component/wordpress/wordpress.json +++ b/components/camel-wordpress/src/generated/resources/META-INF/org/apache/camel/component/wordpress/wordpress.json @@ -39,6 +39,11 @@ "healthCheckProducerEnabled": { "index": 12, "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 [...] "password": { "index": 13, "kind": "property", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.wordpress.WordpressConfiguration", "configurationField": "configuration", "description": "Password from authorized user" } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "pojo" ], "byOption": [ { "option": "operation", "value": "post", "carriers": [ "pojo" ], "javaType": "org.apache.camel.component.wordpress.api.model.Post" }, { "option": "operation", "value": "user", "carriers": [ "pojo" ], "javaType": "org.apache.camel.component.wordpress.api.model.User" } ], "description": "One message per post or user of the search at every poll, the same ones again on the next poll, or the one of the id option: a Post or a User of [...] + "producerIn": { "carriers": [ "pojo" ], "byOption": [ { "option": "operationDetail", "value": "delete", "carriers": [ "any" ] } ], "description": "The Post or User (org.apache.camel.component.wordpress.api.model) to create, or to update with the id option: JSON text, a Map or another body fails, so unmarshal it to the class first. A delete does not read the body" }, + "producerOut": { "carriers": [ "pojo" ], "description": "The Post or User that WordPress answers: the one created, updated or deleted" } + }, "properties": { "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "common", "label": "", "required": true, "type": "enum", "javaType": "java.lang.String", "enum": [ "post", "user" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The endpoint operation." }, "operationDetail": { "index": 1, "kind": "path", "displayName": "Operation Detail", "group": "common", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "delete" ], "deprecated": false, "autowired": false, "secret": false, "description": "The second part of an endpoint operation. Needed only when endpoint semantic is not enough, like wordpress:post:delete" }, diff --git a/components/camel-wordpress/src/main/java/org/apache/camel/component/wordpress/WordpressEndpoint.java b/components/camel-wordpress/src/main/java/org/apache/camel/component/wordpress/WordpressEndpoint.java index 1791ab1c8e94..9fbfbd234030 100644 --- a/components/camel-wordpress/src/main/java/org/apache/camel/component/wordpress/WordpressEndpoint.java +++ b/components/camel-wordpress/src/main/java/org/apache/camel/component/wordpress/WordpressEndpoint.java @@ -33,6 +33,9 @@ import org.apache.camel.component.wordpress.consumer.WordpressUserConsumer; import org.apache.camel.component.wordpress.producer.WordpressPostProducer; import org.apache.camel.component.wordpress.producer.WordpressUserProducer; import org.apache.camel.component.wordpress.proxy.WordpressOperationType; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.EndpointServiceLocation; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; @@ -48,6 +51,23 @@ import org.apache.camel.util.PropertiesHelper; */ @UriEndpoint(firstVersion = "2.21.0", scheme = "wordpress", title = "WordPress", syntax = "wordpress:operation", category = { Category.CLOUD, Category.API, Category.CMS }) +@BodyTypes(consumerOut = @BodyType(value = Carrier.POJO, + byOption = { + @BodyType.When(option = "operation", value = "post", carriers = Carrier.POJO, + javaType = "org.apache.camel.component.wordpress.api.model.Post"), + @BodyType.When(option = "operation", value = "user", carriers = Carrier.POJO, + javaType = "org.apache.camel.component.wordpress.api.model.User") }, + description = "One message per post or user of the search at every poll, the same ones again" + + " on the next poll, or the one of the id option: a Post or a User of" + + " org.apache.camel.component.wordpress.api.model"), + producerIn = @BodyType(value = Carrier.POJO, + byOption = @BodyType.When(option = "operationDetail", value = "delete", + carriers = Carrier.ANY), + description = "The Post or User (org.apache.camel.component.wordpress.api.model) to create, or" + + " to update with the id option: JSON text, a Map or another body fails, so" + + " unmarshal it to the class first. A delete does not read the body"), + producerOut = @BodyType(value = Carrier.POJO, + description = "The Post or User that WordPress answers: the one created, updated or deleted")) public class WordpressEndpoint extends DefaultEndpoint implements EndpointServiceLocation { public static final String ENDPOINT_SERVICE_POST = "post,user"; diff --git a/components/camel-workday/src/generated/resources/META-INF/org/apache/camel/component/workday/workday.json b/components/camel-workday/src/generated/resources/META-INF/org/apache/camel/component/workday/workday.json index 010778298e86..6e3a5ca6d9b6 100644 --- a/components/camel-workday/src/generated/resources/META-INF/org/apache/camel/component/workday/workday.json +++ b/components/camel-workday/src/generated/resources/META-INF/org/apache/camel/component/workday/workday.json @@ -30,6 +30,10 @@ "headers": { "CamelWorkdayURL": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The workday URL", "constantName": "org.apache.camel.component.workday.producer.WorkdayDefaultProducer#WORKDAY_URL_HEADER" } }, + "bodyTypes": { + "producerIn": { "carriers": [ "any" ], "description": "The body is not read: the report or the API resource is the path, and the report parameters are the other options of the endpoint" }, + "producerOut": { "carriers": [ "text" ], "javaType": "java.lang.String", "format": "json", "description": "The JSON that Workday answers, as text: the report (in the reportFormat) or the API resource; unmarshal it to work with its fields. The URL called is in the CamelWorkdayURL header" } + }, "properties": { "entity": { "index": 0, "kind": "path", "displayName": "Entity", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.workday.WorkdayConfiguration.Entity", "enum": [ "report", "commonAPI" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.workday.WorkdayConfiguration", "configurationField": "workdayConfiguration", "description": "The entity to be r [...] "path": { "index": 1, "kind": "path", "displayName": "Path", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.workday.WorkdayConfiguration", "configurationField": "workdayConfiguration", "description": "The API path to access an entity structure." }, diff --git a/components/camel-workday/src/main/java/org/apache/camel/component/workday/WorkdayEndpoint.java b/components/camel-workday/src/main/java/org/apache/camel/component/workday/WorkdayEndpoint.java index cd7e672d9f4a..8293eefb8ffa 100644 --- a/components/camel-workday/src/main/java/org/apache/camel/component/workday/WorkdayEndpoint.java +++ b/components/camel-workday/src/main/java/org/apache/camel/component/workday/WorkdayEndpoint.java @@ -25,6 +25,9 @@ import org.apache.camel.Producer; import org.apache.camel.component.workday.producer.WorkdayCommonAPIProducer; import org.apache.camel.component.workday.producer.WorkdayDefaultProducer; import org.apache.camel.component.workday.producer.WorkdayReportProducer; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.EndpointServiceLocation; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; @@ -35,6 +38,13 @@ import org.apache.camel.support.DefaultEndpoint; */ @UriEndpoint(firstVersion = "3.1.0", scheme = "workday", title = "Workday", syntax = "workday:entity:path", producerOnly = true, category = { Category.CLOUD, Category.API, Category.SAAS }, headersClass = WorkdayDefaultProducer.class) +@BodyTypes(producerIn = @BodyType(value = Carrier.ANY, + description = "The body is not read: the report or the API resource is the path, and the" + + " report parameters are the other options of the endpoint"), + producerOut = @BodyType(value = Carrier.TEXT, javaType = "java.lang.String", format = "json", + description = "The JSON that Workday answers, as text: the report (in the reportFormat) or" + + " the API resource; unmarshal it to work with its fields. The URL called is in" + + " the CamelWorkdayURL header")) public class WorkdayEndpoint extends DefaultEndpoint implements EndpointServiceLocation { @UriParam diff --git a/components/camel-zendesk/src/generated/resources/META-INF/org/apache/camel/component/zendesk/zendesk.json b/components/camel-zendesk/src/generated/resources/META-INF/org/apache/camel/component/zendesk/zendesk.json index b91156d47faa..e9856b162293 100644 --- a/components/camel-zendesk/src/generated/resources/META-INF/org/apache/camel/component/zendesk/zendesk.json +++ b/components/camel-zendesk/src/generated/resources/META-INF/org/apache/camel/component/zendesk/zendesk.json @@ -36,6 +36,11 @@ "token": { "index": 8, "kind": "property", "displayName": "Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "The security token." }, "username": { "index": 9, "kind": "property", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "description": "The user name." } }, + "bodyTypes": { + "consumerOut": { "carriers": [ "pojo", "map" ], "description": "One message per poll with the return value of the method: a Zendesk model object, such as the Ticket of getTicket. An Iterable or a List, such as the tickets of getTickets, is split into one message per element, and all its pages are read. getIncrementalTicketsResult gives a Map" }, + "producerIn": { "carriers": [ "any" ], "dependsOn": [ "inBody" ], "description": "The body is used only when inBody names a parameter of the method, and must then be of the type of that parameter: a Zendesk model object such as a Ticket for ticket of createTicket, a Long for id, or a byte[] for content of createUpload. JSON text or a Map is not turned into a model object: build it first. Without inBody the arguments come from the options and the CamelZendesk. headers" }, + "producerOut": { "carriers": [ "pojo", "iterator", "list", "map", "null" ], "description": "The return value of the method: a Zendesk model object, such as the Ticket of getTicket and createTicket; an Iterable for the methods that list, such as getTickets, which reads the pages from Zendesk while it is iterated, with split for example; a List for some, such as the tags of addTagToTicket; a ListenableFuture for the Async methods; a Map for getIncrementalTicketsResult; null for the met [...] + }, "properties": { "methodName": { "index": 0, "kind": "path", "displayName": "Method Name", "group": "common", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.zendesk.internal.ZendeskApiMethod", "enum": [ "ADD_TAG_TO_ORGANISATIONS", "ADD_TAG_TO_TICKET", "ADD_TAG_TO_TOPICS", "ASSOCIATE_ATTACHMENTS_TO_ARTICLE", "CHANGE_USER_PASSWORD", "CREATE_ARTICLE", "CREATE_ARTICLE_1", "CREATE_ARTICLE_TRANSLATION", "CREATE_AUTOMATION", "CREATE_CATEGORY", "CREATE_CATEGORY_TRANSLA [...] "inBody": { "index": 1, "kind": "parameter", "displayName": "In Body", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the name of a parameter to be passed in the exchange In Body" }, diff --git a/components/camel-zendesk/src/main/java/org/apache/camel/component/zendesk/ZendeskEndpoint.java b/components/camel-zendesk/src/main/java/org/apache/camel/component/zendesk/ZendeskEndpoint.java index f8f217aab091..b4f5a3dfc95d 100644 --- a/components/camel-zendesk/src/main/java/org/apache/camel/component/zendesk/ZendeskEndpoint.java +++ b/components/camel-zendesk/src/main/java/org/apache/camel/component/zendesk/ZendeskEndpoint.java @@ -27,6 +27,9 @@ import org.apache.camel.component.zendesk.internal.ZendeskApiName; import org.apache.camel.component.zendesk.internal.ZendeskConstants; import org.apache.camel.component.zendesk.internal.ZendeskHelper; import org.apache.camel.component.zendesk.internal.ZendeskPropertiesHelper; +import org.apache.camel.spi.BodyType; +import org.apache.camel.spi.BodyType.Carrier; +import org.apache.camel.spi.BodyTypes; import org.apache.camel.spi.EndpointServiceLocation; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; @@ -42,6 +45,27 @@ import org.zendesk.client.v2.Zendesk; @UriEndpoint(firstVersion = "2.19.0", scheme = "zendesk", title = "Zendesk", syntax = "zendesk:methodName", apiSyntax = "methodName", consumerPrefix = "consumer", category = { Category.CLOUD, Category.API, Category.SAAS }) +@BodyTypes(consumerOut = @BodyType(value = { Carrier.POJO, Carrier.MAP }, + description = "One message per poll with the return value of the method: a Zendesk" + + " model object, such as the Ticket of getTicket. An Iterable or a List," + + " such as the tickets of getTickets, is split into one message per" + + " element, and all its pages are read. getIncrementalTicketsResult gives" + + " a Map"), + producerIn = @BodyType(value = Carrier.ANY, dependsOn = "inBody", + description = "The body is used only when inBody names a parameter of the method, and" + + " must then be of the type of that parameter: a Zendesk model object such" + + " as a Ticket for ticket of createTicket, a Long for id, or a byte[] for" + + " content of createUpload. JSON text or a Map is not turned into a model" + + " object: build it first. Without inBody the arguments come from the" + + " options and the CamelZendesk. headers"), + producerOut = @BodyType(value = { Carrier.POJO, Carrier.ITERATOR, Carrier.LIST, Carrier.MAP, Carrier.NULL }, + description = "The return value of the method: a Zendesk model object, such as the" + + " Ticket of getTicket and createTicket; an Iterable for the methods that" + + " list, such as getTickets, which reads the pages from Zendesk while it is" + + " iterated, with split for example; a List for some, such as the tags of" + + " addTagToTicket; a ListenableFuture for the Async methods; a Map for" + + " getIncrementalTicketsResult; null for the methods without a result," + + " such as deleteTicket")) public class ZendeskEndpoint extends AbstractApiEndpoint<ZendeskApiName, ZendeskConfiguration> implements EndpointServiceLocation {
