Class SObjectBatchResult
- java.lang.Object
-
- org.apache.camel.component.salesforce.api.dto.composite.SObjectBatchResult
-
- All Implemented Interfaces:
Serializable
public final class SObjectBatchResult extends Object implements Serializable
Contains the individual result of Composite API batch request. As batch requests can partially succeed or fail make sure you check thegetStatusCode()for status of the specific request. The result of the request can vary from API to API so here it is given asObject, in most cases it will be aMapwith string keys and values or otherMapas value. Requests made in JSON format hold some type information (i.e. it is known what values are strings and what values are numbers), so in general those will be more type friendly. Note that the responses will vary between XML and JSON, this is due to the responses from Salesforce API being different.For example response for SObject record creation in JSON will be:
{ "statusCode": 201, "result": { "id" : "0010Y00000Ary8hQAB", "success" : true, "errors" : [] } }Which will result in
getResult()returningMapcreated like:{ @code Mapresult = new HashMap<>(); result.put("id", "0010Y00000Ary91QAB"); result.put("success", Boolean.TRUE); result.put("errors", Collections.emptyList()); } Whereas using XML format the response will be:
<Result> <id>0010Y00000AryACQAZ</id> <success>true</success> </Result>And that results in
getResult()returningMapcreated like:{ @code Mapresult = new HashMap<>(); Map nestedResult = new HashMap<>(); result.put("Result", nestedResult); nestedResult.put("id", "0010Y00000Ary91QAB"); nestedResult.put("success", "true"); } Note the differences between type and nested
Mapone level deeper in the case of XML.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SObjectBatchResult(int statusCode, Object result)
-