GitHub user zregvart opened a pull request:

    https://github.com/apache/camel/pull/1344

    Composite api batch

    **Please have a look at #1334 and #1338 that are the base for this PR 
first**
    
    This commit implements support for Salesforce Composite Batch API[1]
    that allows the user to combine up to 25 requests in a single batch and
    then send them in a single HTTP request saving on the request round trip
    time and bandwidth.
    
    One would use this operation like this:
    
    //Create the batch request:
    final SObjectBatch batch = new SObjectBatch("38.0");
    
    final Account updates = new Account();
    updates.set...
    
    //Use the builder methods to add up to 25 operations
    batch.addUpdate("Account", accountId, updates)
         .addGet("Account", "001D000000K0fXOIAZ")
         .add...
    
    final SObjectBatchResponse response =
    template.requestBody("salesforce:composite-batch?format=JSON", batch,
    SObjectBatchResponse.class);
    
    [1]
    
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_batch.htm

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zregvart/camel composite-api-batch

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/1344.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1344
    
----
commit 214c18c211ae5a55fedc7a0806d123228d464890
Author: Zoran Regvart <zo...@regvart.com>
Date:   2016-12-08T10:27:28Z

    SObjectDescription metadata in DTOs
    
    This commit adds SObjectDescription by making the DTOs extend
    AbstractDescribedSObjectBase (new class) instead of AbstractSObjectBase.
    
    The code generation is performed in Velocity template by recursing the
    bean SObjectDescription properties. Helper methods are added to
    GeneratorUtility that help track the stack of the recursive invocation.
    
    To prevent hitting Java method length restriction (64K) some properties
    are blacklisted: PicklistValues and ChildRelationships which most likely
    would not be needed in the component operation anyways.
    
    (cherry picked from commit 2d14fd8caa58f4520cf70801a27a0a57b023f492)

commit 856fd49022b48a49114ed01e8528746d17b3fb8e
Author: Zoran Regvart <zo...@regvart.com>
Date:   2016-12-08T10:28:07Z

    CAMEL-10571 SObject tree creation, Composite API
    
    This commit implements support for SObject tree creation via Salesforce
    Composite API. This allows user to create multiple, up to 200, records
    including parent-child relationships, up to 5 levels using one API call.
    
    For instance:
    
    Account account = ...
    Contact president = ...
    Contact marketing = ...
    
    Account anotherAccount = ...
    Contact sales = ...
    Asset someAsset = ...
    
    // build the tree
    SObjectTree request = new SObjectTree();
    request.addObject(account).addChildren(president, marketing);
    request.addObject(anotherAccount).addChild(sales).addChild(someAsset);
    
    final SObjectTree response =
    template.requestBody("salesforce:composite-tree", tree,
    SObjectTree.class);
    
    The returned response in the output message is the identical object
    received in the body of the input message updated with identifiers
    received on successful record creation or populated errors on failure.

commit 3ac2f5b9deec6acf4485086c82759d7933f02046
Author: Zoran Regvart <zo...@regvart.com>
Date:   2016-12-09T11:13:46Z

    CAMEL-10593 Support for Composite API batch
    
    This commit implements support for Salesforce Composite Batch API[1]
    that allows the user to combine up to 25 requests in a single batch and
    then send them in a single HTTP request saving on the request round trip
    time and bandwidth.
    
    One would use this operation like this:
    
    //Create the batch request:
    final SObjectBatch batch = new SObjectBatch("38.0");
    
    final Account updates = new Account();
    updates.set...
    
    //Use the builder methods to add up to 25 operations
    batch.addUpdate("Account", accountId, updates)
         .addGet("Account", "001D000000K0fXOIAZ")
         .add...
    
    final SObjectBatchResponse response =
    template.requestBody("salesforce:composite-batch?format=JSON", batch,
    SObjectBatchResponse.class);
    
    [1]
    
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_batch.htm

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to