S - the object typepublic class Request<S> extends Object
In most cases, requests can be sent over any of the APIs (REST, WebSockets). If the request is naturally idempotent, such as Find or Get, they can be reused multiple times.
Credentials credentials = new Credentials(accountName, tokenString);
RestApi api = new RestApi(credentials);
List<Flow> results = api.send(Flowthings.flow().find(new QueryOptions().limit(5)));
| Modifier and Type | Class and Description |
|---|---|
static class |
Request.Action |
| Modifier and Type | Field and Description |
|---|---|
protected Request.Action |
action |
protected String |
body |
protected S |
bodyObject |
protected String |
flowId |
protected String |
id |
protected boolean |
listResponse |
protected static Logger |
logger |
protected String |
member |
protected Map<String,Object> |
otherData |
protected QueryOptions |
queryOptions |
protected Types |
type |
protected com.google.gson.reflect.TypeToken<? extends Response<S>> |
typeToken |
| Constructor and Description |
|---|
Request(Request.Action action,
Types type,
com.google.gson.reflect.TypeToken<? extends Response<S>> typeToken,
boolean listResponse) |
| Modifier and Type | Method and Description |
|---|---|
Request<S> |
addData(String k,
Object o) |
Request<S> |
body(S s) |
String |
buildHttpPath(Credentials credentials,
String url) |
static <S> Request<List<S>> |
createListRequest(Class<S> domainObjectType,
Request.Action action) |
static <S> Request<S> |
createObjectRequest(Class<S> domainObjectType,
Request.Action action) |
Request<S> |
flowId(String flowId) |
Request<S> |
id(String id) |
Request<S> |
member(String member) |
Request<S> |
params(QueryOptions queryOptions) |
protected static Logger logger
protected String id
protected QueryOptions queryOptions
protected String body
protected Request.Action action
protected Types type
protected String member
protected String flowId
protected boolean listResponse
protected S bodyObject
public Request(Request.Action action, Types type, com.google.gson.reflect.TypeToken<? extends Response<S>> typeToken, boolean listResponse)
public static <S> Request<S> createObjectRequest(Class<S> domainObjectType, Request.Action action)
public static <S> Request<List<S>> createListRequest(Class<S> domainObjectType, Request.Action action)
public Request<S> params(QueryOptions queryOptions)
public String buildHttpPath(Credentials credentials, String url)
Copyright © 2015. All rights reserved.