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.cloud.compute.v1; 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.longrunning.OperationFuture; 24 import com.google.api.gax.paging.AbstractFixedSizeCollection; 25 import com.google.api.gax.paging.AbstractPage; 26 import com.google.api.gax.paging.AbstractPagedListResponse; 27 import com.google.api.gax.rpc.OperationCallable; 28 import com.google.api.gax.rpc.PageContext; 29 import com.google.api.gax.rpc.UnaryCallable; 30 import com.google.cloud.compute.v1.stub.NetworkEndpointGroupsStub; 31 import com.google.cloud.compute.v1.stub.NetworkEndpointGroupsStubSettings; 32 import com.google.common.util.concurrent.MoreExecutors; 33 import java.io.IOException; 34 import java.util.List; 35 import java.util.Map; 36 import java.util.concurrent.TimeUnit; 37 import javax.annotation.Generated; 38 39 // AUTO-GENERATED DOCUMENTATION AND CLASS. 40 /** 41 * Service Description: The NetworkEndpointGroups API. 42 * 43 * <p>This class provides the ability to make remote calls to the backing service through method 44 * calls that map to API methods. Sample code to get started: 45 * 46 * <pre>{@code 47 * // This snippet has been automatically generated and should be regarded as a code template only. 48 * // It will require modifications to work: 49 * // - It may require correct/in-range values for request initialization. 50 * // - It may require specifying regional endpoints when creating the service client as shown in 51 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 52 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 53 * NetworkEndpointGroupsClient.create()) { 54 * String project = "project-309310695"; 55 * String zone = "zone3744684"; 56 * String networkEndpointGroup = "networkEndpointGroup-2120389028"; 57 * NetworkEndpointGroup response = 58 * networkEndpointGroupsClient.get(project, zone, networkEndpointGroup); 59 * } 60 * }</pre> 61 * 62 * <p>Note: close() needs to be called on the NetworkEndpointGroupsClient object to clean up 63 * resources such as threads. In the example above, try-with-resources is used, which automatically 64 * calls close(). 65 * 66 * <p>The surface of this class includes several types of Java methods for each of the API's 67 * methods: 68 * 69 * <ol> 70 * <li>A "flattened" method. With this type of method, the fields of the request type have been 71 * converted into function parameters. It may be the case that not all fields are available as 72 * parameters, and not every API method will have a flattened method entry point. 73 * <li>A "request object" method. This type of method only takes one parameter, a request object, 74 * which must be constructed before the call. Not every API method will have a request object 75 * method. 76 * <li>A "callable" method. This type of method takes no parameters and returns an immutable API 77 * callable object, which can be used to initiate calls to the service. 78 * </ol> 79 * 80 * <p>See the individual methods for example code. 81 * 82 * <p>Many parameters require resource names to be formatted in a particular way. To assist with 83 * these names, this class includes a format method for each type of name, and additionally a parse 84 * method to extract the individual identifiers contained within names that are returned. 85 * 86 * <p>This class can be customized by passing in a custom instance of NetworkEndpointGroupsSettings 87 * to create(). For example: 88 * 89 * <p>To customize credentials: 90 * 91 * <pre>{@code 92 * // This snippet has been automatically generated and should be regarded as a code template only. 93 * // It will require modifications to work: 94 * // - It may require correct/in-range values for request initialization. 95 * // - It may require specifying regional endpoints when creating the service client as shown in 96 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 97 * NetworkEndpointGroupsSettings networkEndpointGroupsSettings = 98 * NetworkEndpointGroupsSettings.newBuilder() 99 * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) 100 * .build(); 101 * NetworkEndpointGroupsClient networkEndpointGroupsClient = 102 * NetworkEndpointGroupsClient.create(networkEndpointGroupsSettings); 103 * }</pre> 104 * 105 * <p>To customize the endpoint: 106 * 107 * <pre>{@code 108 * // This snippet has been automatically generated and should be regarded as a code template only. 109 * // It will require modifications to work: 110 * // - It may require correct/in-range values for request initialization. 111 * // - It may require specifying regional endpoints when creating the service client as shown in 112 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 113 * NetworkEndpointGroupsSettings networkEndpointGroupsSettings = 114 * NetworkEndpointGroupsSettings.newBuilder().setEndpoint(myEndpoint).build(); 115 * NetworkEndpointGroupsClient networkEndpointGroupsClient = 116 * NetworkEndpointGroupsClient.create(networkEndpointGroupsSettings); 117 * }</pre> 118 * 119 * <p>Please refer to the GitHub repository's samples for more quickstart code snippets. 120 */ 121 @Generated("by gapic-generator-java") 122 public class NetworkEndpointGroupsClient implements BackgroundResource { 123 private final NetworkEndpointGroupsSettings settings; 124 private final NetworkEndpointGroupsStub stub; 125 126 /** Constructs an instance of NetworkEndpointGroupsClient with default settings. */ create()127 public static final NetworkEndpointGroupsClient create() throws IOException { 128 return create(NetworkEndpointGroupsSettings.newBuilder().build()); 129 } 130 131 /** 132 * Constructs an instance of NetworkEndpointGroupsClient, using the given settings. The channels 133 * are created based on the settings passed in, or defaults for any settings that are not set. 134 */ create(NetworkEndpointGroupsSettings settings)135 public static final NetworkEndpointGroupsClient create(NetworkEndpointGroupsSettings settings) 136 throws IOException { 137 return new NetworkEndpointGroupsClient(settings); 138 } 139 140 /** 141 * Constructs an instance of NetworkEndpointGroupsClient, using the given stub for making calls. 142 * This is for advanced usage - prefer using create(NetworkEndpointGroupsSettings). 143 */ create(NetworkEndpointGroupsStub stub)144 public static final NetworkEndpointGroupsClient create(NetworkEndpointGroupsStub stub) { 145 return new NetworkEndpointGroupsClient(stub); 146 } 147 148 /** 149 * Constructs an instance of NetworkEndpointGroupsClient, using the given settings. This is 150 * protected so that it is easy to make a subclass, but otherwise, the static factory methods 151 * should be preferred. 152 */ NetworkEndpointGroupsClient(NetworkEndpointGroupsSettings settings)153 protected NetworkEndpointGroupsClient(NetworkEndpointGroupsSettings settings) throws IOException { 154 this.settings = settings; 155 this.stub = ((NetworkEndpointGroupsStubSettings) settings.getStubSettings()).createStub(); 156 } 157 NetworkEndpointGroupsClient(NetworkEndpointGroupsStub stub)158 protected NetworkEndpointGroupsClient(NetworkEndpointGroupsStub stub) { 159 this.settings = null; 160 this.stub = stub; 161 } 162 getSettings()163 public final NetworkEndpointGroupsSettings getSettings() { 164 return settings; 165 } 166 getStub()167 public NetworkEndpointGroupsStub getStub() { 168 return stub; 169 } 170 171 // AUTO-GENERATED DOCUMENTATION AND METHOD. 172 /** 173 * Retrieves the list of network endpoint groups and sorts them by zone. 174 * 175 * <p>Sample code: 176 * 177 * <pre>{@code 178 * // This snippet has been automatically generated and should be regarded as a code template only. 179 * // It will require modifications to work: 180 * // - It may require correct/in-range values for request initialization. 181 * // - It may require specifying regional endpoints when creating the service client as shown in 182 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 183 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 184 * NetworkEndpointGroupsClient.create()) { 185 * String project = "project-309310695"; 186 * for (Map.Entry<String, NetworkEndpointGroupsScopedList> element : 187 * networkEndpointGroupsClient.aggregatedList(project).iterateAll()) { 188 * // doThingsWith(element); 189 * } 190 * } 191 * }</pre> 192 * 193 * @param project Project ID for this request. 194 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 195 */ aggregatedList(String project)196 public final AggregatedListPagedResponse aggregatedList(String project) { 197 AggregatedListNetworkEndpointGroupsRequest request = 198 AggregatedListNetworkEndpointGroupsRequest.newBuilder().setProject(project).build(); 199 return aggregatedList(request); 200 } 201 202 // AUTO-GENERATED DOCUMENTATION AND METHOD. 203 /** 204 * Retrieves the list of network endpoint groups and sorts them by zone. 205 * 206 * <p>Sample code: 207 * 208 * <pre>{@code 209 * // This snippet has been automatically generated and should be regarded as a code template only. 210 * // It will require modifications to work: 211 * // - It may require correct/in-range values for request initialization. 212 * // - It may require specifying regional endpoints when creating the service client as shown in 213 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 214 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 215 * NetworkEndpointGroupsClient.create()) { 216 * AggregatedListNetworkEndpointGroupsRequest request = 217 * AggregatedListNetworkEndpointGroupsRequest.newBuilder() 218 * .setFilter("filter-1274492040") 219 * .setIncludeAllScopes(true) 220 * .setMaxResults(1128457243) 221 * .setOrderBy("orderBy-1207110587") 222 * .setPageToken("pageToken873572522") 223 * .setProject("project-309310695") 224 * .setReturnPartialSuccess(true) 225 * .build(); 226 * for (Map.Entry<String, NetworkEndpointGroupsScopedList> element : 227 * networkEndpointGroupsClient.aggregatedList(request).iterateAll()) { 228 * // doThingsWith(element); 229 * } 230 * } 231 * }</pre> 232 * 233 * @param request The request object containing all of the parameters for the API call. 234 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 235 */ aggregatedList( AggregatedListNetworkEndpointGroupsRequest request)236 public final AggregatedListPagedResponse aggregatedList( 237 AggregatedListNetworkEndpointGroupsRequest request) { 238 return aggregatedListPagedCallable().call(request); 239 } 240 241 // AUTO-GENERATED DOCUMENTATION AND METHOD. 242 /** 243 * Retrieves the list of network endpoint groups and sorts them by zone. 244 * 245 * <p>Sample code: 246 * 247 * <pre>{@code 248 * // This snippet has been automatically generated and should be regarded as a code template only. 249 * // It will require modifications to work: 250 * // - It may require correct/in-range values for request initialization. 251 * // - It may require specifying regional endpoints when creating the service client as shown in 252 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 253 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 254 * NetworkEndpointGroupsClient.create()) { 255 * AggregatedListNetworkEndpointGroupsRequest request = 256 * AggregatedListNetworkEndpointGroupsRequest.newBuilder() 257 * .setFilter("filter-1274492040") 258 * .setIncludeAllScopes(true) 259 * .setMaxResults(1128457243) 260 * .setOrderBy("orderBy-1207110587") 261 * .setPageToken("pageToken873572522") 262 * .setProject("project-309310695") 263 * .setReturnPartialSuccess(true) 264 * .build(); 265 * ApiFuture<Map.Entry<String, NetworkEndpointGroupsScopedList>> future = 266 * networkEndpointGroupsClient.aggregatedListPagedCallable().futureCall(request); 267 * // Do something. 268 * for (Map.Entry<String, NetworkEndpointGroupsScopedList> element : future.get().iterateAll()) { 269 * // doThingsWith(element); 270 * } 271 * } 272 * }</pre> 273 */ 274 public final UnaryCallable< 275 AggregatedListNetworkEndpointGroupsRequest, AggregatedListPagedResponse> aggregatedListPagedCallable()276 aggregatedListPagedCallable() { 277 return stub.aggregatedListPagedCallable(); 278 } 279 280 // AUTO-GENERATED DOCUMENTATION AND METHOD. 281 /** 282 * Retrieves the list of network endpoint groups and sorts them by zone. 283 * 284 * <p>Sample code: 285 * 286 * <pre>{@code 287 * // This snippet has been automatically generated and should be regarded as a code template only. 288 * // It will require modifications to work: 289 * // - It may require correct/in-range values for request initialization. 290 * // - It may require specifying regional endpoints when creating the service client as shown in 291 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 292 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 293 * NetworkEndpointGroupsClient.create()) { 294 * AggregatedListNetworkEndpointGroupsRequest request = 295 * AggregatedListNetworkEndpointGroupsRequest.newBuilder() 296 * .setFilter("filter-1274492040") 297 * .setIncludeAllScopes(true) 298 * .setMaxResults(1128457243) 299 * .setOrderBy("orderBy-1207110587") 300 * .setPageToken("pageToken873572522") 301 * .setProject("project-309310695") 302 * .setReturnPartialSuccess(true) 303 * .build(); 304 * while (true) { 305 * NetworkEndpointGroupAggregatedList response = 306 * networkEndpointGroupsClient.aggregatedListCallable().call(request); 307 * for (Map.Entry<String, NetworkEndpointGroupsScopedList> element : response.getItemsList()) { 308 * // doThingsWith(element); 309 * } 310 * String nextPageToken = response.getNextPageToken(); 311 * if (!Strings.isNullOrEmpty(nextPageToken)) { 312 * request = request.toBuilder().setPageToken(nextPageToken).build(); 313 * } else { 314 * break; 315 * } 316 * } 317 * } 318 * }</pre> 319 */ 320 public final UnaryCallable< 321 AggregatedListNetworkEndpointGroupsRequest, NetworkEndpointGroupAggregatedList> aggregatedListCallable()322 aggregatedListCallable() { 323 return stub.aggregatedListCallable(); 324 } 325 326 // AUTO-GENERATED DOCUMENTATION AND METHOD. 327 /** 328 * Attach a list of network endpoints to the specified network endpoint group. 329 * 330 * <p>Sample code: 331 * 332 * <pre>{@code 333 * // This snippet has been automatically generated and should be regarded as a code template only. 334 * // It will require modifications to work: 335 * // - It may require correct/in-range values for request initialization. 336 * // - It may require specifying regional endpoints when creating the service client as shown in 337 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 338 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 339 * NetworkEndpointGroupsClient.create()) { 340 * String project = "project-309310695"; 341 * String zone = "zone3744684"; 342 * String networkEndpointGroup = "networkEndpointGroup-2120389028"; 343 * NetworkEndpointGroupsAttachEndpointsRequest 344 * networkEndpointGroupsAttachEndpointsRequestResource = 345 * NetworkEndpointGroupsAttachEndpointsRequest.newBuilder().build(); 346 * Operation response = 347 * networkEndpointGroupsClient 348 * .attachNetworkEndpointsAsync( 349 * project, 350 * zone, 351 * networkEndpointGroup, 352 * networkEndpointGroupsAttachEndpointsRequestResource) 353 * .get(); 354 * } 355 * }</pre> 356 * 357 * @param project Project ID for this request. 358 * @param zone The name of the zone where the network endpoint group is located. It should comply 359 * with RFC1035. 360 * @param networkEndpointGroup The name of the network endpoint group where you are attaching 361 * network endpoints to. It should comply with RFC1035. 362 * @param networkEndpointGroupsAttachEndpointsRequestResource The body resource for this request 363 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 364 */ attachNetworkEndpointsAsync( String project, String zone, String networkEndpointGroup, NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource)365 public final OperationFuture<Operation, Operation> attachNetworkEndpointsAsync( 366 String project, 367 String zone, 368 String networkEndpointGroup, 369 NetworkEndpointGroupsAttachEndpointsRequest 370 networkEndpointGroupsAttachEndpointsRequestResource) { 371 AttachNetworkEndpointsNetworkEndpointGroupRequest request = 372 AttachNetworkEndpointsNetworkEndpointGroupRequest.newBuilder() 373 .setProject(project) 374 .setZone(zone) 375 .setNetworkEndpointGroup(networkEndpointGroup) 376 .setNetworkEndpointGroupsAttachEndpointsRequestResource( 377 networkEndpointGroupsAttachEndpointsRequestResource) 378 .build(); 379 return attachNetworkEndpointsAsync(request); 380 } 381 382 // AUTO-GENERATED DOCUMENTATION AND METHOD. 383 /** 384 * Attach a list of network endpoints to the specified network endpoint group. 385 * 386 * <p>Sample code: 387 * 388 * <pre>{@code 389 * // This snippet has been automatically generated and should be regarded as a code template only. 390 * // It will require modifications to work: 391 * // - It may require correct/in-range values for request initialization. 392 * // - It may require specifying regional endpoints when creating the service client as shown in 393 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 394 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 395 * NetworkEndpointGroupsClient.create()) { 396 * AttachNetworkEndpointsNetworkEndpointGroupRequest request = 397 * AttachNetworkEndpointsNetworkEndpointGroupRequest.newBuilder() 398 * .setNetworkEndpointGroup("networkEndpointGroup-2120389028") 399 * .setNetworkEndpointGroupsAttachEndpointsRequestResource( 400 * NetworkEndpointGroupsAttachEndpointsRequest.newBuilder().build()) 401 * .setProject("project-309310695") 402 * .setRequestId("requestId693933066") 403 * .setZone("zone3744684") 404 * .build(); 405 * Operation response = networkEndpointGroupsClient.attachNetworkEndpointsAsync(request).get(); 406 * } 407 * }</pre> 408 * 409 * @param request The request object containing all of the parameters for the API call. 410 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 411 */ 412 @BetaApi( 413 "The surface for long-running operations is not stable yet and may change in the future.") attachNetworkEndpointsAsync( AttachNetworkEndpointsNetworkEndpointGroupRequest request)414 public final OperationFuture<Operation, Operation> attachNetworkEndpointsAsync( 415 AttachNetworkEndpointsNetworkEndpointGroupRequest request) { 416 return attachNetworkEndpointsOperationCallable().futureCall(request); 417 } 418 419 // AUTO-GENERATED DOCUMENTATION AND METHOD. 420 /** 421 * Attach a list of network endpoints to the specified network endpoint group. 422 * 423 * <p>Sample code: 424 * 425 * <pre>{@code 426 * // This snippet has been automatically generated and should be regarded as a code template only. 427 * // It will require modifications to work: 428 * // - It may require correct/in-range values for request initialization. 429 * // - It may require specifying regional endpoints when creating the service client as shown in 430 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 431 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 432 * NetworkEndpointGroupsClient.create()) { 433 * AttachNetworkEndpointsNetworkEndpointGroupRequest request = 434 * AttachNetworkEndpointsNetworkEndpointGroupRequest.newBuilder() 435 * .setNetworkEndpointGroup("networkEndpointGroup-2120389028") 436 * .setNetworkEndpointGroupsAttachEndpointsRequestResource( 437 * NetworkEndpointGroupsAttachEndpointsRequest.newBuilder().build()) 438 * .setProject("project-309310695") 439 * .setRequestId("requestId693933066") 440 * .setZone("zone3744684") 441 * .build(); 442 * OperationFuture<Operation, Operation> future = 443 * networkEndpointGroupsClient.attachNetworkEndpointsOperationCallable().futureCall(request); 444 * // Do something. 445 * Operation response = future.get(); 446 * } 447 * }</pre> 448 */ 449 public final OperationCallable< 450 AttachNetworkEndpointsNetworkEndpointGroupRequest, Operation, Operation> attachNetworkEndpointsOperationCallable()451 attachNetworkEndpointsOperationCallable() { 452 return stub.attachNetworkEndpointsOperationCallable(); 453 } 454 455 // AUTO-GENERATED DOCUMENTATION AND METHOD. 456 /** 457 * Attach a list of network endpoints to the specified network endpoint group. 458 * 459 * <p>Sample code: 460 * 461 * <pre>{@code 462 * // This snippet has been automatically generated and should be regarded as a code template only. 463 * // It will require modifications to work: 464 * // - It may require correct/in-range values for request initialization. 465 * // - It may require specifying regional endpoints when creating the service client as shown in 466 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 467 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 468 * NetworkEndpointGroupsClient.create()) { 469 * AttachNetworkEndpointsNetworkEndpointGroupRequest request = 470 * AttachNetworkEndpointsNetworkEndpointGroupRequest.newBuilder() 471 * .setNetworkEndpointGroup("networkEndpointGroup-2120389028") 472 * .setNetworkEndpointGroupsAttachEndpointsRequestResource( 473 * NetworkEndpointGroupsAttachEndpointsRequest.newBuilder().build()) 474 * .setProject("project-309310695") 475 * .setRequestId("requestId693933066") 476 * .setZone("zone3744684") 477 * .build(); 478 * ApiFuture<Operation> future = 479 * networkEndpointGroupsClient.attachNetworkEndpointsCallable().futureCall(request); 480 * // Do something. 481 * Operation response = future.get(); 482 * } 483 * }</pre> 484 */ 485 public final UnaryCallable<AttachNetworkEndpointsNetworkEndpointGroupRequest, Operation> attachNetworkEndpointsCallable()486 attachNetworkEndpointsCallable() { 487 return stub.attachNetworkEndpointsCallable(); 488 } 489 490 // AUTO-GENERATED DOCUMENTATION AND METHOD. 491 /** 492 * Deletes the specified network endpoint group. The network endpoints in the NEG and the VM 493 * instances they belong to are not terminated when the NEG is deleted. Note that the NEG cannot 494 * be deleted if there are backend services referencing it. 495 * 496 * <p>Sample code: 497 * 498 * <pre>{@code 499 * // This snippet has been automatically generated and should be regarded as a code template only. 500 * // It will require modifications to work: 501 * // - It may require correct/in-range values for request initialization. 502 * // - It may require specifying regional endpoints when creating the service client as shown in 503 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 504 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 505 * NetworkEndpointGroupsClient.create()) { 506 * String project = "project-309310695"; 507 * String zone = "zone3744684"; 508 * String networkEndpointGroup = "networkEndpointGroup-2120389028"; 509 * Operation response = 510 * networkEndpointGroupsClient.deleteAsync(project, zone, networkEndpointGroup).get(); 511 * } 512 * }</pre> 513 * 514 * @param project Project ID for this request. 515 * @param zone The name of the zone where the network endpoint group is located. It should comply 516 * with RFC1035. 517 * @param networkEndpointGroup The name of the network endpoint group to delete. It should comply 518 * with RFC1035. 519 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 520 */ deleteAsync( String project, String zone, String networkEndpointGroup)521 public final OperationFuture<Operation, Operation> deleteAsync( 522 String project, String zone, String networkEndpointGroup) { 523 DeleteNetworkEndpointGroupRequest request = 524 DeleteNetworkEndpointGroupRequest.newBuilder() 525 .setProject(project) 526 .setZone(zone) 527 .setNetworkEndpointGroup(networkEndpointGroup) 528 .build(); 529 return deleteAsync(request); 530 } 531 532 // AUTO-GENERATED DOCUMENTATION AND METHOD. 533 /** 534 * Deletes the specified network endpoint group. The network endpoints in the NEG and the VM 535 * instances they belong to are not terminated when the NEG is deleted. Note that the NEG cannot 536 * be deleted if there are backend services referencing it. 537 * 538 * <p>Sample code: 539 * 540 * <pre>{@code 541 * // This snippet has been automatically generated and should be regarded as a code template only. 542 * // It will require modifications to work: 543 * // - It may require correct/in-range values for request initialization. 544 * // - It may require specifying regional endpoints when creating the service client as shown in 545 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 546 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 547 * NetworkEndpointGroupsClient.create()) { 548 * DeleteNetworkEndpointGroupRequest request = 549 * DeleteNetworkEndpointGroupRequest.newBuilder() 550 * .setNetworkEndpointGroup("networkEndpointGroup-2120389028") 551 * .setProject("project-309310695") 552 * .setRequestId("requestId693933066") 553 * .setZone("zone3744684") 554 * .build(); 555 * Operation response = networkEndpointGroupsClient.deleteAsync(request).get(); 556 * } 557 * }</pre> 558 * 559 * @param request The request object containing all of the parameters for the API call. 560 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 561 */ 562 @BetaApi( 563 "The surface for long-running operations is not stable yet and may change in the future.") deleteAsync( DeleteNetworkEndpointGroupRequest request)564 public final OperationFuture<Operation, Operation> deleteAsync( 565 DeleteNetworkEndpointGroupRequest request) { 566 return deleteOperationCallable().futureCall(request); 567 } 568 569 // AUTO-GENERATED DOCUMENTATION AND METHOD. 570 /** 571 * Deletes the specified network endpoint group. The network endpoints in the NEG and the VM 572 * instances they belong to are not terminated when the NEG is deleted. Note that the NEG cannot 573 * be deleted if there are backend services referencing it. 574 * 575 * <p>Sample code: 576 * 577 * <pre>{@code 578 * // This snippet has been automatically generated and should be regarded as a code template only. 579 * // It will require modifications to work: 580 * // - It may require correct/in-range values for request initialization. 581 * // - It may require specifying regional endpoints when creating the service client as shown in 582 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 583 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 584 * NetworkEndpointGroupsClient.create()) { 585 * DeleteNetworkEndpointGroupRequest request = 586 * DeleteNetworkEndpointGroupRequest.newBuilder() 587 * .setNetworkEndpointGroup("networkEndpointGroup-2120389028") 588 * .setProject("project-309310695") 589 * .setRequestId("requestId693933066") 590 * .setZone("zone3744684") 591 * .build(); 592 * OperationFuture<Operation, Operation> future = 593 * networkEndpointGroupsClient.deleteOperationCallable().futureCall(request); 594 * // Do something. 595 * Operation response = future.get(); 596 * } 597 * }</pre> 598 */ 599 public final OperationCallable<DeleteNetworkEndpointGroupRequest, Operation, Operation> deleteOperationCallable()600 deleteOperationCallable() { 601 return stub.deleteOperationCallable(); 602 } 603 604 // AUTO-GENERATED DOCUMENTATION AND METHOD. 605 /** 606 * Deletes the specified network endpoint group. The network endpoints in the NEG and the VM 607 * instances they belong to are not terminated when the NEG is deleted. Note that the NEG cannot 608 * be deleted if there are backend services referencing it. 609 * 610 * <p>Sample code: 611 * 612 * <pre>{@code 613 * // This snippet has been automatically generated and should be regarded as a code template only. 614 * // It will require modifications to work: 615 * // - It may require correct/in-range values for request initialization. 616 * // - It may require specifying regional endpoints when creating the service client as shown in 617 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 618 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 619 * NetworkEndpointGroupsClient.create()) { 620 * DeleteNetworkEndpointGroupRequest request = 621 * DeleteNetworkEndpointGroupRequest.newBuilder() 622 * .setNetworkEndpointGroup("networkEndpointGroup-2120389028") 623 * .setProject("project-309310695") 624 * .setRequestId("requestId693933066") 625 * .setZone("zone3744684") 626 * .build(); 627 * ApiFuture<Operation> future = 628 * networkEndpointGroupsClient.deleteCallable().futureCall(request); 629 * // Do something. 630 * Operation response = future.get(); 631 * } 632 * }</pre> 633 */ deleteCallable()634 public final UnaryCallable<DeleteNetworkEndpointGroupRequest, Operation> deleteCallable() { 635 return stub.deleteCallable(); 636 } 637 638 // AUTO-GENERATED DOCUMENTATION AND METHOD. 639 /** 640 * Detach a list of network endpoints from the specified network endpoint group. 641 * 642 * <p>Sample code: 643 * 644 * <pre>{@code 645 * // This snippet has been automatically generated and should be regarded as a code template only. 646 * // It will require modifications to work: 647 * // - It may require correct/in-range values for request initialization. 648 * // - It may require specifying regional endpoints when creating the service client as shown in 649 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 650 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 651 * NetworkEndpointGroupsClient.create()) { 652 * String project = "project-309310695"; 653 * String zone = "zone3744684"; 654 * String networkEndpointGroup = "networkEndpointGroup-2120389028"; 655 * NetworkEndpointGroupsDetachEndpointsRequest 656 * networkEndpointGroupsDetachEndpointsRequestResource = 657 * NetworkEndpointGroupsDetachEndpointsRequest.newBuilder().build(); 658 * Operation response = 659 * networkEndpointGroupsClient 660 * .detachNetworkEndpointsAsync( 661 * project, 662 * zone, 663 * networkEndpointGroup, 664 * networkEndpointGroupsDetachEndpointsRequestResource) 665 * .get(); 666 * } 667 * }</pre> 668 * 669 * @param project Project ID for this request. 670 * @param zone The name of the zone where the network endpoint group is located. It should comply 671 * with RFC1035. 672 * @param networkEndpointGroup The name of the network endpoint group where you are removing 673 * network endpoints. It should comply with RFC1035. 674 * @param networkEndpointGroupsDetachEndpointsRequestResource The body resource for this request 675 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 676 */ detachNetworkEndpointsAsync( String project, String zone, String networkEndpointGroup, NetworkEndpointGroupsDetachEndpointsRequest networkEndpointGroupsDetachEndpointsRequestResource)677 public final OperationFuture<Operation, Operation> detachNetworkEndpointsAsync( 678 String project, 679 String zone, 680 String networkEndpointGroup, 681 NetworkEndpointGroupsDetachEndpointsRequest 682 networkEndpointGroupsDetachEndpointsRequestResource) { 683 DetachNetworkEndpointsNetworkEndpointGroupRequest request = 684 DetachNetworkEndpointsNetworkEndpointGroupRequest.newBuilder() 685 .setProject(project) 686 .setZone(zone) 687 .setNetworkEndpointGroup(networkEndpointGroup) 688 .setNetworkEndpointGroupsDetachEndpointsRequestResource( 689 networkEndpointGroupsDetachEndpointsRequestResource) 690 .build(); 691 return detachNetworkEndpointsAsync(request); 692 } 693 694 // AUTO-GENERATED DOCUMENTATION AND METHOD. 695 /** 696 * Detach a list of network endpoints from the specified network endpoint group. 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 (NetworkEndpointGroupsClient networkEndpointGroupsClient = 707 * NetworkEndpointGroupsClient.create()) { 708 * DetachNetworkEndpointsNetworkEndpointGroupRequest request = 709 * DetachNetworkEndpointsNetworkEndpointGroupRequest.newBuilder() 710 * .setNetworkEndpointGroup("networkEndpointGroup-2120389028") 711 * .setNetworkEndpointGroupsDetachEndpointsRequestResource( 712 * NetworkEndpointGroupsDetachEndpointsRequest.newBuilder().build()) 713 * .setProject("project-309310695") 714 * .setRequestId("requestId693933066") 715 * .setZone("zone3744684") 716 * .build(); 717 * Operation response = networkEndpointGroupsClient.detachNetworkEndpointsAsync(request).get(); 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 */ 724 @BetaApi( 725 "The surface for long-running operations is not stable yet and may change in the future.") detachNetworkEndpointsAsync( DetachNetworkEndpointsNetworkEndpointGroupRequest request)726 public final OperationFuture<Operation, Operation> detachNetworkEndpointsAsync( 727 DetachNetworkEndpointsNetworkEndpointGroupRequest request) { 728 return detachNetworkEndpointsOperationCallable().futureCall(request); 729 } 730 731 // AUTO-GENERATED DOCUMENTATION AND METHOD. 732 /** 733 * Detach a list of network endpoints from the specified network endpoint group. 734 * 735 * <p>Sample code: 736 * 737 * <pre>{@code 738 * // This snippet has been automatically generated and should be regarded as a code template only. 739 * // It will require modifications to work: 740 * // - It may require correct/in-range values for request initialization. 741 * // - It may require specifying regional endpoints when creating the service client as shown in 742 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 743 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 744 * NetworkEndpointGroupsClient.create()) { 745 * DetachNetworkEndpointsNetworkEndpointGroupRequest request = 746 * DetachNetworkEndpointsNetworkEndpointGroupRequest.newBuilder() 747 * .setNetworkEndpointGroup("networkEndpointGroup-2120389028") 748 * .setNetworkEndpointGroupsDetachEndpointsRequestResource( 749 * NetworkEndpointGroupsDetachEndpointsRequest.newBuilder().build()) 750 * .setProject("project-309310695") 751 * .setRequestId("requestId693933066") 752 * .setZone("zone3744684") 753 * .build(); 754 * OperationFuture<Operation, Operation> future = 755 * networkEndpointGroupsClient.detachNetworkEndpointsOperationCallable().futureCall(request); 756 * // Do something. 757 * Operation response = future.get(); 758 * } 759 * }</pre> 760 */ 761 public final OperationCallable< 762 DetachNetworkEndpointsNetworkEndpointGroupRequest, Operation, Operation> detachNetworkEndpointsOperationCallable()763 detachNetworkEndpointsOperationCallable() { 764 return stub.detachNetworkEndpointsOperationCallable(); 765 } 766 767 // AUTO-GENERATED DOCUMENTATION AND METHOD. 768 /** 769 * Detach a list of network endpoints from the specified network endpoint group. 770 * 771 * <p>Sample code: 772 * 773 * <pre>{@code 774 * // This snippet has been automatically generated and should be regarded as a code template only. 775 * // It will require modifications to work: 776 * // - It may require correct/in-range values for request initialization. 777 * // - It may require specifying regional endpoints when creating the service client as shown in 778 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 779 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 780 * NetworkEndpointGroupsClient.create()) { 781 * DetachNetworkEndpointsNetworkEndpointGroupRequest request = 782 * DetachNetworkEndpointsNetworkEndpointGroupRequest.newBuilder() 783 * .setNetworkEndpointGroup("networkEndpointGroup-2120389028") 784 * .setNetworkEndpointGroupsDetachEndpointsRequestResource( 785 * NetworkEndpointGroupsDetachEndpointsRequest.newBuilder().build()) 786 * .setProject("project-309310695") 787 * .setRequestId("requestId693933066") 788 * .setZone("zone3744684") 789 * .build(); 790 * ApiFuture<Operation> future = 791 * networkEndpointGroupsClient.detachNetworkEndpointsCallable().futureCall(request); 792 * // Do something. 793 * Operation response = future.get(); 794 * } 795 * }</pre> 796 */ 797 public final UnaryCallable<DetachNetworkEndpointsNetworkEndpointGroupRequest, Operation> detachNetworkEndpointsCallable()798 detachNetworkEndpointsCallable() { 799 return stub.detachNetworkEndpointsCallable(); 800 } 801 802 // AUTO-GENERATED DOCUMENTATION AND METHOD. 803 /** 804 * Returns the specified network endpoint group. 805 * 806 * <p>Sample code: 807 * 808 * <pre>{@code 809 * // This snippet has been automatically generated and should be regarded as a code template only. 810 * // It will require modifications to work: 811 * // - It may require correct/in-range values for request initialization. 812 * // - It may require specifying regional endpoints when creating the service client as shown in 813 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 814 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 815 * NetworkEndpointGroupsClient.create()) { 816 * String project = "project-309310695"; 817 * String zone = "zone3744684"; 818 * String networkEndpointGroup = "networkEndpointGroup-2120389028"; 819 * NetworkEndpointGroup response = 820 * networkEndpointGroupsClient.get(project, zone, networkEndpointGroup); 821 * } 822 * }</pre> 823 * 824 * @param project Project ID for this request. 825 * @param zone The name of the zone where the network endpoint group is located. It should comply 826 * with RFC1035. 827 * @param networkEndpointGroup The name of the network endpoint group. It should comply with 828 * RFC1035. 829 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 830 */ get(String project, String zone, String networkEndpointGroup)831 public final NetworkEndpointGroup get(String project, String zone, String networkEndpointGroup) { 832 GetNetworkEndpointGroupRequest request = 833 GetNetworkEndpointGroupRequest.newBuilder() 834 .setProject(project) 835 .setZone(zone) 836 .setNetworkEndpointGroup(networkEndpointGroup) 837 .build(); 838 return get(request); 839 } 840 841 // AUTO-GENERATED DOCUMENTATION AND METHOD. 842 /** 843 * Returns the specified network endpoint group. 844 * 845 * <p>Sample code: 846 * 847 * <pre>{@code 848 * // This snippet has been automatically generated and should be regarded as a code template only. 849 * // It will require modifications to work: 850 * // - It may require correct/in-range values for request initialization. 851 * // - It may require specifying regional endpoints when creating the service client as shown in 852 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 853 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 854 * NetworkEndpointGroupsClient.create()) { 855 * GetNetworkEndpointGroupRequest request = 856 * GetNetworkEndpointGroupRequest.newBuilder() 857 * .setNetworkEndpointGroup("networkEndpointGroup-2120389028") 858 * .setProject("project-309310695") 859 * .setZone("zone3744684") 860 * .build(); 861 * NetworkEndpointGroup response = networkEndpointGroupsClient.get(request); 862 * } 863 * }</pre> 864 * 865 * @param request The request object containing all of the parameters for the API call. 866 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 867 */ get(GetNetworkEndpointGroupRequest request)868 public final NetworkEndpointGroup get(GetNetworkEndpointGroupRequest request) { 869 return getCallable().call(request); 870 } 871 872 // AUTO-GENERATED DOCUMENTATION AND METHOD. 873 /** 874 * Returns the specified network endpoint group. 875 * 876 * <p>Sample code: 877 * 878 * <pre>{@code 879 * // This snippet has been automatically generated and should be regarded as a code template only. 880 * // It will require modifications to work: 881 * // - It may require correct/in-range values for request initialization. 882 * // - It may require specifying regional endpoints when creating the service client as shown in 883 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 884 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 885 * NetworkEndpointGroupsClient.create()) { 886 * GetNetworkEndpointGroupRequest request = 887 * GetNetworkEndpointGroupRequest.newBuilder() 888 * .setNetworkEndpointGroup("networkEndpointGroup-2120389028") 889 * .setProject("project-309310695") 890 * .setZone("zone3744684") 891 * .build(); 892 * ApiFuture<NetworkEndpointGroup> future = 893 * networkEndpointGroupsClient.getCallable().futureCall(request); 894 * // Do something. 895 * NetworkEndpointGroup response = future.get(); 896 * } 897 * }</pre> 898 */ getCallable()899 public final UnaryCallable<GetNetworkEndpointGroupRequest, NetworkEndpointGroup> getCallable() { 900 return stub.getCallable(); 901 } 902 903 // AUTO-GENERATED DOCUMENTATION AND METHOD. 904 /** 905 * Creates a network endpoint group in the specified project using the parameters that are 906 * included in the request. 907 * 908 * <p>Sample code: 909 * 910 * <pre>{@code 911 * // This snippet has been automatically generated and should be regarded as a code template only. 912 * // It will require modifications to work: 913 * // - It may require correct/in-range values for request initialization. 914 * // - It may require specifying regional endpoints when creating the service client as shown in 915 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 916 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 917 * NetworkEndpointGroupsClient.create()) { 918 * String project = "project-309310695"; 919 * String zone = "zone3744684"; 920 * NetworkEndpointGroup networkEndpointGroupResource = NetworkEndpointGroup.newBuilder().build(); 921 * Operation response = 922 * networkEndpointGroupsClient 923 * .insertAsync(project, zone, networkEndpointGroupResource) 924 * .get(); 925 * } 926 * }</pre> 927 * 928 * @param project Project ID for this request. 929 * @param zone The name of the zone where you want to create the network endpoint group. It should 930 * comply with RFC1035. 931 * @param networkEndpointGroupResource The body resource for this request 932 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 933 */ insertAsync( String project, String zone, NetworkEndpointGroup networkEndpointGroupResource)934 public final OperationFuture<Operation, Operation> insertAsync( 935 String project, String zone, NetworkEndpointGroup networkEndpointGroupResource) { 936 InsertNetworkEndpointGroupRequest request = 937 InsertNetworkEndpointGroupRequest.newBuilder() 938 .setProject(project) 939 .setZone(zone) 940 .setNetworkEndpointGroupResource(networkEndpointGroupResource) 941 .build(); 942 return insertAsync(request); 943 } 944 945 // AUTO-GENERATED DOCUMENTATION AND METHOD. 946 /** 947 * Creates a network endpoint group in the specified project using the parameters that are 948 * included in the request. 949 * 950 * <p>Sample code: 951 * 952 * <pre>{@code 953 * // This snippet has been automatically generated and should be regarded as a code template only. 954 * // It will require modifications to work: 955 * // - It may require correct/in-range values for request initialization. 956 * // - It may require specifying regional endpoints when creating the service client as shown in 957 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 958 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 959 * NetworkEndpointGroupsClient.create()) { 960 * InsertNetworkEndpointGroupRequest request = 961 * InsertNetworkEndpointGroupRequest.newBuilder() 962 * .setNetworkEndpointGroupResource(NetworkEndpointGroup.newBuilder().build()) 963 * .setProject("project-309310695") 964 * .setRequestId("requestId693933066") 965 * .setZone("zone3744684") 966 * .build(); 967 * Operation response = networkEndpointGroupsClient.insertAsync(request).get(); 968 * } 969 * }</pre> 970 * 971 * @param request The request object containing all of the parameters for the API call. 972 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 973 */ 974 @BetaApi( 975 "The surface for long-running operations is not stable yet and may change in the future.") insertAsync( InsertNetworkEndpointGroupRequest request)976 public final OperationFuture<Operation, Operation> insertAsync( 977 InsertNetworkEndpointGroupRequest request) { 978 return insertOperationCallable().futureCall(request); 979 } 980 981 // AUTO-GENERATED DOCUMENTATION AND METHOD. 982 /** 983 * Creates a network endpoint group in the specified project using the parameters that are 984 * included in the request. 985 * 986 * <p>Sample code: 987 * 988 * <pre>{@code 989 * // This snippet has been automatically generated and should be regarded as a code template only. 990 * // It will require modifications to work: 991 * // - It may require correct/in-range values for request initialization. 992 * // - It may require specifying regional endpoints when creating the service client as shown in 993 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 994 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 995 * NetworkEndpointGroupsClient.create()) { 996 * InsertNetworkEndpointGroupRequest request = 997 * InsertNetworkEndpointGroupRequest.newBuilder() 998 * .setNetworkEndpointGroupResource(NetworkEndpointGroup.newBuilder().build()) 999 * .setProject("project-309310695") 1000 * .setRequestId("requestId693933066") 1001 * .setZone("zone3744684") 1002 * .build(); 1003 * OperationFuture<Operation, Operation> future = 1004 * networkEndpointGroupsClient.insertOperationCallable().futureCall(request); 1005 * // Do something. 1006 * Operation response = future.get(); 1007 * } 1008 * }</pre> 1009 */ 1010 public final OperationCallable<InsertNetworkEndpointGroupRequest, Operation, Operation> insertOperationCallable()1011 insertOperationCallable() { 1012 return stub.insertOperationCallable(); 1013 } 1014 1015 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1016 /** 1017 * Creates a network endpoint group in the specified project using the parameters that are 1018 * included in the request. 1019 * 1020 * <p>Sample code: 1021 * 1022 * <pre>{@code 1023 * // This snippet has been automatically generated and should be regarded as a code template only. 1024 * // It will require modifications to work: 1025 * // - It may require correct/in-range values for request initialization. 1026 * // - It may require specifying regional endpoints when creating the service client as shown in 1027 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1028 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 1029 * NetworkEndpointGroupsClient.create()) { 1030 * InsertNetworkEndpointGroupRequest request = 1031 * InsertNetworkEndpointGroupRequest.newBuilder() 1032 * .setNetworkEndpointGroupResource(NetworkEndpointGroup.newBuilder().build()) 1033 * .setProject("project-309310695") 1034 * .setRequestId("requestId693933066") 1035 * .setZone("zone3744684") 1036 * .build(); 1037 * ApiFuture<Operation> future = 1038 * networkEndpointGroupsClient.insertCallable().futureCall(request); 1039 * // Do something. 1040 * Operation response = future.get(); 1041 * } 1042 * }</pre> 1043 */ insertCallable()1044 public final UnaryCallable<InsertNetworkEndpointGroupRequest, Operation> insertCallable() { 1045 return stub.insertCallable(); 1046 } 1047 1048 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1049 /** 1050 * Retrieves the list of network endpoint groups that are located in the specified project and 1051 * zone. 1052 * 1053 * <p>Sample code: 1054 * 1055 * <pre>{@code 1056 * // This snippet has been automatically generated and should be regarded as a code template only. 1057 * // It will require modifications to work: 1058 * // - It may require correct/in-range values for request initialization. 1059 * // - It may require specifying regional endpoints when creating the service client as shown in 1060 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1061 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 1062 * NetworkEndpointGroupsClient.create()) { 1063 * String project = "project-309310695"; 1064 * String zone = "zone3744684"; 1065 * for (NetworkEndpointGroup element : 1066 * networkEndpointGroupsClient.list(project, zone).iterateAll()) { 1067 * // doThingsWith(element); 1068 * } 1069 * } 1070 * }</pre> 1071 * 1072 * @param project Project ID for this request. 1073 * @param zone The name of the zone where the network endpoint group is located. It should comply 1074 * with RFC1035. 1075 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1076 */ list(String project, String zone)1077 public final ListPagedResponse list(String project, String zone) { 1078 ListNetworkEndpointGroupsRequest request = 1079 ListNetworkEndpointGroupsRequest.newBuilder().setProject(project).setZone(zone).build(); 1080 return list(request); 1081 } 1082 1083 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1084 /** 1085 * Retrieves the list of network endpoint groups that are located in the specified project and 1086 * zone. 1087 * 1088 * <p>Sample code: 1089 * 1090 * <pre>{@code 1091 * // This snippet has been automatically generated and should be regarded as a code template only. 1092 * // It will require modifications to work: 1093 * // - It may require correct/in-range values for request initialization. 1094 * // - It may require specifying regional endpoints when creating the service client as shown in 1095 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1096 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 1097 * NetworkEndpointGroupsClient.create()) { 1098 * ListNetworkEndpointGroupsRequest request = 1099 * ListNetworkEndpointGroupsRequest.newBuilder() 1100 * .setFilter("filter-1274492040") 1101 * .setMaxResults(1128457243) 1102 * .setOrderBy("orderBy-1207110587") 1103 * .setPageToken("pageToken873572522") 1104 * .setProject("project-309310695") 1105 * .setReturnPartialSuccess(true) 1106 * .setZone("zone3744684") 1107 * .build(); 1108 * for (NetworkEndpointGroup element : networkEndpointGroupsClient.list(request).iterateAll()) { 1109 * // doThingsWith(element); 1110 * } 1111 * } 1112 * }</pre> 1113 * 1114 * @param request The request object containing all of the parameters for the API call. 1115 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1116 */ list(ListNetworkEndpointGroupsRequest request)1117 public final ListPagedResponse list(ListNetworkEndpointGroupsRequest request) { 1118 return listPagedCallable().call(request); 1119 } 1120 1121 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1122 /** 1123 * Retrieves the list of network endpoint groups that are located in the specified project and 1124 * zone. 1125 * 1126 * <p>Sample code: 1127 * 1128 * <pre>{@code 1129 * // This snippet has been automatically generated and should be regarded as a code template only. 1130 * // It will require modifications to work: 1131 * // - It may require correct/in-range values for request initialization. 1132 * // - It may require specifying regional endpoints when creating the service client as shown in 1133 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1134 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 1135 * NetworkEndpointGroupsClient.create()) { 1136 * ListNetworkEndpointGroupsRequest request = 1137 * ListNetworkEndpointGroupsRequest.newBuilder() 1138 * .setFilter("filter-1274492040") 1139 * .setMaxResults(1128457243) 1140 * .setOrderBy("orderBy-1207110587") 1141 * .setPageToken("pageToken873572522") 1142 * .setProject("project-309310695") 1143 * .setReturnPartialSuccess(true) 1144 * .setZone("zone3744684") 1145 * .build(); 1146 * ApiFuture<NetworkEndpointGroup> future = 1147 * networkEndpointGroupsClient.listPagedCallable().futureCall(request); 1148 * // Do something. 1149 * for (NetworkEndpointGroup element : future.get().iterateAll()) { 1150 * // doThingsWith(element); 1151 * } 1152 * } 1153 * }</pre> 1154 */ 1155 public final UnaryCallable<ListNetworkEndpointGroupsRequest, ListPagedResponse> listPagedCallable()1156 listPagedCallable() { 1157 return stub.listPagedCallable(); 1158 } 1159 1160 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1161 /** 1162 * Retrieves the list of network endpoint groups that are located in the specified project and 1163 * zone. 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 (NetworkEndpointGroupsClient networkEndpointGroupsClient = 1174 * NetworkEndpointGroupsClient.create()) { 1175 * ListNetworkEndpointGroupsRequest request = 1176 * ListNetworkEndpointGroupsRequest.newBuilder() 1177 * .setFilter("filter-1274492040") 1178 * .setMaxResults(1128457243) 1179 * .setOrderBy("orderBy-1207110587") 1180 * .setPageToken("pageToken873572522") 1181 * .setProject("project-309310695") 1182 * .setReturnPartialSuccess(true) 1183 * .setZone("zone3744684") 1184 * .build(); 1185 * while (true) { 1186 * NetworkEndpointGroupList response = 1187 * networkEndpointGroupsClient.listCallable().call(request); 1188 * for (NetworkEndpointGroup element : response.getItemsList()) { 1189 * // doThingsWith(element); 1190 * } 1191 * String nextPageToken = response.getNextPageToken(); 1192 * if (!Strings.isNullOrEmpty(nextPageToken)) { 1193 * request = request.toBuilder().setPageToken(nextPageToken).build(); 1194 * } else { 1195 * break; 1196 * } 1197 * } 1198 * } 1199 * }</pre> 1200 */ 1201 public final UnaryCallable<ListNetworkEndpointGroupsRequest, NetworkEndpointGroupList> listCallable()1202 listCallable() { 1203 return stub.listCallable(); 1204 } 1205 1206 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1207 /** 1208 * Lists the network endpoints in the specified network endpoint group. 1209 * 1210 * <p>Sample code: 1211 * 1212 * <pre>{@code 1213 * // This snippet has been automatically generated and should be regarded as a code template only. 1214 * // It will require modifications to work: 1215 * // - It may require correct/in-range values for request initialization. 1216 * // - It may require specifying regional endpoints when creating the service client as shown in 1217 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1218 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 1219 * NetworkEndpointGroupsClient.create()) { 1220 * String project = "project-309310695"; 1221 * String zone = "zone3744684"; 1222 * String networkEndpointGroup = "networkEndpointGroup-2120389028"; 1223 * NetworkEndpointGroupsListEndpointsRequest networkEndpointGroupsListEndpointsRequestResource = 1224 * NetworkEndpointGroupsListEndpointsRequest.newBuilder().build(); 1225 * for (NetworkEndpointWithHealthStatus element : 1226 * networkEndpointGroupsClient 1227 * .listNetworkEndpoints( 1228 * project, 1229 * zone, 1230 * networkEndpointGroup, 1231 * networkEndpointGroupsListEndpointsRequestResource) 1232 * .iterateAll()) { 1233 * // doThingsWith(element); 1234 * } 1235 * } 1236 * }</pre> 1237 * 1238 * @param project Project ID for this request. 1239 * @param zone The name of the zone where the network endpoint group is located. It should comply 1240 * with RFC1035. 1241 * @param networkEndpointGroup The name of the network endpoint group from which you want to 1242 * generate a list of included network endpoints. It should comply with RFC1035. 1243 * @param networkEndpointGroupsListEndpointsRequestResource The body resource for this request 1244 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1245 */ listNetworkEndpoints( String project, String zone, String networkEndpointGroup, NetworkEndpointGroupsListEndpointsRequest networkEndpointGroupsListEndpointsRequestResource)1246 public final ListNetworkEndpointsPagedResponse listNetworkEndpoints( 1247 String project, 1248 String zone, 1249 String networkEndpointGroup, 1250 NetworkEndpointGroupsListEndpointsRequest networkEndpointGroupsListEndpointsRequestResource) { 1251 ListNetworkEndpointsNetworkEndpointGroupsRequest request = 1252 ListNetworkEndpointsNetworkEndpointGroupsRequest.newBuilder() 1253 .setProject(project) 1254 .setZone(zone) 1255 .setNetworkEndpointGroup(networkEndpointGroup) 1256 .setNetworkEndpointGroupsListEndpointsRequestResource( 1257 networkEndpointGroupsListEndpointsRequestResource) 1258 .build(); 1259 return listNetworkEndpoints(request); 1260 } 1261 1262 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1263 /** 1264 * Lists the network endpoints in the specified network endpoint group. 1265 * 1266 * <p>Sample code: 1267 * 1268 * <pre>{@code 1269 * // This snippet has been automatically generated and should be regarded as a code template only. 1270 * // It will require modifications to work: 1271 * // - It may require correct/in-range values for request initialization. 1272 * // - It may require specifying regional endpoints when creating the service client as shown in 1273 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1274 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 1275 * NetworkEndpointGroupsClient.create()) { 1276 * ListNetworkEndpointsNetworkEndpointGroupsRequest request = 1277 * ListNetworkEndpointsNetworkEndpointGroupsRequest.newBuilder() 1278 * .setFilter("filter-1274492040") 1279 * .setMaxResults(1128457243) 1280 * .setNetworkEndpointGroup("networkEndpointGroup-2120389028") 1281 * .setNetworkEndpointGroupsListEndpointsRequestResource( 1282 * NetworkEndpointGroupsListEndpointsRequest.newBuilder().build()) 1283 * .setOrderBy("orderBy-1207110587") 1284 * .setPageToken("pageToken873572522") 1285 * .setProject("project-309310695") 1286 * .setReturnPartialSuccess(true) 1287 * .setZone("zone3744684") 1288 * .build(); 1289 * for (NetworkEndpointWithHealthStatus element : 1290 * networkEndpointGroupsClient.listNetworkEndpoints(request).iterateAll()) { 1291 * // doThingsWith(element); 1292 * } 1293 * } 1294 * }</pre> 1295 * 1296 * @param request The request object containing all of the parameters for the API call. 1297 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1298 */ listNetworkEndpoints( ListNetworkEndpointsNetworkEndpointGroupsRequest request)1299 public final ListNetworkEndpointsPagedResponse listNetworkEndpoints( 1300 ListNetworkEndpointsNetworkEndpointGroupsRequest request) { 1301 return listNetworkEndpointsPagedCallable().call(request); 1302 } 1303 1304 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1305 /** 1306 * Lists the network endpoints in the specified network endpoint group. 1307 * 1308 * <p>Sample code: 1309 * 1310 * <pre>{@code 1311 * // This snippet has been automatically generated and should be regarded as a code template only. 1312 * // It will require modifications to work: 1313 * // - It may require correct/in-range values for request initialization. 1314 * // - It may require specifying regional endpoints when creating the service client as shown in 1315 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1316 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 1317 * NetworkEndpointGroupsClient.create()) { 1318 * ListNetworkEndpointsNetworkEndpointGroupsRequest request = 1319 * ListNetworkEndpointsNetworkEndpointGroupsRequest.newBuilder() 1320 * .setFilter("filter-1274492040") 1321 * .setMaxResults(1128457243) 1322 * .setNetworkEndpointGroup("networkEndpointGroup-2120389028") 1323 * .setNetworkEndpointGroupsListEndpointsRequestResource( 1324 * NetworkEndpointGroupsListEndpointsRequest.newBuilder().build()) 1325 * .setOrderBy("orderBy-1207110587") 1326 * .setPageToken("pageToken873572522") 1327 * .setProject("project-309310695") 1328 * .setReturnPartialSuccess(true) 1329 * .setZone("zone3744684") 1330 * .build(); 1331 * ApiFuture<NetworkEndpointWithHealthStatus> future = 1332 * networkEndpointGroupsClient.listNetworkEndpointsPagedCallable().futureCall(request); 1333 * // Do something. 1334 * for (NetworkEndpointWithHealthStatus element : future.get().iterateAll()) { 1335 * // doThingsWith(element); 1336 * } 1337 * } 1338 * }</pre> 1339 */ 1340 public final UnaryCallable< 1341 ListNetworkEndpointsNetworkEndpointGroupsRequest, ListNetworkEndpointsPagedResponse> listNetworkEndpointsPagedCallable()1342 listNetworkEndpointsPagedCallable() { 1343 return stub.listNetworkEndpointsPagedCallable(); 1344 } 1345 1346 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1347 /** 1348 * Lists the network endpoints in the specified network endpoint group. 1349 * 1350 * <p>Sample code: 1351 * 1352 * <pre>{@code 1353 * // This snippet has been automatically generated and should be regarded as a code template only. 1354 * // It will require modifications to work: 1355 * // - It may require correct/in-range values for request initialization. 1356 * // - It may require specifying regional endpoints when creating the service client as shown in 1357 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1358 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 1359 * NetworkEndpointGroupsClient.create()) { 1360 * ListNetworkEndpointsNetworkEndpointGroupsRequest request = 1361 * ListNetworkEndpointsNetworkEndpointGroupsRequest.newBuilder() 1362 * .setFilter("filter-1274492040") 1363 * .setMaxResults(1128457243) 1364 * .setNetworkEndpointGroup("networkEndpointGroup-2120389028") 1365 * .setNetworkEndpointGroupsListEndpointsRequestResource( 1366 * NetworkEndpointGroupsListEndpointsRequest.newBuilder().build()) 1367 * .setOrderBy("orderBy-1207110587") 1368 * .setPageToken("pageToken873572522") 1369 * .setProject("project-309310695") 1370 * .setReturnPartialSuccess(true) 1371 * .setZone("zone3744684") 1372 * .build(); 1373 * while (true) { 1374 * NetworkEndpointGroupsListNetworkEndpoints response = 1375 * networkEndpointGroupsClient.listNetworkEndpointsCallable().call(request); 1376 * for (NetworkEndpointWithHealthStatus element : response.getItemsList()) { 1377 * // doThingsWith(element); 1378 * } 1379 * String nextPageToken = response.getNextPageToken(); 1380 * if (!Strings.isNullOrEmpty(nextPageToken)) { 1381 * request = request.toBuilder().setPageToken(nextPageToken).build(); 1382 * } else { 1383 * break; 1384 * } 1385 * } 1386 * } 1387 * }</pre> 1388 */ 1389 public final UnaryCallable< 1390 ListNetworkEndpointsNetworkEndpointGroupsRequest, 1391 NetworkEndpointGroupsListNetworkEndpoints> listNetworkEndpointsCallable()1392 listNetworkEndpointsCallable() { 1393 return stub.listNetworkEndpointsCallable(); 1394 } 1395 1396 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1397 /** 1398 * Returns permissions that a caller has on the specified resource. 1399 * 1400 * <p>Sample code: 1401 * 1402 * <pre>{@code 1403 * // This snippet has been automatically generated and should be regarded as a code template only. 1404 * // It will require modifications to work: 1405 * // - It may require correct/in-range values for request initialization. 1406 * // - It may require specifying regional endpoints when creating the service client as shown in 1407 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1408 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 1409 * NetworkEndpointGroupsClient.create()) { 1410 * String project = "project-309310695"; 1411 * String zone = "zone3744684"; 1412 * String resource = "resource-341064690"; 1413 * TestPermissionsRequest testPermissionsRequestResource = 1414 * TestPermissionsRequest.newBuilder().build(); 1415 * TestPermissionsResponse response = 1416 * networkEndpointGroupsClient.testIamPermissions( 1417 * project, zone, resource, testPermissionsRequestResource); 1418 * } 1419 * }</pre> 1420 * 1421 * @param project Project ID for this request. 1422 * @param zone The name of the zone for this request. 1423 * @param resource Name or id of the resource for this request. 1424 * @param testPermissionsRequestResource The body resource for this request 1425 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1426 */ testIamPermissions( String project, String zone, String resource, TestPermissionsRequest testPermissionsRequestResource)1427 public final TestPermissionsResponse testIamPermissions( 1428 String project, 1429 String zone, 1430 String resource, 1431 TestPermissionsRequest testPermissionsRequestResource) { 1432 TestIamPermissionsNetworkEndpointGroupRequest request = 1433 TestIamPermissionsNetworkEndpointGroupRequest.newBuilder() 1434 .setProject(project) 1435 .setZone(zone) 1436 .setResource(resource) 1437 .setTestPermissionsRequestResource(testPermissionsRequestResource) 1438 .build(); 1439 return testIamPermissions(request); 1440 } 1441 1442 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1443 /** 1444 * Returns permissions that a caller has on the specified resource. 1445 * 1446 * <p>Sample code: 1447 * 1448 * <pre>{@code 1449 * // This snippet has been automatically generated and should be regarded as a code template only. 1450 * // It will require modifications to work: 1451 * // - It may require correct/in-range values for request initialization. 1452 * // - It may require specifying regional endpoints when creating the service client as shown in 1453 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1454 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 1455 * NetworkEndpointGroupsClient.create()) { 1456 * TestIamPermissionsNetworkEndpointGroupRequest request = 1457 * TestIamPermissionsNetworkEndpointGroupRequest.newBuilder() 1458 * .setProject("project-309310695") 1459 * .setResource("resource-341064690") 1460 * .setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build()) 1461 * .setZone("zone3744684") 1462 * .build(); 1463 * TestPermissionsResponse response = networkEndpointGroupsClient.testIamPermissions(request); 1464 * } 1465 * }</pre> 1466 * 1467 * @param request The request object containing all of the parameters for the API call. 1468 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1469 */ testIamPermissions( TestIamPermissionsNetworkEndpointGroupRequest request)1470 public final TestPermissionsResponse testIamPermissions( 1471 TestIamPermissionsNetworkEndpointGroupRequest request) { 1472 return testIamPermissionsCallable().call(request); 1473 } 1474 1475 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1476 /** 1477 * Returns permissions that a caller has on the specified resource. 1478 * 1479 * <p>Sample code: 1480 * 1481 * <pre>{@code 1482 * // This snippet has been automatically generated and should be regarded as a code template only. 1483 * // It will require modifications to work: 1484 * // - It may require correct/in-range values for request initialization. 1485 * // - It may require specifying regional endpoints when creating the service client as shown in 1486 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1487 * try (NetworkEndpointGroupsClient networkEndpointGroupsClient = 1488 * NetworkEndpointGroupsClient.create()) { 1489 * TestIamPermissionsNetworkEndpointGroupRequest request = 1490 * TestIamPermissionsNetworkEndpointGroupRequest.newBuilder() 1491 * .setProject("project-309310695") 1492 * .setResource("resource-341064690") 1493 * .setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build()) 1494 * .setZone("zone3744684") 1495 * .build(); 1496 * ApiFuture<TestPermissionsResponse> future = 1497 * networkEndpointGroupsClient.testIamPermissionsCallable().futureCall(request); 1498 * // Do something. 1499 * TestPermissionsResponse response = future.get(); 1500 * } 1501 * }</pre> 1502 */ 1503 public final UnaryCallable<TestIamPermissionsNetworkEndpointGroupRequest, TestPermissionsResponse> testIamPermissionsCallable()1504 testIamPermissionsCallable() { 1505 return stub.testIamPermissionsCallable(); 1506 } 1507 1508 @Override close()1509 public final void close() { 1510 stub.close(); 1511 } 1512 1513 @Override shutdown()1514 public void shutdown() { 1515 stub.shutdown(); 1516 } 1517 1518 @Override isShutdown()1519 public boolean isShutdown() { 1520 return stub.isShutdown(); 1521 } 1522 1523 @Override isTerminated()1524 public boolean isTerminated() { 1525 return stub.isTerminated(); 1526 } 1527 1528 @Override shutdownNow()1529 public void shutdownNow() { 1530 stub.shutdownNow(); 1531 } 1532 1533 @Override awaitTermination(long duration, TimeUnit unit)1534 public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { 1535 return stub.awaitTermination(duration, unit); 1536 } 1537 1538 public static class AggregatedListPagedResponse 1539 extends AbstractPagedListResponse< 1540 AggregatedListNetworkEndpointGroupsRequest, 1541 NetworkEndpointGroupAggregatedList, 1542 Map.Entry<String, NetworkEndpointGroupsScopedList>, 1543 AggregatedListPage, 1544 AggregatedListFixedSizeCollection> { 1545 createAsync( PageContext< AggregatedListNetworkEndpointGroupsRequest, NetworkEndpointGroupAggregatedList, Map.Entry<String, NetworkEndpointGroupsScopedList>> context, ApiFuture<NetworkEndpointGroupAggregatedList> futureResponse)1546 public static ApiFuture<AggregatedListPagedResponse> createAsync( 1547 PageContext< 1548 AggregatedListNetworkEndpointGroupsRequest, 1549 NetworkEndpointGroupAggregatedList, 1550 Map.Entry<String, NetworkEndpointGroupsScopedList>> 1551 context, 1552 ApiFuture<NetworkEndpointGroupAggregatedList> futureResponse) { 1553 ApiFuture<AggregatedListPage> futurePage = 1554 AggregatedListPage.createEmptyPage().createPageAsync(context, futureResponse); 1555 return ApiFutures.transform( 1556 futurePage, 1557 input -> new AggregatedListPagedResponse(input), 1558 MoreExecutors.directExecutor()); 1559 } 1560 AggregatedListPagedResponse(AggregatedListPage page)1561 private AggregatedListPagedResponse(AggregatedListPage page) { 1562 super(page, AggregatedListFixedSizeCollection.createEmptyCollection()); 1563 } 1564 } 1565 1566 public static class AggregatedListPage 1567 extends AbstractPage< 1568 AggregatedListNetworkEndpointGroupsRequest, 1569 NetworkEndpointGroupAggregatedList, 1570 Map.Entry<String, NetworkEndpointGroupsScopedList>, 1571 AggregatedListPage> { 1572 AggregatedListPage( PageContext< AggregatedListNetworkEndpointGroupsRequest, NetworkEndpointGroupAggregatedList, Map.Entry<String, NetworkEndpointGroupsScopedList>> context, NetworkEndpointGroupAggregatedList response)1573 private AggregatedListPage( 1574 PageContext< 1575 AggregatedListNetworkEndpointGroupsRequest, 1576 NetworkEndpointGroupAggregatedList, 1577 Map.Entry<String, NetworkEndpointGroupsScopedList>> 1578 context, 1579 NetworkEndpointGroupAggregatedList response) { 1580 super(context, response); 1581 } 1582 createEmptyPage()1583 private static AggregatedListPage createEmptyPage() { 1584 return new AggregatedListPage(null, null); 1585 } 1586 1587 @Override createPage( PageContext< AggregatedListNetworkEndpointGroupsRequest, NetworkEndpointGroupAggregatedList, Map.Entry<String, NetworkEndpointGroupsScopedList>> context, NetworkEndpointGroupAggregatedList response)1588 protected AggregatedListPage createPage( 1589 PageContext< 1590 AggregatedListNetworkEndpointGroupsRequest, 1591 NetworkEndpointGroupAggregatedList, 1592 Map.Entry<String, NetworkEndpointGroupsScopedList>> 1593 context, 1594 NetworkEndpointGroupAggregatedList response) { 1595 return new AggregatedListPage(context, response); 1596 } 1597 1598 @Override createPageAsync( PageContext< AggregatedListNetworkEndpointGroupsRequest, NetworkEndpointGroupAggregatedList, Map.Entry<String, NetworkEndpointGroupsScopedList>> context, ApiFuture<NetworkEndpointGroupAggregatedList> futureResponse)1599 public ApiFuture<AggregatedListPage> createPageAsync( 1600 PageContext< 1601 AggregatedListNetworkEndpointGroupsRequest, 1602 NetworkEndpointGroupAggregatedList, 1603 Map.Entry<String, NetworkEndpointGroupsScopedList>> 1604 context, 1605 ApiFuture<NetworkEndpointGroupAggregatedList> futureResponse) { 1606 return super.createPageAsync(context, futureResponse); 1607 } 1608 } 1609 1610 public static class AggregatedListFixedSizeCollection 1611 extends AbstractFixedSizeCollection< 1612 AggregatedListNetworkEndpointGroupsRequest, 1613 NetworkEndpointGroupAggregatedList, 1614 Map.Entry<String, NetworkEndpointGroupsScopedList>, 1615 AggregatedListPage, 1616 AggregatedListFixedSizeCollection> { 1617 AggregatedListFixedSizeCollection(List<AggregatedListPage> pages, int collectionSize)1618 private AggregatedListFixedSizeCollection(List<AggregatedListPage> pages, int collectionSize) { 1619 super(pages, collectionSize); 1620 } 1621 createEmptyCollection()1622 private static AggregatedListFixedSizeCollection createEmptyCollection() { 1623 return new AggregatedListFixedSizeCollection(null, 0); 1624 } 1625 1626 @Override createCollection( List<AggregatedListPage> pages, int collectionSize)1627 protected AggregatedListFixedSizeCollection createCollection( 1628 List<AggregatedListPage> pages, int collectionSize) { 1629 return new AggregatedListFixedSizeCollection(pages, collectionSize); 1630 } 1631 } 1632 1633 public static class ListPagedResponse 1634 extends AbstractPagedListResponse< 1635 ListNetworkEndpointGroupsRequest, 1636 NetworkEndpointGroupList, 1637 NetworkEndpointGroup, 1638 ListPage, 1639 ListFixedSizeCollection> { 1640 createAsync( PageContext< ListNetworkEndpointGroupsRequest, NetworkEndpointGroupList, NetworkEndpointGroup> context, ApiFuture<NetworkEndpointGroupList> futureResponse)1641 public static ApiFuture<ListPagedResponse> createAsync( 1642 PageContext< 1643 ListNetworkEndpointGroupsRequest, NetworkEndpointGroupList, NetworkEndpointGroup> 1644 context, 1645 ApiFuture<NetworkEndpointGroupList> futureResponse) { 1646 ApiFuture<ListPage> futurePage = 1647 ListPage.createEmptyPage().createPageAsync(context, futureResponse); 1648 return ApiFutures.transform( 1649 futurePage, input -> new ListPagedResponse(input), MoreExecutors.directExecutor()); 1650 } 1651 ListPagedResponse(ListPage page)1652 private ListPagedResponse(ListPage page) { 1653 super(page, ListFixedSizeCollection.createEmptyCollection()); 1654 } 1655 } 1656 1657 public static class ListPage 1658 extends AbstractPage< 1659 ListNetworkEndpointGroupsRequest, 1660 NetworkEndpointGroupList, 1661 NetworkEndpointGroup, 1662 ListPage> { 1663 ListPage( PageContext< ListNetworkEndpointGroupsRequest, NetworkEndpointGroupList, NetworkEndpointGroup> context, NetworkEndpointGroupList response)1664 private ListPage( 1665 PageContext< 1666 ListNetworkEndpointGroupsRequest, NetworkEndpointGroupList, NetworkEndpointGroup> 1667 context, 1668 NetworkEndpointGroupList response) { 1669 super(context, response); 1670 } 1671 createEmptyPage()1672 private static ListPage createEmptyPage() { 1673 return new ListPage(null, null); 1674 } 1675 1676 @Override createPage( PageContext< ListNetworkEndpointGroupsRequest, NetworkEndpointGroupList, NetworkEndpointGroup> context, NetworkEndpointGroupList response)1677 protected ListPage createPage( 1678 PageContext< 1679 ListNetworkEndpointGroupsRequest, NetworkEndpointGroupList, NetworkEndpointGroup> 1680 context, 1681 NetworkEndpointGroupList response) { 1682 return new ListPage(context, response); 1683 } 1684 1685 @Override createPageAsync( PageContext< ListNetworkEndpointGroupsRequest, NetworkEndpointGroupList, NetworkEndpointGroup> context, ApiFuture<NetworkEndpointGroupList> futureResponse)1686 public ApiFuture<ListPage> createPageAsync( 1687 PageContext< 1688 ListNetworkEndpointGroupsRequest, NetworkEndpointGroupList, NetworkEndpointGroup> 1689 context, 1690 ApiFuture<NetworkEndpointGroupList> futureResponse) { 1691 return super.createPageAsync(context, futureResponse); 1692 } 1693 } 1694 1695 public static class ListFixedSizeCollection 1696 extends AbstractFixedSizeCollection< 1697 ListNetworkEndpointGroupsRequest, 1698 NetworkEndpointGroupList, 1699 NetworkEndpointGroup, 1700 ListPage, 1701 ListFixedSizeCollection> { 1702 ListFixedSizeCollection(List<ListPage> pages, int collectionSize)1703 private ListFixedSizeCollection(List<ListPage> pages, int collectionSize) { 1704 super(pages, collectionSize); 1705 } 1706 createEmptyCollection()1707 private static ListFixedSizeCollection createEmptyCollection() { 1708 return new ListFixedSizeCollection(null, 0); 1709 } 1710 1711 @Override createCollection(List<ListPage> pages, int collectionSize)1712 protected ListFixedSizeCollection createCollection(List<ListPage> pages, int collectionSize) { 1713 return new ListFixedSizeCollection(pages, collectionSize); 1714 } 1715 } 1716 1717 public static class ListNetworkEndpointsPagedResponse 1718 extends AbstractPagedListResponse< 1719 ListNetworkEndpointsNetworkEndpointGroupsRequest, 1720 NetworkEndpointGroupsListNetworkEndpoints, 1721 NetworkEndpointWithHealthStatus, 1722 ListNetworkEndpointsPage, 1723 ListNetworkEndpointsFixedSizeCollection> { 1724 createAsync( PageContext< ListNetworkEndpointsNetworkEndpointGroupsRequest, NetworkEndpointGroupsListNetworkEndpoints, NetworkEndpointWithHealthStatus> context, ApiFuture<NetworkEndpointGroupsListNetworkEndpoints> futureResponse)1725 public static ApiFuture<ListNetworkEndpointsPagedResponse> createAsync( 1726 PageContext< 1727 ListNetworkEndpointsNetworkEndpointGroupsRequest, 1728 NetworkEndpointGroupsListNetworkEndpoints, 1729 NetworkEndpointWithHealthStatus> 1730 context, 1731 ApiFuture<NetworkEndpointGroupsListNetworkEndpoints> futureResponse) { 1732 ApiFuture<ListNetworkEndpointsPage> futurePage = 1733 ListNetworkEndpointsPage.createEmptyPage().createPageAsync(context, futureResponse); 1734 return ApiFutures.transform( 1735 futurePage, 1736 input -> new ListNetworkEndpointsPagedResponse(input), 1737 MoreExecutors.directExecutor()); 1738 } 1739 ListNetworkEndpointsPagedResponse(ListNetworkEndpointsPage page)1740 private ListNetworkEndpointsPagedResponse(ListNetworkEndpointsPage page) { 1741 super(page, ListNetworkEndpointsFixedSizeCollection.createEmptyCollection()); 1742 } 1743 } 1744 1745 public static class ListNetworkEndpointsPage 1746 extends AbstractPage< 1747 ListNetworkEndpointsNetworkEndpointGroupsRequest, 1748 NetworkEndpointGroupsListNetworkEndpoints, 1749 NetworkEndpointWithHealthStatus, 1750 ListNetworkEndpointsPage> { 1751 ListNetworkEndpointsPage( PageContext< ListNetworkEndpointsNetworkEndpointGroupsRequest, NetworkEndpointGroupsListNetworkEndpoints, NetworkEndpointWithHealthStatus> context, NetworkEndpointGroupsListNetworkEndpoints response)1752 private ListNetworkEndpointsPage( 1753 PageContext< 1754 ListNetworkEndpointsNetworkEndpointGroupsRequest, 1755 NetworkEndpointGroupsListNetworkEndpoints, 1756 NetworkEndpointWithHealthStatus> 1757 context, 1758 NetworkEndpointGroupsListNetworkEndpoints response) { 1759 super(context, response); 1760 } 1761 createEmptyPage()1762 private static ListNetworkEndpointsPage createEmptyPage() { 1763 return new ListNetworkEndpointsPage(null, null); 1764 } 1765 1766 @Override createPage( PageContext< ListNetworkEndpointsNetworkEndpointGroupsRequest, NetworkEndpointGroupsListNetworkEndpoints, NetworkEndpointWithHealthStatus> context, NetworkEndpointGroupsListNetworkEndpoints response)1767 protected ListNetworkEndpointsPage createPage( 1768 PageContext< 1769 ListNetworkEndpointsNetworkEndpointGroupsRequest, 1770 NetworkEndpointGroupsListNetworkEndpoints, 1771 NetworkEndpointWithHealthStatus> 1772 context, 1773 NetworkEndpointGroupsListNetworkEndpoints response) { 1774 return new ListNetworkEndpointsPage(context, response); 1775 } 1776 1777 @Override createPageAsync( PageContext< ListNetworkEndpointsNetworkEndpointGroupsRequest, NetworkEndpointGroupsListNetworkEndpoints, NetworkEndpointWithHealthStatus> context, ApiFuture<NetworkEndpointGroupsListNetworkEndpoints> futureResponse)1778 public ApiFuture<ListNetworkEndpointsPage> createPageAsync( 1779 PageContext< 1780 ListNetworkEndpointsNetworkEndpointGroupsRequest, 1781 NetworkEndpointGroupsListNetworkEndpoints, 1782 NetworkEndpointWithHealthStatus> 1783 context, 1784 ApiFuture<NetworkEndpointGroupsListNetworkEndpoints> futureResponse) { 1785 return super.createPageAsync(context, futureResponse); 1786 } 1787 } 1788 1789 public static class ListNetworkEndpointsFixedSizeCollection 1790 extends AbstractFixedSizeCollection< 1791 ListNetworkEndpointsNetworkEndpointGroupsRequest, 1792 NetworkEndpointGroupsListNetworkEndpoints, 1793 NetworkEndpointWithHealthStatus, 1794 ListNetworkEndpointsPage, 1795 ListNetworkEndpointsFixedSizeCollection> { 1796 ListNetworkEndpointsFixedSizeCollection( List<ListNetworkEndpointsPage> pages, int collectionSize)1797 private ListNetworkEndpointsFixedSizeCollection( 1798 List<ListNetworkEndpointsPage> pages, int collectionSize) { 1799 super(pages, collectionSize); 1800 } 1801 createEmptyCollection()1802 private static ListNetworkEndpointsFixedSizeCollection createEmptyCollection() { 1803 return new ListNetworkEndpointsFixedSizeCollection(null, 0); 1804 } 1805 1806 @Override createCollection( List<ListNetworkEndpointsPage> pages, int collectionSize)1807 protected ListNetworkEndpointsFixedSizeCollection createCollection( 1808 List<ListNetworkEndpointsPage> pages, int collectionSize) { 1809 return new ListNetworkEndpointsFixedSizeCollection(pages, collectionSize); 1810 } 1811 } 1812 } 1813