public interface

GenericHandshakeClient

org.mule.modules.handshake.client.GenericHandshakeClient<T>
Known Indirect Subclasses

Summary

Public Methods
abstract T create(T t)
Create the given element on Handshake for the connected account
abstract Collection<T> getAll(Map<String, String> filters, boolean fetchAllResults)
Get all the elements that match the given filters
abstract T getById(String id)
Get one element, matching the given id.
abstract T getByResourceUri(String resourceUri)
Get one element, matching the given Handshake Id (resourceUri)
abstract HandshakeAPIResponse<T> paginate(Map<String, String> filters, Integer limit, Integer offset)
Pagiante elements that match the given filters
abstract T update(String resourceUri, T toUpdate)
Updates an existing element on Handshake, by providing its resourceUri and an object with the fields to update.

Public Methods

public abstract T create (T t)

Create the given element on Handshake for the connected account

Parameters
t To be created
Returns
  • the created element

public abstract Collection<T> getAll (Map<String, String> filters, boolean fetchAllResults)

Get all the elements that match the given filters

Parameters
filters To apply to the search
fetchAllResults If set to true, will try to fetch all the results, even if they are too much. WARNING: Could be slow and raise OutOfMemoryError
Returns
  • a Collection of all the elements matching the filters

public abstract T getById (String id)

Get one element, matching the given id. The id is the user-specified one for the given entity. Note that not all entities support this field, so you might be looking for getByResourceUri(String)

Parameters
id Of the element to get
Returns
  • the element with the given id, or null if it doesn't exist

public abstract T getByResourceUri (String resourceUri)

Get one element, matching the given Handshake Id (resourceUri)

Parameters
resourceUri Of the element to get
Returns
  • the element with the given id
Throws
IllegalArgumentException if the resourceUri is not well-formed
HandshakeAPIException if the element doesn't exist in Handshake

public abstract HandshakeAPIResponse<T> paginate (Map<String, String> filters, Integer limit, Integer offset)

Pagiante elements that match the given filters

Parameters
filters To apply to the search
limit The maximum amount of items to be returned
offset Pagination offset
Returns
  • an object with elements matching the filters, and metadata to retrieve more in another call (using "next" as "offset")

public abstract T update (String resourceUri, T toUpdate)

Updates an existing element on Handshake, by providing its resourceUri and an object with the fields to update. Because of the way Handshake references work, you should not include fields that you don't want updated, specially if they are nested objects, and should either leave them blank or include the corresponding resourceUri

Parameters
resourceUri Of the element to edit
toUpdate Object with the fields to be edited
Returns
  • the updated element