Class AbstractGoogleProtoClientRequest<T> (1.33.4)

public abstract class AbstractGoogleProtoClientRequest<T> extends AbstractGoogleClientRequest<T>

Beta
Google protocol buffer request for a AbstractGoogleProtoClient.

Implementation is not thread-safe.

Inheritance

Object > java.util.AbstractMap > com.google.api.client.util.GenericData > AbstractGoogleClientRequest > AbstractGoogleProtoClientRequest<T>

Type Parameter

NameDescription
T

Constructors

AbstractGoogleProtoClientRequest(AbstractGoogleProtoClient abstractGoogleProtoClient, String requestMethod, String uriTemplate, MessageLite message, Class<T> responseClass)

protected AbstractGoogleProtoClientRequest(AbstractGoogleProtoClient abstractGoogleProtoClient, String requestMethod, String uriTemplate, MessageLite message, Class<T> responseClass)
Parameters
NameDescription
abstractGoogleProtoClientAbstractGoogleProtoClient

Google protocol buffer client

requestMethodString

HTTP Method

uriTemplateString

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)

messageMessageLite

message to serialize or null for none

responseClassClass<T>

response class to parse into

Methods

getAbstractGoogleClient()

public AbstractGoogleProtoClient getAbstractGoogleClient()

Returns the Google client.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

Returns
TypeDescription
AbstractGoogleProtoClient
Overrides

getMessage()

public Object getMessage()

Returns the message to serialize or null for none.

Returns
TypeDescription
Object

queue(BatchRequest batchRequest, BatchCallback<T,Void> callback)

public final void queue(BatchRequest batchRequest, BatchCallback<T,Void> callback)

Queues the request into the specified batch request container.

Batched requests are then executed when BatchRequest#execute() is called.

Example usage:


 request.queue(batchRequest, new BatchCallback{@literal <}someresponsetype, void{@literal="">}() {

   public void onSuccess(SomeResponseType content, HttpHeaders responseHeaders) {
     log("Success");
   }

   public void onFailure(Void unused, HttpHeaders responseHeaders) {
     log(e.getMessage());
   }
 });
 
Parameters
NameDescription
batchRequestBatchRequest

batch request container

callbackBatchCallback<T,java.lang.Void>

batch callback

Exceptions
TypeDescription
IOException

set(String fieldName, Object value)

public AbstractGoogleProtoClientRequest<T> set(String fieldName, Object value)
Parameters
NameDescription
fieldNameString
valueObject
Returns
TypeDescription
AbstractGoogleProtoClientRequest<T>
Overrides

setDisableGZipContent(boolean disableGZipContent)

public AbstractGoogleProtoClientRequest<T> setDisableGZipContent(boolean disableGZipContent)

Sets whether to disable GZip compression of HTTP content.

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.

Parameter
NameDescription
disableGZipContentboolean
Returns
TypeDescription
AbstractGoogleProtoClientRequest<T>
Overrides

setRequestHeaders(HttpHeaders headers)

public AbstractGoogleProtoClientRequest<T> setRequestHeaders(HttpHeaders headers)

Sets the HTTP headers used for the Google client request.

These headers are set on the request after #buildHttpRequest is called, this means that HttpRequestInitializer#initialize is called first.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

Parameter
NameDescription
headerscom.google.api.client.http.HttpHeaders
Returns
TypeDescription
AbstractGoogleProtoClientRequest<T>
Overrides