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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class CommonGoogleClientRequestInitializer.Builder (2.8.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.8.1 (latest)](/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.services.CommonGoogleClientRequestInitializer.Builder)\n- [2.8.0](/java/docs/reference/google-api-client/2.8.0/com.google.api.client.googleapis.services.CommonGoogleClientRequestInitializer.Builder)\n- [2.7.2](/java/docs/reference/google-api-client/2.7.2/com.google.api.client.googleapis.services.CommonGoogleClientRequestInitializer.Builder)\n- [2.6.0](/java/docs/reference/google-api-client/2.6.0/com.google.api.client.googleapis.services.CommonGoogleClientRequestInitializer.Builder)\n- [2.5.1](/java/docs/reference/google-api-client/2.5.1/com.google.api.client.googleapis.services.CommonGoogleClientRequestInitializer.Builder)\n- [2.4.1](/java/docs/reference/google-api-client/2.4.1/com.google.api.client.googleapis.services.CommonGoogleClientRequestInitializer.Builder)\n- [2.1.2](/java/docs/reference/google-api-client/2.1.2/com.google.api.client.googleapis.services.CommonGoogleClientRequestInitializer.Builder)\n- [2.0.1](/java/docs/reference/google-api-client/2.0.1/com.google.api.client.googleapis.services.CommonGoogleClientRequestInitializer.Builder)\n- [1.35.2](/java/docs/reference/google-api-client/1.35.2/com.google.api.client.googleapis.services.CommonGoogleClientRequestInitializer.Builder)\n- [1.34.1](/java/docs/reference/google-api-client/1.34.1/com.google.api.client.googleapis.services.CommonGoogleClientRequestInitializer.Builder)\n- [1.33.4](/java/docs/reference/google-api-client/1.33.4/com.google.api.client.googleapis.services.CommonGoogleClientRequestInitializer.Builder) \n\n public static class CommonGoogleClientRequestInitializer.Builder\n\nBuilder for `CommonGoogleClientRequestInitializer`. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e CommonGoogleClientRequestInitializer.Builder \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nConstructors\n------------\n\n### Builder()\n\n protected Builder()\n\nMethods\n-------\n\n### build()\n\n public CommonGoogleClientRequestInitializer build()\n\nReturns the constructed CommonGoogleClientRequestInitializer instance.\n\n### getKey()\n\n public String getKey()\n\nReturns the API key.\n\n### getRequestReason()\n\n public String getRequestReason()\n\nGet the configured request reason.\n\n### getUserAgent()\n\n public String getUserAgent()\n\nReturns the configured user agent.\n\n### getUserIp()\n\n public String getUserIp()\n\nReturns the configured userIp.\n\n### getUserProject()\n\n public String getUserProject()\n\nGet the configured user project.\n\n### self()\n\n protected CommonGoogleClientRequestInitializer.Builder self()\n\n### setKey(String key)\n\n public CommonGoogleClientRequestInitializer.Builder setKey(String key)\n\nSet the API Key for outgoing requests.\n\n### setRequestReason(String requestReason)\n\n public CommonGoogleClientRequestInitializer.Builder setRequestReason(String requestReason)\n\nSet the reason for making the request, which is intended to be recorded in audit logging. An\nexample reason would be a support-case ticket number.\n\n### setUserAgent(String userAgent)\n\n public CommonGoogleClientRequestInitializer.Builder setUserAgent(String userAgent)\n\nSet the user agent.\n\n### setUserIp(String userIp)\n\n public CommonGoogleClientRequestInitializer.Builder setUserIp(String userIp)\n\nSet the IP address of the end user for whom the API call is being made.\n\n### setUserProject(String userProject)\n\n public CommonGoogleClientRequestInitializer.Builder setUserProject(String userProject)\n\nSet the user project for the request. This is a caller-specified project for quota and\nbilling purposes. The caller must have serviceusage.services.use permission on the project."]]