1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.google.cloud.orgpolicy.v2; 17 18 import static io.grpc.MethodDescriptor.generateFullMethodName; 19 20 /** 21 * 22 * 23 * <pre> 24 * An interface for managing organization policies. 25 * The Cloud Org Policy service provides a simple mechanism for organizations to 26 * restrict the allowed configurations across their entire Cloud Resource 27 * hierarchy. 28 * You can use a `policy` to configure restrictions in Cloud resources. For 29 * example, you can enforce a `policy` that restricts which Google 30 * Cloud Platform APIs can be activated in a certain part of your resource 31 * hierarchy, or prevents serial port access to VM instances in a particular 32 * folder. 33 * `Policies` are inherited down through the resource hierarchy. A `policy` 34 * applied to a parent resource automatically applies to all its child resources 35 * unless overridden with a `policy` lower in the hierarchy. 36 * A `constraint` defines an aspect of a resource's configuration that can be 37 * controlled by an organization's policy administrator. `Policies` are a 38 * collection of `constraints` that defines their allowable configuration on a 39 * particular resource and its child resources. 40 * </pre> 41 */ 42 @javax.annotation.Generated( 43 value = "by gRPC proto compiler", 44 comments = "Source: google/cloud/orgpolicy/v2/orgpolicy.proto") 45 @io.grpc.stub.annotations.GrpcGenerated 46 public final class OrgPolicyGrpc { 47 OrgPolicyGrpc()48 private OrgPolicyGrpc() {} 49 50 public static final String SERVICE_NAME = "google.cloud.orgpolicy.v2.OrgPolicy"; 51 52 // Static method descriptors that strictly reflect the proto. 53 private static volatile io.grpc.MethodDescriptor< 54 com.google.cloud.orgpolicy.v2.ListConstraintsRequest, 55 com.google.cloud.orgpolicy.v2.ListConstraintsResponse> 56 getListConstraintsMethod; 57 58 @io.grpc.stub.annotations.RpcMethod( 59 fullMethodName = SERVICE_NAME + '/' + "ListConstraints", 60 requestType = com.google.cloud.orgpolicy.v2.ListConstraintsRequest.class, 61 responseType = com.google.cloud.orgpolicy.v2.ListConstraintsResponse.class, 62 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 63 public static io.grpc.MethodDescriptor< 64 com.google.cloud.orgpolicy.v2.ListConstraintsRequest, 65 com.google.cloud.orgpolicy.v2.ListConstraintsResponse> getListConstraintsMethod()66 getListConstraintsMethod() { 67 io.grpc.MethodDescriptor< 68 com.google.cloud.orgpolicy.v2.ListConstraintsRequest, 69 com.google.cloud.orgpolicy.v2.ListConstraintsResponse> 70 getListConstraintsMethod; 71 if ((getListConstraintsMethod = OrgPolicyGrpc.getListConstraintsMethod) == null) { 72 synchronized (OrgPolicyGrpc.class) { 73 if ((getListConstraintsMethod = OrgPolicyGrpc.getListConstraintsMethod) == null) { 74 OrgPolicyGrpc.getListConstraintsMethod = 75 getListConstraintsMethod = 76 io.grpc.MethodDescriptor 77 .<com.google.cloud.orgpolicy.v2.ListConstraintsRequest, 78 com.google.cloud.orgpolicy.v2.ListConstraintsResponse> 79 newBuilder() 80 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 81 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListConstraints")) 82 .setSampledToLocalTracing(true) 83 .setRequestMarshaller( 84 io.grpc.protobuf.ProtoUtils.marshaller( 85 com.google.cloud.orgpolicy.v2.ListConstraintsRequest 86 .getDefaultInstance())) 87 .setResponseMarshaller( 88 io.grpc.protobuf.ProtoUtils.marshaller( 89 com.google.cloud.orgpolicy.v2.ListConstraintsResponse 90 .getDefaultInstance())) 91 .setSchemaDescriptor(new OrgPolicyMethodDescriptorSupplier("ListConstraints")) 92 .build(); 93 } 94 } 95 } 96 return getListConstraintsMethod; 97 } 98 99 private static volatile io.grpc.MethodDescriptor< 100 com.google.cloud.orgpolicy.v2.ListPoliciesRequest, 101 com.google.cloud.orgpolicy.v2.ListPoliciesResponse> 102 getListPoliciesMethod; 103 104 @io.grpc.stub.annotations.RpcMethod( 105 fullMethodName = SERVICE_NAME + '/' + "ListPolicies", 106 requestType = com.google.cloud.orgpolicy.v2.ListPoliciesRequest.class, 107 responseType = com.google.cloud.orgpolicy.v2.ListPoliciesResponse.class, 108 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 109 public static io.grpc.MethodDescriptor< 110 com.google.cloud.orgpolicy.v2.ListPoliciesRequest, 111 com.google.cloud.orgpolicy.v2.ListPoliciesResponse> getListPoliciesMethod()112 getListPoliciesMethod() { 113 io.grpc.MethodDescriptor< 114 com.google.cloud.orgpolicy.v2.ListPoliciesRequest, 115 com.google.cloud.orgpolicy.v2.ListPoliciesResponse> 116 getListPoliciesMethod; 117 if ((getListPoliciesMethod = OrgPolicyGrpc.getListPoliciesMethod) == null) { 118 synchronized (OrgPolicyGrpc.class) { 119 if ((getListPoliciesMethod = OrgPolicyGrpc.getListPoliciesMethod) == null) { 120 OrgPolicyGrpc.getListPoliciesMethod = 121 getListPoliciesMethod = 122 io.grpc.MethodDescriptor 123 .<com.google.cloud.orgpolicy.v2.ListPoliciesRequest, 124 com.google.cloud.orgpolicy.v2.ListPoliciesResponse> 125 newBuilder() 126 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 127 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListPolicies")) 128 .setSampledToLocalTracing(true) 129 .setRequestMarshaller( 130 io.grpc.protobuf.ProtoUtils.marshaller( 131 com.google.cloud.orgpolicy.v2.ListPoliciesRequest 132 .getDefaultInstance())) 133 .setResponseMarshaller( 134 io.grpc.protobuf.ProtoUtils.marshaller( 135 com.google.cloud.orgpolicy.v2.ListPoliciesResponse 136 .getDefaultInstance())) 137 .setSchemaDescriptor(new OrgPolicyMethodDescriptorSupplier("ListPolicies")) 138 .build(); 139 } 140 } 141 } 142 return getListPoliciesMethod; 143 } 144 145 private static volatile io.grpc.MethodDescriptor< 146 com.google.cloud.orgpolicy.v2.GetPolicyRequest, com.google.cloud.orgpolicy.v2.Policy> 147 getGetPolicyMethod; 148 149 @io.grpc.stub.annotations.RpcMethod( 150 fullMethodName = SERVICE_NAME + '/' + "GetPolicy", 151 requestType = com.google.cloud.orgpolicy.v2.GetPolicyRequest.class, 152 responseType = com.google.cloud.orgpolicy.v2.Policy.class, 153 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 154 public static io.grpc.MethodDescriptor< 155 com.google.cloud.orgpolicy.v2.GetPolicyRequest, com.google.cloud.orgpolicy.v2.Policy> getGetPolicyMethod()156 getGetPolicyMethod() { 157 io.grpc.MethodDescriptor< 158 com.google.cloud.orgpolicy.v2.GetPolicyRequest, com.google.cloud.orgpolicy.v2.Policy> 159 getGetPolicyMethod; 160 if ((getGetPolicyMethod = OrgPolicyGrpc.getGetPolicyMethod) == null) { 161 synchronized (OrgPolicyGrpc.class) { 162 if ((getGetPolicyMethod = OrgPolicyGrpc.getGetPolicyMethod) == null) { 163 OrgPolicyGrpc.getGetPolicyMethod = 164 getGetPolicyMethod = 165 io.grpc.MethodDescriptor 166 .<com.google.cloud.orgpolicy.v2.GetPolicyRequest, 167 com.google.cloud.orgpolicy.v2.Policy> 168 newBuilder() 169 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 170 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPolicy")) 171 .setSampledToLocalTracing(true) 172 .setRequestMarshaller( 173 io.grpc.protobuf.ProtoUtils.marshaller( 174 com.google.cloud.orgpolicy.v2.GetPolicyRequest.getDefaultInstance())) 175 .setResponseMarshaller( 176 io.grpc.protobuf.ProtoUtils.marshaller( 177 com.google.cloud.orgpolicy.v2.Policy.getDefaultInstance())) 178 .setSchemaDescriptor(new OrgPolicyMethodDescriptorSupplier("GetPolicy")) 179 .build(); 180 } 181 } 182 } 183 return getGetPolicyMethod; 184 } 185 186 private static volatile io.grpc.MethodDescriptor< 187 com.google.cloud.orgpolicy.v2.GetEffectivePolicyRequest, 188 com.google.cloud.orgpolicy.v2.Policy> 189 getGetEffectivePolicyMethod; 190 191 @io.grpc.stub.annotations.RpcMethod( 192 fullMethodName = SERVICE_NAME + '/' + "GetEffectivePolicy", 193 requestType = com.google.cloud.orgpolicy.v2.GetEffectivePolicyRequest.class, 194 responseType = com.google.cloud.orgpolicy.v2.Policy.class, 195 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 196 public static io.grpc.MethodDescriptor< 197 com.google.cloud.orgpolicy.v2.GetEffectivePolicyRequest, 198 com.google.cloud.orgpolicy.v2.Policy> getGetEffectivePolicyMethod()199 getGetEffectivePolicyMethod() { 200 io.grpc.MethodDescriptor< 201 com.google.cloud.orgpolicy.v2.GetEffectivePolicyRequest, 202 com.google.cloud.orgpolicy.v2.Policy> 203 getGetEffectivePolicyMethod; 204 if ((getGetEffectivePolicyMethod = OrgPolicyGrpc.getGetEffectivePolicyMethod) == null) { 205 synchronized (OrgPolicyGrpc.class) { 206 if ((getGetEffectivePolicyMethod = OrgPolicyGrpc.getGetEffectivePolicyMethod) == null) { 207 OrgPolicyGrpc.getGetEffectivePolicyMethod = 208 getGetEffectivePolicyMethod = 209 io.grpc.MethodDescriptor 210 .<com.google.cloud.orgpolicy.v2.GetEffectivePolicyRequest, 211 com.google.cloud.orgpolicy.v2.Policy> 212 newBuilder() 213 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 214 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetEffectivePolicy")) 215 .setSampledToLocalTracing(true) 216 .setRequestMarshaller( 217 io.grpc.protobuf.ProtoUtils.marshaller( 218 com.google.cloud.orgpolicy.v2.GetEffectivePolicyRequest 219 .getDefaultInstance())) 220 .setResponseMarshaller( 221 io.grpc.protobuf.ProtoUtils.marshaller( 222 com.google.cloud.orgpolicy.v2.Policy.getDefaultInstance())) 223 .setSchemaDescriptor( 224 new OrgPolicyMethodDescriptorSupplier("GetEffectivePolicy")) 225 .build(); 226 } 227 } 228 } 229 return getGetEffectivePolicyMethod; 230 } 231 232 private static volatile io.grpc.MethodDescriptor< 233 com.google.cloud.orgpolicy.v2.CreatePolicyRequest, com.google.cloud.orgpolicy.v2.Policy> 234 getCreatePolicyMethod; 235 236 @io.grpc.stub.annotations.RpcMethod( 237 fullMethodName = SERVICE_NAME + '/' + "CreatePolicy", 238 requestType = com.google.cloud.orgpolicy.v2.CreatePolicyRequest.class, 239 responseType = com.google.cloud.orgpolicy.v2.Policy.class, 240 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 241 public static io.grpc.MethodDescriptor< 242 com.google.cloud.orgpolicy.v2.CreatePolicyRequest, com.google.cloud.orgpolicy.v2.Policy> getCreatePolicyMethod()243 getCreatePolicyMethod() { 244 io.grpc.MethodDescriptor< 245 com.google.cloud.orgpolicy.v2.CreatePolicyRequest, com.google.cloud.orgpolicy.v2.Policy> 246 getCreatePolicyMethod; 247 if ((getCreatePolicyMethod = OrgPolicyGrpc.getCreatePolicyMethod) == null) { 248 synchronized (OrgPolicyGrpc.class) { 249 if ((getCreatePolicyMethod = OrgPolicyGrpc.getCreatePolicyMethod) == null) { 250 OrgPolicyGrpc.getCreatePolicyMethod = 251 getCreatePolicyMethod = 252 io.grpc.MethodDescriptor 253 .<com.google.cloud.orgpolicy.v2.CreatePolicyRequest, 254 com.google.cloud.orgpolicy.v2.Policy> 255 newBuilder() 256 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 257 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreatePolicy")) 258 .setSampledToLocalTracing(true) 259 .setRequestMarshaller( 260 io.grpc.protobuf.ProtoUtils.marshaller( 261 com.google.cloud.orgpolicy.v2.CreatePolicyRequest 262 .getDefaultInstance())) 263 .setResponseMarshaller( 264 io.grpc.protobuf.ProtoUtils.marshaller( 265 com.google.cloud.orgpolicy.v2.Policy.getDefaultInstance())) 266 .setSchemaDescriptor(new OrgPolicyMethodDescriptorSupplier("CreatePolicy")) 267 .build(); 268 } 269 } 270 } 271 return getCreatePolicyMethod; 272 } 273 274 private static volatile io.grpc.MethodDescriptor< 275 com.google.cloud.orgpolicy.v2.UpdatePolicyRequest, com.google.cloud.orgpolicy.v2.Policy> 276 getUpdatePolicyMethod; 277 278 @io.grpc.stub.annotations.RpcMethod( 279 fullMethodName = SERVICE_NAME + '/' + "UpdatePolicy", 280 requestType = com.google.cloud.orgpolicy.v2.UpdatePolicyRequest.class, 281 responseType = com.google.cloud.orgpolicy.v2.Policy.class, 282 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 283 public static io.grpc.MethodDescriptor< 284 com.google.cloud.orgpolicy.v2.UpdatePolicyRequest, com.google.cloud.orgpolicy.v2.Policy> getUpdatePolicyMethod()285 getUpdatePolicyMethod() { 286 io.grpc.MethodDescriptor< 287 com.google.cloud.orgpolicy.v2.UpdatePolicyRequest, com.google.cloud.orgpolicy.v2.Policy> 288 getUpdatePolicyMethod; 289 if ((getUpdatePolicyMethod = OrgPolicyGrpc.getUpdatePolicyMethod) == null) { 290 synchronized (OrgPolicyGrpc.class) { 291 if ((getUpdatePolicyMethod = OrgPolicyGrpc.getUpdatePolicyMethod) == null) { 292 OrgPolicyGrpc.getUpdatePolicyMethod = 293 getUpdatePolicyMethod = 294 io.grpc.MethodDescriptor 295 .<com.google.cloud.orgpolicy.v2.UpdatePolicyRequest, 296 com.google.cloud.orgpolicy.v2.Policy> 297 newBuilder() 298 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 299 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdatePolicy")) 300 .setSampledToLocalTracing(true) 301 .setRequestMarshaller( 302 io.grpc.protobuf.ProtoUtils.marshaller( 303 com.google.cloud.orgpolicy.v2.UpdatePolicyRequest 304 .getDefaultInstance())) 305 .setResponseMarshaller( 306 io.grpc.protobuf.ProtoUtils.marshaller( 307 com.google.cloud.orgpolicy.v2.Policy.getDefaultInstance())) 308 .setSchemaDescriptor(new OrgPolicyMethodDescriptorSupplier("UpdatePolicy")) 309 .build(); 310 } 311 } 312 } 313 return getUpdatePolicyMethod; 314 } 315 316 private static volatile io.grpc.MethodDescriptor< 317 com.google.cloud.orgpolicy.v2.DeletePolicyRequest, com.google.protobuf.Empty> 318 getDeletePolicyMethod; 319 320 @io.grpc.stub.annotations.RpcMethod( 321 fullMethodName = SERVICE_NAME + '/' + "DeletePolicy", 322 requestType = com.google.cloud.orgpolicy.v2.DeletePolicyRequest.class, 323 responseType = com.google.protobuf.Empty.class, 324 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 325 public static io.grpc.MethodDescriptor< 326 com.google.cloud.orgpolicy.v2.DeletePolicyRequest, com.google.protobuf.Empty> getDeletePolicyMethod()327 getDeletePolicyMethod() { 328 io.grpc.MethodDescriptor< 329 com.google.cloud.orgpolicy.v2.DeletePolicyRequest, com.google.protobuf.Empty> 330 getDeletePolicyMethod; 331 if ((getDeletePolicyMethod = OrgPolicyGrpc.getDeletePolicyMethod) == null) { 332 synchronized (OrgPolicyGrpc.class) { 333 if ((getDeletePolicyMethod = OrgPolicyGrpc.getDeletePolicyMethod) == null) { 334 OrgPolicyGrpc.getDeletePolicyMethod = 335 getDeletePolicyMethod = 336 io.grpc.MethodDescriptor 337 .<com.google.cloud.orgpolicy.v2.DeletePolicyRequest, 338 com.google.protobuf.Empty> 339 newBuilder() 340 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 341 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeletePolicy")) 342 .setSampledToLocalTracing(true) 343 .setRequestMarshaller( 344 io.grpc.protobuf.ProtoUtils.marshaller( 345 com.google.cloud.orgpolicy.v2.DeletePolicyRequest 346 .getDefaultInstance())) 347 .setResponseMarshaller( 348 io.grpc.protobuf.ProtoUtils.marshaller( 349 com.google.protobuf.Empty.getDefaultInstance())) 350 .setSchemaDescriptor(new OrgPolicyMethodDescriptorSupplier("DeletePolicy")) 351 .build(); 352 } 353 } 354 } 355 return getDeletePolicyMethod; 356 } 357 358 /** Creates a new async stub that supports all call types for the service */ newStub(io.grpc.Channel channel)359 public static OrgPolicyStub newStub(io.grpc.Channel channel) { 360 io.grpc.stub.AbstractStub.StubFactory<OrgPolicyStub> factory = 361 new io.grpc.stub.AbstractStub.StubFactory<OrgPolicyStub>() { 362 @java.lang.Override 363 public OrgPolicyStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 364 return new OrgPolicyStub(channel, callOptions); 365 } 366 }; 367 return OrgPolicyStub.newStub(factory, channel); 368 } 369 370 /** 371 * Creates a new blocking-style stub that supports unary and streaming output calls on the service 372 */ newBlockingStub(io.grpc.Channel channel)373 public static OrgPolicyBlockingStub newBlockingStub(io.grpc.Channel channel) { 374 io.grpc.stub.AbstractStub.StubFactory<OrgPolicyBlockingStub> factory = 375 new io.grpc.stub.AbstractStub.StubFactory<OrgPolicyBlockingStub>() { 376 @java.lang.Override 377 public OrgPolicyBlockingStub newStub( 378 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 379 return new OrgPolicyBlockingStub(channel, callOptions); 380 } 381 }; 382 return OrgPolicyBlockingStub.newStub(factory, channel); 383 } 384 385 /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ newFutureStub(io.grpc.Channel channel)386 public static OrgPolicyFutureStub newFutureStub(io.grpc.Channel channel) { 387 io.grpc.stub.AbstractStub.StubFactory<OrgPolicyFutureStub> factory = 388 new io.grpc.stub.AbstractStub.StubFactory<OrgPolicyFutureStub>() { 389 @java.lang.Override 390 public OrgPolicyFutureStub newStub( 391 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 392 return new OrgPolicyFutureStub(channel, callOptions); 393 } 394 }; 395 return OrgPolicyFutureStub.newStub(factory, channel); 396 } 397 398 /** 399 * 400 * 401 * <pre> 402 * An interface for managing organization policies. 403 * The Cloud Org Policy service provides a simple mechanism for organizations to 404 * restrict the allowed configurations across their entire Cloud Resource 405 * hierarchy. 406 * You can use a `policy` to configure restrictions in Cloud resources. For 407 * example, you can enforce a `policy` that restricts which Google 408 * Cloud Platform APIs can be activated in a certain part of your resource 409 * hierarchy, or prevents serial port access to VM instances in a particular 410 * folder. 411 * `Policies` are inherited down through the resource hierarchy. A `policy` 412 * applied to a parent resource automatically applies to all its child resources 413 * unless overridden with a `policy` lower in the hierarchy. 414 * A `constraint` defines an aspect of a resource's configuration that can be 415 * controlled by an organization's policy administrator. `Policies` are a 416 * collection of `constraints` that defines their allowable configuration on a 417 * particular resource and its child resources. 418 * </pre> 419 */ 420 public interface AsyncService { 421 422 /** 423 * 424 * 425 * <pre> 426 * Lists `Constraints` that could be applied on the specified resource. 427 * </pre> 428 */ listConstraints( com.google.cloud.orgpolicy.v2.ListConstraintsRequest request, io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.ListConstraintsResponse> responseObserver)429 default void listConstraints( 430 com.google.cloud.orgpolicy.v2.ListConstraintsRequest request, 431 io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.ListConstraintsResponse> 432 responseObserver) { 433 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 434 getListConstraintsMethod(), responseObserver); 435 } 436 437 /** 438 * 439 * 440 * <pre> 441 * Retrieves all of the `Policies` that exist on a particular resource. 442 * </pre> 443 */ listPolicies( com.google.cloud.orgpolicy.v2.ListPoliciesRequest request, io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.ListPoliciesResponse> responseObserver)444 default void listPolicies( 445 com.google.cloud.orgpolicy.v2.ListPoliciesRequest request, 446 io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.ListPoliciesResponse> 447 responseObserver) { 448 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 449 getListPoliciesMethod(), responseObserver); 450 } 451 452 /** 453 * 454 * 455 * <pre> 456 * Gets a `Policy` on a resource. 457 * If no `Policy` is set on the resource, NOT_FOUND is returned. The 458 * `etag` value can be used with `UpdatePolicy()` to update a 459 * `Policy` during read-modify-write. 460 * </pre> 461 */ getPolicy( com.google.cloud.orgpolicy.v2.GetPolicyRequest request, io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.Policy> responseObserver)462 default void getPolicy( 463 com.google.cloud.orgpolicy.v2.GetPolicyRequest request, 464 io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.Policy> responseObserver) { 465 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPolicyMethod(), responseObserver); 466 } 467 468 /** 469 * 470 * 471 * <pre> 472 * Gets the effective `Policy` on a resource. This is the result of merging 473 * `Policies` in the resource hierarchy and evaluating conditions. The 474 * returned `Policy` will not have an `etag` or `condition` set because it is 475 * a computed `Policy` across multiple resources. 476 * Subtrees of Resource Manager resource hierarchy with 'under:' prefix will 477 * not be expanded. 478 * </pre> 479 */ getEffectivePolicy( com.google.cloud.orgpolicy.v2.GetEffectivePolicyRequest request, io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.Policy> responseObserver)480 default void getEffectivePolicy( 481 com.google.cloud.orgpolicy.v2.GetEffectivePolicyRequest request, 482 io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.Policy> responseObserver) { 483 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 484 getGetEffectivePolicyMethod(), responseObserver); 485 } 486 487 /** 488 * 489 * 490 * <pre> 491 * Creates a Policy. 492 * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the 493 * constraint does not exist. 494 * Returns a `google.rpc.Status` with `google.rpc.Code.ALREADY_EXISTS` if the 495 * policy already exists on the given Cloud resource. 496 * </pre> 497 */ createPolicy( com.google.cloud.orgpolicy.v2.CreatePolicyRequest request, io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.Policy> responseObserver)498 default void createPolicy( 499 com.google.cloud.orgpolicy.v2.CreatePolicyRequest request, 500 io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.Policy> responseObserver) { 501 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 502 getCreatePolicyMethod(), responseObserver); 503 } 504 505 /** 506 * 507 * 508 * <pre> 509 * Updates a Policy. 510 * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the 511 * constraint or the policy do not exist. 512 * Returns a `google.rpc.Status` with `google.rpc.Code.ABORTED` if the etag 513 * supplied in the request does not match the persisted etag of the policy 514 * Note: the supplied policy will perform a full overwrite of all 515 * fields. 516 * </pre> 517 */ updatePolicy( com.google.cloud.orgpolicy.v2.UpdatePolicyRequest request, io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.Policy> responseObserver)518 default void updatePolicy( 519 com.google.cloud.orgpolicy.v2.UpdatePolicyRequest request, 520 io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.Policy> responseObserver) { 521 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 522 getUpdatePolicyMethod(), responseObserver); 523 } 524 525 /** 526 * 527 * 528 * <pre> 529 * Deletes a Policy. 530 * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the 531 * constraint or Org Policy does not exist. 532 * </pre> 533 */ deletePolicy( com.google.cloud.orgpolicy.v2.DeletePolicyRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver)534 default void deletePolicy( 535 com.google.cloud.orgpolicy.v2.DeletePolicyRequest request, 536 io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) { 537 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 538 getDeletePolicyMethod(), responseObserver); 539 } 540 } 541 542 /** 543 * Base class for the server implementation of the service OrgPolicy. 544 * 545 * <pre> 546 * An interface for managing organization policies. 547 * The Cloud Org Policy service provides a simple mechanism for organizations to 548 * restrict the allowed configurations across their entire Cloud Resource 549 * hierarchy. 550 * You can use a `policy` to configure restrictions in Cloud resources. For 551 * example, you can enforce a `policy` that restricts which Google 552 * Cloud Platform APIs can be activated in a certain part of your resource 553 * hierarchy, or prevents serial port access to VM instances in a particular 554 * folder. 555 * `Policies` are inherited down through the resource hierarchy. A `policy` 556 * applied to a parent resource automatically applies to all its child resources 557 * unless overridden with a `policy` lower in the hierarchy. 558 * A `constraint` defines an aspect of a resource's configuration that can be 559 * controlled by an organization's policy administrator. `Policies` are a 560 * collection of `constraints` that defines their allowable configuration on a 561 * particular resource and its child resources. 562 * </pre> 563 */ 564 public abstract static class OrgPolicyImplBase implements io.grpc.BindableService, AsyncService { 565 566 @java.lang.Override bindService()567 public final io.grpc.ServerServiceDefinition bindService() { 568 return OrgPolicyGrpc.bindService(this); 569 } 570 } 571 572 /** 573 * A stub to allow clients to do asynchronous rpc calls to service OrgPolicy. 574 * 575 * <pre> 576 * An interface for managing organization policies. 577 * The Cloud Org Policy service provides a simple mechanism for organizations to 578 * restrict the allowed configurations across their entire Cloud Resource 579 * hierarchy. 580 * You can use a `policy` to configure restrictions in Cloud resources. For 581 * example, you can enforce a `policy` that restricts which Google 582 * Cloud Platform APIs can be activated in a certain part of your resource 583 * hierarchy, or prevents serial port access to VM instances in a particular 584 * folder. 585 * `Policies` are inherited down through the resource hierarchy. A `policy` 586 * applied to a parent resource automatically applies to all its child resources 587 * unless overridden with a `policy` lower in the hierarchy. 588 * A `constraint` defines an aspect of a resource's configuration that can be 589 * controlled by an organization's policy administrator. `Policies` are a 590 * collection of `constraints` that defines their allowable configuration on a 591 * particular resource and its child resources. 592 * </pre> 593 */ 594 public static final class OrgPolicyStub extends io.grpc.stub.AbstractAsyncStub<OrgPolicyStub> { OrgPolicyStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)595 private OrgPolicyStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 596 super(channel, callOptions); 597 } 598 599 @java.lang.Override build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)600 protected OrgPolicyStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 601 return new OrgPolicyStub(channel, callOptions); 602 } 603 604 /** 605 * 606 * 607 * <pre> 608 * Lists `Constraints` that could be applied on the specified resource. 609 * </pre> 610 */ listConstraints( com.google.cloud.orgpolicy.v2.ListConstraintsRequest request, io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.ListConstraintsResponse> responseObserver)611 public void listConstraints( 612 com.google.cloud.orgpolicy.v2.ListConstraintsRequest request, 613 io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.ListConstraintsResponse> 614 responseObserver) { 615 io.grpc.stub.ClientCalls.asyncUnaryCall( 616 getChannel().newCall(getListConstraintsMethod(), getCallOptions()), 617 request, 618 responseObserver); 619 } 620 621 /** 622 * 623 * 624 * <pre> 625 * Retrieves all of the `Policies` that exist on a particular resource. 626 * </pre> 627 */ listPolicies( com.google.cloud.orgpolicy.v2.ListPoliciesRequest request, io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.ListPoliciesResponse> responseObserver)628 public void listPolicies( 629 com.google.cloud.orgpolicy.v2.ListPoliciesRequest request, 630 io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.ListPoliciesResponse> 631 responseObserver) { 632 io.grpc.stub.ClientCalls.asyncUnaryCall( 633 getChannel().newCall(getListPoliciesMethod(), getCallOptions()), 634 request, 635 responseObserver); 636 } 637 638 /** 639 * 640 * 641 * <pre> 642 * Gets a `Policy` on a resource. 643 * If no `Policy` is set on the resource, NOT_FOUND is returned. The 644 * `etag` value can be used with `UpdatePolicy()` to update a 645 * `Policy` during read-modify-write. 646 * </pre> 647 */ getPolicy( com.google.cloud.orgpolicy.v2.GetPolicyRequest request, io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.Policy> responseObserver)648 public void getPolicy( 649 com.google.cloud.orgpolicy.v2.GetPolicyRequest request, 650 io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.Policy> responseObserver) { 651 io.grpc.stub.ClientCalls.asyncUnaryCall( 652 getChannel().newCall(getGetPolicyMethod(), getCallOptions()), request, responseObserver); 653 } 654 655 /** 656 * 657 * 658 * <pre> 659 * Gets the effective `Policy` on a resource. This is the result of merging 660 * `Policies` in the resource hierarchy and evaluating conditions. The 661 * returned `Policy` will not have an `etag` or `condition` set because it is 662 * a computed `Policy` across multiple resources. 663 * Subtrees of Resource Manager resource hierarchy with 'under:' prefix will 664 * not be expanded. 665 * </pre> 666 */ getEffectivePolicy( com.google.cloud.orgpolicy.v2.GetEffectivePolicyRequest request, io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.Policy> responseObserver)667 public void getEffectivePolicy( 668 com.google.cloud.orgpolicy.v2.GetEffectivePolicyRequest request, 669 io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.Policy> responseObserver) { 670 io.grpc.stub.ClientCalls.asyncUnaryCall( 671 getChannel().newCall(getGetEffectivePolicyMethod(), getCallOptions()), 672 request, 673 responseObserver); 674 } 675 676 /** 677 * 678 * 679 * <pre> 680 * Creates a Policy. 681 * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the 682 * constraint does not exist. 683 * Returns a `google.rpc.Status` with `google.rpc.Code.ALREADY_EXISTS` if the 684 * policy already exists on the given Cloud resource. 685 * </pre> 686 */ createPolicy( com.google.cloud.orgpolicy.v2.CreatePolicyRequest request, io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.Policy> responseObserver)687 public void createPolicy( 688 com.google.cloud.orgpolicy.v2.CreatePolicyRequest request, 689 io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.Policy> responseObserver) { 690 io.grpc.stub.ClientCalls.asyncUnaryCall( 691 getChannel().newCall(getCreatePolicyMethod(), getCallOptions()), 692 request, 693 responseObserver); 694 } 695 696 /** 697 * 698 * 699 * <pre> 700 * Updates a Policy. 701 * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the 702 * constraint or the policy do not exist. 703 * Returns a `google.rpc.Status` with `google.rpc.Code.ABORTED` if the etag 704 * supplied in the request does not match the persisted etag of the policy 705 * Note: the supplied policy will perform a full overwrite of all 706 * fields. 707 * </pre> 708 */ updatePolicy( com.google.cloud.orgpolicy.v2.UpdatePolicyRequest request, io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.Policy> responseObserver)709 public void updatePolicy( 710 com.google.cloud.orgpolicy.v2.UpdatePolicyRequest request, 711 io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.Policy> responseObserver) { 712 io.grpc.stub.ClientCalls.asyncUnaryCall( 713 getChannel().newCall(getUpdatePolicyMethod(), getCallOptions()), 714 request, 715 responseObserver); 716 } 717 718 /** 719 * 720 * 721 * <pre> 722 * Deletes a Policy. 723 * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the 724 * constraint or Org Policy does not exist. 725 * </pre> 726 */ deletePolicy( com.google.cloud.orgpolicy.v2.DeletePolicyRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver)727 public void deletePolicy( 728 com.google.cloud.orgpolicy.v2.DeletePolicyRequest request, 729 io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) { 730 io.grpc.stub.ClientCalls.asyncUnaryCall( 731 getChannel().newCall(getDeletePolicyMethod(), getCallOptions()), 732 request, 733 responseObserver); 734 } 735 } 736 737 /** 738 * A stub to allow clients to do synchronous rpc calls to service OrgPolicy. 739 * 740 * <pre> 741 * An interface for managing organization policies. 742 * The Cloud Org Policy service provides a simple mechanism for organizations to 743 * restrict the allowed configurations across their entire Cloud Resource 744 * hierarchy. 745 * You can use a `policy` to configure restrictions in Cloud resources. For 746 * example, you can enforce a `policy` that restricts which Google 747 * Cloud Platform APIs can be activated in a certain part of your resource 748 * hierarchy, or prevents serial port access to VM instances in a particular 749 * folder. 750 * `Policies` are inherited down through the resource hierarchy. A `policy` 751 * applied to a parent resource automatically applies to all its child resources 752 * unless overridden with a `policy` lower in the hierarchy. 753 * A `constraint` defines an aspect of a resource's configuration that can be 754 * controlled by an organization's policy administrator. `Policies` are a 755 * collection of `constraints` that defines their allowable configuration on a 756 * particular resource and its child resources. 757 * </pre> 758 */ 759 public static final class OrgPolicyBlockingStub 760 extends io.grpc.stub.AbstractBlockingStub<OrgPolicyBlockingStub> { OrgPolicyBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)761 private OrgPolicyBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 762 super(channel, callOptions); 763 } 764 765 @java.lang.Override build( io.grpc.Channel channel, io.grpc.CallOptions callOptions)766 protected OrgPolicyBlockingStub build( 767 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 768 return new OrgPolicyBlockingStub(channel, callOptions); 769 } 770 771 /** 772 * 773 * 774 * <pre> 775 * Lists `Constraints` that could be applied on the specified resource. 776 * </pre> 777 */ listConstraints( com.google.cloud.orgpolicy.v2.ListConstraintsRequest request)778 public com.google.cloud.orgpolicy.v2.ListConstraintsResponse listConstraints( 779 com.google.cloud.orgpolicy.v2.ListConstraintsRequest request) { 780 return io.grpc.stub.ClientCalls.blockingUnaryCall( 781 getChannel(), getListConstraintsMethod(), getCallOptions(), request); 782 } 783 784 /** 785 * 786 * 787 * <pre> 788 * Retrieves all of the `Policies` that exist on a particular resource. 789 * </pre> 790 */ listPolicies( com.google.cloud.orgpolicy.v2.ListPoliciesRequest request)791 public com.google.cloud.orgpolicy.v2.ListPoliciesResponse listPolicies( 792 com.google.cloud.orgpolicy.v2.ListPoliciesRequest request) { 793 return io.grpc.stub.ClientCalls.blockingUnaryCall( 794 getChannel(), getListPoliciesMethod(), getCallOptions(), request); 795 } 796 797 /** 798 * 799 * 800 * <pre> 801 * Gets a `Policy` on a resource. 802 * If no `Policy` is set on the resource, NOT_FOUND is returned. The 803 * `etag` value can be used with `UpdatePolicy()` to update a 804 * `Policy` during read-modify-write. 805 * </pre> 806 */ getPolicy( com.google.cloud.orgpolicy.v2.GetPolicyRequest request)807 public com.google.cloud.orgpolicy.v2.Policy getPolicy( 808 com.google.cloud.orgpolicy.v2.GetPolicyRequest request) { 809 return io.grpc.stub.ClientCalls.blockingUnaryCall( 810 getChannel(), getGetPolicyMethod(), getCallOptions(), request); 811 } 812 813 /** 814 * 815 * 816 * <pre> 817 * Gets the effective `Policy` on a resource. This is the result of merging 818 * `Policies` in the resource hierarchy and evaluating conditions. The 819 * returned `Policy` will not have an `etag` or `condition` set because it is 820 * a computed `Policy` across multiple resources. 821 * Subtrees of Resource Manager resource hierarchy with 'under:' prefix will 822 * not be expanded. 823 * </pre> 824 */ getEffectivePolicy( com.google.cloud.orgpolicy.v2.GetEffectivePolicyRequest request)825 public com.google.cloud.orgpolicy.v2.Policy getEffectivePolicy( 826 com.google.cloud.orgpolicy.v2.GetEffectivePolicyRequest request) { 827 return io.grpc.stub.ClientCalls.blockingUnaryCall( 828 getChannel(), getGetEffectivePolicyMethod(), getCallOptions(), request); 829 } 830 831 /** 832 * 833 * 834 * <pre> 835 * Creates a Policy. 836 * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the 837 * constraint does not exist. 838 * Returns a `google.rpc.Status` with `google.rpc.Code.ALREADY_EXISTS` if the 839 * policy already exists on the given Cloud resource. 840 * </pre> 841 */ createPolicy( com.google.cloud.orgpolicy.v2.CreatePolicyRequest request)842 public com.google.cloud.orgpolicy.v2.Policy createPolicy( 843 com.google.cloud.orgpolicy.v2.CreatePolicyRequest request) { 844 return io.grpc.stub.ClientCalls.blockingUnaryCall( 845 getChannel(), getCreatePolicyMethod(), getCallOptions(), request); 846 } 847 848 /** 849 * 850 * 851 * <pre> 852 * Updates a Policy. 853 * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the 854 * constraint or the policy do not exist. 855 * Returns a `google.rpc.Status` with `google.rpc.Code.ABORTED` if the etag 856 * supplied in the request does not match the persisted etag of the policy 857 * Note: the supplied policy will perform a full overwrite of all 858 * fields. 859 * </pre> 860 */ updatePolicy( com.google.cloud.orgpolicy.v2.UpdatePolicyRequest request)861 public com.google.cloud.orgpolicy.v2.Policy updatePolicy( 862 com.google.cloud.orgpolicy.v2.UpdatePolicyRequest request) { 863 return io.grpc.stub.ClientCalls.blockingUnaryCall( 864 getChannel(), getUpdatePolicyMethod(), getCallOptions(), request); 865 } 866 867 /** 868 * 869 * 870 * <pre> 871 * Deletes a Policy. 872 * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the 873 * constraint or Org Policy does not exist. 874 * </pre> 875 */ deletePolicy( com.google.cloud.orgpolicy.v2.DeletePolicyRequest request)876 public com.google.protobuf.Empty deletePolicy( 877 com.google.cloud.orgpolicy.v2.DeletePolicyRequest request) { 878 return io.grpc.stub.ClientCalls.blockingUnaryCall( 879 getChannel(), getDeletePolicyMethod(), getCallOptions(), request); 880 } 881 } 882 883 /** 884 * A stub to allow clients to do ListenableFuture-style rpc calls to service OrgPolicy. 885 * 886 * <pre> 887 * An interface for managing organization policies. 888 * The Cloud Org Policy service provides a simple mechanism for organizations to 889 * restrict the allowed configurations across their entire Cloud Resource 890 * hierarchy. 891 * You can use a `policy` to configure restrictions in Cloud resources. For 892 * example, you can enforce a `policy` that restricts which Google 893 * Cloud Platform APIs can be activated in a certain part of your resource 894 * hierarchy, or prevents serial port access to VM instances in a particular 895 * folder. 896 * `Policies` are inherited down through the resource hierarchy. A `policy` 897 * applied to a parent resource automatically applies to all its child resources 898 * unless overridden with a `policy` lower in the hierarchy. 899 * A `constraint` defines an aspect of a resource's configuration that can be 900 * controlled by an organization's policy administrator. `Policies` are a 901 * collection of `constraints` that defines their allowable configuration on a 902 * particular resource and its child resources. 903 * </pre> 904 */ 905 public static final class OrgPolicyFutureStub 906 extends io.grpc.stub.AbstractFutureStub<OrgPolicyFutureStub> { OrgPolicyFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)907 private OrgPolicyFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 908 super(channel, callOptions); 909 } 910 911 @java.lang.Override build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)912 protected OrgPolicyFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 913 return new OrgPolicyFutureStub(channel, callOptions); 914 } 915 916 /** 917 * 918 * 919 * <pre> 920 * Lists `Constraints` that could be applied on the specified resource. 921 * </pre> 922 */ 923 public com.google.common.util.concurrent.ListenableFuture< 924 com.google.cloud.orgpolicy.v2.ListConstraintsResponse> listConstraints(com.google.cloud.orgpolicy.v2.ListConstraintsRequest request)925 listConstraints(com.google.cloud.orgpolicy.v2.ListConstraintsRequest request) { 926 return io.grpc.stub.ClientCalls.futureUnaryCall( 927 getChannel().newCall(getListConstraintsMethod(), getCallOptions()), request); 928 } 929 930 /** 931 * 932 * 933 * <pre> 934 * Retrieves all of the `Policies` that exist on a particular resource. 935 * </pre> 936 */ 937 public com.google.common.util.concurrent.ListenableFuture< 938 com.google.cloud.orgpolicy.v2.ListPoliciesResponse> listPolicies(com.google.cloud.orgpolicy.v2.ListPoliciesRequest request)939 listPolicies(com.google.cloud.orgpolicy.v2.ListPoliciesRequest request) { 940 return io.grpc.stub.ClientCalls.futureUnaryCall( 941 getChannel().newCall(getListPoliciesMethod(), getCallOptions()), request); 942 } 943 944 /** 945 * 946 * 947 * <pre> 948 * Gets a `Policy` on a resource. 949 * If no `Policy` is set on the resource, NOT_FOUND is returned. The 950 * `etag` value can be used with `UpdatePolicy()` to update a 951 * `Policy` during read-modify-write. 952 * </pre> 953 */ 954 public com.google.common.util.concurrent.ListenableFuture<com.google.cloud.orgpolicy.v2.Policy> getPolicy(com.google.cloud.orgpolicy.v2.GetPolicyRequest request)955 getPolicy(com.google.cloud.orgpolicy.v2.GetPolicyRequest request) { 956 return io.grpc.stub.ClientCalls.futureUnaryCall( 957 getChannel().newCall(getGetPolicyMethod(), getCallOptions()), request); 958 } 959 960 /** 961 * 962 * 963 * <pre> 964 * Gets the effective `Policy` on a resource. This is the result of merging 965 * `Policies` in the resource hierarchy and evaluating conditions. The 966 * returned `Policy` will not have an `etag` or `condition` set because it is 967 * a computed `Policy` across multiple resources. 968 * Subtrees of Resource Manager resource hierarchy with 'under:' prefix will 969 * not be expanded. 970 * </pre> 971 */ 972 public com.google.common.util.concurrent.ListenableFuture<com.google.cloud.orgpolicy.v2.Policy> getEffectivePolicy(com.google.cloud.orgpolicy.v2.GetEffectivePolicyRequest request)973 getEffectivePolicy(com.google.cloud.orgpolicy.v2.GetEffectivePolicyRequest request) { 974 return io.grpc.stub.ClientCalls.futureUnaryCall( 975 getChannel().newCall(getGetEffectivePolicyMethod(), getCallOptions()), request); 976 } 977 978 /** 979 * 980 * 981 * <pre> 982 * Creates a Policy. 983 * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the 984 * constraint does not exist. 985 * Returns a `google.rpc.Status` with `google.rpc.Code.ALREADY_EXISTS` if the 986 * policy already exists on the given Cloud resource. 987 * </pre> 988 */ 989 public com.google.common.util.concurrent.ListenableFuture<com.google.cloud.orgpolicy.v2.Policy> createPolicy(com.google.cloud.orgpolicy.v2.CreatePolicyRequest request)990 createPolicy(com.google.cloud.orgpolicy.v2.CreatePolicyRequest request) { 991 return io.grpc.stub.ClientCalls.futureUnaryCall( 992 getChannel().newCall(getCreatePolicyMethod(), getCallOptions()), request); 993 } 994 995 /** 996 * 997 * 998 * <pre> 999 * Updates a Policy. 1000 * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the 1001 * constraint or the policy do not exist. 1002 * Returns a `google.rpc.Status` with `google.rpc.Code.ABORTED` if the etag 1003 * supplied in the request does not match the persisted etag of the policy 1004 * Note: the supplied policy will perform a full overwrite of all 1005 * fields. 1006 * </pre> 1007 */ 1008 public com.google.common.util.concurrent.ListenableFuture<com.google.cloud.orgpolicy.v2.Policy> updatePolicy(com.google.cloud.orgpolicy.v2.UpdatePolicyRequest request)1009 updatePolicy(com.google.cloud.orgpolicy.v2.UpdatePolicyRequest request) { 1010 return io.grpc.stub.ClientCalls.futureUnaryCall( 1011 getChannel().newCall(getUpdatePolicyMethod(), getCallOptions()), request); 1012 } 1013 1014 /** 1015 * 1016 * 1017 * <pre> 1018 * Deletes a Policy. 1019 * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the 1020 * constraint or Org Policy does not exist. 1021 * </pre> 1022 */ 1023 public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> deletePolicy(com.google.cloud.orgpolicy.v2.DeletePolicyRequest request)1024 deletePolicy(com.google.cloud.orgpolicy.v2.DeletePolicyRequest request) { 1025 return io.grpc.stub.ClientCalls.futureUnaryCall( 1026 getChannel().newCall(getDeletePolicyMethod(), getCallOptions()), request); 1027 } 1028 } 1029 1030 private static final int METHODID_LIST_CONSTRAINTS = 0; 1031 private static final int METHODID_LIST_POLICIES = 1; 1032 private static final int METHODID_GET_POLICY = 2; 1033 private static final int METHODID_GET_EFFECTIVE_POLICY = 3; 1034 private static final int METHODID_CREATE_POLICY = 4; 1035 private static final int METHODID_UPDATE_POLICY = 5; 1036 private static final int METHODID_DELETE_POLICY = 6; 1037 1038 private static final class MethodHandlers<Req, Resp> 1039 implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, 1040 io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, 1041 io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, 1042 io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { 1043 private final AsyncService serviceImpl; 1044 private final int methodId; 1045 MethodHandlers(AsyncService serviceImpl, int methodId)1046 MethodHandlers(AsyncService serviceImpl, int methodId) { 1047 this.serviceImpl = serviceImpl; 1048 this.methodId = methodId; 1049 } 1050 1051 @java.lang.Override 1052 @java.lang.SuppressWarnings("unchecked") invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver)1053 public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { 1054 switch (methodId) { 1055 case METHODID_LIST_CONSTRAINTS: 1056 serviceImpl.listConstraints( 1057 (com.google.cloud.orgpolicy.v2.ListConstraintsRequest) request, 1058 (io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.ListConstraintsResponse>) 1059 responseObserver); 1060 break; 1061 case METHODID_LIST_POLICIES: 1062 serviceImpl.listPolicies( 1063 (com.google.cloud.orgpolicy.v2.ListPoliciesRequest) request, 1064 (io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.ListPoliciesResponse>) 1065 responseObserver); 1066 break; 1067 case METHODID_GET_POLICY: 1068 serviceImpl.getPolicy( 1069 (com.google.cloud.orgpolicy.v2.GetPolicyRequest) request, 1070 (io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.Policy>) responseObserver); 1071 break; 1072 case METHODID_GET_EFFECTIVE_POLICY: 1073 serviceImpl.getEffectivePolicy( 1074 (com.google.cloud.orgpolicy.v2.GetEffectivePolicyRequest) request, 1075 (io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.Policy>) responseObserver); 1076 break; 1077 case METHODID_CREATE_POLICY: 1078 serviceImpl.createPolicy( 1079 (com.google.cloud.orgpolicy.v2.CreatePolicyRequest) request, 1080 (io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.Policy>) responseObserver); 1081 break; 1082 case METHODID_UPDATE_POLICY: 1083 serviceImpl.updatePolicy( 1084 (com.google.cloud.orgpolicy.v2.UpdatePolicyRequest) request, 1085 (io.grpc.stub.StreamObserver<com.google.cloud.orgpolicy.v2.Policy>) responseObserver); 1086 break; 1087 case METHODID_DELETE_POLICY: 1088 serviceImpl.deletePolicy( 1089 (com.google.cloud.orgpolicy.v2.DeletePolicyRequest) request, 1090 (io.grpc.stub.StreamObserver<com.google.protobuf.Empty>) responseObserver); 1091 break; 1092 default: 1093 throw new AssertionError(); 1094 } 1095 } 1096 1097 @java.lang.Override 1098 @java.lang.SuppressWarnings("unchecked") invoke( io.grpc.stub.StreamObserver<Resp> responseObserver)1099 public io.grpc.stub.StreamObserver<Req> invoke( 1100 io.grpc.stub.StreamObserver<Resp> responseObserver) { 1101 switch (methodId) { 1102 default: 1103 throw new AssertionError(); 1104 } 1105 } 1106 } 1107 bindService(AsyncService service)1108 public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { 1109 return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) 1110 .addMethod( 1111 getListConstraintsMethod(), 1112 io.grpc.stub.ServerCalls.asyncUnaryCall( 1113 new MethodHandlers< 1114 com.google.cloud.orgpolicy.v2.ListConstraintsRequest, 1115 com.google.cloud.orgpolicy.v2.ListConstraintsResponse>( 1116 service, METHODID_LIST_CONSTRAINTS))) 1117 .addMethod( 1118 getListPoliciesMethod(), 1119 io.grpc.stub.ServerCalls.asyncUnaryCall( 1120 new MethodHandlers< 1121 com.google.cloud.orgpolicy.v2.ListPoliciesRequest, 1122 com.google.cloud.orgpolicy.v2.ListPoliciesResponse>( 1123 service, METHODID_LIST_POLICIES))) 1124 .addMethod( 1125 getGetPolicyMethod(), 1126 io.grpc.stub.ServerCalls.asyncUnaryCall( 1127 new MethodHandlers< 1128 com.google.cloud.orgpolicy.v2.GetPolicyRequest, 1129 com.google.cloud.orgpolicy.v2.Policy>(service, METHODID_GET_POLICY))) 1130 .addMethod( 1131 getGetEffectivePolicyMethod(), 1132 io.grpc.stub.ServerCalls.asyncUnaryCall( 1133 new MethodHandlers< 1134 com.google.cloud.orgpolicy.v2.GetEffectivePolicyRequest, 1135 com.google.cloud.orgpolicy.v2.Policy>(service, METHODID_GET_EFFECTIVE_POLICY))) 1136 .addMethod( 1137 getCreatePolicyMethod(), 1138 io.grpc.stub.ServerCalls.asyncUnaryCall( 1139 new MethodHandlers< 1140 com.google.cloud.orgpolicy.v2.CreatePolicyRequest, 1141 com.google.cloud.orgpolicy.v2.Policy>(service, METHODID_CREATE_POLICY))) 1142 .addMethod( 1143 getUpdatePolicyMethod(), 1144 io.grpc.stub.ServerCalls.asyncUnaryCall( 1145 new MethodHandlers< 1146 com.google.cloud.orgpolicy.v2.UpdatePolicyRequest, 1147 com.google.cloud.orgpolicy.v2.Policy>(service, METHODID_UPDATE_POLICY))) 1148 .addMethod( 1149 getDeletePolicyMethod(), 1150 io.grpc.stub.ServerCalls.asyncUnaryCall( 1151 new MethodHandlers< 1152 com.google.cloud.orgpolicy.v2.DeletePolicyRequest, com.google.protobuf.Empty>( 1153 service, METHODID_DELETE_POLICY))) 1154 .build(); 1155 } 1156 1157 private abstract static class OrgPolicyBaseDescriptorSupplier 1158 implements io.grpc.protobuf.ProtoFileDescriptorSupplier, 1159 io.grpc.protobuf.ProtoServiceDescriptorSupplier { OrgPolicyBaseDescriptorSupplier()1160 OrgPolicyBaseDescriptorSupplier() {} 1161 1162 @java.lang.Override getFileDescriptor()1163 public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { 1164 return com.google.cloud.orgpolicy.v2.OrgPolicyProto.getDescriptor(); 1165 } 1166 1167 @java.lang.Override getServiceDescriptor()1168 public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { 1169 return getFileDescriptor().findServiceByName("OrgPolicy"); 1170 } 1171 } 1172 1173 private static final class OrgPolicyFileDescriptorSupplier 1174 extends OrgPolicyBaseDescriptorSupplier { OrgPolicyFileDescriptorSupplier()1175 OrgPolicyFileDescriptorSupplier() {} 1176 } 1177 1178 private static final class OrgPolicyMethodDescriptorSupplier 1179 extends OrgPolicyBaseDescriptorSupplier 1180 implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { 1181 private final String methodName; 1182 OrgPolicyMethodDescriptorSupplier(String methodName)1183 OrgPolicyMethodDescriptorSupplier(String methodName) { 1184 this.methodName = methodName; 1185 } 1186 1187 @java.lang.Override getMethodDescriptor()1188 public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { 1189 return getServiceDescriptor().findMethodByName(methodName); 1190 } 1191 } 1192 1193 private static volatile io.grpc.ServiceDescriptor serviceDescriptor; 1194 getServiceDescriptor()1195 public static io.grpc.ServiceDescriptor getServiceDescriptor() { 1196 io.grpc.ServiceDescriptor result = serviceDescriptor; 1197 if (result == null) { 1198 synchronized (OrgPolicyGrpc.class) { 1199 result = serviceDescriptor; 1200 if (result == null) { 1201 serviceDescriptor = 1202 result = 1203 io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) 1204 .setSchemaDescriptor(new OrgPolicyFileDescriptorSupplier()) 1205 .addMethod(getListConstraintsMethod()) 1206 .addMethod(getListPoliciesMethod()) 1207 .addMethod(getGetPolicyMethod()) 1208 .addMethod(getGetEffectivePolicyMethod()) 1209 .addMethod(getCreatePolicyMethod()) 1210 .addMethod(getUpdatePolicyMethod()) 1211 .addMethod(getDeletePolicyMethod()) 1212 .build(); 1213 } 1214 } 1215 } 1216 return result; 1217 } 1218 } 1219