Class AbstractGoogleClient (1.35.2)

public abstract class AbstractGoogleClient

Abstract thread-safe Google client.

Inheritance

java.lang.Object > AbstractGoogleClient

Constructors

AbstractGoogleClient(AbstractGoogleClient.Builder builder)

protected AbstractGoogleClient(AbstractGoogleClient.Builder builder)
Parameter
NameDescription
builderAbstractGoogleClient.Builder

builder

Methods

batch()

public final BatchRequest batch()

Create an BatchRequest object from this Google API client instance.

Sample usage:


 client.batch()
    .queue(...)
    .queue(...)
    .execute();
 
Returns
TypeDescription
BatchRequest

newly created Batch request

batch(HttpRequestInitializer httpRequestInitializer)

public final BatchRequest batch(HttpRequestInitializer httpRequestInitializer)

Create an BatchRequest object from this Google API client instance.

Sample usage:


 client.batch(httpRequestInitializer)
    .queue(...)
    .queue(...)
    .execute();
 
Parameter
NameDescription
httpRequestInitializercom.google.api.client.http.HttpRequestInitializer

The initializer to use when creating the top-level batch HTTP request or null for none

Returns
TypeDescription
BatchRequest

newly created Batch request

getApplicationName()

public final String getApplicationName()

Returns the application name to be sent in the User-Agent header of each request or null for none.

Returns
TypeDescription
String

getBaseUrl()

public final String getBaseUrl()

Returns the URL-encoded base URL of the service, for example "https://www.googleapis.com/tasks/v1/".

Must end with a "/". It is guaranteed to be equal to getRootUrl() + getServicePath().

Returns
TypeDescription
String

getGoogleClientRequestInitializer()

public final GoogleClientRequestInitializer getGoogleClientRequestInitializer()

Returns the Google client request initializer or null for none.

Returns
TypeDescription
GoogleClientRequestInitializer

getObjectParser()

public ObjectParser getObjectParser()

Returns the object parser or null for none.

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

Returns
TypeDescription
com.google.api.client.util.ObjectParser

getRequestFactory()

public final HttpRequestFactory getRequestFactory()

Returns the HTTP request factory.

Returns
TypeDescription
com.google.api.client.http.HttpRequestFactory

getRootUrl()

public final String getRootUrl()

Returns the URL-encoded root URL of the service, for example "https://www.googleapis.com/".

Must end with a "/".

Returns
TypeDescription
String

getServicePath()

public final String getServicePath()

Returns the URL-encoded service path of the service, for example "tasks/v1/".

Must end with a "/" and not begin with a "/". It is allowed to be an empty string "" or a forward slash "/", if it is a forward slash then it is treated as an empty string

Returns
TypeDescription
String

getSuppressPatternChecks()

public final boolean getSuppressPatternChecks()

Returns whether discovery pattern checks should be suppressed on required parameters.

Returns
TypeDescription
boolean

getSuppressRequiredParameterChecks()

public final boolean getSuppressRequiredParameterChecks()

Returns whether discovery required parameter checks should be suppressed.

Returns
TypeDescription
boolean

initialize(AbstractGoogleClientRequest<?> httpClientRequest)

protected void initialize(AbstractGoogleClientRequest<?> httpClientRequest)

Initializes a AbstractGoogleClientRequest using a GoogleClientRequestInitializer.

Must be called before the Google client request is executed, preferably right after the request is instantiated. Sample usage:


 public class Get extends HttpClientRequest {
   ...
 }

 public Get get(String userId) throws IOException {
   Get result = new Get(userId);
   initialize(result);
   return result;
 }
 

Subclasses may override by calling the super implementation.

Parameter
NameDescription
httpClientRequestAbstractGoogleClientRequest<?>

Google client request type

Exceptions
TypeDescription
IOException