|
51 | 51 | import com.google.api.servicemanagement.v1.SubmitConfigSourceResponse;
|
52 | 52 | import com.google.api.servicemanagement.v1.UndeleteServiceRequest;
|
53 | 53 | import com.google.api.servicemanagement.v1.UndeleteServiceResponse;
|
| 54 | +import com.google.iam.v1.GetIamPolicyRequest; |
| 55 | +import com.google.iam.v1.Policy; |
| 56 | +import com.google.iam.v1.SetIamPolicyRequest; |
| 57 | +import com.google.iam.v1.TestIamPermissionsRequest; |
| 58 | +import com.google.iam.v1.TestIamPermissionsResponse; |
54 | 59 | import com.google.longrunning.Operation;
|
55 | 60 | import com.google.longrunning.stub.GrpcOperationsStub;
|
56 | 61 | import com.google.protobuf.Empty;
|
@@ -206,6 +211,33 @@ public class GrpcServiceManagerStub extends ServiceManagerStub {
|
206 | 211 | ProtoUtils.marshaller(GenerateConfigReportResponse.getDefaultInstance()))
|
207 | 212 | .build();
|
208 | 213 |
|
| 214 | + private static final MethodDescriptor<SetIamPolicyRequest, Policy> setIamPolicyMethodDescriptor = |
| 215 | + MethodDescriptor.<SetIamPolicyRequest, Policy>newBuilder() |
| 216 | + .setType(MethodDescriptor.MethodType.UNARY) |
| 217 | + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") |
| 218 | + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) |
| 219 | + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) |
| 220 | + .build(); |
| 221 | + |
| 222 | + private static final MethodDescriptor<GetIamPolicyRequest, Policy> getIamPolicyMethodDescriptor = |
| 223 | + MethodDescriptor.<GetIamPolicyRequest, Policy>newBuilder() |
| 224 | + .setType(MethodDescriptor.MethodType.UNARY) |
| 225 | + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") |
| 226 | + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) |
| 227 | + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) |
| 228 | + .build(); |
| 229 | + |
| 230 | + private static final MethodDescriptor<TestIamPermissionsRequest, TestIamPermissionsResponse> |
| 231 | + testIamPermissionsMethodDescriptor = |
| 232 | + MethodDescriptor.<TestIamPermissionsRequest, TestIamPermissionsResponse>newBuilder() |
| 233 | + .setType(MethodDescriptor.MethodType.UNARY) |
| 234 | + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") |
| 235 | + .setRequestMarshaller( |
| 236 | + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) |
| 237 | + .setResponseMarshaller( |
| 238 | + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) |
| 239 | + .build(); |
| 240 | + |
209 | 241 | private final UnaryCallable<ListServicesRequest, ListServicesResponse> listServicesCallable;
|
210 | 242 | private final UnaryCallable<ListServicesRequest, ListServicesPagedResponse>
|
211 | 243 | listServicesPagedCallable;
|
@@ -240,6 +272,10 @@ public class GrpcServiceManagerStub extends ServiceManagerStub {
|
240 | 272 | createServiceRolloutOperationCallable;
|
241 | 273 | private final UnaryCallable<GenerateConfigReportRequest, GenerateConfigReportResponse>
|
242 | 274 | generateConfigReportCallable;
|
| 275 | + private final UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable; |
| 276 | + private final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable; |
| 277 | + private final UnaryCallable<TestIamPermissionsRequest, TestIamPermissionsResponse> |
| 278 | + testIamPermissionsCallable; |
243 | 279 |
|
244 | 280 | private final BackgroundResource backgroundResources;
|
245 | 281 | private final GrpcOperationsStub operationsStub;
|
@@ -402,6 +438,37 @@ protected GrpcServiceManagerStub(
|
402 | 438 | GrpcCallSettings.<GenerateConfigReportRequest, GenerateConfigReportResponse>newBuilder()
|
403 | 439 | .setMethodDescriptor(generateConfigReportMethodDescriptor)
|
404 | 440 | .build();
|
| 441 | + GrpcCallSettings<SetIamPolicyRequest, Policy> setIamPolicyTransportSettings = |
| 442 | + GrpcCallSettings.<SetIamPolicyRequest, Policy>newBuilder() |
| 443 | + .setMethodDescriptor(setIamPolicyMethodDescriptor) |
| 444 | + .setParamsExtractor( |
| 445 | + request -> { |
| 446 | + RequestParamsBuilder builder = RequestParamsBuilder.create(); |
| 447 | + builder.add("resource", String.valueOf(request.getResource())); |
| 448 | + return builder.build(); |
| 449 | + }) |
| 450 | + .build(); |
| 451 | + GrpcCallSettings<GetIamPolicyRequest, Policy> getIamPolicyTransportSettings = |
| 452 | + GrpcCallSettings.<GetIamPolicyRequest, Policy>newBuilder() |
| 453 | + .setMethodDescriptor(getIamPolicyMethodDescriptor) |
| 454 | + .setParamsExtractor( |
| 455 | + request -> { |
| 456 | + RequestParamsBuilder builder = RequestParamsBuilder.create(); |
| 457 | + builder.add("resource", String.valueOf(request.getResource())); |
| 458 | + return builder.build(); |
| 459 | + }) |
| 460 | + .build(); |
| 461 | + GrpcCallSettings<TestIamPermissionsRequest, TestIamPermissionsResponse> |
| 462 | + testIamPermissionsTransportSettings = |
| 463 | + GrpcCallSettings.<TestIamPermissionsRequest, TestIamPermissionsResponse>newBuilder() |
| 464 | + .setMethodDescriptor(testIamPermissionsMethodDescriptor) |
| 465 | + .setParamsExtractor( |
| 466 | + request -> { |
| 467 | + RequestParamsBuilder builder = RequestParamsBuilder.create(); |
| 468 | + builder.add("resource", String.valueOf(request.getResource())); |
| 469 | + return builder.build(); |
| 470 | + }) |
| 471 | + .build(); |
405 | 472 |
|
406 | 473 | this.listServicesCallable =
|
407 | 474 | callableFactory.createUnaryCallable(
|
@@ -499,6 +566,17 @@ protected GrpcServiceManagerStub(
|
499 | 566 | generateConfigReportTransportSettings,
|
500 | 567 | settings.generateConfigReportSettings(),
|
501 | 568 | clientContext);
|
| 569 | + this.setIamPolicyCallable = |
| 570 | + callableFactory.createUnaryCallable( |
| 571 | + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); |
| 572 | + this.getIamPolicyCallable = |
| 573 | + callableFactory.createUnaryCallable( |
| 574 | + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); |
| 575 | + this.testIamPermissionsCallable = |
| 576 | + callableFactory.createUnaryCallable( |
| 577 | + testIamPermissionsTransportSettings, |
| 578 | + settings.testIamPermissionsSettings(), |
| 579 | + clientContext); |
502 | 580 |
|
503 | 581 | this.backgroundResources =
|
504 | 582 | new BackgroundResourceAggregation(clientContext.getBackgroundResources());
|
@@ -623,6 +701,22 @@ public UnaryCallable<CreateServiceRolloutRequest, Operation> createServiceRollou
|
623 | 701 | return generateConfigReportCallable;
|
624 | 702 | }
|
625 | 703 |
|
| 704 | + @Override |
| 705 | + public UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() { |
| 706 | + return setIamPolicyCallable; |
| 707 | + } |
| 708 | + |
| 709 | + @Override |
| 710 | + public UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() { |
| 711 | + return getIamPolicyCallable; |
| 712 | + } |
| 713 | + |
| 714 | + @Override |
| 715 | + public UnaryCallable<TestIamPermissionsRequest, TestIamPermissionsResponse> |
| 716 | + testIamPermissionsCallable() { |
| 717 | + return testIamPermissionsCallable; |
| 718 | + } |
| 719 | + |
626 | 720 | @Override
|
627 | 721 | public final void close() {
|
628 | 722 | try {
|
|
0 commit comments