Interface RestClient
-
- All Known Implementing Classes:
DefaultRestClient
public interface RestClient
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceRestClient.ResponseCallback
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidapexCall(String httpMethod, String apexUrl, Map<String,Object> queryParams, InputStream requestDto, Map<String,List<String>> headers, RestClient.ResponseCallback callback)Executes a user defined APEX REST API call.voidapproval(InputStream request, Map<String,List<String>> headers, RestClient.ResponseCallback callback)Submits, approves or rejects particular record.voidapprovals(Map<String,List<String>> headers, RestClient.ResponseCallback callback)Returns a list of all approval processes.voidcreateSObject(String sObjectName, InputStream sObject, Map<String,List<String>> headers, RestClient.ResponseCallback callback)Creates a record for the specified object.voiddeleteSObject(String sObjectName, String id, Map<String,List<String>> headers, RestClient.ResponseCallback callback)Deletes a record for the specified object ID.voiddeleteSObjectWithId(String sObjectName, String fieldName, String fieldValue, Map<String,List<String>> headers, RestClient.ResponseCallback callback)Deletes a record based on the value of a specified external ID field.voidgetBasicInfo(String sObjectName, Map<String,List<String>> headers, RestClient.ResponseCallback callback)Describes the individual metadata for the specified object.voidgetBlobField(String sObjectName, String id, String blobFieldName, Map<String,List<String>> headers, RestClient.ResponseCallback callback)Retrieves the specified blob field from an individual record.voidgetDescription(String sObjectName, Map<String,List<String>> headers, RestClient.ResponseCallback callback)Completely describes the individual metadata at all levels for the specified object.voidgetGlobalObjects(Map<String,List<String>> headers, RestClient.ResponseCallback callback)Lists the available objects and their metadata for your organization's data.voidgetResources(Map<String,List<String>> headers, RestClient.ResponseCallback callback)Lists available resources for the specified API version, including resource name and URI.voidgetSObject(String sObjectName, String id, String[] fields, Map<String,List<String>> headers, RestClient.ResponseCallback callback)Retrieves a record for the specified object ID.voidgetSObjectWithId(String sObjectName, String fieldName, String fieldValue, Map<String,List<String>> headers, RestClient.ResponseCallback callback)Retrieves a record for the specified external ID.voidgetVersions(Map<String,List<String>> headers, RestClient.ResponseCallback callback)Lists summary information about each API version currently available, including the version, label, and a link to each version's root.voidlimits(Map<String,List<String>> headers, RestClient.ResponseCallback responseCallback)Fetches Organization Limits.voidquery(String soqlQuery, Map<String,List<String>> headers, RestClient.ResponseCallback callback)Executes the specified SOQL query.voidqueryAll(String soqlQuery, Map<String,List<String>> headers, RestClient.ResponseCallback callback)Executes the specified SOQL query including deleted records.voidqueryMore(String nextRecordsUrl, Map<String,List<String>> headers, RestClient.ResponseCallback callback)Get SOQL query results using nextRecordsUrl.voidrecent(Integer limit, Map<String,List<String>> headers, RestClient.ResponseCallback responseCallback)Fetches recently viewed records.voidsearch(String soslQuery, Map<String,List<String>> headers, RestClient.ResponseCallback callback)Executes the specified SOSL search.voidupdateSObject(String sObjectName, String id, InputStream sObject, Map<String,List<String>> headers, RestClient.ResponseCallback callback)Updates a record for the specified object ID.voidupsertSObject(String sObjectName, String fieldName, String fieldValue, Map<String,List<String>> headers, InputStream sObject, RestClient.ResponseCallback callback)Creates or updates a record based on the value of a specified external ID field.
-
-
-
Method Detail
-
getVersions
void getVersions(Map<String,List<String>> headers, RestClient.ResponseCallback callback)
Lists summary information about each API version currently available, including the version, label, and a link to each version's root.- Parameters:
headers- additional HTTP headers to sendcallback-RestClient.ResponseCallbackto handle response or exception
-
getResources
void getResources(Map<String,List<String>> headers, RestClient.ResponseCallback callback)
Lists available resources for the specified API version, including resource name and URI.- Parameters:
headers- additional HTTP headers to sendcallback-RestClient.ResponseCallbackto handle response or exception
-
getGlobalObjects
void getGlobalObjects(Map<String,List<String>> headers, RestClient.ResponseCallback callback)
Lists the available objects and their metadata for your organization's data.- Parameters:
headers- additional HTTP headers to sendcallback-RestClient.ResponseCallbackto handle response or exception
-
getBasicInfo
void getBasicInfo(String sObjectName, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
Describes the individual metadata for the specified object.- Parameters:
sObjectName- specified object nameheaders- additional HTTP headers to sendcallback-RestClient.ResponseCallbackto handle response or exception
-
getDescription
void getDescription(String sObjectName, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
Completely describes the individual metadata at all levels for the specified object.- Parameters:
sObjectName- specified object nameheaders- additional HTTP headers to sendcallback-RestClient.ResponseCallbackto handle response or exception
-
getSObject
void getSObject(String sObjectName, String id, String[] fields, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
Retrieves a record for the specified object ID.- Parameters:
sObjectName- specified object nameid- object idheaders- additional HTTP headers to sendcallback-RestClient.ResponseCallbackto handle response or exception
-
createSObject
void createSObject(String sObjectName, InputStream sObject, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
Creates a record for the specified object.- Parameters:
sObjectName- specified object nameheaders- additional HTTP headers to sendsObject- request entitycallback-RestClient.ResponseCallbackto handle response or exception
-
updateSObject
void updateSObject(String sObjectName, String id, InputStream sObject, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
Updates a record for the specified object ID.- Parameters:
sObjectName- specified object nameid- object idheaders- additional HTTP headers to sendsObject- request entitycallback-RestClient.ResponseCallbackto handle response or exception
-
deleteSObject
void deleteSObject(String sObjectName, String id, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
Deletes a record for the specified object ID.- Parameters:
sObjectName- specified object nameid- object idheaders- additional HTTP headers to sendcallback-RestClient.ResponseCallbackto handle response or exception
-
getSObjectWithId
void getSObjectWithId(String sObjectName, String fieldName, String fieldValue, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
Retrieves a record for the specified external ID.- Parameters:
sObjectName- specified object namefieldName- external field namefieldValue- external field valueheaders- additional HTTP headers to sendcallback-RestClient.ResponseCallbackto handle response or exception
-
upsertSObject
void upsertSObject(String sObjectName, String fieldName, String fieldValue, Map<String,List<String>> headers, InputStream sObject, RestClient.ResponseCallback callback)
Creates or updates a record based on the value of a specified external ID field.- Parameters:
sObjectName- specified object namefieldName- external field namefieldValue- external field valueheaders- additional HTTP headers to sendsObject- input object to insert or updatecallback-RestClient.ResponseCallbackto handle response or exception
-
deleteSObjectWithId
void deleteSObjectWithId(String sObjectName, String fieldName, String fieldValue, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
Deletes a record based on the value of a specified external ID field.- Parameters:
sObjectName- specified object namefieldName- external field namefieldValue- external field valueheaders- additional HTTP headers to sendcallback-RestClient.ResponseCallbackto handle response or exception
-
getBlobField
void getBlobField(String sObjectName, String id, String blobFieldName, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
Retrieves the specified blob field from an individual record.- Parameters:
sObjectName- specified object nameid- identifier of the objectblobFieldName- name of the field holding the blobheaders- additional HTTP headers to sendcallback-RestClient.ResponseCallbackto handle response or exception
-
query
void query(String soqlQuery, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
Executes the specified SOQL query.- Parameters:
soqlQuery- SOQL queryheaders- additional HTTP headers to sendcallback-RestClient.ResponseCallbackto handle response or exception
-
queryMore
void queryMore(String nextRecordsUrl, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
Get SOQL query results using nextRecordsUrl.- Parameters:
nextRecordsUrl- URL for next records to fetch, returned by query()headers- additional HTTP headers to sendcallback-RestClient.ResponseCallbackto handle response or exception
-
queryAll
void queryAll(String soqlQuery, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
Executes the specified SOQL query including deleted records.- Parameters:
soqlQuery- SOQL queryheaders- additional HTTP headers to sendcallback-RestClient.ResponseCallbackto handle response or exception
-
search
void search(String soslQuery, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
Executes the specified SOSL search.- Parameters:
soslQuery- SOSL queryheaders- additional HTTP headers to sendcallback-RestClient.ResponseCallbackto handle response or exception
-
apexCall
void apexCall(String httpMethod, String apexUrl, Map<String,Object> queryParams, InputStream requestDto, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
Executes a user defined APEX REST API call.- Parameters:
httpMethod- HTTP method to execute.apexUrl- APEX api url.queryParams- optional query parameters for GET methods, may be empty.requestDto- optional input DTO for POST, etc. may be null.headers- additional HTTP headers to sendcallback-RestClient.ResponseCallbackto handle response or exception
-
recent
void recent(Integer limit, Map<String,List<String>> headers, RestClient.ResponseCallback responseCallback)
Fetches recently viewed records.- Parameters:
limit- optional limit that specifies the maximum number of records to be returned. If this parameter is not specified, the default maximum number of records returned is the maximum number of entries in RecentlyViewed, which is 200 records per object.headers- additional HTTP headers to sendresponseCallback-RestClient.ResponseCallbackto handle response or exception
-
limits
void limits(Map<String,List<String>> headers, RestClient.ResponseCallback responseCallback)
Fetches Organization Limits.- Parameters:
headers- additional HTTP headers to sendresponseCallback-RestClient.ResponseCallbackto handle response or exception
-
approval
void approval(InputStream request, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
Submits, approves or rejects particular record.- Parameters:
headers- additional HTTP headers to sendcallback-RestClient.ResponseCallbackto handle response or exception
-
approvals
void approvals(Map<String,List<String>> headers, RestClient.ResponseCallback callback)
Returns a list of all approval processes.- Parameters:
headers- additional HTTP headers to sendcallback-RestClient.ResponseCallbackto handle response or exception
-
-