Commit db0fdb1
authored
Add support for custom static headers (#2690)
Note, PubSub is supported only partially. Full support is dependent on migration of PubSub from Grpc stubs to Gapic stubs
Usage:
```java
// For manual/semi-manual clients:
// Resource Manager
// Translate
// Compute
// Storage
// Datastore
// Dns
// BigQuery
//
// Logging
// Firestore
// Spanner
HeaderProvider headerProvider =
FixedHeaderProvider.create("user-agent", "my-client-name", "custom-header", "custom stuff");
DatastoreOptions options =
DatastoreOptions.newBuilder().setHeaderProvider(headerProvider).build();
Datastore datastore = options.getService();
// For generated clients:
// All others, except Pub/Sub
HeaderProvider headerProvider =
FixedHeaderProvider.create("user-agent", "my-client-name", "custom-header", "custom stuff");
LanguageServiceSettings settings =
LanguageServiceSettings.newBuilder().setHeaderProvider(headerProvider).build();
LanguageServiceClient client = LanguageServiceClient.create(settings);
// Note, PubSub is supported only partially. Full support is dependent on migration of PubSub from Grpc stubs to Gapic stubs
```1 parent 973ffc1 commit db0fdb1
79 files changed
Lines changed: 624 additions & 1828 deletions
File tree
- google-cloud-bigquerydatatransfer
- src/main/java/com/google/cloud/bigquery/datatransfer/v1
- google-cloud-bigquery
- google-cloud-bigtable
- src/main/java/com/google/cloud/bigtable
- admin/v2
- v2
- google-cloud-bom
- google-cloud-compute
- google-cloud-container
- src/main/java/com/google/cloud/container/v1
- google-cloud-core-grpc
- src
- main/java/com/google/cloud/grpc
- test/java/com/google/cloud/grpc
- google-cloud-core-http
- src
- main/java/com/google/cloud/http
- test/java/com/google/cloud/http
- google-cloud-core
- src/main/java/com/google/cloud
- google-cloud-datastore
- google-cloud-dialogflow
- src/main/java/com/google/cloud/dialogflow/v2beta1
- google-cloud-dlp
- src/main/java/com/google/cloud/dlp/v2beta1
- google-cloud-dns
- google-cloud-errorreporting
- src/main/java/com/google/cloud/errorreporting/v1beta1
- google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets
- google-cloud-firestore
- src/main/java/com/google/cloud/firestore
- spi/v1beta1
- v1beta1
- google-cloud-language
- src
- main/java/com/google/cloud/language
- v1beta2
- v1
- test/java/com/google/cloud/language/v1
- google-cloud-logging
- src/main/java/com/google/cloud/logging
- spi/v2
- v2
- google-cloud-monitoring
- src/main/java/com/google/cloud/monitoring/v3
- google-cloud-notification
- google-cloud-pubsub
- src/main/java/com/google/cloud/pubsub/v1
- google-cloud-resourcemanager
- google-cloud-spanner
- src
- main/java/com/google/cloud/spanner
- spi/v1
- test/java/com/google/cloud/spanner/spi/v1
- google-cloud-speech
- src/main/java/com/google/cloud/speech
- v1beta1
- v1
- google-cloud-storage
- google-cloud-trace
- src/main/java/com/google/cloud/trace
- v1
- v2
- google-cloud-translate
- google-cloud-util/google-cloud-compat-checker
- google-cloud-video-intelligence
- src/main/java/com/google/cloud/videointelligence
- v1beta1
- v1beta2
- v1
- google-cloud-vision
- src/main/java/com/google/cloud/vision
- v1p1beta1
- v1
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
71 | 70 | | |
72 | 71 | | |
73 | 72 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | 73 | | |
84 | 74 | | |
85 | 75 | | |
| |||
89 | 79 | | |
90 | 80 | | |
91 | 81 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | 82 | | |
112 | 83 | | |
113 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | 105 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | 106 | | |
135 | 107 | | |
136 | 108 | | |
| |||
Lines changed: 6 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | | - | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | 95 | | |
105 | 96 | | |
106 | 97 | | |
| |||
249 | 240 | | |
250 | 241 | | |
251 | 242 | | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
265 | 247 | | |
266 | 248 | | |
267 | 249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
107 | 106 | | |
108 | 107 | | |
109 | 108 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | 109 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | 110 | | |
140 | 111 | | |
141 | 112 | | |
| |||
Lines changed: 7 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | | - | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | 108 | | |
118 | 109 | | |
119 | 110 | | |
| |||
244 | 235 | | |
245 | 236 | | |
246 | 237 | | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
260 | 242 | | |
261 | 243 | | |
262 | 244 | | |
| |||
408 | 390 | | |
409 | 391 | | |
410 | 392 | | |
411 | | - | |
| 393 | + | |
412 | 394 | | |
413 | 395 | | |
414 | 396 | | |
| |||
Lines changed: 7 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | 105 | | |
115 | 106 | | |
116 | 107 | | |
| |||
194 | 185 | | |
195 | 186 | | |
196 | 187 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
210 | 192 | | |
211 | 193 | | |
212 | 194 | | |
| |||
371 | 353 | | |
372 | 354 | | |
373 | 355 | | |
374 | | - | |
| 356 | + | |
375 | 357 | | |
376 | 358 | | |
377 | 359 | | |
| |||
Lines changed: 6 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | | - | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | 97 | | |
106 | 98 | | |
107 | 99 | | |
| |||
189 | 181 | | |
190 | 182 | | |
191 | 183 | | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
205 | 187 | | |
206 | 188 | | |
207 | 189 | | |
| |||
309 | 291 | | |
310 | 292 | | |
311 | 293 | | |
312 | | - | |
| 294 | + | |
313 | 295 | | |
314 | 296 | | |
315 | 297 | | |
| |||
0 commit comments