You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add ability to set requestReason and userAgent when configuring the client.
Introduces the builder pattern for these common configuration options so that it is extensible in the future.
* Fix lint
* Fix lint
* javadoc linting
* Add userProject configuration
* Add test for setting user project, request reason, user agent
Copy file name to clipboardExpand all lines: google-api-client/src/main/java/com/google/api/client/googleapis/services/CommonGoogleClientRequestInitializer.java
+205-5Lines changed: 205 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,9 @@
25
25
*
26
26
* <pre>
27
27
public static final GoogleClientRequestInitializer KEY_INITIALIZER =
28
-
new CommonGoogleClientRequestInitializer(KEY);
28
+
CommonGoogleClientRequestInitializer.newBuilder()
29
+
.setKey(KEY)
30
+
.build();
29
31
* </pre>
30
32
*
31
33
* <p>
@@ -34,7 +36,10 @@
34
36
*
35
37
* <pre>
36
38
public static final GoogleClientRequestInitializer INITIALIZER =
37
-
new CommonGoogleClientRequestInitializer(KEY, USER_IP);
39
+
CommonGoogleClientRequestInitializer.newBuilder()
40
+
.setKey(KEY)
41
+
.setUserIp(USER_IP)
42
+
.build();
38
43
* </pre>
39
44
*
40
45
* <p>
@@ -81,30 +86,73 @@ public void initialize(AbstractGoogleClientRequest{@literal <}?{@literal >} requ
Copy file name to clipboardExpand all lines: google-api-client/src/main/java/com/google/api/client/googleapis/services/json/CommonGoogleJsonClientRequestInitializer.java
+25-2Lines changed: 25 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,9 @@
28
28
*
29
29
* <pre>
30
30
public static final GoogleClientRequestInitializer KEY_INITIALIZER =
31
-
new CommonGoogleJsonClientRequestInitializer(KEY);
Copy file name to clipboardExpand all lines: google-api-client/src/test/java/com/google/api/client/googleapis/services/CommonGoogleClientRequestInitializerTest.java
0 commit comments