1 /* 2 * Copyright 2022 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 17 package com.google.api.serviceusage.v1beta1; 18 19 import com.google.api.core.ApiFuture; 20 import com.google.api.core.ApiFutures; 21 import com.google.api.core.BetaApi; 22 import com.google.api.gax.core.BackgroundResource; 23 import com.google.api.gax.httpjson.longrunning.OperationsClient; 24 import com.google.api.gax.longrunning.OperationFuture; 25 import com.google.api.gax.paging.AbstractFixedSizeCollection; 26 import com.google.api.gax.paging.AbstractPage; 27 import com.google.api.gax.paging.AbstractPagedListResponse; 28 import com.google.api.gax.rpc.OperationCallable; 29 import com.google.api.gax.rpc.PageContext; 30 import com.google.api.gax.rpc.UnaryCallable; 31 import com.google.api.serviceusage.v1beta1.stub.ServiceUsageStub; 32 import com.google.api.serviceusage.v1beta1.stub.ServiceUsageStubSettings; 33 import com.google.common.util.concurrent.MoreExecutors; 34 import com.google.longrunning.Operation; 35 import com.google.protobuf.Empty; 36 import java.io.IOException; 37 import java.util.List; 38 import java.util.concurrent.TimeUnit; 39 import javax.annotation.Generated; 40 41 // AUTO-GENERATED DOCUMENTATION AND CLASS. 42 /** 43 * Service Description: [Service Usage API](https://cloud.google.com/service-usage/docs/overview) 44 * 45 * <p>This class provides the ability to make remote calls to the backing service through method 46 * calls that map to API methods. Sample code to get started: 47 * 48 * <pre>{@code 49 * // This snippet has been automatically generated and should be regarded as a code template only. 50 * // It will require modifications to work: 51 * // - It may require correct/in-range values for request initialization. 52 * // - It may require specifying regional endpoints when creating the service client as shown in 53 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 54 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 55 * GetServiceRequest request = GetServiceRequest.newBuilder().setName("name3373707").build(); 56 * Service response = serviceUsageClient.getService(request); 57 * } 58 * }</pre> 59 * 60 * <p>Note: close() needs to be called on the ServiceUsageClient object to clean up resources such 61 * as threads. In the example above, try-with-resources is used, which automatically calls close(). 62 * 63 * <p>The surface of this class includes several types of Java methods for each of the API's 64 * methods: 65 * 66 * <ol> 67 * <li>A "flattened" method. With this type of method, the fields of the request type have been 68 * converted into function parameters. It may be the case that not all fields are available as 69 * parameters, and not every API method will have a flattened method entry point. 70 * <li>A "request object" method. This type of method only takes one parameter, a request object, 71 * which must be constructed before the call. Not every API method will have a request object 72 * method. 73 * <li>A "callable" method. This type of method takes no parameters and returns an immutable API 74 * callable object, which can be used to initiate calls to the service. 75 * </ol> 76 * 77 * <p>See the individual methods for example code. 78 * 79 * <p>Many parameters require resource names to be formatted in a particular way. To assist with 80 * these names, this class includes a format method for each type of name, and additionally a parse 81 * method to extract the individual identifiers contained within names that are returned. 82 * 83 * <p>This class can be customized by passing in a custom instance of ServiceUsageSettings to 84 * create(). For example: 85 * 86 * <p>To customize credentials: 87 * 88 * <pre>{@code 89 * // This snippet has been automatically generated and should be regarded as a code template only. 90 * // It will require modifications to work: 91 * // - It may require correct/in-range values for request initialization. 92 * // - It may require specifying regional endpoints when creating the service client as shown in 93 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 94 * ServiceUsageSettings serviceUsageSettings = 95 * ServiceUsageSettings.newBuilder() 96 * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) 97 * .build(); 98 * ServiceUsageClient serviceUsageClient = ServiceUsageClient.create(serviceUsageSettings); 99 * }</pre> 100 * 101 * <p>To customize the endpoint: 102 * 103 * <pre>{@code 104 * // This snippet has been automatically generated and should be regarded as a code template only. 105 * // It will require modifications to work: 106 * // - It may require correct/in-range values for request initialization. 107 * // - It may require specifying regional endpoints when creating the service client as shown in 108 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 109 * ServiceUsageSettings serviceUsageSettings = 110 * ServiceUsageSettings.newBuilder().setEndpoint(myEndpoint).build(); 111 * ServiceUsageClient serviceUsageClient = ServiceUsageClient.create(serviceUsageSettings); 112 * }</pre> 113 * 114 * <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over 115 * the wire: 116 * 117 * <pre>{@code 118 * // This snippet has been automatically generated and should be regarded as a code template only. 119 * // It will require modifications to work: 120 * // - It may require correct/in-range values for request initialization. 121 * // - It may require specifying regional endpoints when creating the service client as shown in 122 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 123 * ServiceUsageSettings serviceUsageSettings = ServiceUsageSettings.newHttpJsonBuilder().build(); 124 * ServiceUsageClient serviceUsageClient = ServiceUsageClient.create(serviceUsageSettings); 125 * }</pre> 126 * 127 * <p>Please refer to the GitHub repository's samples for more quickstart code snippets. 128 */ 129 @BetaApi 130 @Generated("by gapic-generator-java") 131 public class ServiceUsageClient implements BackgroundResource { 132 private final ServiceUsageSettings settings; 133 private final ServiceUsageStub stub; 134 private final OperationsClient httpJsonOperationsClient; 135 private final com.google.longrunning.OperationsClient operationsClient; 136 137 /** Constructs an instance of ServiceUsageClient with default settings. */ create()138 public static final ServiceUsageClient create() throws IOException { 139 return create(ServiceUsageSettings.newBuilder().build()); 140 } 141 142 /** 143 * Constructs an instance of ServiceUsageClient, using the given settings. The channels are 144 * created based on the settings passed in, or defaults for any settings that are not set. 145 */ create(ServiceUsageSettings settings)146 public static final ServiceUsageClient create(ServiceUsageSettings settings) throws IOException { 147 return new ServiceUsageClient(settings); 148 } 149 150 /** 151 * Constructs an instance of ServiceUsageClient, using the given stub for making calls. This is 152 * for advanced usage - prefer using create(ServiceUsageSettings). 153 */ create(ServiceUsageStub stub)154 public static final ServiceUsageClient create(ServiceUsageStub stub) { 155 return new ServiceUsageClient(stub); 156 } 157 158 /** 159 * Constructs an instance of ServiceUsageClient, using the given settings. This is protected so 160 * that it is easy to make a subclass, but otherwise, the static factory methods should be 161 * preferred. 162 */ ServiceUsageClient(ServiceUsageSettings settings)163 protected ServiceUsageClient(ServiceUsageSettings settings) throws IOException { 164 this.settings = settings; 165 this.stub = ((ServiceUsageStubSettings) settings.getStubSettings()).createStub(); 166 this.operationsClient = 167 com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); 168 this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); 169 } 170 ServiceUsageClient(ServiceUsageStub stub)171 protected ServiceUsageClient(ServiceUsageStub stub) { 172 this.settings = null; 173 this.stub = stub; 174 this.operationsClient = 175 com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); 176 this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); 177 } 178 getSettings()179 public final ServiceUsageSettings getSettings() { 180 return settings; 181 } 182 getStub()183 public ServiceUsageStub getStub() { 184 return stub; 185 } 186 187 /** 188 * Returns the OperationsClient that can be used to query the status of a long-running operation 189 * returned by another API method call. 190 */ getOperationsClient()191 public final com.google.longrunning.OperationsClient getOperationsClient() { 192 return operationsClient; 193 } 194 195 /** 196 * Returns the OperationsClient that can be used to query the status of a long-running operation 197 * returned by another API method call. 198 */ 199 @BetaApi getHttpJsonOperationsClient()200 public final OperationsClient getHttpJsonOperationsClient() { 201 return httpJsonOperationsClient; 202 } 203 204 // AUTO-GENERATED DOCUMENTATION AND METHOD. 205 /** 206 * Enables a service so that it can be used with a project. 207 * 208 * <p>Operation response type: `google.protobuf.Empty` 209 * 210 * <p>Sample code: 211 * 212 * <pre>{@code 213 * // This snippet has been automatically generated and should be regarded as a code template only. 214 * // It will require modifications to work: 215 * // - It may require correct/in-range values for request initialization. 216 * // - It may require specifying regional endpoints when creating the service client as shown in 217 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 218 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 219 * EnableServiceRequest request = 220 * EnableServiceRequest.newBuilder().setName("name3373707").build(); 221 * serviceUsageClient.enableServiceAsync(request).get(); 222 * } 223 * }</pre> 224 * 225 * @param request The request object containing all of the parameters for the API call. 226 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 227 * @deprecated This method is deprecated and will be removed in the next major version update. 228 */ 229 @Deprecated enableServiceAsync( EnableServiceRequest request)230 public final OperationFuture<Empty, OperationMetadata> enableServiceAsync( 231 EnableServiceRequest request) { 232 return enableServiceOperationCallable().futureCall(request); 233 } 234 235 // AUTO-GENERATED DOCUMENTATION AND METHOD. 236 /** 237 * Enables a service so that it can be used with a project. 238 * 239 * <p>Operation response type: `google.protobuf.Empty` 240 * 241 * <p>Sample code: 242 * 243 * <pre>{@code 244 * // This snippet has been automatically generated and should be regarded as a code template only. 245 * // It will require modifications to work: 246 * // - It may require correct/in-range values for request initialization. 247 * // - It may require specifying regional endpoints when creating the service client as shown in 248 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 249 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 250 * EnableServiceRequest request = 251 * EnableServiceRequest.newBuilder().setName("name3373707").build(); 252 * OperationFuture<Empty, OperationMetadata> future = 253 * serviceUsageClient.enableServiceOperationCallable().futureCall(request); 254 * // Do something. 255 * future.get(); 256 * } 257 * }</pre> 258 * 259 * @deprecated This method is deprecated and will be removed in the next major version update. 260 */ 261 @Deprecated 262 public final OperationCallable<EnableServiceRequest, Empty, OperationMetadata> enableServiceOperationCallable()263 enableServiceOperationCallable() { 264 return stub.enableServiceOperationCallable(); 265 } 266 267 // AUTO-GENERATED DOCUMENTATION AND METHOD. 268 /** 269 * Enables a service so that it can be used with a project. 270 * 271 * <p>Operation response type: `google.protobuf.Empty` 272 * 273 * <p>Sample code: 274 * 275 * <pre>{@code 276 * // This snippet has been automatically generated and should be regarded as a code template only. 277 * // It will require modifications to work: 278 * // - It may require correct/in-range values for request initialization. 279 * // - It may require specifying regional endpoints when creating the service client as shown in 280 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 281 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 282 * EnableServiceRequest request = 283 * EnableServiceRequest.newBuilder().setName("name3373707").build(); 284 * ApiFuture<Operation> future = serviceUsageClient.enableServiceCallable().futureCall(request); 285 * // Do something. 286 * future.get(); 287 * } 288 * }</pre> 289 * 290 * @deprecated This method is deprecated and will be removed in the next major version update. 291 */ 292 @Deprecated enableServiceCallable()293 public final UnaryCallable<EnableServiceRequest, Operation> enableServiceCallable() { 294 return stub.enableServiceCallable(); 295 } 296 297 // AUTO-GENERATED DOCUMENTATION AND METHOD. 298 /** 299 * Disables a service so that it can no longer be used with a project. This prevents unintended 300 * usage that may cause unexpected billing charges or security leaks. 301 * 302 * <p>It is not valid to call the disable method on a service that is not currently enabled. 303 * Callers will receive a `FAILED_PRECONDITION` status if the target service is not currently 304 * enabled. 305 * 306 * <p>Operation response type: `google.protobuf.Empty` 307 * 308 * <p>Sample code: 309 * 310 * <pre>{@code 311 * // This snippet has been automatically generated and should be regarded as a code template only. 312 * // It will require modifications to work: 313 * // - It may require correct/in-range values for request initialization. 314 * // - It may require specifying regional endpoints when creating the service client as shown in 315 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 316 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 317 * DisableServiceRequest request = 318 * DisableServiceRequest.newBuilder().setName("name3373707").build(); 319 * serviceUsageClient.disableServiceAsync(request).get(); 320 * } 321 * }</pre> 322 * 323 * @param request The request object containing all of the parameters for the API call. 324 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 325 * @deprecated This method is deprecated and will be removed in the next major version update. 326 */ 327 @Deprecated disableServiceAsync( DisableServiceRequest request)328 public final OperationFuture<Empty, OperationMetadata> disableServiceAsync( 329 DisableServiceRequest request) { 330 return disableServiceOperationCallable().futureCall(request); 331 } 332 333 // AUTO-GENERATED DOCUMENTATION AND METHOD. 334 /** 335 * Disables a service so that it can no longer be used with a project. This prevents unintended 336 * usage that may cause unexpected billing charges or security leaks. 337 * 338 * <p>It is not valid to call the disable method on a service that is not currently enabled. 339 * Callers will receive a `FAILED_PRECONDITION` status if the target service is not currently 340 * enabled. 341 * 342 * <p>Operation response type: `google.protobuf.Empty` 343 * 344 * <p>Sample code: 345 * 346 * <pre>{@code 347 * // This snippet has been automatically generated and should be regarded as a code template only. 348 * // It will require modifications to work: 349 * // - It may require correct/in-range values for request initialization. 350 * // - It may require specifying regional endpoints when creating the service client as shown in 351 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 352 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 353 * DisableServiceRequest request = 354 * DisableServiceRequest.newBuilder().setName("name3373707").build(); 355 * OperationFuture<Empty, OperationMetadata> future = 356 * serviceUsageClient.disableServiceOperationCallable().futureCall(request); 357 * // Do something. 358 * future.get(); 359 * } 360 * }</pre> 361 * 362 * @deprecated This method is deprecated and will be removed in the next major version update. 363 */ 364 @Deprecated 365 public final OperationCallable<DisableServiceRequest, Empty, OperationMetadata> disableServiceOperationCallable()366 disableServiceOperationCallable() { 367 return stub.disableServiceOperationCallable(); 368 } 369 370 // AUTO-GENERATED DOCUMENTATION AND METHOD. 371 /** 372 * Disables a service so that it can no longer be used with a project. This prevents unintended 373 * usage that may cause unexpected billing charges or security leaks. 374 * 375 * <p>It is not valid to call the disable method on a service that is not currently enabled. 376 * Callers will receive a `FAILED_PRECONDITION` status if the target service is not currently 377 * enabled. 378 * 379 * <p>Operation response type: `google.protobuf.Empty` 380 * 381 * <p>Sample code: 382 * 383 * <pre>{@code 384 * // This snippet has been automatically generated and should be regarded as a code template only. 385 * // It will require modifications to work: 386 * // - It may require correct/in-range values for request initialization. 387 * // - It may require specifying regional endpoints when creating the service client as shown in 388 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 389 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 390 * DisableServiceRequest request = 391 * DisableServiceRequest.newBuilder().setName("name3373707").build(); 392 * ApiFuture<Operation> future = serviceUsageClient.disableServiceCallable().futureCall(request); 393 * // Do something. 394 * future.get(); 395 * } 396 * }</pre> 397 * 398 * @deprecated This method is deprecated and will be removed in the next major version update. 399 */ 400 @Deprecated disableServiceCallable()401 public final UnaryCallable<DisableServiceRequest, Operation> disableServiceCallable() { 402 return stub.disableServiceCallable(); 403 } 404 405 // AUTO-GENERATED DOCUMENTATION AND METHOD. 406 /** 407 * Returns the service configuration and enabled state for a given service. 408 * 409 * <p>Sample code: 410 * 411 * <pre>{@code 412 * // This snippet has been automatically generated and should be regarded as a code template only. 413 * // It will require modifications to work: 414 * // - It may require correct/in-range values for request initialization. 415 * // - It may require specifying regional endpoints when creating the service client as shown in 416 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 417 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 418 * GetServiceRequest request = GetServiceRequest.newBuilder().setName("name3373707").build(); 419 * Service response = serviceUsageClient.getService(request); 420 * } 421 * }</pre> 422 * 423 * @param request The request object containing all of the parameters for the API call. 424 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 425 * @deprecated This method is deprecated and will be removed in the next major version update. 426 */ 427 @Deprecated getService(GetServiceRequest request)428 public final Service getService(GetServiceRequest request) { 429 return getServiceCallable().call(request); 430 } 431 432 // AUTO-GENERATED DOCUMENTATION AND METHOD. 433 /** 434 * Returns the service configuration and enabled state for a given service. 435 * 436 * <p>Sample code: 437 * 438 * <pre>{@code 439 * // This snippet has been automatically generated and should be regarded as a code template only. 440 * // It will require modifications to work: 441 * // - It may require correct/in-range values for request initialization. 442 * // - It may require specifying regional endpoints when creating the service client as shown in 443 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 444 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 445 * GetServiceRequest request = GetServiceRequest.newBuilder().setName("name3373707").build(); 446 * ApiFuture<Service> future = serviceUsageClient.getServiceCallable().futureCall(request); 447 * // Do something. 448 * Service response = future.get(); 449 * } 450 * }</pre> 451 * 452 * @deprecated This method is deprecated and will be removed in the next major version update. 453 */ 454 @Deprecated getServiceCallable()455 public final UnaryCallable<GetServiceRequest, Service> getServiceCallable() { 456 return stub.getServiceCallable(); 457 } 458 459 // AUTO-GENERATED DOCUMENTATION AND METHOD. 460 /** 461 * Lists all services available to the specified project, and the current state of those services 462 * with respect to the project. The list includes all public services, all services for which the 463 * calling user has the `servicemanagement.services.bind` permission, and all services that have 464 * already been enabled on the project. The list can be filtered to only include services in a 465 * specific state, for example to only include services enabled on the project. 466 * 467 * <p>Sample code: 468 * 469 * <pre>{@code 470 * // This snippet has been automatically generated and should be regarded as a code template only. 471 * // It will require modifications to work: 472 * // - It may require correct/in-range values for request initialization. 473 * // - It may require specifying regional endpoints when creating the service client as shown in 474 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 475 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 476 * ListServicesRequest request = 477 * ListServicesRequest.newBuilder() 478 * .setParent("parent-995424086") 479 * .setPageSize(883849137) 480 * .setPageToken("pageToken873572522") 481 * .setFilter("filter-1274492040") 482 * .build(); 483 * for (Service element : serviceUsageClient.listServices(request).iterateAll()) { 484 * // doThingsWith(element); 485 * } 486 * } 487 * }</pre> 488 * 489 * @param request The request object containing all of the parameters for the API call. 490 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 491 * @deprecated This method is deprecated and will be removed in the next major version update. 492 */ 493 @Deprecated listServices(ListServicesRequest request)494 public final ListServicesPagedResponse listServices(ListServicesRequest request) { 495 return listServicesPagedCallable().call(request); 496 } 497 498 // AUTO-GENERATED DOCUMENTATION AND METHOD. 499 /** 500 * Lists all services available to the specified project, and the current state of those services 501 * with respect to the project. The list includes all public services, all services for which the 502 * calling user has the `servicemanagement.services.bind` permission, and all services that have 503 * already been enabled on the project. The list can be filtered to only include services in a 504 * specific state, for example to only include services enabled on the project. 505 * 506 * <p>Sample code: 507 * 508 * <pre>{@code 509 * // This snippet has been automatically generated and should be regarded as a code template only. 510 * // It will require modifications to work: 511 * // - It may require correct/in-range values for request initialization. 512 * // - It may require specifying regional endpoints when creating the service client as shown in 513 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 514 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 515 * ListServicesRequest request = 516 * ListServicesRequest.newBuilder() 517 * .setParent("parent-995424086") 518 * .setPageSize(883849137) 519 * .setPageToken("pageToken873572522") 520 * .setFilter("filter-1274492040") 521 * .build(); 522 * ApiFuture<Service> future = 523 * serviceUsageClient.listServicesPagedCallable().futureCall(request); 524 * // Do something. 525 * for (Service element : future.get().iterateAll()) { 526 * // doThingsWith(element); 527 * } 528 * } 529 * }</pre> 530 * 531 * @deprecated This method is deprecated and will be removed in the next major version update. 532 */ 533 @Deprecated 534 public final UnaryCallable<ListServicesRequest, ListServicesPagedResponse> listServicesPagedCallable()535 listServicesPagedCallable() { 536 return stub.listServicesPagedCallable(); 537 } 538 539 // AUTO-GENERATED DOCUMENTATION AND METHOD. 540 /** 541 * Lists all services available to the specified project, and the current state of those services 542 * with respect to the project. The list includes all public services, all services for which the 543 * calling user has the `servicemanagement.services.bind` permission, and all services that have 544 * already been enabled on the project. The list can be filtered to only include services in a 545 * specific state, for example to only include services enabled on the project. 546 * 547 * <p>Sample code: 548 * 549 * <pre>{@code 550 * // This snippet has been automatically generated and should be regarded as a code template only. 551 * // It will require modifications to work: 552 * // - It may require correct/in-range values for request initialization. 553 * // - It may require specifying regional endpoints when creating the service client as shown in 554 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 555 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 556 * ListServicesRequest request = 557 * ListServicesRequest.newBuilder() 558 * .setParent("parent-995424086") 559 * .setPageSize(883849137) 560 * .setPageToken("pageToken873572522") 561 * .setFilter("filter-1274492040") 562 * .build(); 563 * while (true) { 564 * ListServicesResponse response = serviceUsageClient.listServicesCallable().call(request); 565 * for (Service element : response.getServicesList()) { 566 * // doThingsWith(element); 567 * } 568 * String nextPageToken = response.getNextPageToken(); 569 * if (!Strings.isNullOrEmpty(nextPageToken)) { 570 * request = request.toBuilder().setPageToken(nextPageToken).build(); 571 * } else { 572 * break; 573 * } 574 * } 575 * } 576 * }</pre> 577 * 578 * @deprecated This method is deprecated and will be removed in the next major version update. 579 */ 580 @Deprecated listServicesCallable()581 public final UnaryCallable<ListServicesRequest, ListServicesResponse> listServicesCallable() { 582 return stub.listServicesCallable(); 583 } 584 585 // AUTO-GENERATED DOCUMENTATION AND METHOD. 586 /** 587 * Enables multiple services on a project. The operation is atomic: if enabling any service fails, 588 * then the entire batch fails, and no state changes occur. 589 * 590 * <p>Operation response type: `google.protobuf.Empty` 591 * 592 * <p>Sample code: 593 * 594 * <pre>{@code 595 * // This snippet has been automatically generated and should be regarded as a code template only. 596 * // It will require modifications to work: 597 * // - It may require correct/in-range values for request initialization. 598 * // - It may require specifying regional endpoints when creating the service client as shown in 599 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 600 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 601 * BatchEnableServicesRequest request = 602 * BatchEnableServicesRequest.newBuilder() 603 * .setParent("parent-995424086") 604 * .addAllServiceIds(new ArrayList<String>()) 605 * .build(); 606 * serviceUsageClient.batchEnableServicesAsync(request).get(); 607 * } 608 * }</pre> 609 * 610 * @param request The request object containing all of the parameters for the API call. 611 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 612 * @deprecated This method is deprecated and will be removed in the next major version update. 613 */ 614 @Deprecated batchEnableServicesAsync( BatchEnableServicesRequest request)615 public final OperationFuture<Empty, OperationMetadata> batchEnableServicesAsync( 616 BatchEnableServicesRequest request) { 617 return batchEnableServicesOperationCallable().futureCall(request); 618 } 619 620 // AUTO-GENERATED DOCUMENTATION AND METHOD. 621 /** 622 * Enables multiple services on a project. The operation is atomic: if enabling any service fails, 623 * then the entire batch fails, and no state changes occur. 624 * 625 * <p>Operation response type: `google.protobuf.Empty` 626 * 627 * <p>Sample code: 628 * 629 * <pre>{@code 630 * // This snippet has been automatically generated and should be regarded as a code template only. 631 * // It will require modifications to work: 632 * // - It may require correct/in-range values for request initialization. 633 * // - It may require specifying regional endpoints when creating the service client as shown in 634 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 635 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 636 * BatchEnableServicesRequest request = 637 * BatchEnableServicesRequest.newBuilder() 638 * .setParent("parent-995424086") 639 * .addAllServiceIds(new ArrayList<String>()) 640 * .build(); 641 * OperationFuture<Empty, OperationMetadata> future = 642 * serviceUsageClient.batchEnableServicesOperationCallable().futureCall(request); 643 * // Do something. 644 * future.get(); 645 * } 646 * }</pre> 647 * 648 * @deprecated This method is deprecated and will be removed in the next major version update. 649 */ 650 @Deprecated 651 public final OperationCallable<BatchEnableServicesRequest, Empty, OperationMetadata> batchEnableServicesOperationCallable()652 batchEnableServicesOperationCallable() { 653 return stub.batchEnableServicesOperationCallable(); 654 } 655 656 // AUTO-GENERATED DOCUMENTATION AND METHOD. 657 /** 658 * Enables multiple services on a project. The operation is atomic: if enabling any service fails, 659 * then the entire batch fails, and no state changes occur. 660 * 661 * <p>Operation response type: `google.protobuf.Empty` 662 * 663 * <p>Sample code: 664 * 665 * <pre>{@code 666 * // This snippet has been automatically generated and should be regarded as a code template only. 667 * // It will require modifications to work: 668 * // - It may require correct/in-range values for request initialization. 669 * // - It may require specifying regional endpoints when creating the service client as shown in 670 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 671 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 672 * BatchEnableServicesRequest request = 673 * BatchEnableServicesRequest.newBuilder() 674 * .setParent("parent-995424086") 675 * .addAllServiceIds(new ArrayList<String>()) 676 * .build(); 677 * ApiFuture<Operation> future = 678 * serviceUsageClient.batchEnableServicesCallable().futureCall(request); 679 * // Do something. 680 * future.get(); 681 * } 682 * }</pre> 683 * 684 * @deprecated This method is deprecated and will be removed in the next major version update. 685 */ 686 @Deprecated batchEnableServicesCallable()687 public final UnaryCallable<BatchEnableServicesRequest, Operation> batchEnableServicesCallable() { 688 return stub.batchEnableServicesCallable(); 689 } 690 691 // AUTO-GENERATED DOCUMENTATION AND METHOD. 692 /** 693 * Retrieves a summary of all quota information visible to the service consumer, organized by 694 * service metric. Each metric includes information about all of its defined limits. Each limit 695 * includes the limit configuration (quota unit, preciseness, default value), the current 696 * effective limit value, and all of the overrides applied to the limit. 697 * 698 * <p>Sample code: 699 * 700 * <pre>{@code 701 * // This snippet has been automatically generated and should be regarded as a code template only. 702 * // It will require modifications to work: 703 * // - It may require correct/in-range values for request initialization. 704 * // - It may require specifying regional endpoints when creating the service client as shown in 705 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 706 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 707 * ListConsumerQuotaMetricsRequest request = 708 * ListConsumerQuotaMetricsRequest.newBuilder() 709 * .setParent("parent-995424086") 710 * .setPageSize(883849137) 711 * .setPageToken("pageToken873572522") 712 * .setView(QuotaView.forNumber(0)) 713 * .build(); 714 * for (ConsumerQuotaMetric element : 715 * serviceUsageClient.listConsumerQuotaMetrics(request).iterateAll()) { 716 * // doThingsWith(element); 717 * } 718 * } 719 * }</pre> 720 * 721 * @param request The request object containing all of the parameters for the API call. 722 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 723 */ listConsumerQuotaMetrics( ListConsumerQuotaMetricsRequest request)724 public final ListConsumerQuotaMetricsPagedResponse listConsumerQuotaMetrics( 725 ListConsumerQuotaMetricsRequest request) { 726 return listConsumerQuotaMetricsPagedCallable().call(request); 727 } 728 729 // AUTO-GENERATED DOCUMENTATION AND METHOD. 730 /** 731 * Retrieves a summary of all quota information visible to the service consumer, organized by 732 * service metric. Each metric includes information about all of its defined limits. Each limit 733 * includes the limit configuration (quota unit, preciseness, default value), the current 734 * effective limit value, and all of the overrides applied to the limit. 735 * 736 * <p>Sample code: 737 * 738 * <pre>{@code 739 * // This snippet has been automatically generated and should be regarded as a code template only. 740 * // It will require modifications to work: 741 * // - It may require correct/in-range values for request initialization. 742 * // - It may require specifying regional endpoints when creating the service client as shown in 743 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 744 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 745 * ListConsumerQuotaMetricsRequest request = 746 * ListConsumerQuotaMetricsRequest.newBuilder() 747 * .setParent("parent-995424086") 748 * .setPageSize(883849137) 749 * .setPageToken("pageToken873572522") 750 * .setView(QuotaView.forNumber(0)) 751 * .build(); 752 * ApiFuture<ConsumerQuotaMetric> future = 753 * serviceUsageClient.listConsumerQuotaMetricsPagedCallable().futureCall(request); 754 * // Do something. 755 * for (ConsumerQuotaMetric element : future.get().iterateAll()) { 756 * // doThingsWith(element); 757 * } 758 * } 759 * }</pre> 760 */ 761 public final UnaryCallable<ListConsumerQuotaMetricsRequest, ListConsumerQuotaMetricsPagedResponse> listConsumerQuotaMetricsPagedCallable()762 listConsumerQuotaMetricsPagedCallable() { 763 return stub.listConsumerQuotaMetricsPagedCallable(); 764 } 765 766 // AUTO-GENERATED DOCUMENTATION AND METHOD. 767 /** 768 * Retrieves a summary of all quota information visible to the service consumer, organized by 769 * service metric. Each metric includes information about all of its defined limits. Each limit 770 * includes the limit configuration (quota unit, preciseness, default value), the current 771 * effective limit value, and all of the overrides applied to the limit. 772 * 773 * <p>Sample code: 774 * 775 * <pre>{@code 776 * // This snippet has been automatically generated and should be regarded as a code template only. 777 * // It will require modifications to work: 778 * // - It may require correct/in-range values for request initialization. 779 * // - It may require specifying regional endpoints when creating the service client as shown in 780 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 781 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 782 * ListConsumerQuotaMetricsRequest request = 783 * ListConsumerQuotaMetricsRequest.newBuilder() 784 * .setParent("parent-995424086") 785 * .setPageSize(883849137) 786 * .setPageToken("pageToken873572522") 787 * .setView(QuotaView.forNumber(0)) 788 * .build(); 789 * while (true) { 790 * ListConsumerQuotaMetricsResponse response = 791 * serviceUsageClient.listConsumerQuotaMetricsCallable().call(request); 792 * for (ConsumerQuotaMetric element : response.getMetricsList()) { 793 * // doThingsWith(element); 794 * } 795 * String nextPageToken = response.getNextPageToken(); 796 * if (!Strings.isNullOrEmpty(nextPageToken)) { 797 * request = request.toBuilder().setPageToken(nextPageToken).build(); 798 * } else { 799 * break; 800 * } 801 * } 802 * } 803 * }</pre> 804 */ 805 public final UnaryCallable<ListConsumerQuotaMetricsRequest, ListConsumerQuotaMetricsResponse> listConsumerQuotaMetricsCallable()806 listConsumerQuotaMetricsCallable() { 807 return stub.listConsumerQuotaMetricsCallable(); 808 } 809 810 // AUTO-GENERATED DOCUMENTATION AND METHOD. 811 /** 812 * Retrieves a summary of quota information for a specific quota metric 813 * 814 * <p>Sample code: 815 * 816 * <pre>{@code 817 * // This snippet has been automatically generated and should be regarded as a code template only. 818 * // It will require modifications to work: 819 * // - It may require correct/in-range values for request initialization. 820 * // - It may require specifying regional endpoints when creating the service client as shown in 821 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 822 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 823 * GetConsumerQuotaMetricRequest request = 824 * GetConsumerQuotaMetricRequest.newBuilder() 825 * .setName("name3373707") 826 * .setView(QuotaView.forNumber(0)) 827 * .build(); 828 * ConsumerQuotaMetric response = serviceUsageClient.getConsumerQuotaMetric(request); 829 * } 830 * }</pre> 831 * 832 * @param request The request object containing all of the parameters for the API call. 833 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 834 */ getConsumerQuotaMetric(GetConsumerQuotaMetricRequest request)835 public final ConsumerQuotaMetric getConsumerQuotaMetric(GetConsumerQuotaMetricRequest request) { 836 return getConsumerQuotaMetricCallable().call(request); 837 } 838 839 // AUTO-GENERATED DOCUMENTATION AND METHOD. 840 /** 841 * Retrieves a summary of quota information for a specific quota metric 842 * 843 * <p>Sample code: 844 * 845 * <pre>{@code 846 * // This snippet has been automatically generated and should be regarded as a code template only. 847 * // It will require modifications to work: 848 * // - It may require correct/in-range values for request initialization. 849 * // - It may require specifying regional endpoints when creating the service client as shown in 850 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 851 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 852 * GetConsumerQuotaMetricRequest request = 853 * GetConsumerQuotaMetricRequest.newBuilder() 854 * .setName("name3373707") 855 * .setView(QuotaView.forNumber(0)) 856 * .build(); 857 * ApiFuture<ConsumerQuotaMetric> future = 858 * serviceUsageClient.getConsumerQuotaMetricCallable().futureCall(request); 859 * // Do something. 860 * ConsumerQuotaMetric response = future.get(); 861 * } 862 * }</pre> 863 */ 864 public final UnaryCallable<GetConsumerQuotaMetricRequest, ConsumerQuotaMetric> getConsumerQuotaMetricCallable()865 getConsumerQuotaMetricCallable() { 866 return stub.getConsumerQuotaMetricCallable(); 867 } 868 869 // AUTO-GENERATED DOCUMENTATION AND METHOD. 870 /** 871 * Retrieves a summary of quota information for a specific quota limit. 872 * 873 * <p>Sample code: 874 * 875 * <pre>{@code 876 * // This snippet has been automatically generated and should be regarded as a code template only. 877 * // It will require modifications to work: 878 * // - It may require correct/in-range values for request initialization. 879 * // - It may require specifying regional endpoints when creating the service client as shown in 880 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 881 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 882 * GetConsumerQuotaLimitRequest request = 883 * GetConsumerQuotaLimitRequest.newBuilder() 884 * .setName("name3373707") 885 * .setView(QuotaView.forNumber(0)) 886 * .build(); 887 * ConsumerQuotaLimit response = serviceUsageClient.getConsumerQuotaLimit(request); 888 * } 889 * }</pre> 890 * 891 * @param request The request object containing all of the parameters for the API call. 892 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 893 */ getConsumerQuotaLimit(GetConsumerQuotaLimitRequest request)894 public final ConsumerQuotaLimit getConsumerQuotaLimit(GetConsumerQuotaLimitRequest request) { 895 return getConsumerQuotaLimitCallable().call(request); 896 } 897 898 // AUTO-GENERATED DOCUMENTATION AND METHOD. 899 /** 900 * Retrieves a summary of quota information for a specific quota limit. 901 * 902 * <p>Sample code: 903 * 904 * <pre>{@code 905 * // This snippet has been automatically generated and should be regarded as a code template only. 906 * // It will require modifications to work: 907 * // - It may require correct/in-range values for request initialization. 908 * // - It may require specifying regional endpoints when creating the service client as shown in 909 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 910 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 911 * GetConsumerQuotaLimitRequest request = 912 * GetConsumerQuotaLimitRequest.newBuilder() 913 * .setName("name3373707") 914 * .setView(QuotaView.forNumber(0)) 915 * .build(); 916 * ApiFuture<ConsumerQuotaLimit> future = 917 * serviceUsageClient.getConsumerQuotaLimitCallable().futureCall(request); 918 * // Do something. 919 * ConsumerQuotaLimit response = future.get(); 920 * } 921 * }</pre> 922 */ 923 public final UnaryCallable<GetConsumerQuotaLimitRequest, ConsumerQuotaLimit> getConsumerQuotaLimitCallable()924 getConsumerQuotaLimitCallable() { 925 return stub.getConsumerQuotaLimitCallable(); 926 } 927 928 // AUTO-GENERATED DOCUMENTATION AND METHOD. 929 /** 930 * Creates an admin override. An admin override is applied by an administrator of a parent folder 931 * or parent organization of the consumer receiving the override. An admin override is intended to 932 * limit the amount of quota the consumer can use out of the total quota pool allocated to all 933 * children of the folder or organization. 934 * 935 * <p>Sample code: 936 * 937 * <pre>{@code 938 * // This snippet has been automatically generated and should be regarded as a code template only. 939 * // It will require modifications to work: 940 * // - It may require correct/in-range values for request initialization. 941 * // - It may require specifying regional endpoints when creating the service client as shown in 942 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 943 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 944 * CreateAdminOverrideRequest request = 945 * CreateAdminOverrideRequest.newBuilder() 946 * .setParent("parent-995424086") 947 * .setOverride(QuotaOverride.newBuilder().build()) 948 * .setForce(true) 949 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 950 * .build(); 951 * QuotaOverride response = serviceUsageClient.createAdminOverrideAsync(request).get(); 952 * } 953 * }</pre> 954 * 955 * @param request The request object containing all of the parameters for the API call. 956 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 957 */ createAdminOverrideAsync( CreateAdminOverrideRequest request)958 public final OperationFuture<QuotaOverride, OperationMetadata> createAdminOverrideAsync( 959 CreateAdminOverrideRequest request) { 960 return createAdminOverrideOperationCallable().futureCall(request); 961 } 962 963 // AUTO-GENERATED DOCUMENTATION AND METHOD. 964 /** 965 * Creates an admin override. An admin override is applied by an administrator of a parent folder 966 * or parent organization of the consumer receiving the override. An admin override is intended to 967 * limit the amount of quota the consumer can use out of the total quota pool allocated to all 968 * children of the folder or organization. 969 * 970 * <p>Sample code: 971 * 972 * <pre>{@code 973 * // This snippet has been automatically generated and should be regarded as a code template only. 974 * // It will require modifications to work: 975 * // - It may require correct/in-range values for request initialization. 976 * // - It may require specifying regional endpoints when creating the service client as shown in 977 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 978 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 979 * CreateAdminOverrideRequest request = 980 * CreateAdminOverrideRequest.newBuilder() 981 * .setParent("parent-995424086") 982 * .setOverride(QuotaOverride.newBuilder().build()) 983 * .setForce(true) 984 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 985 * .build(); 986 * OperationFuture<QuotaOverride, OperationMetadata> future = 987 * serviceUsageClient.createAdminOverrideOperationCallable().futureCall(request); 988 * // Do something. 989 * QuotaOverride response = future.get(); 990 * } 991 * }</pre> 992 */ 993 public final OperationCallable<CreateAdminOverrideRequest, QuotaOverride, OperationMetadata> createAdminOverrideOperationCallable()994 createAdminOverrideOperationCallable() { 995 return stub.createAdminOverrideOperationCallable(); 996 } 997 998 // AUTO-GENERATED DOCUMENTATION AND METHOD. 999 /** 1000 * Creates an admin override. An admin override is applied by an administrator of a parent folder 1001 * or parent organization of the consumer receiving the override. An admin override is intended to 1002 * limit the amount of quota the consumer can use out of the total quota pool allocated to all 1003 * children of the folder or organization. 1004 * 1005 * <p>Sample code: 1006 * 1007 * <pre>{@code 1008 * // This snippet has been automatically generated and should be regarded as a code template only. 1009 * // It will require modifications to work: 1010 * // - It may require correct/in-range values for request initialization. 1011 * // - It may require specifying regional endpoints when creating the service client as shown in 1012 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1013 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1014 * CreateAdminOverrideRequest request = 1015 * CreateAdminOverrideRequest.newBuilder() 1016 * .setParent("parent-995424086") 1017 * .setOverride(QuotaOverride.newBuilder().build()) 1018 * .setForce(true) 1019 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 1020 * .build(); 1021 * ApiFuture<Operation> future = 1022 * serviceUsageClient.createAdminOverrideCallable().futureCall(request); 1023 * // Do something. 1024 * Operation response = future.get(); 1025 * } 1026 * }</pre> 1027 */ createAdminOverrideCallable()1028 public final UnaryCallable<CreateAdminOverrideRequest, Operation> createAdminOverrideCallable() { 1029 return stub.createAdminOverrideCallable(); 1030 } 1031 1032 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1033 /** 1034 * Updates an admin override. 1035 * 1036 * <p>Sample code: 1037 * 1038 * <pre>{@code 1039 * // This snippet has been automatically generated and should be regarded as a code template only. 1040 * // It will require modifications to work: 1041 * // - It may require correct/in-range values for request initialization. 1042 * // - It may require specifying regional endpoints when creating the service client as shown in 1043 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1044 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1045 * UpdateAdminOverrideRequest request = 1046 * UpdateAdminOverrideRequest.newBuilder() 1047 * .setName("name3373707") 1048 * .setOverride(QuotaOverride.newBuilder().build()) 1049 * .setForce(true) 1050 * .setUpdateMask(FieldMask.newBuilder().build()) 1051 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 1052 * .build(); 1053 * QuotaOverride response = serviceUsageClient.updateAdminOverrideAsync(request).get(); 1054 * } 1055 * }</pre> 1056 * 1057 * @param request The request object containing all of the parameters for the API call. 1058 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1059 */ updateAdminOverrideAsync( UpdateAdminOverrideRequest request)1060 public final OperationFuture<QuotaOverride, OperationMetadata> updateAdminOverrideAsync( 1061 UpdateAdminOverrideRequest request) { 1062 return updateAdminOverrideOperationCallable().futureCall(request); 1063 } 1064 1065 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1066 /** 1067 * Updates an admin override. 1068 * 1069 * <p>Sample code: 1070 * 1071 * <pre>{@code 1072 * // This snippet has been automatically generated and should be regarded as a code template only. 1073 * // It will require modifications to work: 1074 * // - It may require correct/in-range values for request initialization. 1075 * // - It may require specifying regional endpoints when creating the service client as shown in 1076 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1077 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1078 * UpdateAdminOverrideRequest request = 1079 * UpdateAdminOverrideRequest.newBuilder() 1080 * .setName("name3373707") 1081 * .setOverride(QuotaOverride.newBuilder().build()) 1082 * .setForce(true) 1083 * .setUpdateMask(FieldMask.newBuilder().build()) 1084 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 1085 * .build(); 1086 * OperationFuture<QuotaOverride, OperationMetadata> future = 1087 * serviceUsageClient.updateAdminOverrideOperationCallable().futureCall(request); 1088 * // Do something. 1089 * QuotaOverride response = future.get(); 1090 * } 1091 * }</pre> 1092 */ 1093 public final OperationCallable<UpdateAdminOverrideRequest, QuotaOverride, OperationMetadata> updateAdminOverrideOperationCallable()1094 updateAdminOverrideOperationCallable() { 1095 return stub.updateAdminOverrideOperationCallable(); 1096 } 1097 1098 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1099 /** 1100 * Updates an admin override. 1101 * 1102 * <p>Sample code: 1103 * 1104 * <pre>{@code 1105 * // This snippet has been automatically generated and should be regarded as a code template only. 1106 * // It will require modifications to work: 1107 * // - It may require correct/in-range values for request initialization. 1108 * // - It may require specifying regional endpoints when creating the service client as shown in 1109 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1110 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1111 * UpdateAdminOverrideRequest request = 1112 * UpdateAdminOverrideRequest.newBuilder() 1113 * .setName("name3373707") 1114 * .setOverride(QuotaOverride.newBuilder().build()) 1115 * .setForce(true) 1116 * .setUpdateMask(FieldMask.newBuilder().build()) 1117 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 1118 * .build(); 1119 * ApiFuture<Operation> future = 1120 * serviceUsageClient.updateAdminOverrideCallable().futureCall(request); 1121 * // Do something. 1122 * Operation response = future.get(); 1123 * } 1124 * }</pre> 1125 */ updateAdminOverrideCallable()1126 public final UnaryCallable<UpdateAdminOverrideRequest, Operation> updateAdminOverrideCallable() { 1127 return stub.updateAdminOverrideCallable(); 1128 } 1129 1130 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1131 /** 1132 * Deletes an admin override. 1133 * 1134 * <p>Sample code: 1135 * 1136 * <pre>{@code 1137 * // This snippet has been automatically generated and should be regarded as a code template only. 1138 * // It will require modifications to work: 1139 * // - It may require correct/in-range values for request initialization. 1140 * // - It may require specifying regional endpoints when creating the service client as shown in 1141 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1142 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1143 * DeleteAdminOverrideRequest request = 1144 * DeleteAdminOverrideRequest.newBuilder() 1145 * .setName("name3373707") 1146 * .setForce(true) 1147 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 1148 * .build(); 1149 * serviceUsageClient.deleteAdminOverrideAsync(request).get(); 1150 * } 1151 * }</pre> 1152 * 1153 * @param request The request object containing all of the parameters for the API call. 1154 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1155 */ deleteAdminOverrideAsync( DeleteAdminOverrideRequest request)1156 public final OperationFuture<Empty, OperationMetadata> deleteAdminOverrideAsync( 1157 DeleteAdminOverrideRequest request) { 1158 return deleteAdminOverrideOperationCallable().futureCall(request); 1159 } 1160 1161 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1162 /** 1163 * Deletes an admin override. 1164 * 1165 * <p>Sample code: 1166 * 1167 * <pre>{@code 1168 * // This snippet has been automatically generated and should be regarded as a code template only. 1169 * // It will require modifications to work: 1170 * // - It may require correct/in-range values for request initialization. 1171 * // - It may require specifying regional endpoints when creating the service client as shown in 1172 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1173 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1174 * DeleteAdminOverrideRequest request = 1175 * DeleteAdminOverrideRequest.newBuilder() 1176 * .setName("name3373707") 1177 * .setForce(true) 1178 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 1179 * .build(); 1180 * OperationFuture<Empty, OperationMetadata> future = 1181 * serviceUsageClient.deleteAdminOverrideOperationCallable().futureCall(request); 1182 * // Do something. 1183 * future.get(); 1184 * } 1185 * }</pre> 1186 */ 1187 public final OperationCallable<DeleteAdminOverrideRequest, Empty, OperationMetadata> deleteAdminOverrideOperationCallable()1188 deleteAdminOverrideOperationCallable() { 1189 return stub.deleteAdminOverrideOperationCallable(); 1190 } 1191 1192 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1193 /** 1194 * Deletes an admin override. 1195 * 1196 * <p>Sample code: 1197 * 1198 * <pre>{@code 1199 * // This snippet has been automatically generated and should be regarded as a code template only. 1200 * // It will require modifications to work: 1201 * // - It may require correct/in-range values for request initialization. 1202 * // - It may require specifying regional endpoints when creating the service client as shown in 1203 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1204 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1205 * DeleteAdminOverrideRequest request = 1206 * DeleteAdminOverrideRequest.newBuilder() 1207 * .setName("name3373707") 1208 * .setForce(true) 1209 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 1210 * .build(); 1211 * ApiFuture<Operation> future = 1212 * serviceUsageClient.deleteAdminOverrideCallable().futureCall(request); 1213 * // Do something. 1214 * future.get(); 1215 * } 1216 * }</pre> 1217 */ deleteAdminOverrideCallable()1218 public final UnaryCallable<DeleteAdminOverrideRequest, Operation> deleteAdminOverrideCallable() { 1219 return stub.deleteAdminOverrideCallable(); 1220 } 1221 1222 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1223 /** 1224 * Lists all admin overrides on this limit. 1225 * 1226 * <p>Sample code: 1227 * 1228 * <pre>{@code 1229 * // This snippet has been automatically generated and should be regarded as a code template only. 1230 * // It will require modifications to work: 1231 * // - It may require correct/in-range values for request initialization. 1232 * // - It may require specifying regional endpoints when creating the service client as shown in 1233 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1234 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1235 * ListAdminOverridesRequest request = 1236 * ListAdminOverridesRequest.newBuilder() 1237 * .setParent("parent-995424086") 1238 * .setPageSize(883849137) 1239 * .setPageToken("pageToken873572522") 1240 * .build(); 1241 * for (QuotaOverride element : serviceUsageClient.listAdminOverrides(request).iterateAll()) { 1242 * // doThingsWith(element); 1243 * } 1244 * } 1245 * }</pre> 1246 * 1247 * @param request The request object containing all of the parameters for the API call. 1248 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1249 */ listAdminOverrides( ListAdminOverridesRequest request)1250 public final ListAdminOverridesPagedResponse listAdminOverrides( 1251 ListAdminOverridesRequest request) { 1252 return listAdminOverridesPagedCallable().call(request); 1253 } 1254 1255 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1256 /** 1257 * Lists all admin overrides on this limit. 1258 * 1259 * <p>Sample code: 1260 * 1261 * <pre>{@code 1262 * // This snippet has been automatically generated and should be regarded as a code template only. 1263 * // It will require modifications to work: 1264 * // - It may require correct/in-range values for request initialization. 1265 * // - It may require specifying regional endpoints when creating the service client as shown in 1266 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1267 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1268 * ListAdminOverridesRequest request = 1269 * ListAdminOverridesRequest.newBuilder() 1270 * .setParent("parent-995424086") 1271 * .setPageSize(883849137) 1272 * .setPageToken("pageToken873572522") 1273 * .build(); 1274 * ApiFuture<QuotaOverride> future = 1275 * serviceUsageClient.listAdminOverridesPagedCallable().futureCall(request); 1276 * // Do something. 1277 * for (QuotaOverride element : future.get().iterateAll()) { 1278 * // doThingsWith(element); 1279 * } 1280 * } 1281 * }</pre> 1282 */ 1283 public final UnaryCallable<ListAdminOverridesRequest, ListAdminOverridesPagedResponse> listAdminOverridesPagedCallable()1284 listAdminOverridesPagedCallable() { 1285 return stub.listAdminOverridesPagedCallable(); 1286 } 1287 1288 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1289 /** 1290 * Lists all admin overrides on this limit. 1291 * 1292 * <p>Sample code: 1293 * 1294 * <pre>{@code 1295 * // This snippet has been automatically generated and should be regarded as a code template only. 1296 * // It will require modifications to work: 1297 * // - It may require correct/in-range values for request initialization. 1298 * // - It may require specifying regional endpoints when creating the service client as shown in 1299 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1300 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1301 * ListAdminOverridesRequest request = 1302 * ListAdminOverridesRequest.newBuilder() 1303 * .setParent("parent-995424086") 1304 * .setPageSize(883849137) 1305 * .setPageToken("pageToken873572522") 1306 * .build(); 1307 * while (true) { 1308 * ListAdminOverridesResponse response = 1309 * serviceUsageClient.listAdminOverridesCallable().call(request); 1310 * for (QuotaOverride element : response.getOverridesList()) { 1311 * // doThingsWith(element); 1312 * } 1313 * String nextPageToken = response.getNextPageToken(); 1314 * if (!Strings.isNullOrEmpty(nextPageToken)) { 1315 * request = request.toBuilder().setPageToken(nextPageToken).build(); 1316 * } else { 1317 * break; 1318 * } 1319 * } 1320 * } 1321 * }</pre> 1322 */ 1323 public final UnaryCallable<ListAdminOverridesRequest, ListAdminOverridesResponse> listAdminOverridesCallable()1324 listAdminOverridesCallable() { 1325 return stub.listAdminOverridesCallable(); 1326 } 1327 1328 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1329 /** 1330 * Creates or updates multiple admin overrides atomically, all on the same consumer, but on many 1331 * different metrics or limits. The name field in the quota override message should not be set. 1332 * 1333 * <p>Sample code: 1334 * 1335 * <pre>{@code 1336 * // This snippet has been automatically generated and should be regarded as a code template only. 1337 * // It will require modifications to work: 1338 * // - It may require correct/in-range values for request initialization. 1339 * // - It may require specifying regional endpoints when creating the service client as shown in 1340 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1341 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1342 * ImportAdminOverridesRequest request = 1343 * ImportAdminOverridesRequest.newBuilder() 1344 * .setParent("parent-995424086") 1345 * .setForce(true) 1346 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 1347 * .build(); 1348 * ImportAdminOverridesResponse response = 1349 * serviceUsageClient.importAdminOverridesAsync(request).get(); 1350 * } 1351 * }</pre> 1352 * 1353 * @param request The request object containing all of the parameters for the API call. 1354 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1355 */ 1356 public final OperationFuture<ImportAdminOverridesResponse, ImportAdminOverridesMetadata> importAdminOverridesAsync(ImportAdminOverridesRequest request)1357 importAdminOverridesAsync(ImportAdminOverridesRequest request) { 1358 return importAdminOverridesOperationCallable().futureCall(request); 1359 } 1360 1361 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1362 /** 1363 * Creates or updates multiple admin overrides atomically, all on the same consumer, but on many 1364 * different metrics or limits. The name field in the quota override message should not be set. 1365 * 1366 * <p>Sample code: 1367 * 1368 * <pre>{@code 1369 * // This snippet has been automatically generated and should be regarded as a code template only. 1370 * // It will require modifications to work: 1371 * // - It may require correct/in-range values for request initialization. 1372 * // - It may require specifying regional endpoints when creating the service client as shown in 1373 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1374 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1375 * ImportAdminOverridesRequest request = 1376 * ImportAdminOverridesRequest.newBuilder() 1377 * .setParent("parent-995424086") 1378 * .setForce(true) 1379 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 1380 * .build(); 1381 * OperationFuture<ImportAdminOverridesResponse, ImportAdminOverridesMetadata> future = 1382 * serviceUsageClient.importAdminOverridesOperationCallable().futureCall(request); 1383 * // Do something. 1384 * ImportAdminOverridesResponse response = future.get(); 1385 * } 1386 * }</pre> 1387 */ 1388 public final OperationCallable< 1389 ImportAdminOverridesRequest, ImportAdminOverridesResponse, ImportAdminOverridesMetadata> importAdminOverridesOperationCallable()1390 importAdminOverridesOperationCallable() { 1391 return stub.importAdminOverridesOperationCallable(); 1392 } 1393 1394 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1395 /** 1396 * Creates or updates multiple admin overrides atomically, all on the same consumer, but on many 1397 * different metrics or limits. The name field in the quota override message should not be set. 1398 * 1399 * <p>Sample code: 1400 * 1401 * <pre>{@code 1402 * // This snippet has been automatically generated and should be regarded as a code template only. 1403 * // It will require modifications to work: 1404 * // - It may require correct/in-range values for request initialization. 1405 * // - It may require specifying regional endpoints when creating the service client as shown in 1406 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1407 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1408 * ImportAdminOverridesRequest request = 1409 * ImportAdminOverridesRequest.newBuilder() 1410 * .setParent("parent-995424086") 1411 * .setForce(true) 1412 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 1413 * .build(); 1414 * ApiFuture<Operation> future = 1415 * serviceUsageClient.importAdminOverridesCallable().futureCall(request); 1416 * // Do something. 1417 * Operation response = future.get(); 1418 * } 1419 * }</pre> 1420 */ 1421 public final UnaryCallable<ImportAdminOverridesRequest, Operation> importAdminOverridesCallable()1422 importAdminOverridesCallable() { 1423 return stub.importAdminOverridesCallable(); 1424 } 1425 1426 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1427 /** 1428 * Creates a consumer override. A consumer override is applied to the consumer on its own 1429 * authority to limit its own quota usage. Consumer overrides cannot be used to grant more quota 1430 * than would be allowed by admin overrides, producer overrides, or the default limit of the 1431 * service. 1432 * 1433 * <p>Sample code: 1434 * 1435 * <pre>{@code 1436 * // This snippet has been automatically generated and should be regarded as a code template only. 1437 * // It will require modifications to work: 1438 * // - It may require correct/in-range values for request initialization. 1439 * // - It may require specifying regional endpoints when creating the service client as shown in 1440 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1441 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1442 * CreateConsumerOverrideRequest request = 1443 * CreateConsumerOverrideRequest.newBuilder() 1444 * .setParent("parent-995424086") 1445 * .setOverride(QuotaOverride.newBuilder().build()) 1446 * .setForce(true) 1447 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 1448 * .build(); 1449 * QuotaOverride response = serviceUsageClient.createConsumerOverrideAsync(request).get(); 1450 * } 1451 * }</pre> 1452 * 1453 * @param request The request object containing all of the parameters for the API call. 1454 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1455 */ createConsumerOverrideAsync( CreateConsumerOverrideRequest request)1456 public final OperationFuture<QuotaOverride, OperationMetadata> createConsumerOverrideAsync( 1457 CreateConsumerOverrideRequest request) { 1458 return createConsumerOverrideOperationCallable().futureCall(request); 1459 } 1460 1461 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1462 /** 1463 * Creates a consumer override. A consumer override is applied to the consumer on its own 1464 * authority to limit its own quota usage. Consumer overrides cannot be used to grant more quota 1465 * than would be allowed by admin overrides, producer overrides, or the default limit of the 1466 * service. 1467 * 1468 * <p>Sample code: 1469 * 1470 * <pre>{@code 1471 * // This snippet has been automatically generated and should be regarded as a code template only. 1472 * // It will require modifications to work: 1473 * // - It may require correct/in-range values for request initialization. 1474 * // - It may require specifying regional endpoints when creating the service client as shown in 1475 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1476 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1477 * CreateConsumerOverrideRequest request = 1478 * CreateConsumerOverrideRequest.newBuilder() 1479 * .setParent("parent-995424086") 1480 * .setOverride(QuotaOverride.newBuilder().build()) 1481 * .setForce(true) 1482 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 1483 * .build(); 1484 * OperationFuture<QuotaOverride, OperationMetadata> future = 1485 * serviceUsageClient.createConsumerOverrideOperationCallable().futureCall(request); 1486 * // Do something. 1487 * QuotaOverride response = future.get(); 1488 * } 1489 * }</pre> 1490 */ 1491 public final OperationCallable<CreateConsumerOverrideRequest, QuotaOverride, OperationMetadata> createConsumerOverrideOperationCallable()1492 createConsumerOverrideOperationCallable() { 1493 return stub.createConsumerOverrideOperationCallable(); 1494 } 1495 1496 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1497 /** 1498 * Creates a consumer override. A consumer override is applied to the consumer on its own 1499 * authority to limit its own quota usage. Consumer overrides cannot be used to grant more quota 1500 * than would be allowed by admin overrides, producer overrides, or the default limit of the 1501 * service. 1502 * 1503 * <p>Sample code: 1504 * 1505 * <pre>{@code 1506 * // This snippet has been automatically generated and should be regarded as a code template only. 1507 * // It will require modifications to work: 1508 * // - It may require correct/in-range values for request initialization. 1509 * // - It may require specifying regional endpoints when creating the service client as shown in 1510 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1511 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1512 * CreateConsumerOverrideRequest request = 1513 * CreateConsumerOverrideRequest.newBuilder() 1514 * .setParent("parent-995424086") 1515 * .setOverride(QuotaOverride.newBuilder().build()) 1516 * .setForce(true) 1517 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 1518 * .build(); 1519 * ApiFuture<Operation> future = 1520 * serviceUsageClient.createConsumerOverrideCallable().futureCall(request); 1521 * // Do something. 1522 * Operation response = future.get(); 1523 * } 1524 * }</pre> 1525 */ 1526 public final UnaryCallable<CreateConsumerOverrideRequest, Operation> createConsumerOverrideCallable()1527 createConsumerOverrideCallable() { 1528 return stub.createConsumerOverrideCallable(); 1529 } 1530 1531 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1532 /** 1533 * Updates a consumer override. 1534 * 1535 * <p>Sample code: 1536 * 1537 * <pre>{@code 1538 * // This snippet has been automatically generated and should be regarded as a code template only. 1539 * // It will require modifications to work: 1540 * // - It may require correct/in-range values for request initialization. 1541 * // - It may require specifying regional endpoints when creating the service client as shown in 1542 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1543 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1544 * UpdateConsumerOverrideRequest request = 1545 * UpdateConsumerOverrideRequest.newBuilder() 1546 * .setName("name3373707") 1547 * .setOverride(QuotaOverride.newBuilder().build()) 1548 * .setForce(true) 1549 * .setUpdateMask(FieldMask.newBuilder().build()) 1550 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 1551 * .build(); 1552 * QuotaOverride response = serviceUsageClient.updateConsumerOverrideAsync(request).get(); 1553 * } 1554 * }</pre> 1555 * 1556 * @param request The request object containing all of the parameters for the API call. 1557 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1558 */ updateConsumerOverrideAsync( UpdateConsumerOverrideRequest request)1559 public final OperationFuture<QuotaOverride, OperationMetadata> updateConsumerOverrideAsync( 1560 UpdateConsumerOverrideRequest request) { 1561 return updateConsumerOverrideOperationCallable().futureCall(request); 1562 } 1563 1564 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1565 /** 1566 * Updates a consumer override. 1567 * 1568 * <p>Sample code: 1569 * 1570 * <pre>{@code 1571 * // This snippet has been automatically generated and should be regarded as a code template only. 1572 * // It will require modifications to work: 1573 * // - It may require correct/in-range values for request initialization. 1574 * // - It may require specifying regional endpoints when creating the service client as shown in 1575 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1576 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1577 * UpdateConsumerOverrideRequest request = 1578 * UpdateConsumerOverrideRequest.newBuilder() 1579 * .setName("name3373707") 1580 * .setOverride(QuotaOverride.newBuilder().build()) 1581 * .setForce(true) 1582 * .setUpdateMask(FieldMask.newBuilder().build()) 1583 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 1584 * .build(); 1585 * OperationFuture<QuotaOverride, OperationMetadata> future = 1586 * serviceUsageClient.updateConsumerOverrideOperationCallable().futureCall(request); 1587 * // Do something. 1588 * QuotaOverride response = future.get(); 1589 * } 1590 * }</pre> 1591 */ 1592 public final OperationCallable<UpdateConsumerOverrideRequest, QuotaOverride, OperationMetadata> updateConsumerOverrideOperationCallable()1593 updateConsumerOverrideOperationCallable() { 1594 return stub.updateConsumerOverrideOperationCallable(); 1595 } 1596 1597 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1598 /** 1599 * Updates a consumer override. 1600 * 1601 * <p>Sample code: 1602 * 1603 * <pre>{@code 1604 * // This snippet has been automatically generated and should be regarded as a code template only. 1605 * // It will require modifications to work: 1606 * // - It may require correct/in-range values for request initialization. 1607 * // - It may require specifying regional endpoints when creating the service client as shown in 1608 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1609 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1610 * UpdateConsumerOverrideRequest request = 1611 * UpdateConsumerOverrideRequest.newBuilder() 1612 * .setName("name3373707") 1613 * .setOverride(QuotaOverride.newBuilder().build()) 1614 * .setForce(true) 1615 * .setUpdateMask(FieldMask.newBuilder().build()) 1616 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 1617 * .build(); 1618 * ApiFuture<Operation> future = 1619 * serviceUsageClient.updateConsumerOverrideCallable().futureCall(request); 1620 * // Do something. 1621 * Operation response = future.get(); 1622 * } 1623 * }</pre> 1624 */ 1625 public final UnaryCallable<UpdateConsumerOverrideRequest, Operation> updateConsumerOverrideCallable()1626 updateConsumerOverrideCallable() { 1627 return stub.updateConsumerOverrideCallable(); 1628 } 1629 1630 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1631 /** 1632 * Deletes a consumer override. 1633 * 1634 * <p>Sample code: 1635 * 1636 * <pre>{@code 1637 * // This snippet has been automatically generated and should be regarded as a code template only. 1638 * // It will require modifications to work: 1639 * // - It may require correct/in-range values for request initialization. 1640 * // - It may require specifying regional endpoints when creating the service client as shown in 1641 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1642 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1643 * DeleteConsumerOverrideRequest request = 1644 * DeleteConsumerOverrideRequest.newBuilder() 1645 * .setName("name3373707") 1646 * .setForce(true) 1647 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 1648 * .build(); 1649 * serviceUsageClient.deleteConsumerOverrideAsync(request).get(); 1650 * } 1651 * }</pre> 1652 * 1653 * @param request The request object containing all of the parameters for the API call. 1654 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1655 */ deleteConsumerOverrideAsync( DeleteConsumerOverrideRequest request)1656 public final OperationFuture<Empty, OperationMetadata> deleteConsumerOverrideAsync( 1657 DeleteConsumerOverrideRequest request) { 1658 return deleteConsumerOverrideOperationCallable().futureCall(request); 1659 } 1660 1661 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1662 /** 1663 * Deletes a consumer override. 1664 * 1665 * <p>Sample code: 1666 * 1667 * <pre>{@code 1668 * // This snippet has been automatically generated and should be regarded as a code template only. 1669 * // It will require modifications to work: 1670 * // - It may require correct/in-range values for request initialization. 1671 * // - It may require specifying regional endpoints when creating the service client as shown in 1672 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1673 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1674 * DeleteConsumerOverrideRequest request = 1675 * DeleteConsumerOverrideRequest.newBuilder() 1676 * .setName("name3373707") 1677 * .setForce(true) 1678 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 1679 * .build(); 1680 * OperationFuture<Empty, OperationMetadata> future = 1681 * serviceUsageClient.deleteConsumerOverrideOperationCallable().futureCall(request); 1682 * // Do something. 1683 * future.get(); 1684 * } 1685 * }</pre> 1686 */ 1687 public final OperationCallable<DeleteConsumerOverrideRequest, Empty, OperationMetadata> deleteConsumerOverrideOperationCallable()1688 deleteConsumerOverrideOperationCallable() { 1689 return stub.deleteConsumerOverrideOperationCallable(); 1690 } 1691 1692 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1693 /** 1694 * Deletes a consumer override. 1695 * 1696 * <p>Sample code: 1697 * 1698 * <pre>{@code 1699 * // This snippet has been automatically generated and should be regarded as a code template only. 1700 * // It will require modifications to work: 1701 * // - It may require correct/in-range values for request initialization. 1702 * // - It may require specifying regional endpoints when creating the service client as shown in 1703 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1704 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1705 * DeleteConsumerOverrideRequest request = 1706 * DeleteConsumerOverrideRequest.newBuilder() 1707 * .setName("name3373707") 1708 * .setForce(true) 1709 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 1710 * .build(); 1711 * ApiFuture<Operation> future = 1712 * serviceUsageClient.deleteConsumerOverrideCallable().futureCall(request); 1713 * // Do something. 1714 * future.get(); 1715 * } 1716 * }</pre> 1717 */ 1718 public final UnaryCallable<DeleteConsumerOverrideRequest, Operation> deleteConsumerOverrideCallable()1719 deleteConsumerOverrideCallable() { 1720 return stub.deleteConsumerOverrideCallable(); 1721 } 1722 1723 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1724 /** 1725 * Lists all consumer overrides on this limit. 1726 * 1727 * <p>Sample code: 1728 * 1729 * <pre>{@code 1730 * // This snippet has been automatically generated and should be regarded as a code template only. 1731 * // It will require modifications to work: 1732 * // - It may require correct/in-range values for request initialization. 1733 * // - It may require specifying regional endpoints when creating the service client as shown in 1734 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1735 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1736 * ListConsumerOverridesRequest request = 1737 * ListConsumerOverridesRequest.newBuilder() 1738 * .setParent("parent-995424086") 1739 * .setPageSize(883849137) 1740 * .setPageToken("pageToken873572522") 1741 * .build(); 1742 * for (QuotaOverride element : serviceUsageClient.listConsumerOverrides(request).iterateAll()) { 1743 * // doThingsWith(element); 1744 * } 1745 * } 1746 * }</pre> 1747 * 1748 * @param request The request object containing all of the parameters for the API call. 1749 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1750 */ listConsumerOverrides( ListConsumerOverridesRequest request)1751 public final ListConsumerOverridesPagedResponse listConsumerOverrides( 1752 ListConsumerOverridesRequest request) { 1753 return listConsumerOverridesPagedCallable().call(request); 1754 } 1755 1756 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1757 /** 1758 * Lists all consumer overrides on this limit. 1759 * 1760 * <p>Sample code: 1761 * 1762 * <pre>{@code 1763 * // This snippet has been automatically generated and should be regarded as a code template only. 1764 * // It will require modifications to work: 1765 * // - It may require correct/in-range values for request initialization. 1766 * // - It may require specifying regional endpoints when creating the service client as shown in 1767 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1768 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1769 * ListConsumerOverridesRequest request = 1770 * ListConsumerOverridesRequest.newBuilder() 1771 * .setParent("parent-995424086") 1772 * .setPageSize(883849137) 1773 * .setPageToken("pageToken873572522") 1774 * .build(); 1775 * ApiFuture<QuotaOverride> future = 1776 * serviceUsageClient.listConsumerOverridesPagedCallable().futureCall(request); 1777 * // Do something. 1778 * for (QuotaOverride element : future.get().iterateAll()) { 1779 * // doThingsWith(element); 1780 * } 1781 * } 1782 * }</pre> 1783 */ 1784 public final UnaryCallable<ListConsumerOverridesRequest, ListConsumerOverridesPagedResponse> listConsumerOverridesPagedCallable()1785 listConsumerOverridesPagedCallable() { 1786 return stub.listConsumerOverridesPagedCallable(); 1787 } 1788 1789 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1790 /** 1791 * Lists all consumer overrides on this limit. 1792 * 1793 * <p>Sample code: 1794 * 1795 * <pre>{@code 1796 * // This snippet has been automatically generated and should be regarded as a code template only. 1797 * // It will require modifications to work: 1798 * // - It may require correct/in-range values for request initialization. 1799 * // - It may require specifying regional endpoints when creating the service client as shown in 1800 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1801 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1802 * ListConsumerOverridesRequest request = 1803 * ListConsumerOverridesRequest.newBuilder() 1804 * .setParent("parent-995424086") 1805 * .setPageSize(883849137) 1806 * .setPageToken("pageToken873572522") 1807 * .build(); 1808 * while (true) { 1809 * ListConsumerOverridesResponse response = 1810 * serviceUsageClient.listConsumerOverridesCallable().call(request); 1811 * for (QuotaOverride element : response.getOverridesList()) { 1812 * // doThingsWith(element); 1813 * } 1814 * String nextPageToken = response.getNextPageToken(); 1815 * if (!Strings.isNullOrEmpty(nextPageToken)) { 1816 * request = request.toBuilder().setPageToken(nextPageToken).build(); 1817 * } else { 1818 * break; 1819 * } 1820 * } 1821 * } 1822 * }</pre> 1823 */ 1824 public final UnaryCallable<ListConsumerOverridesRequest, ListConsumerOverridesResponse> listConsumerOverridesCallable()1825 listConsumerOverridesCallable() { 1826 return stub.listConsumerOverridesCallable(); 1827 } 1828 1829 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1830 /** 1831 * Creates or updates multiple consumer overrides atomically, all on the same consumer, but on 1832 * many different metrics or limits. The name field in the quota override message should not be 1833 * set. 1834 * 1835 * <p>Sample code: 1836 * 1837 * <pre>{@code 1838 * // This snippet has been automatically generated and should be regarded as a code template only. 1839 * // It will require modifications to work: 1840 * // - It may require correct/in-range values for request initialization. 1841 * // - It may require specifying regional endpoints when creating the service client as shown in 1842 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1843 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1844 * ImportConsumerOverridesRequest request = 1845 * ImportConsumerOverridesRequest.newBuilder() 1846 * .setParent("parent-995424086") 1847 * .setForce(true) 1848 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 1849 * .build(); 1850 * ImportConsumerOverridesResponse response = 1851 * serviceUsageClient.importConsumerOverridesAsync(request).get(); 1852 * } 1853 * }</pre> 1854 * 1855 * @param request The request object containing all of the parameters for the API call. 1856 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1857 */ 1858 public final OperationFuture<ImportConsumerOverridesResponse, ImportConsumerOverridesMetadata> importConsumerOverridesAsync(ImportConsumerOverridesRequest request)1859 importConsumerOverridesAsync(ImportConsumerOverridesRequest request) { 1860 return importConsumerOverridesOperationCallable().futureCall(request); 1861 } 1862 1863 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1864 /** 1865 * Creates or updates multiple consumer overrides atomically, all on the same consumer, but on 1866 * many different metrics or limits. The name field in the quota override message should not be 1867 * set. 1868 * 1869 * <p>Sample code: 1870 * 1871 * <pre>{@code 1872 * // This snippet has been automatically generated and should be regarded as a code template only. 1873 * // It will require modifications to work: 1874 * // - It may require correct/in-range values for request initialization. 1875 * // - It may require specifying regional endpoints when creating the service client as shown in 1876 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1877 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1878 * ImportConsumerOverridesRequest request = 1879 * ImportConsumerOverridesRequest.newBuilder() 1880 * .setParent("parent-995424086") 1881 * .setForce(true) 1882 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 1883 * .build(); 1884 * OperationFuture<ImportConsumerOverridesResponse, ImportConsumerOverridesMetadata> future = 1885 * serviceUsageClient.importConsumerOverridesOperationCallable().futureCall(request); 1886 * // Do something. 1887 * ImportConsumerOverridesResponse response = future.get(); 1888 * } 1889 * }</pre> 1890 */ 1891 public final OperationCallable< 1892 ImportConsumerOverridesRequest, 1893 ImportConsumerOverridesResponse, 1894 ImportConsumerOverridesMetadata> importConsumerOverridesOperationCallable()1895 importConsumerOverridesOperationCallable() { 1896 return stub.importConsumerOverridesOperationCallable(); 1897 } 1898 1899 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1900 /** 1901 * Creates or updates multiple consumer overrides atomically, all on the same consumer, but on 1902 * many different metrics or limits. The name field in the quota override message should not be 1903 * set. 1904 * 1905 * <p>Sample code: 1906 * 1907 * <pre>{@code 1908 * // This snippet has been automatically generated and should be regarded as a code template only. 1909 * // It will require modifications to work: 1910 * // - It may require correct/in-range values for request initialization. 1911 * // - It may require specifying regional endpoints when creating the service client as shown in 1912 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1913 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1914 * ImportConsumerOverridesRequest request = 1915 * ImportConsumerOverridesRequest.newBuilder() 1916 * .setParent("parent-995424086") 1917 * .setForce(true) 1918 * .addAllForceOnly(new ArrayList<QuotaSafetyCheck>()) 1919 * .build(); 1920 * ApiFuture<Operation> future = 1921 * serviceUsageClient.importConsumerOverridesCallable().futureCall(request); 1922 * // Do something. 1923 * Operation response = future.get(); 1924 * } 1925 * }</pre> 1926 */ 1927 public final UnaryCallable<ImportConsumerOverridesRequest, Operation> importConsumerOverridesCallable()1928 importConsumerOverridesCallable() { 1929 return stub.importConsumerOverridesCallable(); 1930 } 1931 1932 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1933 /** 1934 * Generates service identity for service. 1935 * 1936 * <p>Sample code: 1937 * 1938 * <pre>{@code 1939 * // This snippet has been automatically generated and should be regarded as a code template only. 1940 * // It will require modifications to work: 1941 * // - It may require correct/in-range values for request initialization. 1942 * // - It may require specifying regional endpoints when creating the service client as shown in 1943 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1944 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1945 * GenerateServiceIdentityRequest request = 1946 * GenerateServiceIdentityRequest.newBuilder().setParent("parent-995424086").build(); 1947 * ServiceIdentity response = serviceUsageClient.generateServiceIdentityAsync(request).get(); 1948 * } 1949 * }</pre> 1950 * 1951 * @param request The request object containing all of the parameters for the API call. 1952 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1953 */ generateServiceIdentityAsync( GenerateServiceIdentityRequest request)1954 public final OperationFuture<ServiceIdentity, Empty> generateServiceIdentityAsync( 1955 GenerateServiceIdentityRequest request) { 1956 return generateServiceIdentityOperationCallable().futureCall(request); 1957 } 1958 1959 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1960 /** 1961 * Generates service identity for service. 1962 * 1963 * <p>Sample code: 1964 * 1965 * <pre>{@code 1966 * // This snippet has been automatically generated and should be regarded as a code template only. 1967 * // It will require modifications to work: 1968 * // - It may require correct/in-range values for request initialization. 1969 * // - It may require specifying regional endpoints when creating the service client as shown in 1970 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1971 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1972 * GenerateServiceIdentityRequest request = 1973 * GenerateServiceIdentityRequest.newBuilder().setParent("parent-995424086").build(); 1974 * OperationFuture<ServiceIdentity, Empty> future = 1975 * serviceUsageClient.generateServiceIdentityOperationCallable().futureCall(request); 1976 * // Do something. 1977 * ServiceIdentity response = future.get(); 1978 * } 1979 * }</pre> 1980 */ 1981 public final OperationCallable<GenerateServiceIdentityRequest, ServiceIdentity, Empty> generateServiceIdentityOperationCallable()1982 generateServiceIdentityOperationCallable() { 1983 return stub.generateServiceIdentityOperationCallable(); 1984 } 1985 1986 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1987 /** 1988 * Generates service identity for service. 1989 * 1990 * <p>Sample code: 1991 * 1992 * <pre>{@code 1993 * // This snippet has been automatically generated and should be regarded as a code template only. 1994 * // It will require modifications to work: 1995 * // - It may require correct/in-range values for request initialization. 1996 * // - It may require specifying regional endpoints when creating the service client as shown in 1997 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1998 * try (ServiceUsageClient serviceUsageClient = ServiceUsageClient.create()) { 1999 * GenerateServiceIdentityRequest request = 2000 * GenerateServiceIdentityRequest.newBuilder().setParent("parent-995424086").build(); 2001 * ApiFuture<Operation> future = 2002 * serviceUsageClient.generateServiceIdentityCallable().futureCall(request); 2003 * // Do something. 2004 * Operation response = future.get(); 2005 * } 2006 * }</pre> 2007 */ 2008 public final UnaryCallable<GenerateServiceIdentityRequest, Operation> generateServiceIdentityCallable()2009 generateServiceIdentityCallable() { 2010 return stub.generateServiceIdentityCallable(); 2011 } 2012 2013 @Override close()2014 public final void close() { 2015 stub.close(); 2016 } 2017 2018 @Override shutdown()2019 public void shutdown() { 2020 stub.shutdown(); 2021 } 2022 2023 @Override isShutdown()2024 public boolean isShutdown() { 2025 return stub.isShutdown(); 2026 } 2027 2028 @Override isTerminated()2029 public boolean isTerminated() { 2030 return stub.isTerminated(); 2031 } 2032 2033 @Override shutdownNow()2034 public void shutdownNow() { 2035 stub.shutdownNow(); 2036 } 2037 2038 @Override awaitTermination(long duration, TimeUnit unit)2039 public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { 2040 return stub.awaitTermination(duration, unit); 2041 } 2042 2043 public static class ListServicesPagedResponse 2044 extends AbstractPagedListResponse< 2045 ListServicesRequest, 2046 ListServicesResponse, 2047 Service, 2048 ListServicesPage, 2049 ListServicesFixedSizeCollection> { 2050 createAsync( PageContext<ListServicesRequest, ListServicesResponse, Service> context, ApiFuture<ListServicesResponse> futureResponse)2051 public static ApiFuture<ListServicesPagedResponse> createAsync( 2052 PageContext<ListServicesRequest, ListServicesResponse, Service> context, 2053 ApiFuture<ListServicesResponse> futureResponse) { 2054 ApiFuture<ListServicesPage> futurePage = 2055 ListServicesPage.createEmptyPage().createPageAsync(context, futureResponse); 2056 return ApiFutures.transform( 2057 futurePage, 2058 input -> new ListServicesPagedResponse(input), 2059 MoreExecutors.directExecutor()); 2060 } 2061 ListServicesPagedResponse(ListServicesPage page)2062 private ListServicesPagedResponse(ListServicesPage page) { 2063 super(page, ListServicesFixedSizeCollection.createEmptyCollection()); 2064 } 2065 } 2066 2067 public static class ListServicesPage 2068 extends AbstractPage<ListServicesRequest, ListServicesResponse, Service, ListServicesPage> { 2069 ListServicesPage( PageContext<ListServicesRequest, ListServicesResponse, Service> context, ListServicesResponse response)2070 private ListServicesPage( 2071 PageContext<ListServicesRequest, ListServicesResponse, Service> context, 2072 ListServicesResponse response) { 2073 super(context, response); 2074 } 2075 createEmptyPage()2076 private static ListServicesPage createEmptyPage() { 2077 return new ListServicesPage(null, null); 2078 } 2079 2080 @Override createPage( PageContext<ListServicesRequest, ListServicesResponse, Service> context, ListServicesResponse response)2081 protected ListServicesPage createPage( 2082 PageContext<ListServicesRequest, ListServicesResponse, Service> context, 2083 ListServicesResponse response) { 2084 return new ListServicesPage(context, response); 2085 } 2086 2087 @Override createPageAsync( PageContext<ListServicesRequest, ListServicesResponse, Service> context, ApiFuture<ListServicesResponse> futureResponse)2088 public ApiFuture<ListServicesPage> createPageAsync( 2089 PageContext<ListServicesRequest, ListServicesResponse, Service> context, 2090 ApiFuture<ListServicesResponse> futureResponse) { 2091 return super.createPageAsync(context, futureResponse); 2092 } 2093 } 2094 2095 public static class ListServicesFixedSizeCollection 2096 extends AbstractFixedSizeCollection< 2097 ListServicesRequest, 2098 ListServicesResponse, 2099 Service, 2100 ListServicesPage, 2101 ListServicesFixedSizeCollection> { 2102 ListServicesFixedSizeCollection(List<ListServicesPage> pages, int collectionSize)2103 private ListServicesFixedSizeCollection(List<ListServicesPage> pages, int collectionSize) { 2104 super(pages, collectionSize); 2105 } 2106 createEmptyCollection()2107 private static ListServicesFixedSizeCollection createEmptyCollection() { 2108 return new ListServicesFixedSizeCollection(null, 0); 2109 } 2110 2111 @Override createCollection( List<ListServicesPage> pages, int collectionSize)2112 protected ListServicesFixedSizeCollection createCollection( 2113 List<ListServicesPage> pages, int collectionSize) { 2114 return new ListServicesFixedSizeCollection(pages, collectionSize); 2115 } 2116 } 2117 2118 public static class ListConsumerQuotaMetricsPagedResponse 2119 extends AbstractPagedListResponse< 2120 ListConsumerQuotaMetricsRequest, 2121 ListConsumerQuotaMetricsResponse, 2122 ConsumerQuotaMetric, 2123 ListConsumerQuotaMetricsPage, 2124 ListConsumerQuotaMetricsFixedSizeCollection> { 2125 createAsync( PageContext< ListConsumerQuotaMetricsRequest, ListConsumerQuotaMetricsResponse, ConsumerQuotaMetric> context, ApiFuture<ListConsumerQuotaMetricsResponse> futureResponse)2126 public static ApiFuture<ListConsumerQuotaMetricsPagedResponse> createAsync( 2127 PageContext< 2128 ListConsumerQuotaMetricsRequest, 2129 ListConsumerQuotaMetricsResponse, 2130 ConsumerQuotaMetric> 2131 context, 2132 ApiFuture<ListConsumerQuotaMetricsResponse> futureResponse) { 2133 ApiFuture<ListConsumerQuotaMetricsPage> futurePage = 2134 ListConsumerQuotaMetricsPage.createEmptyPage().createPageAsync(context, futureResponse); 2135 return ApiFutures.transform( 2136 futurePage, 2137 input -> new ListConsumerQuotaMetricsPagedResponse(input), 2138 MoreExecutors.directExecutor()); 2139 } 2140 ListConsumerQuotaMetricsPagedResponse(ListConsumerQuotaMetricsPage page)2141 private ListConsumerQuotaMetricsPagedResponse(ListConsumerQuotaMetricsPage page) { 2142 super(page, ListConsumerQuotaMetricsFixedSizeCollection.createEmptyCollection()); 2143 } 2144 } 2145 2146 public static class ListConsumerQuotaMetricsPage 2147 extends AbstractPage< 2148 ListConsumerQuotaMetricsRequest, 2149 ListConsumerQuotaMetricsResponse, 2150 ConsumerQuotaMetric, 2151 ListConsumerQuotaMetricsPage> { 2152 ListConsumerQuotaMetricsPage( PageContext< ListConsumerQuotaMetricsRequest, ListConsumerQuotaMetricsResponse, ConsumerQuotaMetric> context, ListConsumerQuotaMetricsResponse response)2153 private ListConsumerQuotaMetricsPage( 2154 PageContext< 2155 ListConsumerQuotaMetricsRequest, 2156 ListConsumerQuotaMetricsResponse, 2157 ConsumerQuotaMetric> 2158 context, 2159 ListConsumerQuotaMetricsResponse response) { 2160 super(context, response); 2161 } 2162 createEmptyPage()2163 private static ListConsumerQuotaMetricsPage createEmptyPage() { 2164 return new ListConsumerQuotaMetricsPage(null, null); 2165 } 2166 2167 @Override createPage( PageContext< ListConsumerQuotaMetricsRequest, ListConsumerQuotaMetricsResponse, ConsumerQuotaMetric> context, ListConsumerQuotaMetricsResponse response)2168 protected ListConsumerQuotaMetricsPage createPage( 2169 PageContext< 2170 ListConsumerQuotaMetricsRequest, 2171 ListConsumerQuotaMetricsResponse, 2172 ConsumerQuotaMetric> 2173 context, 2174 ListConsumerQuotaMetricsResponse response) { 2175 return new ListConsumerQuotaMetricsPage(context, response); 2176 } 2177 2178 @Override createPageAsync( PageContext< ListConsumerQuotaMetricsRequest, ListConsumerQuotaMetricsResponse, ConsumerQuotaMetric> context, ApiFuture<ListConsumerQuotaMetricsResponse> futureResponse)2179 public ApiFuture<ListConsumerQuotaMetricsPage> createPageAsync( 2180 PageContext< 2181 ListConsumerQuotaMetricsRequest, 2182 ListConsumerQuotaMetricsResponse, 2183 ConsumerQuotaMetric> 2184 context, 2185 ApiFuture<ListConsumerQuotaMetricsResponse> futureResponse) { 2186 return super.createPageAsync(context, futureResponse); 2187 } 2188 } 2189 2190 public static class ListConsumerQuotaMetricsFixedSizeCollection 2191 extends AbstractFixedSizeCollection< 2192 ListConsumerQuotaMetricsRequest, 2193 ListConsumerQuotaMetricsResponse, 2194 ConsumerQuotaMetric, 2195 ListConsumerQuotaMetricsPage, 2196 ListConsumerQuotaMetricsFixedSizeCollection> { 2197 ListConsumerQuotaMetricsFixedSizeCollection( List<ListConsumerQuotaMetricsPage> pages, int collectionSize)2198 private ListConsumerQuotaMetricsFixedSizeCollection( 2199 List<ListConsumerQuotaMetricsPage> pages, int collectionSize) { 2200 super(pages, collectionSize); 2201 } 2202 createEmptyCollection()2203 private static ListConsumerQuotaMetricsFixedSizeCollection createEmptyCollection() { 2204 return new ListConsumerQuotaMetricsFixedSizeCollection(null, 0); 2205 } 2206 2207 @Override createCollection( List<ListConsumerQuotaMetricsPage> pages, int collectionSize)2208 protected ListConsumerQuotaMetricsFixedSizeCollection createCollection( 2209 List<ListConsumerQuotaMetricsPage> pages, int collectionSize) { 2210 return new ListConsumerQuotaMetricsFixedSizeCollection(pages, collectionSize); 2211 } 2212 } 2213 2214 public static class ListAdminOverridesPagedResponse 2215 extends AbstractPagedListResponse< 2216 ListAdminOverridesRequest, 2217 ListAdminOverridesResponse, 2218 QuotaOverride, 2219 ListAdminOverridesPage, 2220 ListAdminOverridesFixedSizeCollection> { 2221 createAsync( PageContext<ListAdminOverridesRequest, ListAdminOverridesResponse, QuotaOverride> context, ApiFuture<ListAdminOverridesResponse> futureResponse)2222 public static ApiFuture<ListAdminOverridesPagedResponse> createAsync( 2223 PageContext<ListAdminOverridesRequest, ListAdminOverridesResponse, QuotaOverride> context, 2224 ApiFuture<ListAdminOverridesResponse> futureResponse) { 2225 ApiFuture<ListAdminOverridesPage> futurePage = 2226 ListAdminOverridesPage.createEmptyPage().createPageAsync(context, futureResponse); 2227 return ApiFutures.transform( 2228 futurePage, 2229 input -> new ListAdminOverridesPagedResponse(input), 2230 MoreExecutors.directExecutor()); 2231 } 2232 ListAdminOverridesPagedResponse(ListAdminOverridesPage page)2233 private ListAdminOverridesPagedResponse(ListAdminOverridesPage page) { 2234 super(page, ListAdminOverridesFixedSizeCollection.createEmptyCollection()); 2235 } 2236 } 2237 2238 public static class ListAdminOverridesPage 2239 extends AbstractPage< 2240 ListAdminOverridesRequest, 2241 ListAdminOverridesResponse, 2242 QuotaOverride, 2243 ListAdminOverridesPage> { 2244 ListAdminOverridesPage( PageContext<ListAdminOverridesRequest, ListAdminOverridesResponse, QuotaOverride> context, ListAdminOverridesResponse response)2245 private ListAdminOverridesPage( 2246 PageContext<ListAdminOverridesRequest, ListAdminOverridesResponse, QuotaOverride> context, 2247 ListAdminOverridesResponse response) { 2248 super(context, response); 2249 } 2250 createEmptyPage()2251 private static ListAdminOverridesPage createEmptyPage() { 2252 return new ListAdminOverridesPage(null, null); 2253 } 2254 2255 @Override createPage( PageContext<ListAdminOverridesRequest, ListAdminOverridesResponse, QuotaOverride> context, ListAdminOverridesResponse response)2256 protected ListAdminOverridesPage createPage( 2257 PageContext<ListAdminOverridesRequest, ListAdminOverridesResponse, QuotaOverride> context, 2258 ListAdminOverridesResponse response) { 2259 return new ListAdminOverridesPage(context, response); 2260 } 2261 2262 @Override createPageAsync( PageContext<ListAdminOverridesRequest, ListAdminOverridesResponse, QuotaOverride> context, ApiFuture<ListAdminOverridesResponse> futureResponse)2263 public ApiFuture<ListAdminOverridesPage> createPageAsync( 2264 PageContext<ListAdminOverridesRequest, ListAdminOverridesResponse, QuotaOverride> context, 2265 ApiFuture<ListAdminOverridesResponse> futureResponse) { 2266 return super.createPageAsync(context, futureResponse); 2267 } 2268 } 2269 2270 public static class ListAdminOverridesFixedSizeCollection 2271 extends AbstractFixedSizeCollection< 2272 ListAdminOverridesRequest, 2273 ListAdminOverridesResponse, 2274 QuotaOverride, 2275 ListAdminOverridesPage, 2276 ListAdminOverridesFixedSizeCollection> { 2277 ListAdminOverridesFixedSizeCollection( List<ListAdminOverridesPage> pages, int collectionSize)2278 private ListAdminOverridesFixedSizeCollection( 2279 List<ListAdminOverridesPage> pages, int collectionSize) { 2280 super(pages, collectionSize); 2281 } 2282 createEmptyCollection()2283 private static ListAdminOverridesFixedSizeCollection createEmptyCollection() { 2284 return new ListAdminOverridesFixedSizeCollection(null, 0); 2285 } 2286 2287 @Override createCollection( List<ListAdminOverridesPage> pages, int collectionSize)2288 protected ListAdminOverridesFixedSizeCollection createCollection( 2289 List<ListAdminOverridesPage> pages, int collectionSize) { 2290 return new ListAdminOverridesFixedSizeCollection(pages, collectionSize); 2291 } 2292 } 2293 2294 public static class ListConsumerOverridesPagedResponse 2295 extends AbstractPagedListResponse< 2296 ListConsumerOverridesRequest, 2297 ListConsumerOverridesResponse, 2298 QuotaOverride, 2299 ListConsumerOverridesPage, 2300 ListConsumerOverridesFixedSizeCollection> { 2301 createAsync( PageContext<ListConsumerOverridesRequest, ListConsumerOverridesResponse, QuotaOverride> context, ApiFuture<ListConsumerOverridesResponse> futureResponse)2302 public static ApiFuture<ListConsumerOverridesPagedResponse> createAsync( 2303 PageContext<ListConsumerOverridesRequest, ListConsumerOverridesResponse, QuotaOverride> 2304 context, 2305 ApiFuture<ListConsumerOverridesResponse> futureResponse) { 2306 ApiFuture<ListConsumerOverridesPage> futurePage = 2307 ListConsumerOverridesPage.createEmptyPage().createPageAsync(context, futureResponse); 2308 return ApiFutures.transform( 2309 futurePage, 2310 input -> new ListConsumerOverridesPagedResponse(input), 2311 MoreExecutors.directExecutor()); 2312 } 2313 ListConsumerOverridesPagedResponse(ListConsumerOverridesPage page)2314 private ListConsumerOverridesPagedResponse(ListConsumerOverridesPage page) { 2315 super(page, ListConsumerOverridesFixedSizeCollection.createEmptyCollection()); 2316 } 2317 } 2318 2319 public static class ListConsumerOverridesPage 2320 extends AbstractPage< 2321 ListConsumerOverridesRequest, 2322 ListConsumerOverridesResponse, 2323 QuotaOverride, 2324 ListConsumerOverridesPage> { 2325 ListConsumerOverridesPage( PageContext<ListConsumerOverridesRequest, ListConsumerOverridesResponse, QuotaOverride> context, ListConsumerOverridesResponse response)2326 private ListConsumerOverridesPage( 2327 PageContext<ListConsumerOverridesRequest, ListConsumerOverridesResponse, QuotaOverride> 2328 context, 2329 ListConsumerOverridesResponse response) { 2330 super(context, response); 2331 } 2332 createEmptyPage()2333 private static ListConsumerOverridesPage createEmptyPage() { 2334 return new ListConsumerOverridesPage(null, null); 2335 } 2336 2337 @Override createPage( PageContext<ListConsumerOverridesRequest, ListConsumerOverridesResponse, QuotaOverride> context, ListConsumerOverridesResponse response)2338 protected ListConsumerOverridesPage createPage( 2339 PageContext<ListConsumerOverridesRequest, ListConsumerOverridesResponse, QuotaOverride> 2340 context, 2341 ListConsumerOverridesResponse response) { 2342 return new ListConsumerOverridesPage(context, response); 2343 } 2344 2345 @Override createPageAsync( PageContext<ListConsumerOverridesRequest, ListConsumerOverridesResponse, QuotaOverride> context, ApiFuture<ListConsumerOverridesResponse> futureResponse)2346 public ApiFuture<ListConsumerOverridesPage> createPageAsync( 2347 PageContext<ListConsumerOverridesRequest, ListConsumerOverridesResponse, QuotaOverride> 2348 context, 2349 ApiFuture<ListConsumerOverridesResponse> futureResponse) { 2350 return super.createPageAsync(context, futureResponse); 2351 } 2352 } 2353 2354 public static class ListConsumerOverridesFixedSizeCollection 2355 extends AbstractFixedSizeCollection< 2356 ListConsumerOverridesRequest, 2357 ListConsumerOverridesResponse, 2358 QuotaOverride, 2359 ListConsumerOverridesPage, 2360 ListConsumerOverridesFixedSizeCollection> { 2361 ListConsumerOverridesFixedSizeCollection( List<ListConsumerOverridesPage> pages, int collectionSize)2362 private ListConsumerOverridesFixedSizeCollection( 2363 List<ListConsumerOverridesPage> pages, int collectionSize) { 2364 super(pages, collectionSize); 2365 } 2366 createEmptyCollection()2367 private static ListConsumerOverridesFixedSizeCollection createEmptyCollection() { 2368 return new ListConsumerOverridesFixedSizeCollection(null, 0); 2369 } 2370 2371 @Override createCollection( List<ListConsumerOverridesPage> pages, int collectionSize)2372 protected ListConsumerOverridesFixedSizeCollection createCollection( 2373 List<ListConsumerOverridesPage> pages, int collectionSize) { 2374 return new ListConsumerOverridesFixedSizeCollection(pages, collectionSize); 2375 } 2376 } 2377 } 2378