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.RegionUrlMapsStub; 31 import com.google.cloud.compute.v1.stub.RegionUrlMapsStubSettings; 32 import com.google.common.util.concurrent.MoreExecutors; 33 import java.io.IOException; 34 import java.util.List; 35 import java.util.concurrent.TimeUnit; 36 import javax.annotation.Generated; 37 38 // AUTO-GENERATED DOCUMENTATION AND CLASS. 39 /** 40 * Service Description: The RegionUrlMaps API. 41 * 42 * <p>This class provides the ability to make remote calls to the backing service through method 43 * calls that map to API methods. Sample code to get started: 44 * 45 * <pre>{@code 46 * // This snippet has been automatically generated and should be regarded as a code template only. 47 * // It will require modifications to work: 48 * // - It may require correct/in-range values for request initialization. 49 * // - It may require specifying regional endpoints when creating the service client as shown in 50 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 51 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 52 * String project = "project-309310695"; 53 * String region = "region-934795532"; 54 * String urlMap = "urlMap-836780691"; 55 * UrlMap response = regionUrlMapsClient.get(project, region, urlMap); 56 * } 57 * }</pre> 58 * 59 * <p>Note: close() needs to be called on the RegionUrlMapsClient object to clean up resources such 60 * as threads. In the example above, try-with-resources is used, which automatically calls close(). 61 * 62 * <p>The surface of this class includes several types of Java methods for each of the API's 63 * methods: 64 * 65 * <ol> 66 * <li>A "flattened" method. With this type of method, the fields of the request type have been 67 * converted into function parameters. It may be the case that not all fields are available as 68 * parameters, and not every API method will have a flattened method entry point. 69 * <li>A "request object" method. This type of method only takes one parameter, a request object, 70 * which must be constructed before the call. Not every API method will have a request object 71 * method. 72 * <li>A "callable" method. This type of method takes no parameters and returns an immutable API 73 * callable object, which can be used to initiate calls to the service. 74 * </ol> 75 * 76 * <p>See the individual methods for example code. 77 * 78 * <p>Many parameters require resource names to be formatted in a particular way. To assist with 79 * these names, this class includes a format method for each type of name, and additionally a parse 80 * method to extract the individual identifiers contained within names that are returned. 81 * 82 * <p>This class can be customized by passing in a custom instance of RegionUrlMapsSettings to 83 * create(). For example: 84 * 85 * <p>To customize credentials: 86 * 87 * <pre>{@code 88 * // This snippet has been automatically generated and should be regarded as a code template only. 89 * // It will require modifications to work: 90 * // - It may require correct/in-range values for request initialization. 91 * // - It may require specifying regional endpoints when creating the service client as shown in 92 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 93 * RegionUrlMapsSettings regionUrlMapsSettings = 94 * RegionUrlMapsSettings.newBuilder() 95 * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) 96 * .build(); 97 * RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create(regionUrlMapsSettings); 98 * }</pre> 99 * 100 * <p>To customize the endpoint: 101 * 102 * <pre>{@code 103 * // This snippet has been automatically generated and should be regarded as a code template only. 104 * // It will require modifications to work: 105 * // - It may require correct/in-range values for request initialization. 106 * // - It may require specifying regional endpoints when creating the service client as shown in 107 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 108 * RegionUrlMapsSettings regionUrlMapsSettings = 109 * RegionUrlMapsSettings.newBuilder().setEndpoint(myEndpoint).build(); 110 * RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create(regionUrlMapsSettings); 111 * }</pre> 112 * 113 * <p>Please refer to the GitHub repository's samples for more quickstart code snippets. 114 */ 115 @Generated("by gapic-generator-java") 116 public class RegionUrlMapsClient implements BackgroundResource { 117 private final RegionUrlMapsSettings settings; 118 private final RegionUrlMapsStub stub; 119 120 /** Constructs an instance of RegionUrlMapsClient with default settings. */ create()121 public static final RegionUrlMapsClient create() throws IOException { 122 return create(RegionUrlMapsSettings.newBuilder().build()); 123 } 124 125 /** 126 * Constructs an instance of RegionUrlMapsClient, using the given settings. The channels are 127 * created based on the settings passed in, or defaults for any settings that are not set. 128 */ create(RegionUrlMapsSettings settings)129 public static final RegionUrlMapsClient create(RegionUrlMapsSettings settings) 130 throws IOException { 131 return new RegionUrlMapsClient(settings); 132 } 133 134 /** 135 * Constructs an instance of RegionUrlMapsClient, using the given stub for making calls. This is 136 * for advanced usage - prefer using create(RegionUrlMapsSettings). 137 */ create(RegionUrlMapsStub stub)138 public static final RegionUrlMapsClient create(RegionUrlMapsStub stub) { 139 return new RegionUrlMapsClient(stub); 140 } 141 142 /** 143 * Constructs an instance of RegionUrlMapsClient, using the given settings. This is protected so 144 * that it is easy to make a subclass, but otherwise, the static factory methods should be 145 * preferred. 146 */ RegionUrlMapsClient(RegionUrlMapsSettings settings)147 protected RegionUrlMapsClient(RegionUrlMapsSettings settings) throws IOException { 148 this.settings = settings; 149 this.stub = ((RegionUrlMapsStubSettings) settings.getStubSettings()).createStub(); 150 } 151 RegionUrlMapsClient(RegionUrlMapsStub stub)152 protected RegionUrlMapsClient(RegionUrlMapsStub stub) { 153 this.settings = null; 154 this.stub = stub; 155 } 156 getSettings()157 public final RegionUrlMapsSettings getSettings() { 158 return settings; 159 } 160 getStub()161 public RegionUrlMapsStub getStub() { 162 return stub; 163 } 164 165 // AUTO-GENERATED DOCUMENTATION AND METHOD. 166 /** 167 * Deletes the specified UrlMap resource. 168 * 169 * <p>Sample code: 170 * 171 * <pre>{@code 172 * // This snippet has been automatically generated and should be regarded as a code template only. 173 * // It will require modifications to work: 174 * // - It may require correct/in-range values for request initialization. 175 * // - It may require specifying regional endpoints when creating the service client as shown in 176 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 177 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 178 * String project = "project-309310695"; 179 * String region = "region-934795532"; 180 * String urlMap = "urlMap-836780691"; 181 * Operation response = regionUrlMapsClient.deleteAsync(project, region, urlMap).get(); 182 * } 183 * }</pre> 184 * 185 * @param project Project ID for this request. 186 * @param region Name of the region scoping this request. 187 * @param urlMap Name of the UrlMap resource to delete. 188 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 189 */ deleteAsync( String project, String region, String urlMap)190 public final OperationFuture<Operation, Operation> deleteAsync( 191 String project, String region, String urlMap) { 192 DeleteRegionUrlMapRequest request = 193 DeleteRegionUrlMapRequest.newBuilder() 194 .setProject(project) 195 .setRegion(region) 196 .setUrlMap(urlMap) 197 .build(); 198 return deleteAsync(request); 199 } 200 201 // AUTO-GENERATED DOCUMENTATION AND METHOD. 202 /** 203 * Deletes the specified UrlMap resource. 204 * 205 * <p>Sample code: 206 * 207 * <pre>{@code 208 * // This snippet has been automatically generated and should be regarded as a code template only. 209 * // It will require modifications to work: 210 * // - It may require correct/in-range values for request initialization. 211 * // - It may require specifying regional endpoints when creating the service client as shown in 212 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 213 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 214 * DeleteRegionUrlMapRequest request = 215 * DeleteRegionUrlMapRequest.newBuilder() 216 * .setProject("project-309310695") 217 * .setRegion("region-934795532") 218 * .setRequestId("requestId693933066") 219 * .setUrlMap("urlMap-836780691") 220 * .build(); 221 * Operation response = regionUrlMapsClient.deleteAsync(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 */ 228 @BetaApi( 229 "The surface for long-running operations is not stable yet and may change in the future.") deleteAsync( DeleteRegionUrlMapRequest request)230 public final OperationFuture<Operation, Operation> deleteAsync( 231 DeleteRegionUrlMapRequest request) { 232 return deleteOperationCallable().futureCall(request); 233 } 234 235 // AUTO-GENERATED DOCUMENTATION AND METHOD. 236 /** 237 * Deletes the specified UrlMap resource. 238 * 239 * <p>Sample code: 240 * 241 * <pre>{@code 242 * // This snippet has been automatically generated and should be regarded as a code template only. 243 * // It will require modifications to work: 244 * // - It may require correct/in-range values for request initialization. 245 * // - It may require specifying regional endpoints when creating the service client as shown in 246 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 247 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 248 * DeleteRegionUrlMapRequest request = 249 * DeleteRegionUrlMapRequest.newBuilder() 250 * .setProject("project-309310695") 251 * .setRegion("region-934795532") 252 * .setRequestId("requestId693933066") 253 * .setUrlMap("urlMap-836780691") 254 * .build(); 255 * OperationFuture<Operation, Operation> future = 256 * regionUrlMapsClient.deleteOperationCallable().futureCall(request); 257 * // Do something. 258 * Operation response = future.get(); 259 * } 260 * }</pre> 261 */ 262 public final OperationCallable<DeleteRegionUrlMapRequest, Operation, Operation> deleteOperationCallable()263 deleteOperationCallable() { 264 return stub.deleteOperationCallable(); 265 } 266 267 // AUTO-GENERATED DOCUMENTATION AND METHOD. 268 /** 269 * Deletes the specified UrlMap resource. 270 * 271 * <p>Sample code: 272 * 273 * <pre>{@code 274 * // This snippet has been automatically generated and should be regarded as a code template only. 275 * // It will require modifications to work: 276 * // - It may require correct/in-range values for request initialization. 277 * // - It may require specifying regional endpoints when creating the service client as shown in 278 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 279 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 280 * DeleteRegionUrlMapRequest request = 281 * DeleteRegionUrlMapRequest.newBuilder() 282 * .setProject("project-309310695") 283 * .setRegion("region-934795532") 284 * .setRequestId("requestId693933066") 285 * .setUrlMap("urlMap-836780691") 286 * .build(); 287 * ApiFuture<Operation> future = regionUrlMapsClient.deleteCallable().futureCall(request); 288 * // Do something. 289 * Operation response = future.get(); 290 * } 291 * }</pre> 292 */ deleteCallable()293 public final UnaryCallable<DeleteRegionUrlMapRequest, Operation> deleteCallable() { 294 return stub.deleteCallable(); 295 } 296 297 // AUTO-GENERATED DOCUMENTATION AND METHOD. 298 /** 299 * Returns the specified UrlMap resource. 300 * 301 * <p>Sample code: 302 * 303 * <pre>{@code 304 * // This snippet has been automatically generated and should be regarded as a code template only. 305 * // It will require modifications to work: 306 * // - It may require correct/in-range values for request initialization. 307 * // - It may require specifying regional endpoints when creating the service client as shown in 308 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 309 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 310 * String project = "project-309310695"; 311 * String region = "region-934795532"; 312 * String urlMap = "urlMap-836780691"; 313 * UrlMap response = regionUrlMapsClient.get(project, region, urlMap); 314 * } 315 * }</pre> 316 * 317 * @param project Project ID for this request. 318 * @param region Name of the region scoping this request. 319 * @param urlMap Name of the UrlMap resource to return. 320 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 321 */ get(String project, String region, String urlMap)322 public final UrlMap get(String project, String region, String urlMap) { 323 GetRegionUrlMapRequest request = 324 GetRegionUrlMapRequest.newBuilder() 325 .setProject(project) 326 .setRegion(region) 327 .setUrlMap(urlMap) 328 .build(); 329 return get(request); 330 } 331 332 // AUTO-GENERATED DOCUMENTATION AND METHOD. 333 /** 334 * Returns the specified UrlMap resource. 335 * 336 * <p>Sample code: 337 * 338 * <pre>{@code 339 * // This snippet has been automatically generated and should be regarded as a code template only. 340 * // It will require modifications to work: 341 * // - It may require correct/in-range values for request initialization. 342 * // - It may require specifying regional endpoints when creating the service client as shown in 343 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 344 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 345 * GetRegionUrlMapRequest request = 346 * GetRegionUrlMapRequest.newBuilder() 347 * .setProject("project-309310695") 348 * .setRegion("region-934795532") 349 * .setUrlMap("urlMap-836780691") 350 * .build(); 351 * UrlMap response = regionUrlMapsClient.get(request); 352 * } 353 * }</pre> 354 * 355 * @param request The request object containing all of the parameters for the API call. 356 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 357 */ get(GetRegionUrlMapRequest request)358 public final UrlMap get(GetRegionUrlMapRequest request) { 359 return getCallable().call(request); 360 } 361 362 // AUTO-GENERATED DOCUMENTATION AND METHOD. 363 /** 364 * Returns the specified UrlMap resource. 365 * 366 * <p>Sample code: 367 * 368 * <pre>{@code 369 * // This snippet has been automatically generated and should be regarded as a code template only. 370 * // It will require modifications to work: 371 * // - It may require correct/in-range values for request initialization. 372 * // - It may require specifying regional endpoints when creating the service client as shown in 373 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 374 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 375 * GetRegionUrlMapRequest request = 376 * GetRegionUrlMapRequest.newBuilder() 377 * .setProject("project-309310695") 378 * .setRegion("region-934795532") 379 * .setUrlMap("urlMap-836780691") 380 * .build(); 381 * ApiFuture<UrlMap> future = regionUrlMapsClient.getCallable().futureCall(request); 382 * // Do something. 383 * UrlMap response = future.get(); 384 * } 385 * }</pre> 386 */ getCallable()387 public final UnaryCallable<GetRegionUrlMapRequest, UrlMap> getCallable() { 388 return stub.getCallable(); 389 } 390 391 // AUTO-GENERATED DOCUMENTATION AND METHOD. 392 /** 393 * Creates a UrlMap resource in the specified project using the data included in the request. 394 * 395 * <p>Sample code: 396 * 397 * <pre>{@code 398 * // This snippet has been automatically generated and should be regarded as a code template only. 399 * // It will require modifications to work: 400 * // - It may require correct/in-range values for request initialization. 401 * // - It may require specifying regional endpoints when creating the service client as shown in 402 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 403 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 404 * String project = "project-309310695"; 405 * String region = "region-934795532"; 406 * UrlMap urlMapResource = UrlMap.newBuilder().build(); 407 * Operation response = regionUrlMapsClient.insertAsync(project, region, urlMapResource).get(); 408 * } 409 * }</pre> 410 * 411 * @param project Project ID for this request. 412 * @param region Name of the region scoping this request. 413 * @param urlMapResource The body resource for this request 414 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 415 */ insertAsync( String project, String region, UrlMap urlMapResource)416 public final OperationFuture<Operation, Operation> insertAsync( 417 String project, String region, UrlMap urlMapResource) { 418 InsertRegionUrlMapRequest request = 419 InsertRegionUrlMapRequest.newBuilder() 420 .setProject(project) 421 .setRegion(region) 422 .setUrlMapResource(urlMapResource) 423 .build(); 424 return insertAsync(request); 425 } 426 427 // AUTO-GENERATED DOCUMENTATION AND METHOD. 428 /** 429 * Creates a UrlMap resource in the specified project using the data included in the request. 430 * 431 * <p>Sample code: 432 * 433 * <pre>{@code 434 * // This snippet has been automatically generated and should be regarded as a code template only. 435 * // It will require modifications to work: 436 * // - It may require correct/in-range values for request initialization. 437 * // - It may require specifying regional endpoints when creating the service client as shown in 438 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 439 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 440 * InsertRegionUrlMapRequest request = 441 * InsertRegionUrlMapRequest.newBuilder() 442 * .setProject("project-309310695") 443 * .setRegion("region-934795532") 444 * .setRequestId("requestId693933066") 445 * .setUrlMapResource(UrlMap.newBuilder().build()) 446 * .build(); 447 * Operation response = regionUrlMapsClient.insertAsync(request).get(); 448 * } 449 * }</pre> 450 * 451 * @param request The request object containing all of the parameters for the API call. 452 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 453 */ 454 @BetaApi( 455 "The surface for long-running operations is not stable yet and may change in the future.") insertAsync( InsertRegionUrlMapRequest request)456 public final OperationFuture<Operation, Operation> insertAsync( 457 InsertRegionUrlMapRequest request) { 458 return insertOperationCallable().futureCall(request); 459 } 460 461 // AUTO-GENERATED DOCUMENTATION AND METHOD. 462 /** 463 * Creates a UrlMap resource in the specified project using the data included in the request. 464 * 465 * <p>Sample code: 466 * 467 * <pre>{@code 468 * // This snippet has been automatically generated and should be regarded as a code template only. 469 * // It will require modifications to work: 470 * // - It may require correct/in-range values for request initialization. 471 * // - It may require specifying regional endpoints when creating the service client as shown in 472 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 473 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 474 * InsertRegionUrlMapRequest request = 475 * InsertRegionUrlMapRequest.newBuilder() 476 * .setProject("project-309310695") 477 * .setRegion("region-934795532") 478 * .setRequestId("requestId693933066") 479 * .setUrlMapResource(UrlMap.newBuilder().build()) 480 * .build(); 481 * OperationFuture<Operation, Operation> future = 482 * regionUrlMapsClient.insertOperationCallable().futureCall(request); 483 * // Do something. 484 * Operation response = future.get(); 485 * } 486 * }</pre> 487 */ 488 public final OperationCallable<InsertRegionUrlMapRequest, Operation, Operation> insertOperationCallable()489 insertOperationCallable() { 490 return stub.insertOperationCallable(); 491 } 492 493 // AUTO-GENERATED DOCUMENTATION AND METHOD. 494 /** 495 * Creates a UrlMap resource in the specified project using the data included in the request. 496 * 497 * <p>Sample code: 498 * 499 * <pre>{@code 500 * // This snippet has been automatically generated and should be regarded as a code template only. 501 * // It will require modifications to work: 502 * // - It may require correct/in-range values for request initialization. 503 * // - It may require specifying regional endpoints when creating the service client as shown in 504 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 505 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 506 * InsertRegionUrlMapRequest request = 507 * InsertRegionUrlMapRequest.newBuilder() 508 * .setProject("project-309310695") 509 * .setRegion("region-934795532") 510 * .setRequestId("requestId693933066") 511 * .setUrlMapResource(UrlMap.newBuilder().build()) 512 * .build(); 513 * ApiFuture<Operation> future = regionUrlMapsClient.insertCallable().futureCall(request); 514 * // Do something. 515 * Operation response = future.get(); 516 * } 517 * }</pre> 518 */ insertCallable()519 public final UnaryCallable<InsertRegionUrlMapRequest, Operation> insertCallable() { 520 return stub.insertCallable(); 521 } 522 523 // AUTO-GENERATED DOCUMENTATION AND METHOD. 524 /** 525 * Retrieves the list of UrlMap resources available to the specified project in the specified 526 * region. 527 * 528 * <p>Sample code: 529 * 530 * <pre>{@code 531 * // This snippet has been automatically generated and should be regarded as a code template only. 532 * // It will require modifications to work: 533 * // - It may require correct/in-range values for request initialization. 534 * // - It may require specifying regional endpoints when creating the service client as shown in 535 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 536 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 537 * String project = "project-309310695"; 538 * String region = "region-934795532"; 539 * for (UrlMap element : regionUrlMapsClient.list(project, region).iterateAll()) { 540 * // doThingsWith(element); 541 * } 542 * } 543 * }</pre> 544 * 545 * @param project Project ID for this request. 546 * @param region Name of the region scoping this request. 547 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 548 */ list(String project, String region)549 public final ListPagedResponse list(String project, String region) { 550 ListRegionUrlMapsRequest request = 551 ListRegionUrlMapsRequest.newBuilder().setProject(project).setRegion(region).build(); 552 return list(request); 553 } 554 555 // AUTO-GENERATED DOCUMENTATION AND METHOD. 556 /** 557 * Retrieves the list of UrlMap resources available to the specified project in the specified 558 * region. 559 * 560 * <p>Sample code: 561 * 562 * <pre>{@code 563 * // This snippet has been automatically generated and should be regarded as a code template only. 564 * // It will require modifications to work: 565 * // - It may require correct/in-range values for request initialization. 566 * // - It may require specifying regional endpoints when creating the service client as shown in 567 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 568 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 569 * ListRegionUrlMapsRequest request = 570 * ListRegionUrlMapsRequest.newBuilder() 571 * .setFilter("filter-1274492040") 572 * .setMaxResults(1128457243) 573 * .setOrderBy("orderBy-1207110587") 574 * .setPageToken("pageToken873572522") 575 * .setProject("project-309310695") 576 * .setRegion("region-934795532") 577 * .setReturnPartialSuccess(true) 578 * .build(); 579 * for (UrlMap element : regionUrlMapsClient.list(request).iterateAll()) { 580 * // doThingsWith(element); 581 * } 582 * } 583 * }</pre> 584 * 585 * @param request The request object containing all of the parameters for the API call. 586 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 587 */ list(ListRegionUrlMapsRequest request)588 public final ListPagedResponse list(ListRegionUrlMapsRequest request) { 589 return listPagedCallable().call(request); 590 } 591 592 // AUTO-GENERATED DOCUMENTATION AND METHOD. 593 /** 594 * Retrieves the list of UrlMap resources available to the specified project in the specified 595 * region. 596 * 597 * <p>Sample code: 598 * 599 * <pre>{@code 600 * // This snippet has been automatically generated and should be regarded as a code template only. 601 * // It will require modifications to work: 602 * // - It may require correct/in-range values for request initialization. 603 * // - It may require specifying regional endpoints when creating the service client as shown in 604 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 605 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 606 * ListRegionUrlMapsRequest request = 607 * ListRegionUrlMapsRequest.newBuilder() 608 * .setFilter("filter-1274492040") 609 * .setMaxResults(1128457243) 610 * .setOrderBy("orderBy-1207110587") 611 * .setPageToken("pageToken873572522") 612 * .setProject("project-309310695") 613 * .setRegion("region-934795532") 614 * .setReturnPartialSuccess(true) 615 * .build(); 616 * ApiFuture<UrlMap> future = regionUrlMapsClient.listPagedCallable().futureCall(request); 617 * // Do something. 618 * for (UrlMap element : future.get().iterateAll()) { 619 * // doThingsWith(element); 620 * } 621 * } 622 * }</pre> 623 */ listPagedCallable()624 public final UnaryCallable<ListRegionUrlMapsRequest, ListPagedResponse> listPagedCallable() { 625 return stub.listPagedCallable(); 626 } 627 628 // AUTO-GENERATED DOCUMENTATION AND METHOD. 629 /** 630 * Retrieves the list of UrlMap resources available to the specified project in the specified 631 * region. 632 * 633 * <p>Sample code: 634 * 635 * <pre>{@code 636 * // This snippet has been automatically generated and should be regarded as a code template only. 637 * // It will require modifications to work: 638 * // - It may require correct/in-range values for request initialization. 639 * // - It may require specifying regional endpoints when creating the service client as shown in 640 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 641 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 642 * ListRegionUrlMapsRequest request = 643 * ListRegionUrlMapsRequest.newBuilder() 644 * .setFilter("filter-1274492040") 645 * .setMaxResults(1128457243) 646 * .setOrderBy("orderBy-1207110587") 647 * .setPageToken("pageToken873572522") 648 * .setProject("project-309310695") 649 * .setRegion("region-934795532") 650 * .setReturnPartialSuccess(true) 651 * .build(); 652 * while (true) { 653 * UrlMapList response = regionUrlMapsClient.listCallable().call(request); 654 * for (UrlMap element : response.getItemsList()) { 655 * // doThingsWith(element); 656 * } 657 * String nextPageToken = response.getNextPageToken(); 658 * if (!Strings.isNullOrEmpty(nextPageToken)) { 659 * request = request.toBuilder().setPageToken(nextPageToken).build(); 660 * } else { 661 * break; 662 * } 663 * } 664 * } 665 * }</pre> 666 */ listCallable()667 public final UnaryCallable<ListRegionUrlMapsRequest, UrlMapList> listCallable() { 668 return stub.listCallable(); 669 } 670 671 // AUTO-GENERATED DOCUMENTATION AND METHOD. 672 /** 673 * Patches the specified UrlMap resource with the data included in the request. This method 674 * supports PATCH semantics and uses JSON merge patch format and processing rules. 675 * 676 * <p>Sample code: 677 * 678 * <pre>{@code 679 * // This snippet has been automatically generated and should be regarded as a code template only. 680 * // It will require modifications to work: 681 * // - It may require correct/in-range values for request initialization. 682 * // - It may require specifying regional endpoints when creating the service client as shown in 683 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 684 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 685 * String project = "project-309310695"; 686 * String region = "region-934795532"; 687 * String urlMap = "urlMap-836780691"; 688 * UrlMap urlMapResource = UrlMap.newBuilder().build(); 689 * Operation response = 690 * regionUrlMapsClient.patchAsync(project, region, urlMap, urlMapResource).get(); 691 * } 692 * }</pre> 693 * 694 * @param project Project ID for this request. 695 * @param region Name of the region scoping this request. 696 * @param urlMap Name of the UrlMap resource to patch. 697 * @param urlMapResource The body resource for this request 698 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 699 */ patchAsync( String project, String region, String urlMap, UrlMap urlMapResource)700 public final OperationFuture<Operation, Operation> patchAsync( 701 String project, String region, String urlMap, UrlMap urlMapResource) { 702 PatchRegionUrlMapRequest request = 703 PatchRegionUrlMapRequest.newBuilder() 704 .setProject(project) 705 .setRegion(region) 706 .setUrlMap(urlMap) 707 .setUrlMapResource(urlMapResource) 708 .build(); 709 return patchAsync(request); 710 } 711 712 // AUTO-GENERATED DOCUMENTATION AND METHOD. 713 /** 714 * Patches the specified UrlMap resource with the data included in the request. This method 715 * supports PATCH semantics and uses JSON merge patch format and processing rules. 716 * 717 * <p>Sample code: 718 * 719 * <pre>{@code 720 * // This snippet has been automatically generated and should be regarded as a code template only. 721 * // It will require modifications to work: 722 * // - It may require correct/in-range values for request initialization. 723 * // - It may require specifying regional endpoints when creating the service client as shown in 724 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 725 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 726 * PatchRegionUrlMapRequest request = 727 * PatchRegionUrlMapRequest.newBuilder() 728 * .setProject("project-309310695") 729 * .setRegion("region-934795532") 730 * .setRequestId("requestId693933066") 731 * .setUrlMap("urlMap-836780691") 732 * .setUrlMapResource(UrlMap.newBuilder().build()) 733 * .build(); 734 * Operation response = regionUrlMapsClient.patchAsync(request).get(); 735 * } 736 * }</pre> 737 * 738 * @param request The request object containing all of the parameters for the API call. 739 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 740 */ 741 @BetaApi( 742 "The surface for long-running operations is not stable yet and may change in the future.") patchAsync(PatchRegionUrlMapRequest request)743 public final OperationFuture<Operation, Operation> patchAsync(PatchRegionUrlMapRequest request) { 744 return patchOperationCallable().futureCall(request); 745 } 746 747 // AUTO-GENERATED DOCUMENTATION AND METHOD. 748 /** 749 * Patches the specified UrlMap resource with the data included in the request. This method 750 * supports PATCH semantics and uses JSON merge patch format and processing rules. 751 * 752 * <p>Sample code: 753 * 754 * <pre>{@code 755 * // This snippet has been automatically generated and should be regarded as a code template only. 756 * // It will require modifications to work: 757 * // - It may require correct/in-range values for request initialization. 758 * // - It may require specifying regional endpoints when creating the service client as shown in 759 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 760 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 761 * PatchRegionUrlMapRequest request = 762 * PatchRegionUrlMapRequest.newBuilder() 763 * .setProject("project-309310695") 764 * .setRegion("region-934795532") 765 * .setRequestId("requestId693933066") 766 * .setUrlMap("urlMap-836780691") 767 * .setUrlMapResource(UrlMap.newBuilder().build()) 768 * .build(); 769 * OperationFuture<Operation, Operation> future = 770 * regionUrlMapsClient.patchOperationCallable().futureCall(request); 771 * // Do something. 772 * Operation response = future.get(); 773 * } 774 * }</pre> 775 */ 776 public final OperationCallable<PatchRegionUrlMapRequest, Operation, Operation> patchOperationCallable()777 patchOperationCallable() { 778 return stub.patchOperationCallable(); 779 } 780 781 // AUTO-GENERATED DOCUMENTATION AND METHOD. 782 /** 783 * Patches the specified UrlMap resource with the data included in the request. This method 784 * supports PATCH semantics and uses JSON merge patch format and processing rules. 785 * 786 * <p>Sample code: 787 * 788 * <pre>{@code 789 * // This snippet has been automatically generated and should be regarded as a code template only. 790 * // It will require modifications to work: 791 * // - It may require correct/in-range values for request initialization. 792 * // - It may require specifying regional endpoints when creating the service client as shown in 793 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 794 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 795 * PatchRegionUrlMapRequest request = 796 * PatchRegionUrlMapRequest.newBuilder() 797 * .setProject("project-309310695") 798 * .setRegion("region-934795532") 799 * .setRequestId("requestId693933066") 800 * .setUrlMap("urlMap-836780691") 801 * .setUrlMapResource(UrlMap.newBuilder().build()) 802 * .build(); 803 * ApiFuture<Operation> future = regionUrlMapsClient.patchCallable().futureCall(request); 804 * // Do something. 805 * Operation response = future.get(); 806 * } 807 * }</pre> 808 */ patchCallable()809 public final UnaryCallable<PatchRegionUrlMapRequest, Operation> patchCallable() { 810 return stub.patchCallable(); 811 } 812 813 // AUTO-GENERATED DOCUMENTATION AND METHOD. 814 /** 815 * Updates the specified UrlMap resource with the data included in the request. 816 * 817 * <p>Sample code: 818 * 819 * <pre>{@code 820 * // This snippet has been automatically generated and should be regarded as a code template only. 821 * // It will require modifications to work: 822 * // - It may require correct/in-range values for request initialization. 823 * // - It may require specifying regional endpoints when creating the service client as shown in 824 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 825 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 826 * String project = "project-309310695"; 827 * String region = "region-934795532"; 828 * String urlMap = "urlMap-836780691"; 829 * UrlMap urlMapResource = UrlMap.newBuilder().build(); 830 * Operation response = 831 * regionUrlMapsClient.updateAsync(project, region, urlMap, urlMapResource).get(); 832 * } 833 * }</pre> 834 * 835 * @param project Project ID for this request. 836 * @param region Name of the region scoping this request. 837 * @param urlMap Name of the UrlMap resource to update. 838 * @param urlMapResource The body resource for this request 839 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 840 */ updateAsync( String project, String region, String urlMap, UrlMap urlMapResource)841 public final OperationFuture<Operation, Operation> updateAsync( 842 String project, String region, String urlMap, UrlMap urlMapResource) { 843 UpdateRegionUrlMapRequest request = 844 UpdateRegionUrlMapRequest.newBuilder() 845 .setProject(project) 846 .setRegion(region) 847 .setUrlMap(urlMap) 848 .setUrlMapResource(urlMapResource) 849 .build(); 850 return updateAsync(request); 851 } 852 853 // AUTO-GENERATED DOCUMENTATION AND METHOD. 854 /** 855 * Updates the specified UrlMap resource with the data included in the request. 856 * 857 * <p>Sample code: 858 * 859 * <pre>{@code 860 * // This snippet has been automatically generated and should be regarded as a code template only. 861 * // It will require modifications to work: 862 * // - It may require correct/in-range values for request initialization. 863 * // - It may require specifying regional endpoints when creating the service client as shown in 864 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 865 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 866 * UpdateRegionUrlMapRequest request = 867 * UpdateRegionUrlMapRequest.newBuilder() 868 * .setProject("project-309310695") 869 * .setRegion("region-934795532") 870 * .setRequestId("requestId693933066") 871 * .setUrlMap("urlMap-836780691") 872 * .setUrlMapResource(UrlMap.newBuilder().build()) 873 * .build(); 874 * Operation response = regionUrlMapsClient.updateAsync(request).get(); 875 * } 876 * }</pre> 877 * 878 * @param request The request object containing all of the parameters for the API call. 879 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 880 */ 881 @BetaApi( 882 "The surface for long-running operations is not stable yet and may change in the future.") updateAsync( UpdateRegionUrlMapRequest request)883 public final OperationFuture<Operation, Operation> updateAsync( 884 UpdateRegionUrlMapRequest request) { 885 return updateOperationCallable().futureCall(request); 886 } 887 888 // AUTO-GENERATED DOCUMENTATION AND METHOD. 889 /** 890 * Updates the specified UrlMap resource with the data included in the request. 891 * 892 * <p>Sample code: 893 * 894 * <pre>{@code 895 * // This snippet has been automatically generated and should be regarded as a code template only. 896 * // It will require modifications to work: 897 * // - It may require correct/in-range values for request initialization. 898 * // - It may require specifying regional endpoints when creating the service client as shown in 899 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 900 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 901 * UpdateRegionUrlMapRequest request = 902 * UpdateRegionUrlMapRequest.newBuilder() 903 * .setProject("project-309310695") 904 * .setRegion("region-934795532") 905 * .setRequestId("requestId693933066") 906 * .setUrlMap("urlMap-836780691") 907 * .setUrlMapResource(UrlMap.newBuilder().build()) 908 * .build(); 909 * OperationFuture<Operation, Operation> future = 910 * regionUrlMapsClient.updateOperationCallable().futureCall(request); 911 * // Do something. 912 * Operation response = future.get(); 913 * } 914 * }</pre> 915 */ 916 public final OperationCallable<UpdateRegionUrlMapRequest, Operation, Operation> updateOperationCallable()917 updateOperationCallable() { 918 return stub.updateOperationCallable(); 919 } 920 921 // AUTO-GENERATED DOCUMENTATION AND METHOD. 922 /** 923 * Updates the specified UrlMap resource with the data included in the request. 924 * 925 * <p>Sample code: 926 * 927 * <pre>{@code 928 * // This snippet has been automatically generated and should be regarded as a code template only. 929 * // It will require modifications to work: 930 * // - It may require correct/in-range values for request initialization. 931 * // - It may require specifying regional endpoints when creating the service client as shown in 932 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 933 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 934 * UpdateRegionUrlMapRequest request = 935 * UpdateRegionUrlMapRequest.newBuilder() 936 * .setProject("project-309310695") 937 * .setRegion("region-934795532") 938 * .setRequestId("requestId693933066") 939 * .setUrlMap("urlMap-836780691") 940 * .setUrlMapResource(UrlMap.newBuilder().build()) 941 * .build(); 942 * ApiFuture<Operation> future = regionUrlMapsClient.updateCallable().futureCall(request); 943 * // Do something. 944 * Operation response = future.get(); 945 * } 946 * }</pre> 947 */ updateCallable()948 public final UnaryCallable<UpdateRegionUrlMapRequest, Operation> updateCallable() { 949 return stub.updateCallable(); 950 } 951 952 // AUTO-GENERATED DOCUMENTATION AND METHOD. 953 /** 954 * Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be 955 * run. Calling this method does NOT create the UrlMap. 956 * 957 * <p>Sample code: 958 * 959 * <pre>{@code 960 * // This snippet has been automatically generated and should be regarded as a code template only. 961 * // It will require modifications to work: 962 * // - It may require correct/in-range values for request initialization. 963 * // - It may require specifying regional endpoints when creating the service client as shown in 964 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 965 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 966 * String project = "project-309310695"; 967 * String region = "region-934795532"; 968 * String urlMap = "urlMap-836780691"; 969 * RegionUrlMapsValidateRequest regionUrlMapsValidateRequestResource = 970 * RegionUrlMapsValidateRequest.newBuilder().build(); 971 * UrlMapsValidateResponse response = 972 * regionUrlMapsClient.validate( 973 * project, region, urlMap, regionUrlMapsValidateRequestResource); 974 * } 975 * }</pre> 976 * 977 * @param project Project ID for this request. 978 * @param region Name of the region scoping this request. 979 * @param urlMap Name of the UrlMap resource to be validated as. 980 * @param regionUrlMapsValidateRequestResource The body resource for this request 981 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 982 */ validate( String project, String region, String urlMap, RegionUrlMapsValidateRequest regionUrlMapsValidateRequestResource)983 public final UrlMapsValidateResponse validate( 984 String project, 985 String region, 986 String urlMap, 987 RegionUrlMapsValidateRequest regionUrlMapsValidateRequestResource) { 988 ValidateRegionUrlMapRequest request = 989 ValidateRegionUrlMapRequest.newBuilder() 990 .setProject(project) 991 .setRegion(region) 992 .setUrlMap(urlMap) 993 .setRegionUrlMapsValidateRequestResource(regionUrlMapsValidateRequestResource) 994 .build(); 995 return validate(request); 996 } 997 998 // AUTO-GENERATED DOCUMENTATION AND METHOD. 999 /** 1000 * Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be 1001 * run. Calling this method does NOT create the UrlMap. 1002 * 1003 * <p>Sample code: 1004 * 1005 * <pre>{@code 1006 * // This snippet has been automatically generated and should be regarded as a code template only. 1007 * // It will require modifications to work: 1008 * // - It may require correct/in-range values for request initialization. 1009 * // - It may require specifying regional endpoints when creating the service client as shown in 1010 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1011 * try (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 1012 * ValidateRegionUrlMapRequest request = 1013 * ValidateRegionUrlMapRequest.newBuilder() 1014 * .setProject("project-309310695") 1015 * .setRegion("region-934795532") 1016 * .setRegionUrlMapsValidateRequestResource( 1017 * RegionUrlMapsValidateRequest.newBuilder().build()) 1018 * .setUrlMap("urlMap-836780691") 1019 * .build(); 1020 * UrlMapsValidateResponse response = regionUrlMapsClient.validate(request); 1021 * } 1022 * }</pre> 1023 * 1024 * @param request The request object containing all of the parameters for the API call. 1025 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1026 */ validate(ValidateRegionUrlMapRequest request)1027 public final UrlMapsValidateResponse validate(ValidateRegionUrlMapRequest request) { 1028 return validateCallable().call(request); 1029 } 1030 1031 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1032 /** 1033 * Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be 1034 * run. Calling this method does NOT create the UrlMap. 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 (RegionUrlMapsClient regionUrlMapsClient = RegionUrlMapsClient.create()) { 1045 * ValidateRegionUrlMapRequest request = 1046 * ValidateRegionUrlMapRequest.newBuilder() 1047 * .setProject("project-309310695") 1048 * .setRegion("region-934795532") 1049 * .setRegionUrlMapsValidateRequestResource( 1050 * RegionUrlMapsValidateRequest.newBuilder().build()) 1051 * .setUrlMap("urlMap-836780691") 1052 * .build(); 1053 * ApiFuture<UrlMapsValidateResponse> future = 1054 * regionUrlMapsClient.validateCallable().futureCall(request); 1055 * // Do something. 1056 * UrlMapsValidateResponse response = future.get(); 1057 * } 1058 * }</pre> 1059 */ 1060 public final UnaryCallable<ValidateRegionUrlMapRequest, UrlMapsValidateResponse> validateCallable()1061 validateCallable() { 1062 return stub.validateCallable(); 1063 } 1064 1065 @Override close()1066 public final void close() { 1067 stub.close(); 1068 } 1069 1070 @Override shutdown()1071 public void shutdown() { 1072 stub.shutdown(); 1073 } 1074 1075 @Override isShutdown()1076 public boolean isShutdown() { 1077 return stub.isShutdown(); 1078 } 1079 1080 @Override isTerminated()1081 public boolean isTerminated() { 1082 return stub.isTerminated(); 1083 } 1084 1085 @Override shutdownNow()1086 public void shutdownNow() { 1087 stub.shutdownNow(); 1088 } 1089 1090 @Override awaitTermination(long duration, TimeUnit unit)1091 public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { 1092 return stub.awaitTermination(duration, unit); 1093 } 1094 1095 public static class ListPagedResponse 1096 extends AbstractPagedListResponse< 1097 ListRegionUrlMapsRequest, UrlMapList, UrlMap, ListPage, ListFixedSizeCollection> { 1098 createAsync( PageContext<ListRegionUrlMapsRequest, UrlMapList, UrlMap> context, ApiFuture<UrlMapList> futureResponse)1099 public static ApiFuture<ListPagedResponse> createAsync( 1100 PageContext<ListRegionUrlMapsRequest, UrlMapList, UrlMap> context, 1101 ApiFuture<UrlMapList> futureResponse) { 1102 ApiFuture<ListPage> futurePage = 1103 ListPage.createEmptyPage().createPageAsync(context, futureResponse); 1104 return ApiFutures.transform( 1105 futurePage, input -> new ListPagedResponse(input), MoreExecutors.directExecutor()); 1106 } 1107 ListPagedResponse(ListPage page)1108 private ListPagedResponse(ListPage page) { 1109 super(page, ListFixedSizeCollection.createEmptyCollection()); 1110 } 1111 } 1112 1113 public static class ListPage 1114 extends AbstractPage<ListRegionUrlMapsRequest, UrlMapList, UrlMap, ListPage> { 1115 ListPage( PageContext<ListRegionUrlMapsRequest, UrlMapList, UrlMap> context, UrlMapList response)1116 private ListPage( 1117 PageContext<ListRegionUrlMapsRequest, UrlMapList, UrlMap> context, UrlMapList response) { 1118 super(context, response); 1119 } 1120 createEmptyPage()1121 private static ListPage createEmptyPage() { 1122 return new ListPage(null, null); 1123 } 1124 1125 @Override createPage( PageContext<ListRegionUrlMapsRequest, UrlMapList, UrlMap> context, UrlMapList response)1126 protected ListPage createPage( 1127 PageContext<ListRegionUrlMapsRequest, UrlMapList, UrlMap> context, UrlMapList response) { 1128 return new ListPage(context, response); 1129 } 1130 1131 @Override createPageAsync( PageContext<ListRegionUrlMapsRequest, UrlMapList, UrlMap> context, ApiFuture<UrlMapList> futureResponse)1132 public ApiFuture<ListPage> createPageAsync( 1133 PageContext<ListRegionUrlMapsRequest, UrlMapList, UrlMap> context, 1134 ApiFuture<UrlMapList> futureResponse) { 1135 return super.createPageAsync(context, futureResponse); 1136 } 1137 } 1138 1139 public static class ListFixedSizeCollection 1140 extends AbstractFixedSizeCollection< 1141 ListRegionUrlMapsRequest, UrlMapList, UrlMap, ListPage, ListFixedSizeCollection> { 1142 ListFixedSizeCollection(List<ListPage> pages, int collectionSize)1143 private ListFixedSizeCollection(List<ListPage> pages, int collectionSize) { 1144 super(pages, collectionSize); 1145 } 1146 createEmptyCollection()1147 private static ListFixedSizeCollection createEmptyCollection() { 1148 return new ListFixedSizeCollection(null, 0); 1149 } 1150 1151 @Override createCollection(List<ListPage> pages, int collectionSize)1152 protected ListFixedSizeCollection createCollection(List<ListPage> pages, int collectionSize) { 1153 return new ListFixedSizeCollection(pages, collectionSize); 1154 } 1155 } 1156 } 1157