This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch CAMEL-27980-api-descriptions in repository https://gitbox.apache.org/repos/asf/camel.git
commit 6e8b765a66e677f83c2a5beaf665d2f7b58e7730 Author: Claus Ibsen <[email protected]> AuthorDate: Wed Dec 2 11:12:52 2026 +0100 CAMEL-27980: API components - descriptions file for methods without Javadoc, and the header prefix of 7 more components The API generator takes the descriptions of the methods and parameters from the Javadoc of the SDK sources, and some SDKs have none (twilio is generated without Javadoc, zendesk has little): 457 methods and 782 parameters have no description in the catalog. camel-api-component-maven-plugin now reads an optional src/main/api-descriptions.properties that fills the descriptions the Javadoc leaves empty, by the method and parameter names of the catalog. The texts themselves come in later commits. as2, braintree, dhis2, fhir, google-calendar, twilio and zendesk now declare the CamelXxx. prefix header that carries the parameters of the API method, as box, google-drive, google-mail and google-sheets already do. Part of CAMEL-27980. Co-Authored-By: Claude Opus 5.5 <[email protected]> --- .../org/apache/camel/catalog/components/as2.json | 3 + .../apache/camel/catalog/components/braintree.json | 3 + .../org/apache/camel/catalog/components/dhis2.json | 3 + .../org/apache/camel/catalog/components/fhir.json | 3 + .../camel/catalog/components/google-calendar.json | 3 + .../apache/camel/catalog/components/twilio.json | 3 + .../apache/camel/catalog/components/zendesk.json | 3 + .../org/apache/camel/component/as2/as2.json | 3 + .../apache/camel/component/as2/AS2Endpoint.java | 3 +- .../camel/component/as2/internal/AS2Constants.java | 6 ++ .../camel/component/braintree/braintree.json | 3 + .../component/braintree/BraintreeEndpoint.java | 3 +- .../braintree/internal/BraintreeConstants.java | 6 ++ .../org/apache/camel/component/dhis2/dhis2.json | 3 + .../camel/component/dhis2/Dhis2Endpoint.java | 3 +- .../component/dhis2/internal/Dhis2Constants.java | 6 ++ .../org/apache/camel/component/fhir/fhir.json | 3 + .../apache/camel/component/fhir/FhirEndpoint.java | 3 +- .../component/fhir/internal/FhirConstants.java | 6 ++ .../component/google/calendar/google-calendar.json | 3 + .../google/calendar/GoogleCalendarEndpoint.java | 3 +- .../calendar/internal/GoogleCalendarConstants.java | 6 ++ .../org/apache/camel/component/twilio/twilio.json | 3 + .../camel/component/twilio/TwilioEndpoint.java | 3 +- .../component/twilio/internal/TwilioConstants.java | 6 ++ .../apache/camel/component/zendesk/zendesk.json | 3 + .../camel/component/zendesk/ZendeskEndpoint.java | 3 +- .../zendesk/internal/ZendeskConstants.java | 6 ++ .../builder/endpoint/EndpointHeaderBuilders.java | 99 +++++++++++++++++++ .../endpoint/dsl/AS2EndpointBuilderFactory.java | 40 ++++++++ .../dsl/BraintreeEndpointBuilderFactory.java | 40 ++++++++ .../endpoint/dsl/Dhis2EndpointBuilderFactory.java | 39 ++++++++ .../endpoint/dsl/FhirEndpointBuilderFactory.java | 40 ++++++++ .../dsl/GoogleCalendarEndpointBuilderFactory.java | 40 ++++++++ .../endpoint/dsl/TwilioEndpointBuilderFactory.java | 41 ++++++++ .../dsl/ZendeskEndpointBuilderFactory.java | 40 ++++++++ .../maven/AbstractApiMethodGeneratorMojo.java | 45 ++++++++- .../camel/maven/ApiComponentGeneratorMojo.java | 18 ++++ .../org/apache/camel/maven/ApiDescriptions.java | 107 +++++++++++++++++++++ .../ApiJavaSourceComponentGeneratorMojoTest.java | 38 ++++++++ 40 files changed, 684 insertions(+), 8 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/as2.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/as2.json index c42e4a4df4bb..94a6eec02394 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/as2.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/as2.json @@ -32,6 +32,9 @@ "sslContextParameters": { "index": 4, "kind": "property", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "description": "To configure security using SSLContextParameters" }, "useGlobalSslContextParameters": { "index": 5, "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters." } }, + "headers": { + "CamelAs2.": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Object", "deprecated": false, "autowired": false, "secret": false, "description": "The prefix of the headers that carry the parameters of the API method: the header CamelAs2.requestUri holds the requestUri parameter. The name without the dot, such as CamelAs2RequestUri, works too.", "constantName": "org.apache.camel.component.as2.internal.AS2Consta [...] + }, "bodyTypes": { "consumerOut": { "carriers": [ "text", "stream" ], "byOption": [ { "option": "apiName", "value": "RECEIPT", "carriers": [ "pojo" ] } ], "description": "The EDI message that server\/listen receives, decrypted, decompressed and without its signature: text in the charset of its Content-Type, or a stream when the sender used the base64 or binary transfer encoding. The component answers with its own receipt (MDN), never the body of the route. receipt\/receive gives the receipt: a Disposit [...] "producerIn": { "carriers": [ "any" ], "dependsOn": [ "inBody" ], "description": "The body is used only when inBody names the argument of the method it is: with inBody=ediMessage it is the EDI message of client\/send: text, encoded in ediMessageCharset (us-ascii when not set), a stream, or bytes, a file or another body that converts to bytes, sent as those bytes; a body that does not convert fails. Without inBody the message comes from the ediMessage option or the CamelAs2.ediMessage [...] 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 96a4aebd531e..980aaefbb381 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,9 @@ "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" } }, + "headers": { + "CamelBraintree.": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Object", "deprecated": false, "autowired": false, "secret": false, "description": "The prefix of the headers that carry the parameters of the API method: the header CamelBraintree.customerId holds the customerId parameter. The name without the dot, such as CamelBraintreeCustomerId, works too.", "constantName": "org.apache.camel.component.brai [...] + }, "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 [...] diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dhis2.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dhis2.json index a7153717a504..1ac74b3cc446 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dhis2.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dhis2.json @@ -35,6 +35,9 @@ "personalAccessToken": { "index": 7, "kind": "property", "displayName": "Personal Access Token", "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.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "The personal access token to authenticate with DHIS2, sent as an ApiT [...] "username": { "index": 8, "kind": "property", "displayName": "Username", "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.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "The username of the DHIS2 user to call the API as, with HTTP Basic authentication together wi [...] }, + "headers": { + "CamelDhis2.": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Object", "deprecated": false, "autowired": false, "secret": false, "description": "The prefix of the headers that carry the parameters of the API method: the header CamelDhis2.path holds the path parameter. The name without the dot, such as CamelDhis2Path, works too.", "constantName": "org.apache.camel.component.dhis2.internal.Dhis2Constants#PROP [...] + }, "bodyTypes": { "consumerOut": { "carriers": [ "stream" ], "byOption": [ { "option": "methodName", "value": "collection", "carriers": [ "map" ] }, { "option": "apiName", "value": "RESOURCE_TABLES", "carriers": [ "null" ] } ], "description": "The return value of the method: one message per poll with the JSON response of get\/resource as a stream; get\/collection gives one message per item, a Dhis2Resource, which is a Map of the JSON fields" }, "producerIn": { "carriers": [ "text", "bytes", "stream", "file", "map", "list", "pojo", "null" ], "byOption": [ { "option": "apiName", "value": "GET", "carriers": [ "any" ] }, { "option": "apiName", "value": "DELETE", "carriers": [ "any" ] }, { "option": "apiName", "value": "RESOURCE_TABLES", "carriers": [ "any" ] } ], "description": "post and put send the body as the JSON resource of the request, also without inBody: text, bytes, a stream or a file as the JSON it holds, and a Map, a [...] diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/fhir.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/fhir.json index e4f632717463..c026e549ccd3 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/fhir.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/fhir.json @@ -53,6 +53,9 @@ "password": { "index": 25, "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.fhir.FhirConfiguration", "configurationField": "configuration", "description": "The password for HTTP basic authentication, used when username is set." }, "username": { "index": 26, "kind": "property", "displayName": "Username", "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.fhir.FhirConfiguration", "configurationField": "configuration", "description": "The user name for HTTP basic authentication. The password option is used with it." } }, + "headers": { + "CamelFhir.": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Object", "deprecated": false, "autowired": false, "secret": false, "description": "The prefix of the headers that carry the parameters of the API method: the header CamelFhir.url holds the url parameter. The name without the dot, such as CamelFhirUrl, works too.", "constantName": "org.apache.camel.component.fhir.internal.FhirConstants#PROPERTY_PREFIX" } + }, "bodyTypes": { "consumerOut": { "carriers": [ "pojo" ], "byOption": [ { "option": "apiName", "value": "TRANSACTION", "carriers": [ "pojo", "text" ] } ], "description": "One message per poll with the return value of the method: a MethodOutcome for create, update, patch, delete and validate, and a HAPI FHIR model object of the fhirVersion for the others, such as the Bundle of a search. A List is split into one message per resource, and transaction withBundle with stringBundle gives the response as text" }, "producerIn": { "carriers": [ "any" ], "dependsOn": [ "inBody" ], "description": "The body is used only when inBody names the argument of the method it is, and then converted to the type of that argument: resourceAsString, stringBundle and url take text, which a byte array, a stream or a file converts to, and resource, bundle and resources a HAPI FHIR object or a List of them (unmarshal with fhirJson or fhirXml first). A body that cannot be converted fails the exchange before the cal [...] diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/google-calendar.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/google-calendar.json index 44e49636502f..bbd28a0ed832 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/google-calendar.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/google-calendar.json @@ -42,6 +42,9 @@ "serviceAccountKey": { "index": 14, "kind": "property", "displayName": "Service Account Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.calendar.GoogleCalendarConfiguration", "configurationField": "configuration", "description": "The service account key in JSON format, to authenticate the application as [...] "user": { "index": 15, "kind": "property", "displayName": "User", "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.google.calendar.GoogleCalendarConfiguration", "configurationField": "configuration", "description": "The email address of the user to impersonate in the service account flow." } }, + "headers": { + "CamelGoogleCalendar.": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Object", "deprecated": false, "autowired": false, "secret": false, "description": "The prefix of the headers that carry the parameters of the API method: the header CamelGoogleCalendar.calendarId holds the calendarId parameter. The name without the dot, such as CamelGoogleCalendarCalendarId, works too.", "constantName": "org.apache.camel [...] + }, "bodyTypes": { "consumerOut": { "carriers": [ "pojo" ], "description": "One message per poll with the return value of the method: a Google Calendar model object, such as the Events of events\/list, which is one message and not split per event. The model classes are GenericJson, which is also a Map of the JSON fields" }, "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 Event for content of events\/insert, or text for text of events\/quickAdd. 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 CamelGoogleCalendar. headers" }, 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 1139a1fd74b4..5c48405388ad 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,9 @@ "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": "The password of the HTTP basic authentication with Twilio: the Auth Token of the account, or the secret of the API key set in username." }, "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 user name of the HTTP basic authentication with Twilio: the Account SID, or the SID of an API key (SK...). Used with password to build the REST client when restClient is not set." } }, + "headers": { + "CamelTwilio.": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Object", "deprecated": false, "autowired": false, "secret": false, "description": "The prefix of the headers that carry the parameters of the API method: the header CamelTwilio.pathAccountSid holds the pathAccountSid parameter. The name without the dot, such as CamelTwilioPathAccountSid, works too.", "constantName": "org.apache.camel.component.t [...] + }, "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" }, 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 98c6dc76663b..45a0bc5da4f9 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,9 @@ "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 Zendesk API token, sent with username as username\/token in basic authentication. Not used when password or oauthToken is set." }, "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 email address of the Zendesk user, sent with password or token in basic authentication. Not used with oauthToken." } }, + "headers": { + "CamelZendesk.": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Object", "deprecated": false, "autowired": false, "secret": false, "description": "The prefix of the headers that carry the parameters of the API method: the header CamelZendesk.ticketId holds the ticketId parameter. The name without the dot, such as CamelZendeskTicketId, works too.", "constantName": "org.apache.camel.component.zendesk.internal [...] + }, "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" }, diff --git a/components/camel-as2/camel-as2-component/src/generated/resources/META-INF/org/apache/camel/component/as2/as2.json b/components/camel-as2/camel-as2-component/src/generated/resources/META-INF/org/apache/camel/component/as2/as2.json index c42e4a4df4bb..94a6eec02394 100644 --- a/components/camel-as2/camel-as2-component/src/generated/resources/META-INF/org/apache/camel/component/as2/as2.json +++ b/components/camel-as2/camel-as2-component/src/generated/resources/META-INF/org/apache/camel/component/as2/as2.json @@ -32,6 +32,9 @@ "sslContextParameters": { "index": 4, "kind": "property", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "description": "To configure security using SSLContextParameters" }, "useGlobalSslContextParameters": { "index": 5, "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters." } }, + "headers": { + "CamelAs2.": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Object", "deprecated": false, "autowired": false, "secret": false, "description": "The prefix of the headers that carry the parameters of the API method: the header CamelAs2.requestUri holds the requestUri parameter. The name without the dot, such as CamelAs2RequestUri, works too.", "constantName": "org.apache.camel.component.as2.internal.AS2Consta [...] + }, "bodyTypes": { "consumerOut": { "carriers": [ "text", "stream" ], "byOption": [ { "option": "apiName", "value": "RECEIPT", "carriers": [ "pojo" ] } ], "description": "The EDI message that server\/listen receives, decrypted, decompressed and without its signature: text in the charset of its Content-Type, or a stream when the sender used the base64 or binary transfer encoding. The component answers with its own receipt (MDN), never the body of the route. receipt\/receive gives the receipt: a Disposit [...] "producerIn": { "carriers": [ "any" ], "dependsOn": [ "inBody" ], "description": "The body is used only when inBody names the argument of the method it is: with inBody=ediMessage it is the EDI message of client\/send: text, encoded in ediMessageCharset (us-ascii when not set), a stream, or bytes, a file or another body that converts to bytes, sent as those bytes; a body that does not convert fails. Without inBody the message comes from the ediMessage option or the CamelAs2.ediMessage [...] diff --git a/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Endpoint.java b/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Endpoint.java index 428a3eb62b55..58b52f59c218 100644 --- a/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Endpoint.java +++ b/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Endpoint.java @@ -60,7 +60,8 @@ import org.apache.camel.support.jsse.SSLContextParameters; */ @UriEndpoint(scheme = "as2", firstVersion = "2.22.0", title = "AS2", syntax = "as2:apiName/methodName", apiSyntax = "apiName/methodName", - category = { Category.FILE }) + category = { Category.FILE }, + headersClass = AS2Constants.class) @Metadata(excludeProperties = "startScheduler,initialDelay,delay,timeUnit,useFixedDelay,pollStrategy,runLoggingLevel,sendEmptyMessageWhenIdle" + ",greedy,scheduler,schedulerProperties,scheduledExecutorService,backoffMultiplier,backoffIdleThreshold,backoffErrorThreshold,repeatCount,healthCheckMaxPollDuration,bridgeErrorHandler") @BodyTypes(consumerOut = @BodyType(value = { Carrier.TEXT, Carrier.STREAM }, diff --git a/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/internal/AS2Constants.java b/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/internal/AS2Constants.java index df9793fc900c..0c2ced2c238b 100644 --- a/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/internal/AS2Constants.java +++ b/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/internal/AS2Constants.java @@ -16,12 +16,18 @@ */ package org.apache.camel.component.as2.internal; +import org.apache.camel.spi.Metadata; + /** * Constants for AS2 component. */ public interface AS2Constants { // suffix for parameters when passed as exchange header properties + @Metadata(label = "producer", + description = "The prefix of the headers that carry the parameters of the API method: the header CamelAs2.requestUri holds the requestUri parameter." + + " The name without the dot, such as CamelAs2RequestUri, works too.", + javaType = "Object") String PROPERTY_PREFIX = "CamelAs2."; // thread profile name for this component 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 96a4aebd531e..980aaefbb381 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,9 @@ "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" } }, + "headers": { + "CamelBraintree.": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Object", "deprecated": false, "autowired": false, "secret": false, "description": "The prefix of the headers that carry the parameters of the API method: the header CamelBraintree.customerId holds the customerId parameter. The name without the dot, such as CamelBraintreeCustomerId, works too.", "constantName": "org.apache.camel.component.brai [...] + }, "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 [...] 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 69d2013cc415..23da1776b4c8 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 @@ -45,7 +45,8 @@ import org.apache.camel.support.component.ApiMethodPropertiesHelper; @UriEndpoint(firstVersion = "2.17.0", scheme = "braintree", title = "Braintree", syntax = "braintree:apiName/methodName", producerOnly = true, apiSyntax = "apiName/methodName", - category = { Category.SAAS, Category.FINANCE }) + category = { Category.SAAS, Category.FINANCE }, + headersClass = BraintreeConstants.class) @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" diff --git a/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/internal/BraintreeConstants.java b/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/internal/BraintreeConstants.java index 7f3ed8d88996..c4938380747a 100644 --- a/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/internal/BraintreeConstants.java +++ b/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/internal/BraintreeConstants.java @@ -16,12 +16,18 @@ */ package org.apache.camel.component.braintree.internal; +import org.apache.camel.spi.Metadata; + /** * Constants for Braintree component. */ public interface BraintreeConstants { // suffix for parameters when passed as exchange header properties + @Metadata(label = "producer", + description = "The prefix of the headers that carry the parameters of the API method: the header CamelBraintree.customerId holds the customerId parameter." + + " The name without the dot, such as CamelBraintreeCustomerId, works too.", + javaType = "Object") String PROPERTY_PREFIX = "CamelBraintree."; // thread profile name for this component diff --git a/components/camel-dhis2/camel-dhis2-component/src/generated/resources/META-INF/org/apache/camel/component/dhis2/dhis2.json b/components/camel-dhis2/camel-dhis2-component/src/generated/resources/META-INF/org/apache/camel/component/dhis2/dhis2.json index a7153717a504..1ac74b3cc446 100644 --- a/components/camel-dhis2/camel-dhis2-component/src/generated/resources/META-INF/org/apache/camel/component/dhis2/dhis2.json +++ b/components/camel-dhis2/camel-dhis2-component/src/generated/resources/META-INF/org/apache/camel/component/dhis2/dhis2.json @@ -35,6 +35,9 @@ "personalAccessToken": { "index": 7, "kind": "property", "displayName": "Personal Access Token", "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.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "The personal access token to authenticate with DHIS2, sent as an ApiT [...] "username": { "index": 8, "kind": "property", "displayName": "Username", "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.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "The username of the DHIS2 user to call the API as, with HTTP Basic authentication together wi [...] }, + "headers": { + "CamelDhis2.": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Object", "deprecated": false, "autowired": false, "secret": false, "description": "The prefix of the headers that carry the parameters of the API method: the header CamelDhis2.path holds the path parameter. The name without the dot, such as CamelDhis2Path, works too.", "constantName": "org.apache.camel.component.dhis2.internal.Dhis2Constants#PROP [...] + }, "bodyTypes": { "consumerOut": { "carriers": [ "stream" ], "byOption": [ { "option": "methodName", "value": "collection", "carriers": [ "map" ] }, { "option": "apiName", "value": "RESOURCE_TABLES", "carriers": [ "null" ] } ], "description": "The return value of the method: one message per poll with the JSON response of get\/resource as a stream; get\/collection gives one message per item, a Dhis2Resource, which is a Map of the JSON fields" }, "producerIn": { "carriers": [ "text", "bytes", "stream", "file", "map", "list", "pojo", "null" ], "byOption": [ { "option": "apiName", "value": "GET", "carriers": [ "any" ] }, { "option": "apiName", "value": "DELETE", "carriers": [ "any" ] }, { "option": "apiName", "value": "RESOURCE_TABLES", "carriers": [ "any" ] } ], "description": "post and put send the body as the JSON resource of the request, also without inBody: text, bytes, a stream or a file as the JSON it holds, and a Map, a [...] diff --git a/components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/Dhis2Endpoint.java b/components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/Dhis2Endpoint.java index 9fc64ed19562..735a2ef19bfa 100644 --- a/components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/Dhis2Endpoint.java +++ b/components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/Dhis2Endpoint.java @@ -46,7 +46,8 @@ import org.hisp.dhis.integration.sdk.api.Dhis2Client; * Get, create, update and delete DHIS2 resources and generate the DHIS2 analytics tables through the DHIS2 Web API. */ @UriEndpoint(firstVersion = "4.0.0", scheme = "dhis2", title = "DHIS2", syntax = "dhis2:apiName/methodName", - apiSyntax = "apiName/methodName", category = { Category.API }) + apiSyntax = "apiName/methodName", category = { Category.API }, + headersClass = Dhis2Constants.class) @BodyTypes(consumerOut = @BodyType(value = Carrier.STREAM, byOption = { @BodyType.When(option = "methodName", value = "collection", diff --git a/components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/internal/Dhis2Constants.java b/components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/internal/Dhis2Constants.java index 0b4e614aadde..74cda874fdf6 100644 --- a/components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/internal/Dhis2Constants.java +++ b/components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/internal/Dhis2Constants.java @@ -16,12 +16,18 @@ */ package org.apache.camel.component.dhis2.internal; +import org.apache.camel.spi.Metadata; + /** * Constants for Dhis2 component. */ public interface Dhis2Constants { // suffix for parameters when passed as exchange header properties + @Metadata(label = "producer", + description = "The prefix of the headers that carry the parameters of the API method: the header CamelDhis2.path holds the path parameter." + + " The name without the dot, such as CamelDhis2Path, works too.", + javaType = "Object") String PROPERTY_PREFIX = "CamelDhis2."; // thread profile name for this component diff --git a/components/camel-fhir/camel-fhir-component/src/generated/resources/META-INF/org/apache/camel/component/fhir/fhir.json b/components/camel-fhir/camel-fhir-component/src/generated/resources/META-INF/org/apache/camel/component/fhir/fhir.json index e4f632717463..c026e549ccd3 100644 --- a/components/camel-fhir/camel-fhir-component/src/generated/resources/META-INF/org/apache/camel/component/fhir/fhir.json +++ b/components/camel-fhir/camel-fhir-component/src/generated/resources/META-INF/org/apache/camel/component/fhir/fhir.json @@ -53,6 +53,9 @@ "password": { "index": 25, "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.fhir.FhirConfiguration", "configurationField": "configuration", "description": "The password for HTTP basic authentication, used when username is set." }, "username": { "index": 26, "kind": "property", "displayName": "Username", "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.fhir.FhirConfiguration", "configurationField": "configuration", "description": "The user name for HTTP basic authentication. The password option is used with it." } }, + "headers": { + "CamelFhir.": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Object", "deprecated": false, "autowired": false, "secret": false, "description": "The prefix of the headers that carry the parameters of the API method: the header CamelFhir.url holds the url parameter. The name without the dot, such as CamelFhirUrl, works too.", "constantName": "org.apache.camel.component.fhir.internal.FhirConstants#PROPERTY_PREFIX" } + }, "bodyTypes": { "consumerOut": { "carriers": [ "pojo" ], "byOption": [ { "option": "apiName", "value": "TRANSACTION", "carriers": [ "pojo", "text" ] } ], "description": "One message per poll with the return value of the method: a MethodOutcome for create, update, patch, delete and validate, and a HAPI FHIR model object of the fhirVersion for the others, such as the Bundle of a search. A List is split into one message per resource, and transaction withBundle with stringBundle gives the response as text" }, "producerIn": { "carriers": [ "any" ], "dependsOn": [ "inBody" ], "description": "The body is used only when inBody names the argument of the method it is, and then converted to the type of that argument: resourceAsString, stringBundle and url take text, which a byte array, a stream or a file converts to, and resource, bundle and resources a HAPI FHIR object or a List of them (unmarshal with fhirJson or fhirXml first). A body that cannot be converted fails the exchange before the cal [...] diff --git a/components/camel-fhir/camel-fhir-component/src/main/java/org/apache/camel/component/fhir/FhirEndpoint.java b/components/camel-fhir/camel-fhir-component/src/main/java/org/apache/camel/component/fhir/FhirEndpoint.java index 03f98aeab97b..b240157eff45 100644 --- a/components/camel-fhir/camel-fhir-component/src/main/java/org/apache/camel/component/fhir/FhirEndpoint.java +++ b/components/camel-fhir/camel-fhir-component/src/main/java/org/apache/camel/component/fhir/FhirEndpoint.java @@ -58,7 +58,8 @@ import org.apache.camel.support.component.ApiMethodPropertiesHelper; */ @UriEndpoint(firstVersion = "2.23.0", scheme = "fhir", title = "FHIR", syntax = "fhir:apiName/methodName", apiSyntax = "apiName/methodName", - category = { Category.API }) + category = { Category.API }, + headersClass = FhirConstants.class) @BodyTypes(consumerOut = @BodyType(value = Carrier.POJO, byOption = @BodyType.When(option = "apiName", value = "TRANSACTION", carriers = { Carrier.POJO, Carrier.TEXT }), diff --git a/components/camel-fhir/camel-fhir-component/src/main/java/org/apache/camel/component/fhir/internal/FhirConstants.java b/components/camel-fhir/camel-fhir-component/src/main/java/org/apache/camel/component/fhir/internal/FhirConstants.java index 0f050244c1c7..db12a56de8e1 100644 --- a/components/camel-fhir/camel-fhir-component/src/main/java/org/apache/camel/component/fhir/internal/FhirConstants.java +++ b/components/camel-fhir/camel-fhir-component/src/main/java/org/apache/camel/component/fhir/internal/FhirConstants.java @@ -16,12 +16,18 @@ */ package org.apache.camel.component.fhir.internal; +import org.apache.camel.spi.Metadata; + /** * Constants for FHIR component. */ public interface FhirConstants { // suffix for parameters when passed as exchange header properties + @Metadata(label = "producer", + description = "The prefix of the headers that carry the parameters of the API method: the header CamelFhir.url holds the url parameter." + + " The name without the dot, such as CamelFhirUrl, works too.", + javaType = "Object") String PROPERTY_PREFIX = "CamelFhir."; // thread profile name for this component diff --git a/components/camel-google/camel-google-calendar/src/generated/resources/META-INF/org/apache/camel/component/google/calendar/google-calendar.json b/components/camel-google/camel-google-calendar/src/generated/resources/META-INF/org/apache/camel/component/google/calendar/google-calendar.json index 44e49636502f..bbd28a0ed832 100644 --- a/components/camel-google/camel-google-calendar/src/generated/resources/META-INF/org/apache/camel/component/google/calendar/google-calendar.json +++ b/components/camel-google/camel-google-calendar/src/generated/resources/META-INF/org/apache/camel/component/google/calendar/google-calendar.json @@ -42,6 +42,9 @@ "serviceAccountKey": { "index": 14, "kind": "property", "displayName": "Service Account Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.calendar.GoogleCalendarConfiguration", "configurationField": "configuration", "description": "The service account key in JSON format, to authenticate the application as [...] "user": { "index": 15, "kind": "property", "displayName": "User", "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.google.calendar.GoogleCalendarConfiguration", "configurationField": "configuration", "description": "The email address of the user to impersonate in the service account flow." } }, + "headers": { + "CamelGoogleCalendar.": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Object", "deprecated": false, "autowired": false, "secret": false, "description": "The prefix of the headers that carry the parameters of the API method: the header CamelGoogleCalendar.calendarId holds the calendarId parameter. The name without the dot, such as CamelGoogleCalendarCalendarId, works too.", "constantName": "org.apache.camel [...] + }, "bodyTypes": { "consumerOut": { "carriers": [ "pojo" ], "description": "One message per poll with the return value of the method: a Google Calendar model object, such as the Events of events\/list, which is one message and not split per event. The model classes are GenericJson, which is also a Map of the JSON fields" }, "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 Event for content of events\/insert, or text for text of events\/quickAdd. 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 CamelGoogleCalendar. headers" }, diff --git a/components/camel-google/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/GoogleCalendarEndpoint.java b/components/camel-google/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/GoogleCalendarEndpoint.java index 7c78b291f728..c5ee5ee27e2f 100644 --- a/components/camel-google/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/GoogleCalendarEndpoint.java +++ b/components/camel-google/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/GoogleCalendarEndpoint.java @@ -45,7 +45,8 @@ import org.apache.camel.util.ObjectHelper; */ @UriEndpoint(firstVersion = "2.15.0", scheme = "google-calendar", title = "Google Calendar", syntax = "google-calendar:apiName/methodName", apiSyntax = "apiName/methodName", - consumerPrefix = "consumer", category = { Category.API, Category.CLOUD }) + consumerPrefix = "consumer", category = { Category.API, Category.CLOUD }, + headersClass = GoogleCalendarConstants.class) @BodyTypes(consumerOut = @BodyType(value = Carrier.POJO, description = "One message per poll with the return value of the method: a Google" + " Calendar model object, such as the Events of events/list, which is one" diff --git a/components/camel-google/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/internal/GoogleCalendarConstants.java b/components/camel-google/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/internal/GoogleCalendarConstants.java index 75b91e316b66..843c0147a3e6 100644 --- a/components/camel-google/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/internal/GoogleCalendarConstants.java +++ b/components/camel-google/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/internal/GoogleCalendarConstants.java @@ -16,12 +16,18 @@ */ package org.apache.camel.component.google.calendar.internal; +import org.apache.camel.spi.Metadata; + /** * Constants for GoogleCalendar component. */ public final class GoogleCalendarConstants { // suffix for parameters when passed as exchange header properties + @Metadata(label = "producer", + description = "The prefix of the headers that carry the parameters of the API method: the header CamelGoogleCalendar.calendarId holds the calendarId parameter." + + " The name without the dot, such as CamelGoogleCalendarCalendarId, works too.", + javaType = "Object") public static final String PROPERTY_PREFIX = "CamelGoogleCalendar."; // thread profile name for this component 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 1139a1fd74b4..5c48405388ad 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,9 @@ "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": "The password of the HTTP basic authentication with Twilio: the Auth Token of the account, or the secret of the API key set in username." }, "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 user name of the HTTP basic authentication with Twilio: the Account SID, or the SID of an API key (SK...). Used with password to build the REST client when restClient is not set." } }, + "headers": { + "CamelTwilio.": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Object", "deprecated": false, "autowired": false, "secret": false, "description": "The prefix of the headers that carry the parameters of the API method: the header CamelTwilio.pathAccountSid holds the pathAccountSid parameter. The name without the dot, such as CamelTwilioPathAccountSid, works too.", "constantName": "org.apache.camel.component.t [...] + }, "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" }, 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 3090f6c02b7b..0db6a0e3bf71 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 @@ -49,7 +49,8 @@ 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 }) + category = { Category.API, Category.MESSAGING, Category.CLOUD }, + headersClass = TwilioConstants.class) @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," diff --git a/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/internal/TwilioConstants.java b/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/internal/TwilioConstants.java index 93c9054fc6fc..17309215ee87 100644 --- a/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/internal/TwilioConstants.java +++ b/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/internal/TwilioConstants.java @@ -16,6 +16,8 @@ */ package org.apache.camel.component.twilio.internal; +import org.apache.camel.spi.Metadata; + /** * Constants for Twilio component. */ @@ -24,6 +26,10 @@ public interface TwilioConstants { /** * Suffix for parameters when passed as exchange header properties */ + @Metadata(label = "producer", + description = "The prefix of the headers that carry the parameters of the API method: the header CamelTwilio.pathAccountSid holds the pathAccountSid parameter." + + " The name without the dot, such as CamelTwilioPathAccountSid, works too.", + javaType = "Object") String PROPERTY_PREFIX = "CamelTwilio."; /** 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 98c6dc76663b..45a0bc5da4f9 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,9 @@ "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 Zendesk API token, sent with username as username\/token in basic authentication. Not used when password or oauthToken is set." }, "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 email address of the Zendesk user, sent with password or token in basic authentication. Not used with oauthToken." } }, + "headers": { + "CamelZendesk.": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Object", "deprecated": false, "autowired": false, "secret": false, "description": "The prefix of the headers that carry the parameters of the API method: the header CamelZendesk.ticketId holds the ticketId parameter. The name without the dot, such as CamelZendeskTicketId, works too.", "constantName": "org.apache.camel.component.zendesk.internal [...] + }, "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" }, 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 7fa0e536967a..72dd3b9f0fd5 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 @@ -44,7 +44,8 @@ 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 }) + consumerPrefix = "consumer", category = { Category.CLOUD, Category.API, Category.SAAS }, + headersClass = ZendeskConstants.class) @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," diff --git a/components/camel-zendesk/src/main/java/org/apache/camel/component/zendesk/internal/ZendeskConstants.java b/components/camel-zendesk/src/main/java/org/apache/camel/component/zendesk/internal/ZendeskConstants.java index 83cc301d35ff..a214ed7fddb0 100644 --- a/components/camel-zendesk/src/main/java/org/apache/camel/component/zendesk/internal/ZendeskConstants.java +++ b/components/camel-zendesk/src/main/java/org/apache/camel/component/zendesk/internal/ZendeskConstants.java @@ -16,12 +16,18 @@ */ package org.apache.camel.component.zendesk.internal; +import org.apache.camel.spi.Metadata; + /** * Constants for Zendesk component. */ public interface ZendeskConstants { // suffix for parameters when passed as exchange header properties + @Metadata(label = "producer", + description = "The prefix of the headers that carry the parameters of the API method: the header CamelZendesk.ticketId holds the ticketId parameter." + + " The name without the dot, such as CamelZendeskTicketId, works too.", + javaType = "Object") String PROPERTY_PREFIX = "CamelZendesk."; // thread profile name for this component diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java index ec9b1cbb77c5..3f9cd45f4f50 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java @@ -256,6 +256,19 @@ public class EndpointHeaderBuilders { public static ArangoDbEndpointBuilderFactory.ArangoDbHeaderNameBuilder arangodb() { return ArangoDbEndpointBuilderFactory.ArangoDbHeaderNameBuilder.INSTANCE; } + /** + * AS2 (camel-as2) + * Send and receive EDI messages over HTTP with the AS2 protocol (RFC 4130). + * + * Category: file + * Since: 2.22 + * Maven coordinates: org.apache.camel:camel-as2 + * + * @return the dsl builder for the headers' name. + */ + public static AS2EndpointBuilderFactory.AS2HeaderNameBuilder as2() { + return AS2EndpointBuilderFactory.AS2HeaderNameBuilder.INSTANCE; + } /** * Asterisk (camel-asterisk) * Receive events from an Asterisk PBX server and send actions to it over @@ -1007,6 +1020,20 @@ public class EndpointHeaderBuilders { public static BoxEndpointBuilderFactory.BoxHeaderNameBuilder box() { return BoxEndpointBuilderFactory.BoxHeaderNameBuilder.INSTANCE; } + /** + * Braintree (camel-braintree) + * Process payments and manage customers, payment methods, subscriptions and + * disputes with the Braintree payment gateway. + * + * Category: saas,finance + * Since: 2.17 + * Maven coordinates: org.apache.camel:camel-braintree + * + * @return the dsl builder for the headers' name. + */ + public static BraintreeEndpointBuilderFactory.BraintreeHeaderNameBuilder braintree() { + return BraintreeEndpointBuilderFactory.BraintreeHeaderNameBuilder.INSTANCE; + } /** * Caffeine Cache (camel-caffeine) * Store, get and invalidate entries in a local Caffeine cache. @@ -1339,6 +1366,20 @@ public class EndpointHeaderBuilders { public static DebeziumSqlserverEndpointBuilderFactory.DebeziumSqlserverHeaderNameBuilder debeziumSqlserver() { return DebeziumSqlserverEndpointBuilderFactory.DebeziumSqlserverHeaderNameBuilder.INSTANCE; } + /** + * DHIS2 (camel-dhis2) + * Get, create, update and delete DHIS2 resources and generate the DHIS2 + * analytics tables through the DHIS2 Web API. + * + * Category: api + * Since: 4.0 + * Maven coordinates: org.apache.camel:camel-dhis2 + * + * @return the dsl builder for the headers' name. + */ + public static Dhis2EndpointBuilderFactory.Dhis2HeaderNameBuilder dhis2() { + return Dhis2EndpointBuilderFactory.Dhis2HeaderNameBuilder.INSTANCE; + } /** * Deep Java Library (camel-djl) * Run inference with a deep learning model on the message body using Deep @@ -1520,6 +1561,21 @@ public class EndpointHeaderBuilders { public static ExecEndpointBuilderFactory.ExecHeaderNameBuilder exec() { return ExecEndpointBuilderFactory.ExecHeaderNameBuilder.INSTANCE; } + /** + * FHIR (camel-fhir) + * Create, read, update, delete and search healthcare resources on a FHIR + * (Fast Healthcare Interoperability Resources) server with the HAPI FHIR + * client. + * + * Category: api + * Since: 2.23 + * Maven coordinates: org.apache.camel:camel-fhir + * + * @return the dsl builder for the headers' name. + */ + public static FhirEndpointBuilderFactory.FhirHeaderNameBuilder fhir() { + return FhirEndpointBuilderFactory.FhirHeaderNameBuilder.INSTANCE; + } /** * File (camel-file) * Read and write files in a directory of the file system. @@ -1698,6 +1754,20 @@ public class EndpointHeaderBuilders { public static GoogleBigQuerySQLEndpointBuilderFactory.GoogleBigQuerySQLHeaderNameBuilder googleBigquerySql() { return GoogleBigQuerySQLEndpointBuilderFactory.GoogleBigQuerySQLHeaderNameBuilder.INSTANCE; } + /** + * Google Calendar (camel-google-calendar) + * Manage calendars, events and access control rules in Google Calendar + * through the Google Calendar API. + * + * Category: api,cloud + * Since: 2.15 + * Maven coordinates: org.apache.camel:camel-google-calendar + * + * @return the dsl builder for the headers' name. + */ + public static GoogleCalendarEndpointBuilderFactory.GoogleCalendarHeaderNameBuilder googleCalendar() { + return GoogleCalendarEndpointBuilderFactory.GoogleCalendarHeaderNameBuilder.INSTANCE; + } /** * Google Calendar Stream (camel-google-calendar) * Receive the events of a Google Calendar by polling the Google Calendar @@ -4493,6 +4563,21 @@ public class EndpointHeaderBuilders { public static TimerEndpointBuilderFactory.TimerHeaderNameBuilder timer() { return TimerEndpointBuilderFactory.TimerHeaderNameBuilder.INSTANCE; } + /** + * Twilio (camel-twilio) + * Send SMS and MMS messages, make phone calls and manage the resources of a + * Twilio account, such as phone numbers, recordings and SIP domains, with + * the Twilio REST API. + * + * Category: api,messaging,cloud + * Since: 2.20 + * Maven coordinates: org.apache.camel:camel-twilio + * + * @return the dsl builder for the headers' name. + */ + public static TwilioEndpointBuilderFactory.TwilioHeaderNameBuilder twilio() { + return TwilioEndpointBuilderFactory.TwilioHeaderNameBuilder.INSTANCE; + } /** * Twitter Direct Message (camel-twitter) * Send and receive Twitter direct messages. @@ -4780,6 +4865,20 @@ public class EndpointHeaderBuilders { public static XsltSaxonEndpointBuilderFactory.XsltSaxonHeaderNameBuilder xsltSaxon() { return XsltSaxonEndpointBuilderFactory.XsltSaxonHeaderNameBuilder.INSTANCE; } + /** + * Zendesk (camel-zendesk) + * Manage tickets, users, organizations and other resources of Zendesk + * Support through the Zendesk REST API. + * + * Category: cloud,api,saas + * Since: 2.19 + * Maven coordinates: org.apache.camel:camel-zendesk + * + * @return the dsl builder for the headers' name. + */ + public static ZendeskEndpointBuilderFactory.ZendeskHeaderNameBuilder zendesk() { + return ZendeskEndpointBuilderFactory.ZendeskHeaderNameBuilder.INSTANCE; + } /** * ZooKeeper (camel-zookeeper) * Read, write, delete and watch the znodes of an Apache ZooKeeper cluster. diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AS2EndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AS2EndpointBuilderFactory.java index b59a12a2621c..92385cd2f1eb 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AS2EndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AS2EndpointBuilderFactory.java @@ -3816,6 +3816,20 @@ public interface AS2EndpointBuilderFactory { } public interface AS2Builders { + /** + * AS2 (camel-as2) + * Send and receive EDI messages over HTTP with the AS2 protocol (RFC + * 4130). + * + * Category: file + * Since: 2.22 + * Maven coordinates: org.apache.camel:camel-as2 + * + * @return the dsl builder for the headers' name. + */ + default AS2HeaderNameBuilder as2() { + return AS2HeaderNameBuilder.INSTANCE; + } /** * AS2 (camel-as2) * Send and receive EDI messages over HTTP with the AS2 protocol (RFC @@ -3876,6 +3890,32 @@ public interface AS2EndpointBuilderFactory { } } + /** + * The builder of headers' name for the AS2 component. + */ + public static class AS2HeaderNameBuilder { + /** + * The internal instance of the builder used to access to all the + * methods representing the name of headers. + */ + public static final AS2HeaderNameBuilder INSTANCE = new AS2HeaderNameBuilder(); + + /** + * The prefix of the headers that carry the parameters of the API + * method: the header CamelAs2.requestUri holds the requestUri + * parameter. The name without the dot, such as CamelAs2RequestUri, + * works too. + * + * The option is a: {@code Object} type. + * + * Group: producer + * + * @return the name of the header {@code As2.}. + */ + public String as2() { + return "CamelAs2."; + } + } static AS2EndpointBuilder endpointBuilder(String componentName, String path) { class AS2EndpointBuilderImpl extends AbstractEndpointBuilder implements AS2EndpointBuilder, AdvancedAS2EndpointBuilder { public AS2EndpointBuilderImpl(String path) { diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BraintreeEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BraintreeEndpointBuilderFactory.java index 448aefaaf01f..321383d868b5 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BraintreeEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BraintreeEndpointBuilderFactory.java @@ -351,6 +351,20 @@ public interface BraintreeEndpointBuilderFactory { } public interface BraintreeBuilders { + /** + * Braintree (camel-braintree) + * Process payments and manage customers, payment methods, subscriptions + * and disputes with the Braintree payment gateway. + * + * Category: saas,finance + * Since: 2.17 + * Maven coordinates: org.apache.camel:camel-braintree + * + * @return the dsl builder for the headers' name. + */ + default BraintreeHeaderNameBuilder braintree() { + return BraintreeHeaderNameBuilder.INSTANCE; + } /** * Braintree (camel-braintree) * Process payments and manage customers, payment methods, subscriptions @@ -433,6 +447,32 @@ public interface BraintreeEndpointBuilderFactory { } } + /** + * The builder of headers' name for the Braintree component. + */ + public static class BraintreeHeaderNameBuilder { + /** + * The internal instance of the builder used to access to all the + * methods representing the name of headers. + */ + public static final BraintreeHeaderNameBuilder INSTANCE = new BraintreeHeaderNameBuilder(); + + /** + * The prefix of the headers that carry the parameters of the API + * method: the header CamelBraintree.customerId holds the customerId + * parameter. The name without the dot, such as + * CamelBraintreeCustomerId, works too. + * + * The option is a: {@code Object} type. + * + * Group: producer + * + * @return the name of the header {@code Braintree.}. + */ + public String braintree() { + return "CamelBraintree."; + } + } static BraintreeEndpointBuilder endpointBuilder(String componentName, String path) { class BraintreeEndpointBuilderImpl extends AbstractEndpointBuilder implements BraintreeEndpointBuilder, AdvancedBraintreeEndpointBuilder { public BraintreeEndpointBuilderImpl(String path) { diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Dhis2EndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Dhis2EndpointBuilderFactory.java index 79c39c3b6836..d1fbd9a0a137 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Dhis2EndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Dhis2EndpointBuilderFactory.java @@ -1175,6 +1175,20 @@ public interface Dhis2EndpointBuilderFactory { } public interface Dhis2Builders { + /** + * DHIS2 (camel-dhis2) + * Get, create, update and delete DHIS2 resources and generate the DHIS2 + * analytics tables through the DHIS2 Web API. + * + * Category: api + * Since: 4.0 + * Maven coordinates: org.apache.camel:camel-dhis2 + * + * @return the dsl builder for the headers' name. + */ + default Dhis2HeaderNameBuilder dhis2() { + return Dhis2HeaderNameBuilder.INSTANCE; + } /** * DHIS2 (camel-dhis2) * Get, create, update and delete DHIS2 resources and generate the DHIS2 @@ -1231,6 +1245,31 @@ public interface Dhis2EndpointBuilderFactory { } } + /** + * The builder of headers' name for the DHIS2 component. + */ + public static class Dhis2HeaderNameBuilder { + /** + * The internal instance of the builder used to access to all the + * methods representing the name of headers. + */ + public static final Dhis2HeaderNameBuilder INSTANCE = new Dhis2HeaderNameBuilder(); + + /** + * The prefix of the headers that carry the parameters of the API + * method: the header CamelDhis2.path holds the path parameter. The name + * without the dot, such as CamelDhis2Path, works too. + * + * The option is a: {@code Object} type. + * + * Group: producer + * + * @return the name of the header {@code Dhis2.}. + */ + public String dhis2() { + return "CamelDhis2."; + } + } static Dhis2EndpointBuilder endpointBuilder(String componentName, String path) { class Dhis2EndpointBuilderImpl extends AbstractEndpointBuilder implements Dhis2EndpointBuilder, AdvancedDhis2EndpointBuilder { public Dhis2EndpointBuilderImpl(String path) { diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/FhirEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/FhirEndpointBuilderFactory.java index ec8a64f06df3..68b601c3b15c 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/FhirEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/FhirEndpointBuilderFactory.java @@ -2528,6 +2528,21 @@ public interface FhirEndpointBuilderFactory { } public interface FhirBuilders { + /** + * FHIR (camel-fhir) + * Create, read, update, delete and search healthcare resources on a + * FHIR (Fast Healthcare Interoperability Resources) server with the + * HAPI FHIR client. + * + * Category: api + * Since: 2.23 + * Maven coordinates: org.apache.camel:camel-fhir + * + * @return the dsl builder for the headers' name. + */ + default FhirHeaderNameBuilder fhir() { + return FhirHeaderNameBuilder.INSTANCE; + } /** * FHIR (camel-fhir) * Create, read, update, delete and search healthcare resources on a @@ -2592,6 +2607,31 @@ public interface FhirEndpointBuilderFactory { } } + /** + * The builder of headers' name for the FHIR component. + */ + public static class FhirHeaderNameBuilder { + /** + * The internal instance of the builder used to access to all the + * methods representing the name of headers. + */ + public static final FhirHeaderNameBuilder INSTANCE = new FhirHeaderNameBuilder(); + + /** + * The prefix of the headers that carry the parameters of the API + * method: the header CamelFhir.url holds the url parameter. The name + * without the dot, such as CamelFhirUrl, works too. + * + * The option is a: {@code Object} type. + * + * Group: producer + * + * @return the name of the header {@code Fhir.}. + */ + public String fhir() { + return "CamelFhir."; + } + } static FhirEndpointBuilder endpointBuilder(String componentName, String path) { class FhirEndpointBuilderImpl extends AbstractEndpointBuilder implements FhirEndpointBuilder, AdvancedFhirEndpointBuilder { public FhirEndpointBuilderImpl(String path) { diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GoogleCalendarEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GoogleCalendarEndpointBuilderFactory.java index 95be81eceafa..00c8fc836f69 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GoogleCalendarEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GoogleCalendarEndpointBuilderFactory.java @@ -1376,6 +1376,20 @@ public interface GoogleCalendarEndpointBuilderFactory { } public interface GoogleCalendarBuilders { + /** + * Google Calendar (camel-google-calendar) + * Manage calendars, events and access control rules in Google Calendar + * through the Google Calendar API. + * + * Category: api,cloud + * Since: 2.15 + * Maven coordinates: org.apache.camel:camel-google-calendar + * + * @return the dsl builder for the headers' name. + */ + default GoogleCalendarHeaderNameBuilder googleCalendar() { + return GoogleCalendarHeaderNameBuilder.INSTANCE; + } /** * Google Calendar (camel-google-calendar) * Manage calendars, events and access control rules in Google Calendar @@ -1438,6 +1452,32 @@ public interface GoogleCalendarEndpointBuilderFactory { } } + /** + * The builder of headers' name for the Google Calendar component. + */ + public static class GoogleCalendarHeaderNameBuilder { + /** + * The internal instance of the builder used to access to all the + * methods representing the name of headers. + */ + public static final GoogleCalendarHeaderNameBuilder INSTANCE = new GoogleCalendarHeaderNameBuilder(); + + /** + * The prefix of the headers that carry the parameters of the API + * method: the header CamelGoogleCalendar.calendarId holds the + * calendarId parameter. The name without the dot, such as + * CamelGoogleCalendarCalendarId, works too. + * + * The option is a: {@code Object} type. + * + * Group: producer + * + * @return the name of the header {@code GoogleCalendar.}. + */ + public String googlecalendar() { + return "CamelGoogleCalendar."; + } + } static GoogleCalendarEndpointBuilder endpointBuilder(String componentName, String path) { class GoogleCalendarEndpointBuilderImpl extends AbstractEndpointBuilder implements GoogleCalendarEndpointBuilder, AdvancedGoogleCalendarEndpointBuilder { public GoogleCalendarEndpointBuilderImpl(String path) { diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/TwilioEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/TwilioEndpointBuilderFactory.java index 9f862b6056b0..096a053437c5 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/TwilioEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/TwilioEndpointBuilderFactory.java @@ -879,6 +879,21 @@ public interface TwilioEndpointBuilderFactory { } public interface TwilioBuilders { + /** + * Twilio (camel-twilio) + * Send SMS and MMS messages, make phone calls and manage the resources + * of a Twilio account, such as phone numbers, recordings and SIP + * domains, with the Twilio REST API. + * + * Category: api,messaging,cloud + * Since: 2.20 + * Maven coordinates: org.apache.camel:camel-twilio + * + * @return the dsl builder for the headers' name. + */ + default TwilioHeaderNameBuilder twilio() { + return TwilioHeaderNameBuilder.INSTANCE; + } /** * Twilio (camel-twilio) * Send SMS and MMS messages, make phone calls and manage the resources @@ -985,6 +1000,32 @@ public interface TwilioEndpointBuilderFactory { } } + /** + * The builder of headers' name for the Twilio component. + */ + public static class TwilioHeaderNameBuilder { + /** + * The internal instance of the builder used to access to all the + * methods representing the name of headers. + */ + public static final TwilioHeaderNameBuilder INSTANCE = new TwilioHeaderNameBuilder(); + + /** + * The prefix of the headers that carry the parameters of the API + * method: the header CamelTwilio.pathAccountSid holds the + * pathAccountSid parameter. The name without the dot, such as + * CamelTwilioPathAccountSid, works too. + * + * The option is a: {@code Object} type. + * + * Group: producer + * + * @return the name of the header {@code Twilio.}. + */ + public String twilio() { + return "CamelTwilio."; + } + } static TwilioEndpointBuilder endpointBuilder(String componentName, String path) { class TwilioEndpointBuilderImpl extends AbstractEndpointBuilder implements TwilioEndpointBuilder, AdvancedTwilioEndpointBuilder { public TwilioEndpointBuilderImpl(String path) { diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ZendeskEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ZendeskEndpointBuilderFactory.java index 8140f6e0547a..aed6f91a158b 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ZendeskEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ZendeskEndpointBuilderFactory.java @@ -1103,6 +1103,20 @@ public interface ZendeskEndpointBuilderFactory { } public interface ZendeskBuilders { + /** + * Zendesk (camel-zendesk) + * Manage tickets, users, organizations and other resources of Zendesk + * Support through the Zendesk REST API. + * + * Category: cloud,api,saas + * Since: 2.19 + * Maven coordinates: org.apache.camel:camel-zendesk + * + * @return the dsl builder for the headers' name. + */ + default ZendeskHeaderNameBuilder zendesk() { + return ZendeskHeaderNameBuilder.INSTANCE; + } /** * Zendesk (camel-zendesk) * Manage tickets, users, organizations and other resources of Zendesk @@ -1439,6 +1453,32 @@ public interface ZendeskEndpointBuilderFactory { } } + /** + * The builder of headers' name for the Zendesk component. + */ + public static class ZendeskHeaderNameBuilder { + /** + * The internal instance of the builder used to access to all the + * methods representing the name of headers. + */ + public static final ZendeskHeaderNameBuilder INSTANCE = new ZendeskHeaderNameBuilder(); + + /** + * The prefix of the headers that carry the parameters of the API + * method: the header CamelZendesk.ticketId holds the ticketId + * parameter. The name without the dot, such as CamelZendeskTicketId, + * works too. + * + * The option is a: {@code Object} type. + * + * Group: producer + * + * @return the name of the header {@code Zendesk.}. + */ + public String zendesk() { + return "CamelZendesk."; + } + } static ZendeskEndpointBuilder endpointBuilder(String componentName, String path) { class ZendeskEndpointBuilderImpl extends AbstractEndpointBuilder implements ZendeskEndpointBuilder, AdvancedZendeskEndpointBuilder { public ZendeskEndpointBuilderImpl(String path) { diff --git a/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java b/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java index 68d810a36af9..4bdcfaa7e7c3 100644 --- a/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java +++ b/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java @@ -76,6 +76,11 @@ public abstract class AbstractApiMethodGeneratorMojo extends AbstractApiMethodBa @Parameter protected String[] nullableOptions; + /** + * Descriptions of the methods and parameters whose source has no Javadoc. + */ + protected ApiDescriptions apiDescriptions = ApiDescriptions.EMPTY; + // cached fields private Class<?> proxyType; @@ -114,6 +119,7 @@ public abstract class AbstractApiMethodGeneratorMojo extends AbstractApiMethodBa if (method != null && method.contains(" ")) { method = StringHelper.after(method, " "); } + String methodDescription = model.getMethodDescription(); if (method != null) { var docs = new HashMap<String, String>(); if (model.getParameterDescriptions() != null && !model.getParameterDescriptions().isEmpty()) { @@ -122,9 +128,13 @@ public abstract class AbstractApiMethodGeneratorMojo extends AbstractApiMethodBa if (model.getSetterDescriptions() != null && !model.getSetterDescriptions().isEmpty()) { docs.putAll(model.getSetterDescriptions()); } + if (ObjectHelper.isEmpty(methodDescription)) { + // the source has no Javadoc for the method + methodDescription = apiDescriptions.methodDescription(getApiName(apiName), method); + } parameters.put(method, docs); } - parser.getDescriptions().put(method, model.getMethodDescription()); + parser.getDescriptions().put(method, methodDescription); parser.addSignatureArguments(model.getSignature(), model.getParameterTypes()); parser.addSignatureProperties(model.getSignature(), model.getSetterTypes()); } @@ -134,6 +144,7 @@ public abstract class AbstractApiMethodGeneratorMojo extends AbstractApiMethodBa // parse signatures final List<ApiMethodParser.ApiMethodModel> models = parser.parse(); + addMissingParameterDescriptions(models); // generate enumeration from model mergeTemplate(getApiMethodContext(models), getApiMethodFile(), "/api-method-enum.vm"); @@ -149,6 +160,38 @@ public abstract class AbstractApiMethodGeneratorMojo extends AbstractApiMethodBa } } + /** + * Fills the parameter descriptions that the source has no Javadoc for, by the parameter names of the catalog (after + * the substitutions). + */ + private void addMissingParameterDescriptions(List<ApiMethodParser.ApiMethodModel> models) { + if (apiDescriptions.isEmpty()) { + return; + } + String api = getApiName(apiName); + for (ApiMethodParser.ApiMethodModel model : models) { + addMissingParameterDescriptions(api, model.getName(), model.getArguments()); + addMissingParameterDescriptions(api, model.getName(), model.getProperties()); + } + } + + private void addMissingParameterDescriptions(String api, String method, List<ApiMethodArg> arguments) { + if (arguments == null) { + return; + } + for (int i = 0; i < arguments.size(); i++) { + ApiMethodArg arg = arguments.get(i); + if (ObjectHelper.isEmpty(arg.getDescription())) { + String description = apiDescriptions.parameterDescription(api, method, arg.getName()); + if (description != null) { + arguments.set(i, new ApiMethodArg( + arg.getName(), arg.getType(), arg.getTypeArgs(), arg.getRawTypeArgs(), description, + arg.isSetter())); + } + } + } + } + protected ApiMethodParser<?> createAdapterParser(Class<?> proxyType) { return new ArgumentSubstitutionParser<>(proxyType, getArgumentSubstitutions()); } diff --git a/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/ApiComponentGeneratorMojo.java b/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/ApiComponentGeneratorMojo.java index 5cc69df433d0..734602adfdb1 100644 --- a/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/ApiComponentGeneratorMojo.java +++ b/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/ApiComponentGeneratorMojo.java @@ -88,6 +88,15 @@ public class ApiComponentGeneratorMojo extends AbstractApiMethodBaseMojo { @Parameter protected File apiSrcDir; + /** + * Descriptions of the API methods and their parameters whose source has no Javadoc, as a properties file. Keys: + * {@code api.method}, {@code api.method.parameter}, {@code api.*.parameter} (all methods of the API) and + * {@code *.parameter} (all APIs), where {@code api} is the API name as in the catalog ({@code DEFAULT} for a single + * unnamed API). The Javadoc of the source wins when it has a description. + */ + @Parameter(defaultValue = "${project.basedir}/src/main/api-descriptions.properties") + protected File apiDescriptionsFile; + /** * Names of options that can be set to null value if not specified. */ @@ -111,8 +120,16 @@ public class ApiComponentGeneratorMojo extends AbstractApiMethodBaseMojo { apis[0].setApiName(""); } + final ApiDescriptions descriptions; + try { + descriptions = ApiDescriptions.load(apiDescriptionsFile); + } catch (IOException e) { + throw new MojoExecutionException("Error reading " + apiDescriptionsFile + ": " + e.getMessage(), e); + } + String newHash = new HashHelper() .hash("ApiComponentGeneratorMojo") + .hash("apiDescriptions", descriptions.toString()) .hash("apis", apis) .hash("apiSrcDir", apiSrcDir) .hash("fromJavasource", fromJavasource) @@ -160,6 +177,7 @@ public class ApiComponentGeneratorMojo extends AbstractApiMethodBaseMojo { if (apiMethodGenerator != null) { // configure API method properties and generate Proxy classes configureMethodGenerator(apiMethodGenerator, api); + apiMethodGenerator.apiDescriptions = descriptions; try { apiMethodGenerator.setProjectClassLoader(getProjectClassLoader()); // supply pre-constructed ClassLoader apiMethodGenerator.executeInternal(); // Call internal execute method diff --git a/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/ApiDescriptions.java b/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/ApiDescriptions.java new file mode 100644 index 000000000000..40649640f992 --- /dev/null +++ b/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/ApiDescriptions.java @@ -0,0 +1,107 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.maven; + +import java.io.File; +import java.io.IOException; +import java.io.Reader; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.util.Map; +import java.util.Properties; +import java.util.TreeMap; + +/** + * Descriptions of API methods and their parameters, for the methods whose source has no Javadoc (many SDKs are + * generated without it). They are read from a properties file of the component, and only fill the descriptions that the + * Javadoc leaves empty. + * <p> + * Keys, where {@code api} is the API name as in the catalog ({@code DEFAULT} for a component with a single unnamed + * API): + * <ul> + * <li>{@code api.method}: the description of a method</li> + * <li>{@code api.method.parameter}: the description of a parameter of one method</li> + * <li>{@code api.*.parameter}: the description of a parameter of all the methods of the API</li> + * <li>{@code *.parameter}: the description of a parameter of all the methods of all the APIs</li> + * </ul> + * The most specific key wins. + */ +final class ApiDescriptions { + + static final ApiDescriptions EMPTY = new ApiDescriptions(Map.of()); + + private final Map<String, String> descriptions; + + private ApiDescriptions(Map<String, String> descriptions) { + this.descriptions = descriptions; + } + + static ApiDescriptions load(File file) throws IOException { + if (file == null || !file.isFile()) { + return EMPTY; + } + Properties props = new Properties(); + try (Reader reader = Files.newBufferedReader(file.toPath(), StandardCharsets.UTF_8)) { + props.load(reader); + } + Map<String, String> map = new TreeMap<>(); + for (String key : props.stringPropertyNames()) { + String value = props.getProperty(key).trim(); + if (!value.isEmpty()) { + map.put(key.trim(), value); + } + } + return new ApiDescriptions(map); + } + + boolean isEmpty() { + return descriptions.isEmpty(); + } + + /** + * The content, for the hash that tells whether the sources must be generated again. + */ + @Override + public String toString() { + return descriptions.toString(); + } + + String methodDescription(String api, String method) { + return escape(descriptions.get(api + "." + method)); + } + + String parameterDescription(String api, String method, String parameter) { + String answer = descriptions.get(api + "." + method + "." + parameter); + if (answer == null) { + answer = descriptions.get(api + ".*." + parameter); + } + if (answer == null) { + answer = descriptions.get("*." + parameter); + } + return escape(answer); + } + + /** + * The descriptions end up in Java string literals of the generated sources. + */ + private static String escape(String text) { + if (text == null) { + return null; + } + return text.replace("\\", "\\\\").replace("\"", "\\\""); + } +} diff --git a/tooling/maven/camel-api-component-maven-plugin/src/test/java/org/apache/camel/maven/ApiJavaSourceComponentGeneratorMojoTest.java b/tooling/maven/camel-api-component-maven-plugin/src/test/java/org/apache/camel/maven/ApiJavaSourceComponentGeneratorMojoTest.java index d9fdf32ec161..c0f816a99deb 100644 --- a/tooling/maven/camel-api-component-maven-plugin/src/test/java/org/apache/camel/maven/ApiJavaSourceComponentGeneratorMojoTest.java +++ b/tooling/maven/camel-api-component-maven-plugin/src/test/java/org/apache/camel/maven/ApiJavaSourceComponentGeneratorMojoTest.java @@ -18,9 +18,11 @@ package org.apache.camel.maven; import java.io.File; import java.nio.file.Files; +import java.nio.file.Path; import org.apache.camel.component.test.TestProxy; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -71,6 +73,42 @@ public class ApiJavaSourceComponentGeneratorMojoTest extends AbstractGeneratorMo assertFalse(config.contains("List<String> names)"), config); } + @Test + public void testDescriptionsFileFillsMissingJavadoc(@TempDir Path dir) throws Exception { + final File configFile = new File(OUT_DIR, COMPONENT_PACKAGE_PATH + "TestProxyEndpointConfiguration.java"); + configFile.delete(); + + final Path descriptions = dir.resolve("api-descriptions.properties"); + Files.writeString(descriptions, """ + # greetTimes and greetWildcard have no Javadoc + test.greetTimes = Greets the name several times + test.greetTimes.times = How many times to greet "the name" + test.greetWildcard.wildcards = The names to greet, by their catalog name + *.name = The name from the descriptions file + # sayHi has Javadoc, which wins + test.sayHi = Not used + test.*.hello = Not used either + """); + + final ApiComponentGeneratorMojo mojo = createGeneratorMojo(); + mojo.apiDescriptionsFile = descriptions.toFile(); + mojo.apis[0].setSubstitutions(new Substitution[] { + new Substitution("^greetWildcard$", "wildcardNames", null, "wildcards", false) }); + + mojo.execute(); + + assertExists(configFile); + final String config = Files.readString(configFile.toPath()); + assertTrue(config.contains("methodName = \"greetTimes\", description=\"Greets the name several times\""), config); + assertTrue(config.contains("description=\"How many times to greet \\\"the name\\\"\""), config); + assertTrue(config.contains("description=\"The names to greet, by their catalog name\""), config); + assertTrue(config.contains("methodName = \"greetTimes\", description=\"The name from the descriptions file\""), config); + // the Javadoc of the source wins + assertTrue(config.contains("methodName = \"sayHi\", description=\"Just saying hi\""), config); + assertTrue(config.contains("description=\"Should we say hello or hi\""), config); + assertFalse(config.contains("Not used"), config); + } + @Override protected ApiComponentGeneratorMojo createGeneratorMojo() { final ApiComponentGeneratorMojo mojo = new ApiComponentGeneratorMojo();
