2.9.1 (latest) 2.9.0 2.8.1 2.7.2 2.6.0 2.5.1 2.4.1 2.1.2 2.0.1 1.35.2 1.34.1 1.33.4

    public abstract class AbstractGoogleClient

Abstract thread-safe Google client.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> AbstractGoogleClient

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Constructors

### AbstractGoogleClient(AbstractGoogleClient.Builder builder)

    protected AbstractGoogleClient(AbstractGoogleClient.Builder builder)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `builder` | `https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.services.AbstractGoogleClient.Builder` builder |

## Methods

### batch()

    public final BatchRequest batch()

Create an [BatchRequest](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.batch.BatchRequest) object from this Google API client instance.

Sample usage:


     client.batch()
        .queue(...)
        .queue(...)
        .execute();
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.batch.BatchRequest` | newly created Batch request |

### batch(HttpRequestInitializer httpRequestInitializer)

    public final BatchRequest batch(HttpRequestInitializer httpRequestInitializer)

Create an [BatchRequest](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.batch.BatchRequest) object from this Google API client instance.

Sample usage:


     client.batch(httpRequestInitializer)
        .queue(...)
        .queue(...)
        .execute();
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `httpRequestInitializer` | `com.google.api.client.http.HttpRequestInitializer` The initializer to use when creating the top-level batch HTTP request or `null` for none |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.batch.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** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### 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** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getGoogleClientRequestInitializer()

    public final GoogleClientRequestInitializer getGoogleClientRequestInitializer()

Returns the Google client request initializer or `null` for none.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.services.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** ||
|---|---|
| **Type** | **Description** |
| `com.google.api.client.util.ObjectParser` |   |

### getRequestFactory()

    public final HttpRequestFactory getRequestFactory()

Returns the HTTP request factory.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### 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** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getSuppressPatternChecks()

    public final boolean getSuppressPatternChecks()

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getSuppressRequiredParameterChecks()

    public final boolean getSuppressRequiredParameterChecks()

Returns whether discovery required parameter checks should be suppressed.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getUniverseDomain()

    public final String getUniverseDomain()

Universe Domain is the domain for Google Cloud Services. It follows the format of
`{ServiceName}.{UniverseDomain}`. For example, speech.googleapis.com would have a Universe
Domain value of `googleapis.com` and cloudasset.test.com would have a Universe Domain of
`test.com`. If this value is not set, this will default to `googleapis.com`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The configured Universe Domain or the Google Default Universe (googleapis.com) |

### initialize(AbstractGoogleClientRequest\<?\> httpClientRequest)

    protected void initialize(AbstractGoogleClientRequest<?> httpClientRequest)

Initializes a [AbstractGoogleClientRequest](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.services.AbstractGoogleClientRequest) using a [GoogleClientRequestInitializer](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.services.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** ||
|---|---|
| **Name** | **Description** |
| `httpClientRequest` | `https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.services.AbstractGoogleClientRequest<?>` Google client request type |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### validateUniverseDomain()

    public void validateUniverseDomain()

Check that the User configured universe domain matches the Credentials' universe domain. This
uses the HttpRequestInitializer to get the Credentials and is enforced that the
HttpRequestInitializer is of the {@see [HttpCredentialsAdapter](https://github.com/googleapis/google-auth-library-java/blob/main/oauth2_http/java/com/google/auth/http/HttpCredentialsAdapter.java)}
from the google-auth-library.

To use a non-GDU Credentials, you must use the HttpCredentialsAdapter class.

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` | if there is an error reading the Universe Domain from the credentials |