T
- type of the response@Beta public abstract class AbstractGoogleProtoClientRequest<T> extends AbstractGoogleClientRequest<T>
Beta
AbstractGoogleProtoClient
.
Implementation is not thread-safe.
GenericData.Flags
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
USER_AGENT_SUFFIX
Modifier | Constructor and Description |
---|---|
protected |
AbstractGoogleProtoClientRequest(AbstractGoogleProtoClient abstractGoogleProtoClient,
String requestMethod,
String uriTemplate,
com.google.protobuf.MessageLite message,
Class<T> responseClass) |
Modifier and Type | Method and Description |
---|---|
AbstractGoogleProtoClient |
getAbstractGoogleClient()
Returns the Google client.
|
Object |
getMessage()
Returns the message to serialize or
null for none. |
void |
queue(BatchRequest batchRequest,
BatchCallback<T,Void> callback)
Queues the request into the specified batch request container.
|
AbstractGoogleProtoClientRequest<T> |
set(String fieldName,
Object value) |
AbstractGoogleProtoClientRequest<T> |
setDisableGZipContent(boolean disableGZipContent)
Sets whether to disable GZip compression of HTTP content.
|
AbstractGoogleProtoClientRequest<T> |
setRequestHeaders(HttpHeaders headers)
Sets the HTTP headers used for the Google client request.
|
buildHttpRequest, buildHttpRequestUrl, buildHttpRequestUsingHead, checkRequiredParameter, execute, executeAndDownloadTo, executeAsInputStream, executeMedia, executeMediaAndDownloadTo, executeMediaAsInputStream, executeUnparsed, executeUsingHead, getDisableGZipContent, getHttpContent, getLastResponseHeaders, getLastStatusCode, getLastStatusMessage, getMediaHttpDownloader, getMediaHttpUploader, getRequestHeaders, getRequestMethod, getResponseClass, getReturnRawInputSteam, getUriTemplate, initializeMediaDownload, initializeMediaUpload, newExceptionOnError, queue, setReturnRawInputStream
clone, entrySet, equals, get, getClassInfo, getUnknownKeys, hashCode, put, putAll, remove, setUnknownKeys, toString
clear, containsKey, containsValue, isEmpty, keySet, size, values
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
protected AbstractGoogleProtoClientRequest(AbstractGoogleProtoClient abstractGoogleProtoClient, String requestMethod, String uriTemplate, com.google.protobuf.MessageLite message, Class<T> responseClass)
abstractGoogleProtoClient
- Google protocol buffer clientrequestMethod
- HTTP MethoduriTemplate
- URI template for the path relative to the base URL. If it starts with a "/"
the base path from the base URL will be stripped out. The URI template can also be a
full URL. URI template expansion is done using
UriTemplate.expand(String, String, Object, boolean)
message
- message to serialize or null
for noneresponseClass
- response class to parse intopublic AbstractGoogleProtoClient getAbstractGoogleClient()
AbstractGoogleClientRequest
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
getAbstractGoogleClient
in class AbstractGoogleClientRequest<T>
public AbstractGoogleProtoClientRequest<T> setDisableGZipContent(boolean disableGZipContent)
AbstractGoogleClientRequest
By default it is false
.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
setDisableGZipContent
in class AbstractGoogleClientRequest<T>
public AbstractGoogleProtoClientRequest<T> setRequestHeaders(HttpHeaders headers)
AbstractGoogleClientRequest
These headers are set on the request after AbstractGoogleClientRequest.buildHttpRequest()
is called, this means that
HttpRequestInitializer.initialize(com.google.api.client.http.HttpRequest)
is called first.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
setRequestHeaders
in class AbstractGoogleClientRequest<T>
public final void queue(BatchRequest batchRequest, BatchCallback<T,Void> callback) throws IOException
Batched requests are then executed when BatchRequest.execute()
is called.
Example usage:
request.queue(batchRequest, new BatchCallback <SomeResponseType, Void >() { public void onSuccess(SomeResponseType content, HttpHeaders responseHeaders) { log("Success"); } public void onFailure(Void unused, HttpHeaders responseHeaders) { log(e.getMessage()); } });
batchRequest
- batch request containercallback
- batch callbackIOException
public Object getMessage()
null
for none.public AbstractGoogleProtoClientRequest<T> set(String fieldName, Object value)
set
in class AbstractGoogleClientRequest<T>
Copyright © 2010–2020 Google. All rights reserved.