Class CommonGoogleClientRequestInitializer.Builder (1.35.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
TypeDescription
CommonGoogleClientRequestInitializer

the constructed CommonGoogleClientRequestInitializer instance

getKey()

public String getKey()

Returns the API key.

Returns
TypeDescription
String

the API key

getRequestReason()

public String getRequestReason()

Get the configured request reason.

Returns
TypeDescription
String

the request reason

getUserAgent()

public String getUserAgent()

Returns the configured user agent.

Returns
TypeDescription
String

the user agent

getUserIp()

public String getUserIp()

Returns the configured userIp.

Returns
TypeDescription
String

the userIp

getUserProject()

public String getUserProject()

Get the configured user project.

Returns
TypeDescription
String

the user project

self()

protected CommonGoogleClientRequestInitializer.Builder self()
Returns
TypeDescription
CommonGoogleClientRequestInitializer.Builder

setKey(String key)

public CommonGoogleClientRequestInitializer.Builder setKey(String key)

Set the API Key for outgoing requests.

Parameter
NameDescription
keyString

the API key

Returns
TypeDescription
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
NameDescription
requestReasonString

the reason for making the request

Returns
TypeDescription
CommonGoogleClientRequestInitializer.Builder

the builder

setUserAgent(String userAgent)

public CommonGoogleClientRequestInitializer.Builder setUserAgent(String userAgent)

Set the user agent.

Parameter
NameDescription
userAgentString

the user agent

Returns
TypeDescription
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
NameDescription
userIpString

the user's IP address

Returns
TypeDescription
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
NameDescription
userProjectString

the user project

Returns
TypeDescription
CommonGoogleClientRequestInitializer.Builder

the builder