|
25 | 25 | import com.google.api.gax.grpc.GrpcCallSettings; |
26 | 26 | import com.google.api.gax.grpc.GrpcStubCallableFactory; |
27 | 27 | import com.google.api.gax.rpc.ClientContext; |
| 28 | +import com.google.api.gax.rpc.RequestParamsExtractor; |
28 | 29 | import com.google.api.gax.rpc.UnaryCallable; |
| 30 | +import com.google.common.collect.ImmutableMap; |
29 | 31 | import com.google.protobuf.Empty; |
30 | 32 | import io.grafeas.v1beta1.BatchCreateNotesRequest; |
31 | 33 | import io.grafeas.v1beta1.BatchCreateNotesResponse; |
|
53 | 55 | import io.grpc.MethodDescriptor; |
54 | 56 | import io.grpc.protobuf.ProtoUtils; |
55 | 57 | import java.io.IOException; |
| 58 | +import java.util.Map; |
56 | 59 | import java.util.concurrent.TimeUnit; |
57 | 60 | import javax.annotation.Generated; |
58 | 61 |
|
@@ -278,70 +281,206 @@ protected GrpcGrafeasV1Beta1Stub( |
278 | 281 | GrpcCallSettings<GetOccurrenceRequest, Occurrence> getOccurrenceTransportSettings = |
279 | 282 | GrpcCallSettings.<GetOccurrenceRequest, Occurrence>newBuilder() |
280 | 283 | .setMethodDescriptor(getOccurrenceMethodDescriptor) |
| 284 | + .setParamsExtractor( |
| 285 | + new RequestParamsExtractor<GetOccurrenceRequest>() { |
| 286 | + @Override |
| 287 | + public Map<String, String> extract(GetOccurrenceRequest request) { |
| 288 | + ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); |
| 289 | + params.put("name", String.valueOf(request.getName())); |
| 290 | + return params.build(); |
| 291 | + } |
| 292 | + }) |
281 | 293 | .build(); |
282 | 294 | GrpcCallSettings<ListOccurrencesRequest, ListOccurrencesResponse> |
283 | 295 | listOccurrencesTransportSettings = |
284 | 296 | GrpcCallSettings.<ListOccurrencesRequest, ListOccurrencesResponse>newBuilder() |
285 | 297 | .setMethodDescriptor(listOccurrencesMethodDescriptor) |
| 298 | + .setParamsExtractor( |
| 299 | + new RequestParamsExtractor<ListOccurrencesRequest>() { |
| 300 | + @Override |
| 301 | + public Map<String, String> extract(ListOccurrencesRequest request) { |
| 302 | + ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); |
| 303 | + params.put("parent", String.valueOf(request.getParent())); |
| 304 | + return params.build(); |
| 305 | + } |
| 306 | + }) |
286 | 307 | .build(); |
287 | 308 | GrpcCallSettings<DeleteOccurrenceRequest, Empty> deleteOccurrenceTransportSettings = |
288 | 309 | GrpcCallSettings.<DeleteOccurrenceRequest, Empty>newBuilder() |
289 | 310 | .setMethodDescriptor(deleteOccurrenceMethodDescriptor) |
| 311 | + .setParamsExtractor( |
| 312 | + new RequestParamsExtractor<DeleteOccurrenceRequest>() { |
| 313 | + @Override |
| 314 | + public Map<String, String> extract(DeleteOccurrenceRequest request) { |
| 315 | + ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); |
| 316 | + params.put("name", String.valueOf(request.getName())); |
| 317 | + return params.build(); |
| 318 | + } |
| 319 | + }) |
290 | 320 | .build(); |
291 | 321 | GrpcCallSettings<CreateOccurrenceRequest, Occurrence> createOccurrenceTransportSettings = |
292 | 322 | GrpcCallSettings.<CreateOccurrenceRequest, Occurrence>newBuilder() |
293 | 323 | .setMethodDescriptor(createOccurrenceMethodDescriptor) |
| 324 | + .setParamsExtractor( |
| 325 | + new RequestParamsExtractor<CreateOccurrenceRequest>() { |
| 326 | + @Override |
| 327 | + public Map<String, String> extract(CreateOccurrenceRequest request) { |
| 328 | + ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); |
| 329 | + params.put("parent", String.valueOf(request.getParent())); |
| 330 | + return params.build(); |
| 331 | + } |
| 332 | + }) |
294 | 333 | .build(); |
295 | 334 | GrpcCallSettings<BatchCreateOccurrencesRequest, BatchCreateOccurrencesResponse> |
296 | 335 | batchCreateOccurrencesTransportSettings = |
297 | 336 | GrpcCallSettings |
298 | 337 | .<BatchCreateOccurrencesRequest, BatchCreateOccurrencesResponse>newBuilder() |
299 | 338 | .setMethodDescriptor(batchCreateOccurrencesMethodDescriptor) |
| 339 | + .setParamsExtractor( |
| 340 | + new RequestParamsExtractor<BatchCreateOccurrencesRequest>() { |
| 341 | + @Override |
| 342 | + public Map<String, String> extract(BatchCreateOccurrencesRequest request) { |
| 343 | + ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); |
| 344 | + params.put("parent", String.valueOf(request.getParent())); |
| 345 | + return params.build(); |
| 346 | + } |
| 347 | + }) |
300 | 348 | .build(); |
301 | 349 | GrpcCallSettings<UpdateOccurrenceRequest, Occurrence> updateOccurrenceTransportSettings = |
302 | 350 | GrpcCallSettings.<UpdateOccurrenceRequest, Occurrence>newBuilder() |
303 | 351 | .setMethodDescriptor(updateOccurrenceMethodDescriptor) |
| 352 | + .setParamsExtractor( |
| 353 | + new RequestParamsExtractor<UpdateOccurrenceRequest>() { |
| 354 | + @Override |
| 355 | + public Map<String, String> extract(UpdateOccurrenceRequest request) { |
| 356 | + ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); |
| 357 | + params.put("name", String.valueOf(request.getName())); |
| 358 | + return params.build(); |
| 359 | + } |
| 360 | + }) |
304 | 361 | .build(); |
305 | 362 | GrpcCallSettings<GetOccurrenceNoteRequest, Note> getOccurrenceNoteTransportSettings = |
306 | 363 | GrpcCallSettings.<GetOccurrenceNoteRequest, Note>newBuilder() |
307 | 364 | .setMethodDescriptor(getOccurrenceNoteMethodDescriptor) |
| 365 | + .setParamsExtractor( |
| 366 | + new RequestParamsExtractor<GetOccurrenceNoteRequest>() { |
| 367 | + @Override |
| 368 | + public Map<String, String> extract(GetOccurrenceNoteRequest request) { |
| 369 | + ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); |
| 370 | + params.put("name", String.valueOf(request.getName())); |
| 371 | + return params.build(); |
| 372 | + } |
| 373 | + }) |
308 | 374 | .build(); |
309 | 375 | GrpcCallSettings<GetNoteRequest, Note> getNoteTransportSettings = |
310 | 376 | GrpcCallSettings.<GetNoteRequest, Note>newBuilder() |
311 | 377 | .setMethodDescriptor(getNoteMethodDescriptor) |
| 378 | + .setParamsExtractor( |
| 379 | + new RequestParamsExtractor<GetNoteRequest>() { |
| 380 | + @Override |
| 381 | + public Map<String, String> extract(GetNoteRequest request) { |
| 382 | + ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); |
| 383 | + params.put("name", String.valueOf(request.getName())); |
| 384 | + return params.build(); |
| 385 | + } |
| 386 | + }) |
312 | 387 | .build(); |
313 | 388 | GrpcCallSettings<ListNotesRequest, ListNotesResponse> listNotesTransportSettings = |
314 | 389 | GrpcCallSettings.<ListNotesRequest, ListNotesResponse>newBuilder() |
315 | 390 | .setMethodDescriptor(listNotesMethodDescriptor) |
| 391 | + .setParamsExtractor( |
| 392 | + new RequestParamsExtractor<ListNotesRequest>() { |
| 393 | + @Override |
| 394 | + public Map<String, String> extract(ListNotesRequest request) { |
| 395 | + ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); |
| 396 | + params.put("parent", String.valueOf(request.getParent())); |
| 397 | + return params.build(); |
| 398 | + } |
| 399 | + }) |
316 | 400 | .build(); |
317 | 401 | GrpcCallSettings<DeleteNoteRequest, Empty> deleteNoteTransportSettings = |
318 | 402 | GrpcCallSettings.<DeleteNoteRequest, Empty>newBuilder() |
319 | 403 | .setMethodDescriptor(deleteNoteMethodDescriptor) |
| 404 | + .setParamsExtractor( |
| 405 | + new RequestParamsExtractor<DeleteNoteRequest>() { |
| 406 | + @Override |
| 407 | + public Map<String, String> extract(DeleteNoteRequest request) { |
| 408 | + ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); |
| 409 | + params.put("name", String.valueOf(request.getName())); |
| 410 | + return params.build(); |
| 411 | + } |
| 412 | + }) |
320 | 413 | .build(); |
321 | 414 | GrpcCallSettings<CreateNoteRequest, Note> createNoteTransportSettings = |
322 | 415 | GrpcCallSettings.<CreateNoteRequest, Note>newBuilder() |
323 | 416 | .setMethodDescriptor(createNoteMethodDescriptor) |
| 417 | + .setParamsExtractor( |
| 418 | + new RequestParamsExtractor<CreateNoteRequest>() { |
| 419 | + @Override |
| 420 | + public Map<String, String> extract(CreateNoteRequest request) { |
| 421 | + ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); |
| 422 | + params.put("parent", String.valueOf(request.getParent())); |
| 423 | + return params.build(); |
| 424 | + } |
| 425 | + }) |
324 | 426 | .build(); |
325 | 427 | GrpcCallSettings<BatchCreateNotesRequest, BatchCreateNotesResponse> |
326 | 428 | batchCreateNotesTransportSettings = |
327 | 429 | GrpcCallSettings.<BatchCreateNotesRequest, BatchCreateNotesResponse>newBuilder() |
328 | 430 | .setMethodDescriptor(batchCreateNotesMethodDescriptor) |
| 431 | + .setParamsExtractor( |
| 432 | + new RequestParamsExtractor<BatchCreateNotesRequest>() { |
| 433 | + @Override |
| 434 | + public Map<String, String> extract(BatchCreateNotesRequest request) { |
| 435 | + ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); |
| 436 | + params.put("parent", String.valueOf(request.getParent())); |
| 437 | + return params.build(); |
| 438 | + } |
| 439 | + }) |
329 | 440 | .build(); |
330 | 441 | GrpcCallSettings<UpdateNoteRequest, Note> updateNoteTransportSettings = |
331 | 442 | GrpcCallSettings.<UpdateNoteRequest, Note>newBuilder() |
332 | 443 | .setMethodDescriptor(updateNoteMethodDescriptor) |
| 444 | + .setParamsExtractor( |
| 445 | + new RequestParamsExtractor<UpdateNoteRequest>() { |
| 446 | + @Override |
| 447 | + public Map<String, String> extract(UpdateNoteRequest request) { |
| 448 | + ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); |
| 449 | + params.put("name", String.valueOf(request.getName())); |
| 450 | + return params.build(); |
| 451 | + } |
| 452 | + }) |
333 | 453 | .build(); |
334 | 454 | GrpcCallSettings<ListNoteOccurrencesRequest, ListNoteOccurrencesResponse> |
335 | 455 | listNoteOccurrencesTransportSettings = |
336 | 456 | GrpcCallSettings.<ListNoteOccurrencesRequest, ListNoteOccurrencesResponse>newBuilder() |
337 | 457 | .setMethodDescriptor(listNoteOccurrencesMethodDescriptor) |
| 458 | + .setParamsExtractor( |
| 459 | + new RequestParamsExtractor<ListNoteOccurrencesRequest>() { |
| 460 | + @Override |
| 461 | + public Map<String, String> extract(ListNoteOccurrencesRequest request) { |
| 462 | + ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); |
| 463 | + params.put("name", String.valueOf(request.getName())); |
| 464 | + return params.build(); |
| 465 | + } |
| 466 | + }) |
338 | 467 | .build(); |
339 | 468 | GrpcCallSettings<GetVulnerabilityOccurrencesSummaryRequest, VulnerabilityOccurrencesSummary> |
340 | 469 | getVulnerabilityOccurrencesSummaryTransportSettings = |
341 | 470 | GrpcCallSettings |
342 | 471 | .<GetVulnerabilityOccurrencesSummaryRequest, VulnerabilityOccurrencesSummary> |
343 | 472 | newBuilder() |
344 | 473 | .setMethodDescriptor(getVulnerabilityOccurrencesSummaryMethodDescriptor) |
| 474 | + .setParamsExtractor( |
| 475 | + new RequestParamsExtractor<GetVulnerabilityOccurrencesSummaryRequest>() { |
| 476 | + @Override |
| 477 | + public Map<String, String> extract( |
| 478 | + GetVulnerabilityOccurrencesSummaryRequest request) { |
| 479 | + ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); |
| 480 | + params.put("parent", String.valueOf(request.getParent())); |
| 481 | + return params.build(); |
| 482 | + } |
| 483 | + }) |
345 | 484 | .build(); |
346 | 485 |
|
347 | 486 | this.getOccurrenceCallable = |
|
0 commit comments