This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git
The following commit(s) were added to refs/heads/main by this push: new 6585384c Create salesforce-composite-upsert-sink.kamelet.yaml (#1612) 6585384c is described below commit 6585384c6a5a11f714a42a9b60c2444a4f47f855 Author: Ziauddin135 <zia.uddin...@gmail.com> AuthorDate: Tue Sep 5 10:59:59 2023 +0530 Create salesforce-composite-upsert-sink.kamelet.yaml (#1612) This is the sink Kamelet which allows to facilitate Upsert the composite list of sObjects in the Salesforce. --- .../salesforce-composite-upsert-sink.kamelet.yaml | 123 +++++++++++++++++++++ 1 file changed, 123 insertions(+) diff --git a/kamelets/salesforce-composite-upsert-sink.kamelet.yaml b/kamelets/salesforce-composite-upsert-sink.kamelet.yaml new file mode 100644 index 00000000..1c281698 --- /dev/null +++ b/kamelets/salesforce-composite-upsert-sink.kamelet.yaml @@ -0,0 +1,123 @@ +#--------------------------------------------------------------------------- +# 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. +# --------------------------------------------------------------------------- +apiVersion: camel.apache.org/v1alpha1 +kind: Kamelet +metadata: + name: salesforce-composite-upsert-sink + annotations: + camel.apache.org/kamelet.support.level: "Stable" + camel.apache.org/catalog.version: "4.0.0-SNAPSHOT" + camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZpZXdCb3g9IjAgMCA0OCA0OCIgdmVyc2lvbj0iMS4xIj48ZyBpZD0ic3VyZmFjZTEiPjxwYXRoIGQ9Ik0zNi41IDEyYy0xLjMyNCAwLTIuNTkuMjU4LTMuNzU4LjcwM0E3Ljk5NCA3Ljk5NCAwIDAgMCAyNiA5Yy0yLjEwNSAwLTQuMDIuODItNS40NDUgMi4xNTJBOS40NjggOS40NjggMCAwIDAgMTMuNSA4QzguMjU0IDggNCAxMi4yNTQgNCAxNy41YzAgLj [...] + camel.apache.org/provider: "Apache Software Foundation" + camel.apache.org/kamelet.group: "Salesforce" + camel.apache.org/kamelet.namespace: "Salesforce" + labels: + camel.apache.org/kamelet.type: "sink" +spec: + definition: + title: "Salesforce composite upsert Sink" + description: |- + Upsert Composite List of sObjects in Salesforce. + + The body received must contain List of JSON SObjects to insert/update inside the records attribute, for example: + + `{"records" : ["attributes" : {"type" : "KameletSinkSObject__c"},"ExtId__c" : "1","Name__c": "Ziauddin", "City__c": "Bhopal"], ["attributes" : {"type" : "KameletSinkSObject__c"},"ExtId__c" : "2","Name__c": "Shaikh", "City__c": "Bhopal"] }` + + required: + - sObjectName + - sObjectIdName + - clientId + - clientSecret + - userName + - password + type: object + properties: + sObjectName: + title: Object Name + description: The type of the Salesforce object. Required if using a key-value pair. + type: string + example: Contact + sObjectIdName: + title: Object Id Name + description: The Field Name of the External ID of the Salesforce object. Required if using a key-value pair. + type: string + loginUrl: + title: Login URL + description: The Salesforce instance login URL. + type: string + default: https://login.salesforce.com + clientId: + title: Consumer Key + description: The Salesforce application consumer key. + type: string + x-descriptors: + - urn:camel:group:credentials + clientSecret: + title: Consumer Secret + description: The Salesforce application consumer secret. + type: string + format: password + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:password + - urn:camel:group:credentials + userName: + title: Username + description: The Salesforce username. + type: string + x-descriptors: + - urn:camel:group:credentials + password: + title: Password + description: The Salesforce user password. + type: string + format: password + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:password + - urn:camel:group:credentials + types: + in: + mediaType: application/json + dependencies: + - "camel:core" + - "camel:jsonpath" + - "camel:jackson" + - "camel:salesforce" + - "camel:kamelet" + template: + beans: + - name: salesforce + type: "#class:org.apache.camel.component.salesforce.SalesforceComponent" + properties: + sObjectName: "{{sObjectName}}" + sObjectIdName: "{{sObjectIdName}}" + clientId: "{{clientId}}" + clientSecret: "{{clientSecret}}" + userName: "{{userName}}" + password: "{{password}}" + loginUrl: "{{loginUrl}}" + from: + uri: kamelet:source + steps: + - transform: + jsonpath: "$['records']" + - to: + uri: "{{salesforce}}:compositeUpsertSObjectCollections" + parameters: + sObjectName: "{{sObjectName}}" + sObjectIdName: "{{sObjectIdName}}" + rawPayload: "true" + allOrNone: "false"