Class CommonGoogleClientRequestInitializer.Builder (2.6.0)

public static class CommonGoogleClientRequestInitializer.Builder

Builder for CommonGoogleClientRequestInitializer.

Inheritance

java.lang.Object > CommonGoogleClientRequestInitializer.Builder

Constructors

Builder()

protected Builder()

Methods

build()

public CommonGoogleClientRequestInitializer build()

Returns the constructed CommonGoogleClientRequestInitializer instance.

Returns
Type Description
CommonGoogleClientRequestInitializer

the constructed CommonGoogleClientRequestInitializer instance

getKey()

public String getKey()

Returns the API key.

Returns
Type Description
String

the API key

getRequestReason()

public String getRequestReason()

Get the configured request reason.

Returns
Type Description
String

the request reason

getUserAgent()

public String getUserAgent()

Returns the configured user agent.

Returns
Type Description
String

the user agent

getUserIp()

public String getUserIp()

Returns the configured userIp.

Returns
Type Description
String

the userIp

getUserProject()

public String getUserProject()

Get the configured user project.

Returns
Type Description
String

the user project

self()

protected CommonGoogleClientRequestInitializer.Builder self()
Returns
Type Description
CommonGoogleClientRequestInitializer.Builder

setKey(String key)

public CommonGoogleClientRequestInitializer.Builder setKey(String key)

Set the API Key for outgoing requests.

Parameter
Name Description
key String

the API key

Returns
Type Description
CommonGoogleClientRequestInitializer.Builder

the builder

setRequestReason(String requestReason)

public CommonGoogleClientRequestInitializer.Builder setRequestReason(String requestReason)

Set the reason for making the request, which is intended to be recorded in audit logging. An example reason would be a support-case ticket number.

Parameter
Name Description
requestReason String

the reason for making the request

Returns
Type Description
CommonGoogleClientRequestInitializer.Builder

the builder

setUserAgent(String userAgent)

public CommonGoogleClientRequestInitializer.Builder setUserAgent(String userAgent)

Set the user agent.

Parameter
Name Description
userAgent String

the user agent

Returns
Type Description
CommonGoogleClientRequestInitializer.Builder

the builder

setUserIp(String userIp)

public CommonGoogleClientRequestInitializer.Builder setUserIp(String userIp)

Set the IP address of the end user for whom the API call is being made.

Parameter
Name Description
userIp String

the user's IP address

Returns
Type Description
CommonGoogleClientRequestInitializer.Builder

the builder

setUserProject(String userProject)

public CommonGoogleClientRequestInitializer.Builder setUserProject(String userProject)

Set the user project for the request. This is a caller-specified project for quota and billing purposes. The caller must have serviceusage.services.use permission on the project.

Parameter
Name Description
userProject String

the user project

Returns
Type Description
CommonGoogleClientRequestInitializer.Builder

the builder