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.area120.tables.v1alpha; 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.paging.AbstractFixedSizeCollection; 24 import com.google.api.gax.paging.AbstractPage; 25 import com.google.api.gax.paging.AbstractPagedListResponse; 26 import com.google.api.gax.rpc.PageContext; 27 import com.google.api.gax.rpc.UnaryCallable; 28 import com.google.area120.tables.v1alpha.stub.TablesServiceStub; 29 import com.google.area120.tables.v1alpha.stub.TablesServiceStubSettings; 30 import com.google.area120.tables.v1alpha1.BatchCreateRowsRequest; 31 import com.google.area120.tables.v1alpha1.BatchCreateRowsResponse; 32 import com.google.area120.tables.v1alpha1.BatchDeleteRowsRequest; 33 import com.google.area120.tables.v1alpha1.BatchUpdateRowsRequest; 34 import com.google.area120.tables.v1alpha1.BatchUpdateRowsResponse; 35 import com.google.area120.tables.v1alpha1.CreateRowRequest; 36 import com.google.area120.tables.v1alpha1.DeleteRowRequest; 37 import com.google.area120.tables.v1alpha1.GetRowRequest; 38 import com.google.area120.tables.v1alpha1.GetTableRequest; 39 import com.google.area120.tables.v1alpha1.GetWorkspaceRequest; 40 import com.google.area120.tables.v1alpha1.ListRowsRequest; 41 import com.google.area120.tables.v1alpha1.ListRowsResponse; 42 import com.google.area120.tables.v1alpha1.ListTablesRequest; 43 import com.google.area120.tables.v1alpha1.ListTablesResponse; 44 import com.google.area120.tables.v1alpha1.ListWorkspacesRequest; 45 import com.google.area120.tables.v1alpha1.ListWorkspacesResponse; 46 import com.google.area120.tables.v1alpha1.Row; 47 import com.google.area120.tables.v1alpha1.RowName; 48 import com.google.area120.tables.v1alpha1.Table; 49 import com.google.area120.tables.v1alpha1.TableName; 50 import com.google.area120.tables.v1alpha1.UpdateRowRequest; 51 import com.google.area120.tables.v1alpha1.Workspace; 52 import com.google.area120.tables.v1alpha1.WorkspaceName; 53 import com.google.common.util.concurrent.MoreExecutors; 54 import com.google.protobuf.Empty; 55 import com.google.protobuf.FieldMask; 56 import java.io.IOException; 57 import java.util.List; 58 import java.util.concurrent.TimeUnit; 59 import javax.annotation.Generated; 60 61 // AUTO-GENERATED DOCUMENTATION AND CLASS. 62 /** 63 * Service Description: The Tables Service provides an API for reading and updating tables. It 64 * defines the following resource model: 65 * 66 * <p>- The API has a collection of [Table][google.area120.tables.v1alpha1.Table] resources, named 67 * `tables/*` 68 * 69 * <p>- Each Table has a collection of [Row][google.area120.tables.v1alpha1.Row] resources, named 70 * `tables/*/rows/*` 71 * 72 * <p>- The API has a collection of [Workspace][google.area120.tables.v1alpha1.Workspace] resources, 73 * named `workspaces/*`. 74 * 75 * <p>This class provides the ability to make remote calls to the backing service through method 76 * calls that map to API methods. Sample code to get started: 77 * 78 * <pre>{@code 79 * // This snippet has been automatically generated and should be regarded as a code template only. 80 * // It will require modifications to work: 81 * // - It may require correct/in-range values for request initialization. 82 * // - It may require specifying regional endpoints when creating the service client as shown in 83 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 84 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 85 * TableName name = TableName.of("[TABLE]"); 86 * Table response = tablesServiceClient.getTable(name); 87 * } 88 * }</pre> 89 * 90 * <p>Note: close() needs to be called on the TablesServiceClient object to clean up resources such 91 * as threads. In the example above, try-with-resources is used, which automatically calls close(). 92 * 93 * <p>The surface of this class includes several types of Java methods for each of the API's 94 * methods: 95 * 96 * <ol> 97 * <li>A "flattened" method. With this type of method, the fields of the request type have been 98 * converted into function parameters. It may be the case that not all fields are available as 99 * parameters, and not every API method will have a flattened method entry point. 100 * <li>A "request object" method. This type of method only takes one parameter, a request object, 101 * which must be constructed before the call. Not every API method will have a request object 102 * method. 103 * <li>A "callable" method. This type of method takes no parameters and returns an immutable API 104 * callable object, which can be used to initiate calls to the service. 105 * </ol> 106 * 107 * <p>See the individual methods for example code. 108 * 109 * <p>Many parameters require resource names to be formatted in a particular way. To assist with 110 * these names, this class includes a format method for each type of name, and additionally a parse 111 * method to extract the individual identifiers contained within names that are returned. 112 * 113 * <p>This class can be customized by passing in a custom instance of TablesServiceSettings to 114 * create(). For example: 115 * 116 * <p>To customize credentials: 117 * 118 * <pre>{@code 119 * // This snippet has been automatically generated and should be regarded as a code template only. 120 * // It will require modifications to work: 121 * // - It may require correct/in-range values for request initialization. 122 * // - It may require specifying regional endpoints when creating the service client as shown in 123 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 124 * TablesServiceSettings tablesServiceSettings = 125 * TablesServiceSettings.newBuilder() 126 * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) 127 * .build(); 128 * TablesServiceClient tablesServiceClient = TablesServiceClient.create(tablesServiceSettings); 129 * }</pre> 130 * 131 * <p>To customize the endpoint: 132 * 133 * <pre>{@code 134 * // This snippet has been automatically generated and should be regarded as a code template only. 135 * // It will require modifications to work: 136 * // - It may require correct/in-range values for request initialization. 137 * // - It may require specifying regional endpoints when creating the service client as shown in 138 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 139 * TablesServiceSettings tablesServiceSettings = 140 * TablesServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); 141 * TablesServiceClient tablesServiceClient = TablesServiceClient.create(tablesServiceSettings); 142 * }</pre> 143 * 144 * <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over 145 * the wire: 146 * 147 * <pre>{@code 148 * // This snippet has been automatically generated and should be regarded as a code template only. 149 * // It will require modifications to work: 150 * // - It may require correct/in-range values for request initialization. 151 * // - It may require specifying regional endpoints when creating the service client as shown in 152 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 153 * TablesServiceSettings tablesServiceSettings = 154 * TablesServiceSettings.newHttpJsonBuilder().build(); 155 * TablesServiceClient tablesServiceClient = TablesServiceClient.create(tablesServiceSettings); 156 * }</pre> 157 * 158 * <p>Please refer to the GitHub repository's samples for more quickstart code snippets. 159 */ 160 @BetaApi 161 @Generated("by gapic-generator-java") 162 public class TablesServiceClient implements BackgroundResource { 163 private final TablesServiceSettings settings; 164 private final TablesServiceStub stub; 165 166 /** Constructs an instance of TablesServiceClient with default settings. */ create()167 public static final TablesServiceClient create() throws IOException { 168 return create(TablesServiceSettings.newBuilder().build()); 169 } 170 171 /** 172 * Constructs an instance of TablesServiceClient, using the given settings. The channels are 173 * created based on the settings passed in, or defaults for any settings that are not set. 174 */ create(TablesServiceSettings settings)175 public static final TablesServiceClient create(TablesServiceSettings settings) 176 throws IOException { 177 return new TablesServiceClient(settings); 178 } 179 180 /** 181 * Constructs an instance of TablesServiceClient, using the given stub for making calls. This is 182 * for advanced usage - prefer using create(TablesServiceSettings). 183 */ create(TablesServiceStub stub)184 public static final TablesServiceClient create(TablesServiceStub stub) { 185 return new TablesServiceClient(stub); 186 } 187 188 /** 189 * Constructs an instance of TablesServiceClient, using the given settings. This is protected so 190 * that it is easy to make a subclass, but otherwise, the static factory methods should be 191 * preferred. 192 */ TablesServiceClient(TablesServiceSettings settings)193 protected TablesServiceClient(TablesServiceSettings settings) throws IOException { 194 this.settings = settings; 195 this.stub = ((TablesServiceStubSettings) settings.getStubSettings()).createStub(); 196 } 197 TablesServiceClient(TablesServiceStub stub)198 protected TablesServiceClient(TablesServiceStub stub) { 199 this.settings = null; 200 this.stub = stub; 201 } 202 getSettings()203 public final TablesServiceSettings getSettings() { 204 return settings; 205 } 206 getStub()207 public TablesServiceStub getStub() { 208 return stub; 209 } 210 211 // AUTO-GENERATED DOCUMENTATION AND METHOD. 212 /** 213 * Gets a table. Returns NOT_FOUND if the table does not exist. 214 * 215 * <p>Sample code: 216 * 217 * <pre>{@code 218 * // This snippet has been automatically generated and should be regarded as a code template only. 219 * // It will require modifications to work: 220 * // - It may require correct/in-range values for request initialization. 221 * // - It may require specifying regional endpoints when creating the service client as shown in 222 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 223 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 224 * TableName name = TableName.of("[TABLE]"); 225 * Table response = tablesServiceClient.getTable(name); 226 * } 227 * }</pre> 228 * 229 * @param name Required. The name of the table to retrieve. Format: tables/{table} 230 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 231 */ getTable(TableName name)232 public final Table getTable(TableName name) { 233 GetTableRequest request = 234 GetTableRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 235 return getTable(request); 236 } 237 238 // AUTO-GENERATED DOCUMENTATION AND METHOD. 239 /** 240 * Gets a table. Returns NOT_FOUND if the table does not exist. 241 * 242 * <p>Sample code: 243 * 244 * <pre>{@code 245 * // This snippet has been automatically generated and should be regarded as a code template only. 246 * // It will require modifications to work: 247 * // - It may require correct/in-range values for request initialization. 248 * // - It may require specifying regional endpoints when creating the service client as shown in 249 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 250 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 251 * String name = TableName.of("[TABLE]").toString(); 252 * Table response = tablesServiceClient.getTable(name); 253 * } 254 * }</pre> 255 * 256 * @param name Required. The name of the table to retrieve. Format: tables/{table} 257 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 258 */ getTable(String name)259 public final Table getTable(String name) { 260 GetTableRequest request = GetTableRequest.newBuilder().setName(name).build(); 261 return getTable(request); 262 } 263 264 // AUTO-GENERATED DOCUMENTATION AND METHOD. 265 /** 266 * Gets a table. Returns NOT_FOUND if the table does not exist. 267 * 268 * <p>Sample code: 269 * 270 * <pre>{@code 271 * // This snippet has been automatically generated and should be regarded as a code template only. 272 * // It will require modifications to work: 273 * // - It may require correct/in-range values for request initialization. 274 * // - It may require specifying regional endpoints when creating the service client as shown in 275 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 276 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 277 * GetTableRequest request = 278 * GetTableRequest.newBuilder().setName(TableName.of("[TABLE]").toString()).build(); 279 * Table response = tablesServiceClient.getTable(request); 280 * } 281 * }</pre> 282 * 283 * @param request The request object containing all of the parameters for the API call. 284 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 285 */ getTable(GetTableRequest request)286 public final Table getTable(GetTableRequest request) { 287 return getTableCallable().call(request); 288 } 289 290 // AUTO-GENERATED DOCUMENTATION AND METHOD. 291 /** 292 * Gets a table. Returns NOT_FOUND if the table does not exist. 293 * 294 * <p>Sample code: 295 * 296 * <pre>{@code 297 * // This snippet has been automatically generated and should be regarded as a code template only. 298 * // It will require modifications to work: 299 * // - It may require correct/in-range values for request initialization. 300 * // - It may require specifying regional endpoints when creating the service client as shown in 301 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 302 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 303 * GetTableRequest request = 304 * GetTableRequest.newBuilder().setName(TableName.of("[TABLE]").toString()).build(); 305 * ApiFuture<Table> future = tablesServiceClient.getTableCallable().futureCall(request); 306 * // Do something. 307 * Table response = future.get(); 308 * } 309 * }</pre> 310 */ getTableCallable()311 public final UnaryCallable<GetTableRequest, Table> getTableCallable() { 312 return stub.getTableCallable(); 313 } 314 315 // AUTO-GENERATED DOCUMENTATION AND METHOD. 316 /** 317 * Lists tables for the user. 318 * 319 * <p>Sample code: 320 * 321 * <pre>{@code 322 * // This snippet has been automatically generated and should be regarded as a code template only. 323 * // It will require modifications to work: 324 * // - It may require correct/in-range values for request initialization. 325 * // - It may require specifying regional endpoints when creating the service client as shown in 326 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 327 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 328 * ListTablesRequest request = 329 * ListTablesRequest.newBuilder() 330 * .setPageSize(883849137) 331 * .setPageToken("pageToken873572522") 332 * .build(); 333 * for (Table element : tablesServiceClient.listTables(request).iterateAll()) { 334 * // doThingsWith(element); 335 * } 336 * } 337 * }</pre> 338 * 339 * @param request The request object containing all of the parameters for the API call. 340 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 341 */ listTables(ListTablesRequest request)342 public final ListTablesPagedResponse listTables(ListTablesRequest request) { 343 return listTablesPagedCallable().call(request); 344 } 345 346 // AUTO-GENERATED DOCUMENTATION AND METHOD. 347 /** 348 * Lists tables for the user. 349 * 350 * <p>Sample code: 351 * 352 * <pre>{@code 353 * // This snippet has been automatically generated and should be regarded as a code template only. 354 * // It will require modifications to work: 355 * // - It may require correct/in-range values for request initialization. 356 * // - It may require specifying regional endpoints when creating the service client as shown in 357 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 358 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 359 * ListTablesRequest request = 360 * ListTablesRequest.newBuilder() 361 * .setPageSize(883849137) 362 * .setPageToken("pageToken873572522") 363 * .build(); 364 * ApiFuture<Table> future = tablesServiceClient.listTablesPagedCallable().futureCall(request); 365 * // Do something. 366 * for (Table element : future.get().iterateAll()) { 367 * // doThingsWith(element); 368 * } 369 * } 370 * }</pre> 371 */ listTablesPagedCallable()372 public final UnaryCallable<ListTablesRequest, ListTablesPagedResponse> listTablesPagedCallable() { 373 return stub.listTablesPagedCallable(); 374 } 375 376 // AUTO-GENERATED DOCUMENTATION AND METHOD. 377 /** 378 * Lists tables for the user. 379 * 380 * <p>Sample code: 381 * 382 * <pre>{@code 383 * // This snippet has been automatically generated and should be regarded as a code template only. 384 * // It will require modifications to work: 385 * // - It may require correct/in-range values for request initialization. 386 * // - It may require specifying regional endpoints when creating the service client as shown in 387 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 388 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 389 * ListTablesRequest request = 390 * ListTablesRequest.newBuilder() 391 * .setPageSize(883849137) 392 * .setPageToken("pageToken873572522") 393 * .build(); 394 * while (true) { 395 * ListTablesResponse response = tablesServiceClient.listTablesCallable().call(request); 396 * for (Table element : response.getTablesList()) { 397 * // doThingsWith(element); 398 * } 399 * String nextPageToken = response.getNextPageToken(); 400 * if (!Strings.isNullOrEmpty(nextPageToken)) { 401 * request = request.toBuilder().setPageToken(nextPageToken).build(); 402 * } else { 403 * break; 404 * } 405 * } 406 * } 407 * }</pre> 408 */ listTablesCallable()409 public final UnaryCallable<ListTablesRequest, ListTablesResponse> listTablesCallable() { 410 return stub.listTablesCallable(); 411 } 412 413 // AUTO-GENERATED DOCUMENTATION AND METHOD. 414 /** 415 * Gets a workspace. Returns NOT_FOUND if the workspace does not exist. 416 * 417 * <p>Sample code: 418 * 419 * <pre>{@code 420 * // This snippet has been automatically generated and should be regarded as a code template only. 421 * // It will require modifications to work: 422 * // - It may require correct/in-range values for request initialization. 423 * // - It may require specifying regional endpoints when creating the service client as shown in 424 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 425 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 426 * WorkspaceName name = WorkspaceName.of("[WORKSPACE]"); 427 * Workspace response = tablesServiceClient.getWorkspace(name); 428 * } 429 * }</pre> 430 * 431 * @param name Required. The name of the workspace to retrieve. Format: workspaces/{workspace} 432 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 433 */ getWorkspace(WorkspaceName name)434 public final Workspace getWorkspace(WorkspaceName name) { 435 GetWorkspaceRequest request = 436 GetWorkspaceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 437 return getWorkspace(request); 438 } 439 440 // AUTO-GENERATED DOCUMENTATION AND METHOD. 441 /** 442 * Gets a workspace. Returns NOT_FOUND if the workspace does not exist. 443 * 444 * <p>Sample code: 445 * 446 * <pre>{@code 447 * // This snippet has been automatically generated and should be regarded as a code template only. 448 * // It will require modifications to work: 449 * // - It may require correct/in-range values for request initialization. 450 * // - It may require specifying regional endpoints when creating the service client as shown in 451 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 452 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 453 * String name = WorkspaceName.of("[WORKSPACE]").toString(); 454 * Workspace response = tablesServiceClient.getWorkspace(name); 455 * } 456 * }</pre> 457 * 458 * @param name Required. The name of the workspace to retrieve. Format: workspaces/{workspace} 459 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 460 */ getWorkspace(String name)461 public final Workspace getWorkspace(String name) { 462 GetWorkspaceRequest request = GetWorkspaceRequest.newBuilder().setName(name).build(); 463 return getWorkspace(request); 464 } 465 466 // AUTO-GENERATED DOCUMENTATION AND METHOD. 467 /** 468 * Gets a workspace. Returns NOT_FOUND if the workspace does not exist. 469 * 470 * <p>Sample code: 471 * 472 * <pre>{@code 473 * // This snippet has been automatically generated and should be regarded as a code template only. 474 * // It will require modifications to work: 475 * // - It may require correct/in-range values for request initialization. 476 * // - It may require specifying regional endpoints when creating the service client as shown in 477 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 478 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 479 * GetWorkspaceRequest request = 480 * GetWorkspaceRequest.newBuilder() 481 * .setName(WorkspaceName.of("[WORKSPACE]").toString()) 482 * .build(); 483 * Workspace response = tablesServiceClient.getWorkspace(request); 484 * } 485 * }</pre> 486 * 487 * @param request The request object containing all of the parameters for the API call. 488 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 489 */ getWorkspace(GetWorkspaceRequest request)490 public final Workspace getWorkspace(GetWorkspaceRequest request) { 491 return getWorkspaceCallable().call(request); 492 } 493 494 // AUTO-GENERATED DOCUMENTATION AND METHOD. 495 /** 496 * Gets a workspace. Returns NOT_FOUND if the workspace does not exist. 497 * 498 * <p>Sample code: 499 * 500 * <pre>{@code 501 * // This snippet has been automatically generated and should be regarded as a code template only. 502 * // It will require modifications to work: 503 * // - It may require correct/in-range values for request initialization. 504 * // - It may require specifying regional endpoints when creating the service client as shown in 505 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 506 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 507 * GetWorkspaceRequest request = 508 * GetWorkspaceRequest.newBuilder() 509 * .setName(WorkspaceName.of("[WORKSPACE]").toString()) 510 * .build(); 511 * ApiFuture<Workspace> future = tablesServiceClient.getWorkspaceCallable().futureCall(request); 512 * // Do something. 513 * Workspace response = future.get(); 514 * } 515 * }</pre> 516 */ getWorkspaceCallable()517 public final UnaryCallable<GetWorkspaceRequest, Workspace> getWorkspaceCallable() { 518 return stub.getWorkspaceCallable(); 519 } 520 521 // AUTO-GENERATED DOCUMENTATION AND METHOD. 522 /** 523 * Lists workspaces for the user. 524 * 525 * <p>Sample code: 526 * 527 * <pre>{@code 528 * // This snippet has been automatically generated and should be regarded as a code template only. 529 * // It will require modifications to work: 530 * // - It may require correct/in-range values for request initialization. 531 * // - It may require specifying regional endpoints when creating the service client as shown in 532 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 533 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 534 * ListWorkspacesRequest request = 535 * ListWorkspacesRequest.newBuilder() 536 * .setPageSize(883849137) 537 * .setPageToken("pageToken873572522") 538 * .build(); 539 * for (Workspace element : tablesServiceClient.listWorkspaces(request).iterateAll()) { 540 * // doThingsWith(element); 541 * } 542 * } 543 * }</pre> 544 * 545 * @param request The request object containing all of the parameters for the API call. 546 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 547 */ listWorkspaces(ListWorkspacesRequest request)548 public final ListWorkspacesPagedResponse listWorkspaces(ListWorkspacesRequest request) { 549 return listWorkspacesPagedCallable().call(request); 550 } 551 552 // AUTO-GENERATED DOCUMENTATION AND METHOD. 553 /** 554 * Lists workspaces for the user. 555 * 556 * <p>Sample code: 557 * 558 * <pre>{@code 559 * // This snippet has been automatically generated and should be regarded as a code template only. 560 * // It will require modifications to work: 561 * // - It may require correct/in-range values for request initialization. 562 * // - It may require specifying regional endpoints when creating the service client as shown in 563 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 564 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 565 * ListWorkspacesRequest request = 566 * ListWorkspacesRequest.newBuilder() 567 * .setPageSize(883849137) 568 * .setPageToken("pageToken873572522") 569 * .build(); 570 * ApiFuture<Workspace> future = 571 * tablesServiceClient.listWorkspacesPagedCallable().futureCall(request); 572 * // Do something. 573 * for (Workspace element : future.get().iterateAll()) { 574 * // doThingsWith(element); 575 * } 576 * } 577 * }</pre> 578 */ 579 public final UnaryCallable<ListWorkspacesRequest, ListWorkspacesPagedResponse> listWorkspacesPagedCallable()580 listWorkspacesPagedCallable() { 581 return stub.listWorkspacesPagedCallable(); 582 } 583 584 // AUTO-GENERATED DOCUMENTATION AND METHOD. 585 /** 586 * Lists workspaces for the user. 587 * 588 * <p>Sample code: 589 * 590 * <pre>{@code 591 * // This snippet has been automatically generated and should be regarded as a code template only. 592 * // It will require modifications to work: 593 * // - It may require correct/in-range values for request initialization. 594 * // - It may require specifying regional endpoints when creating the service client as shown in 595 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 596 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 597 * ListWorkspacesRequest request = 598 * ListWorkspacesRequest.newBuilder() 599 * .setPageSize(883849137) 600 * .setPageToken("pageToken873572522") 601 * .build(); 602 * while (true) { 603 * ListWorkspacesResponse response = 604 * tablesServiceClient.listWorkspacesCallable().call(request); 605 * for (Workspace element : response.getWorkspacesList()) { 606 * // doThingsWith(element); 607 * } 608 * String nextPageToken = response.getNextPageToken(); 609 * if (!Strings.isNullOrEmpty(nextPageToken)) { 610 * request = request.toBuilder().setPageToken(nextPageToken).build(); 611 * } else { 612 * break; 613 * } 614 * } 615 * } 616 * }</pre> 617 */ 618 public final UnaryCallable<ListWorkspacesRequest, ListWorkspacesResponse> listWorkspacesCallable()619 listWorkspacesCallable() { 620 return stub.listWorkspacesCallable(); 621 } 622 623 // AUTO-GENERATED DOCUMENTATION AND METHOD. 624 /** 625 * Gets a row. Returns NOT_FOUND if the row does not exist in the table. 626 * 627 * <p>Sample code: 628 * 629 * <pre>{@code 630 * // This snippet has been automatically generated and should be regarded as a code template only. 631 * // It will require modifications to work: 632 * // - It may require correct/in-range values for request initialization. 633 * // - It may require specifying regional endpoints when creating the service client as shown in 634 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 635 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 636 * RowName name = RowName.of("[TABLE]", "[ROW]"); 637 * Row response = tablesServiceClient.getRow(name); 638 * } 639 * }</pre> 640 * 641 * @param name Required. The name of the row to retrieve. Format: tables/{table}/rows/{row} 642 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 643 */ getRow(RowName name)644 public final Row getRow(RowName name) { 645 GetRowRequest request = 646 GetRowRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 647 return getRow(request); 648 } 649 650 // AUTO-GENERATED DOCUMENTATION AND METHOD. 651 /** 652 * Gets a row. Returns NOT_FOUND if the row does not exist in the table. 653 * 654 * <p>Sample code: 655 * 656 * <pre>{@code 657 * // This snippet has been automatically generated and should be regarded as a code template only. 658 * // It will require modifications to work: 659 * // - It may require correct/in-range values for request initialization. 660 * // - It may require specifying regional endpoints when creating the service client as shown in 661 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 662 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 663 * String name = RowName.of("[TABLE]", "[ROW]").toString(); 664 * Row response = tablesServiceClient.getRow(name); 665 * } 666 * }</pre> 667 * 668 * @param name Required. The name of the row to retrieve. Format: tables/{table}/rows/{row} 669 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 670 */ getRow(String name)671 public final Row getRow(String name) { 672 GetRowRequest request = GetRowRequest.newBuilder().setName(name).build(); 673 return getRow(request); 674 } 675 676 // AUTO-GENERATED DOCUMENTATION AND METHOD. 677 /** 678 * Gets a row. Returns NOT_FOUND if the row does not exist in the table. 679 * 680 * <p>Sample code: 681 * 682 * <pre>{@code 683 * // This snippet has been automatically generated and should be regarded as a code template only. 684 * // It will require modifications to work: 685 * // - It may require correct/in-range values for request initialization. 686 * // - It may require specifying regional endpoints when creating the service client as shown in 687 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 688 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 689 * GetRowRequest request = 690 * GetRowRequest.newBuilder() 691 * .setName(RowName.of("[TABLE]", "[ROW]").toString()) 692 * .setView(View.forNumber(0)) 693 * .build(); 694 * Row response = tablesServiceClient.getRow(request); 695 * } 696 * }</pre> 697 * 698 * @param request The request object containing all of the parameters for the API call. 699 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 700 */ getRow(GetRowRequest request)701 public final Row getRow(GetRowRequest request) { 702 return getRowCallable().call(request); 703 } 704 705 // AUTO-GENERATED DOCUMENTATION AND METHOD. 706 /** 707 * Gets a row. Returns NOT_FOUND if the row does not exist in the table. 708 * 709 * <p>Sample code: 710 * 711 * <pre>{@code 712 * // This snippet has been automatically generated and should be regarded as a code template only. 713 * // It will require modifications to work: 714 * // - It may require correct/in-range values for request initialization. 715 * // - It may require specifying regional endpoints when creating the service client as shown in 716 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 717 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 718 * GetRowRequest request = 719 * GetRowRequest.newBuilder() 720 * .setName(RowName.of("[TABLE]", "[ROW]").toString()) 721 * .setView(View.forNumber(0)) 722 * .build(); 723 * ApiFuture<Row> future = tablesServiceClient.getRowCallable().futureCall(request); 724 * // Do something. 725 * Row response = future.get(); 726 * } 727 * }</pre> 728 */ getRowCallable()729 public final UnaryCallable<GetRowRequest, Row> getRowCallable() { 730 return stub.getRowCallable(); 731 } 732 733 // AUTO-GENERATED DOCUMENTATION AND METHOD. 734 /** 735 * Lists rows in a table. Returns NOT_FOUND if the table does not exist. 736 * 737 * <p>Sample code: 738 * 739 * <pre>{@code 740 * // This snippet has been automatically generated and should be regarded as a code template only. 741 * // It will require modifications to work: 742 * // - It may require correct/in-range values for request initialization. 743 * // - It may require specifying regional endpoints when creating the service client as shown in 744 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 745 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 746 * String parent = "parent-995424086"; 747 * for (Row element : tablesServiceClient.listRows(parent).iterateAll()) { 748 * // doThingsWith(element); 749 * } 750 * } 751 * }</pre> 752 * 753 * @param parent Required. The parent table. Format: tables/{table} 754 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 755 */ listRows(String parent)756 public final ListRowsPagedResponse listRows(String parent) { 757 ListRowsRequest request = ListRowsRequest.newBuilder().setParent(parent).build(); 758 return listRows(request); 759 } 760 761 // AUTO-GENERATED DOCUMENTATION AND METHOD. 762 /** 763 * Lists rows in a table. Returns NOT_FOUND if the table does not exist. 764 * 765 * <p>Sample code: 766 * 767 * <pre>{@code 768 * // This snippet has been automatically generated and should be regarded as a code template only. 769 * // It will require modifications to work: 770 * // - It may require correct/in-range values for request initialization. 771 * // - It may require specifying regional endpoints when creating the service client as shown in 772 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 773 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 774 * ListRowsRequest request = 775 * ListRowsRequest.newBuilder() 776 * .setParent("parent-995424086") 777 * .setPageSize(883849137) 778 * .setPageToken("pageToken873572522") 779 * .setView(View.forNumber(0)) 780 * .setFilter("filter-1274492040") 781 * .build(); 782 * for (Row element : tablesServiceClient.listRows(request).iterateAll()) { 783 * // doThingsWith(element); 784 * } 785 * } 786 * }</pre> 787 * 788 * @param request The request object containing all of the parameters for the API call. 789 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 790 */ listRows(ListRowsRequest request)791 public final ListRowsPagedResponse listRows(ListRowsRequest request) { 792 return listRowsPagedCallable().call(request); 793 } 794 795 // AUTO-GENERATED DOCUMENTATION AND METHOD. 796 /** 797 * Lists rows in a table. Returns NOT_FOUND if the table does not exist. 798 * 799 * <p>Sample code: 800 * 801 * <pre>{@code 802 * // This snippet has been automatically generated and should be regarded as a code template only. 803 * // It will require modifications to work: 804 * // - It may require correct/in-range values for request initialization. 805 * // - It may require specifying regional endpoints when creating the service client as shown in 806 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 807 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 808 * ListRowsRequest request = 809 * ListRowsRequest.newBuilder() 810 * .setParent("parent-995424086") 811 * .setPageSize(883849137) 812 * .setPageToken("pageToken873572522") 813 * .setView(View.forNumber(0)) 814 * .setFilter("filter-1274492040") 815 * .build(); 816 * ApiFuture<Row> future = tablesServiceClient.listRowsPagedCallable().futureCall(request); 817 * // Do something. 818 * for (Row element : future.get().iterateAll()) { 819 * // doThingsWith(element); 820 * } 821 * } 822 * }</pre> 823 */ listRowsPagedCallable()824 public final UnaryCallable<ListRowsRequest, ListRowsPagedResponse> listRowsPagedCallable() { 825 return stub.listRowsPagedCallable(); 826 } 827 828 // AUTO-GENERATED DOCUMENTATION AND METHOD. 829 /** 830 * Lists rows in a table. Returns NOT_FOUND if the table does not exist. 831 * 832 * <p>Sample code: 833 * 834 * <pre>{@code 835 * // This snippet has been automatically generated and should be regarded as a code template only. 836 * // It will require modifications to work: 837 * // - It may require correct/in-range values for request initialization. 838 * // - It may require specifying regional endpoints when creating the service client as shown in 839 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 840 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 841 * ListRowsRequest request = 842 * ListRowsRequest.newBuilder() 843 * .setParent("parent-995424086") 844 * .setPageSize(883849137) 845 * .setPageToken("pageToken873572522") 846 * .setView(View.forNumber(0)) 847 * .setFilter("filter-1274492040") 848 * .build(); 849 * while (true) { 850 * ListRowsResponse response = tablesServiceClient.listRowsCallable().call(request); 851 * for (Row element : response.getRowsList()) { 852 * // doThingsWith(element); 853 * } 854 * String nextPageToken = response.getNextPageToken(); 855 * if (!Strings.isNullOrEmpty(nextPageToken)) { 856 * request = request.toBuilder().setPageToken(nextPageToken).build(); 857 * } else { 858 * break; 859 * } 860 * } 861 * } 862 * }</pre> 863 */ listRowsCallable()864 public final UnaryCallable<ListRowsRequest, ListRowsResponse> listRowsCallable() { 865 return stub.listRowsCallable(); 866 } 867 868 // AUTO-GENERATED DOCUMENTATION AND METHOD. 869 /** 870 * Creates a row. 871 * 872 * <p>Sample code: 873 * 874 * <pre>{@code 875 * // This snippet has been automatically generated and should be regarded as a code template only. 876 * // It will require modifications to work: 877 * // - It may require correct/in-range values for request initialization. 878 * // - It may require specifying regional endpoints when creating the service client as shown in 879 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 880 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 881 * String parent = "parent-995424086"; 882 * Row row = Row.newBuilder().build(); 883 * Row response = tablesServiceClient.createRow(parent, row); 884 * } 885 * }</pre> 886 * 887 * @param parent Required. The parent table where this row will be created. Format: tables/{table} 888 * @param row Required. The row to create. 889 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 890 */ createRow(String parent, Row row)891 public final Row createRow(String parent, Row row) { 892 CreateRowRequest request = CreateRowRequest.newBuilder().setParent(parent).setRow(row).build(); 893 return createRow(request); 894 } 895 896 // AUTO-GENERATED DOCUMENTATION AND METHOD. 897 /** 898 * Creates a row. 899 * 900 * <p>Sample code: 901 * 902 * <pre>{@code 903 * // This snippet has been automatically generated and should be regarded as a code template only. 904 * // It will require modifications to work: 905 * // - It may require correct/in-range values for request initialization. 906 * // - It may require specifying regional endpoints when creating the service client as shown in 907 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 908 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 909 * CreateRowRequest request = 910 * CreateRowRequest.newBuilder() 911 * .setParent("parent-995424086") 912 * .setRow(Row.newBuilder().build()) 913 * .setView(View.forNumber(0)) 914 * .build(); 915 * Row response = tablesServiceClient.createRow(request); 916 * } 917 * }</pre> 918 * 919 * @param request The request object containing all of the parameters for the API call. 920 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 921 */ createRow(CreateRowRequest request)922 public final Row createRow(CreateRowRequest request) { 923 return createRowCallable().call(request); 924 } 925 926 // AUTO-GENERATED DOCUMENTATION AND METHOD. 927 /** 928 * Creates a row. 929 * 930 * <p>Sample code: 931 * 932 * <pre>{@code 933 * // This snippet has been automatically generated and should be regarded as a code template only. 934 * // It will require modifications to work: 935 * // - It may require correct/in-range values for request initialization. 936 * // - It may require specifying regional endpoints when creating the service client as shown in 937 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 938 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 939 * CreateRowRequest request = 940 * CreateRowRequest.newBuilder() 941 * .setParent("parent-995424086") 942 * .setRow(Row.newBuilder().build()) 943 * .setView(View.forNumber(0)) 944 * .build(); 945 * ApiFuture<Row> future = tablesServiceClient.createRowCallable().futureCall(request); 946 * // Do something. 947 * Row response = future.get(); 948 * } 949 * }</pre> 950 */ createRowCallable()951 public final UnaryCallable<CreateRowRequest, Row> createRowCallable() { 952 return stub.createRowCallable(); 953 } 954 955 // AUTO-GENERATED DOCUMENTATION AND METHOD. 956 /** 957 * Creates multiple rows. 958 * 959 * <p>Sample code: 960 * 961 * <pre>{@code 962 * // This snippet has been automatically generated and should be regarded as a code template only. 963 * // It will require modifications to work: 964 * // - It may require correct/in-range values for request initialization. 965 * // - It may require specifying regional endpoints when creating the service client as shown in 966 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 967 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 968 * BatchCreateRowsRequest request = 969 * BatchCreateRowsRequest.newBuilder() 970 * .setParent("parent-995424086") 971 * .addAllRequests(new ArrayList<CreateRowRequest>()) 972 * .build(); 973 * BatchCreateRowsResponse response = tablesServiceClient.batchCreateRows(request); 974 * } 975 * }</pre> 976 * 977 * @param request The request object containing all of the parameters for the API call. 978 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 979 */ batchCreateRows(BatchCreateRowsRequest request)980 public final BatchCreateRowsResponse batchCreateRows(BatchCreateRowsRequest request) { 981 return batchCreateRowsCallable().call(request); 982 } 983 984 // AUTO-GENERATED DOCUMENTATION AND METHOD. 985 /** 986 * Creates multiple rows. 987 * 988 * <p>Sample code: 989 * 990 * <pre>{@code 991 * // This snippet has been automatically generated and should be regarded as a code template only. 992 * // It will require modifications to work: 993 * // - It may require correct/in-range values for request initialization. 994 * // - It may require specifying regional endpoints when creating the service client as shown in 995 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 996 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 997 * BatchCreateRowsRequest request = 998 * BatchCreateRowsRequest.newBuilder() 999 * .setParent("parent-995424086") 1000 * .addAllRequests(new ArrayList<CreateRowRequest>()) 1001 * .build(); 1002 * ApiFuture<BatchCreateRowsResponse> future = 1003 * tablesServiceClient.batchCreateRowsCallable().futureCall(request); 1004 * // Do something. 1005 * BatchCreateRowsResponse response = future.get(); 1006 * } 1007 * }</pre> 1008 */ 1009 public final UnaryCallable<BatchCreateRowsRequest, BatchCreateRowsResponse> batchCreateRowsCallable()1010 batchCreateRowsCallable() { 1011 return stub.batchCreateRowsCallable(); 1012 } 1013 1014 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1015 /** 1016 * Updates a row. 1017 * 1018 * <p>Sample code: 1019 * 1020 * <pre>{@code 1021 * // This snippet has been automatically generated and should be regarded as a code template only. 1022 * // It will require modifications to work: 1023 * // - It may require correct/in-range values for request initialization. 1024 * // - It may require specifying regional endpoints when creating the service client as shown in 1025 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1026 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 1027 * Row row = Row.newBuilder().build(); 1028 * FieldMask updateMask = FieldMask.newBuilder().build(); 1029 * Row response = tablesServiceClient.updateRow(row, updateMask); 1030 * } 1031 * }</pre> 1032 * 1033 * @param row Required. The row to update. 1034 * @param updateMask The list of fields to update. 1035 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1036 */ updateRow(Row row, FieldMask updateMask)1037 public final Row updateRow(Row row, FieldMask updateMask) { 1038 UpdateRowRequest request = 1039 UpdateRowRequest.newBuilder().setRow(row).setUpdateMask(updateMask).build(); 1040 return updateRow(request); 1041 } 1042 1043 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1044 /** 1045 * Updates a row. 1046 * 1047 * <p>Sample code: 1048 * 1049 * <pre>{@code 1050 * // This snippet has been automatically generated and should be regarded as a code template only. 1051 * // It will require modifications to work: 1052 * // - It may require correct/in-range values for request initialization. 1053 * // - It may require specifying regional endpoints when creating the service client as shown in 1054 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1055 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 1056 * UpdateRowRequest request = 1057 * UpdateRowRequest.newBuilder() 1058 * .setRow(Row.newBuilder().build()) 1059 * .setUpdateMask(FieldMask.newBuilder().build()) 1060 * .setView(View.forNumber(0)) 1061 * .build(); 1062 * Row response = tablesServiceClient.updateRow(request); 1063 * } 1064 * }</pre> 1065 * 1066 * @param request The request object containing all of the parameters for the API call. 1067 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1068 */ updateRow(UpdateRowRequest request)1069 public final Row updateRow(UpdateRowRequest request) { 1070 return updateRowCallable().call(request); 1071 } 1072 1073 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1074 /** 1075 * Updates a row. 1076 * 1077 * <p>Sample code: 1078 * 1079 * <pre>{@code 1080 * // This snippet has been automatically generated and should be regarded as a code template only. 1081 * // It will require modifications to work: 1082 * // - It may require correct/in-range values for request initialization. 1083 * // - It may require specifying regional endpoints when creating the service client as shown in 1084 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1085 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 1086 * UpdateRowRequest request = 1087 * UpdateRowRequest.newBuilder() 1088 * .setRow(Row.newBuilder().build()) 1089 * .setUpdateMask(FieldMask.newBuilder().build()) 1090 * .setView(View.forNumber(0)) 1091 * .build(); 1092 * ApiFuture<Row> future = tablesServiceClient.updateRowCallable().futureCall(request); 1093 * // Do something. 1094 * Row response = future.get(); 1095 * } 1096 * }</pre> 1097 */ updateRowCallable()1098 public final UnaryCallable<UpdateRowRequest, Row> updateRowCallable() { 1099 return stub.updateRowCallable(); 1100 } 1101 1102 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1103 /** 1104 * Updates multiple rows. 1105 * 1106 * <p>Sample code: 1107 * 1108 * <pre>{@code 1109 * // This snippet has been automatically generated and should be regarded as a code template only. 1110 * // It will require modifications to work: 1111 * // - It may require correct/in-range values for request initialization. 1112 * // - It may require specifying regional endpoints when creating the service client as shown in 1113 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1114 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 1115 * BatchUpdateRowsRequest request = 1116 * BatchUpdateRowsRequest.newBuilder() 1117 * .setParent("parent-995424086") 1118 * .addAllRequests(new ArrayList<UpdateRowRequest>()) 1119 * .build(); 1120 * BatchUpdateRowsResponse response = tablesServiceClient.batchUpdateRows(request); 1121 * } 1122 * }</pre> 1123 * 1124 * @param request The request object containing all of the parameters for the API call. 1125 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1126 */ batchUpdateRows(BatchUpdateRowsRequest request)1127 public final BatchUpdateRowsResponse batchUpdateRows(BatchUpdateRowsRequest request) { 1128 return batchUpdateRowsCallable().call(request); 1129 } 1130 1131 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1132 /** 1133 * Updates multiple rows. 1134 * 1135 * <p>Sample code: 1136 * 1137 * <pre>{@code 1138 * // This snippet has been automatically generated and should be regarded as a code template only. 1139 * // It will require modifications to work: 1140 * // - It may require correct/in-range values for request initialization. 1141 * // - It may require specifying regional endpoints when creating the service client as shown in 1142 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1143 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 1144 * BatchUpdateRowsRequest request = 1145 * BatchUpdateRowsRequest.newBuilder() 1146 * .setParent("parent-995424086") 1147 * .addAllRequests(new ArrayList<UpdateRowRequest>()) 1148 * .build(); 1149 * ApiFuture<BatchUpdateRowsResponse> future = 1150 * tablesServiceClient.batchUpdateRowsCallable().futureCall(request); 1151 * // Do something. 1152 * BatchUpdateRowsResponse response = future.get(); 1153 * } 1154 * }</pre> 1155 */ 1156 public final UnaryCallable<BatchUpdateRowsRequest, BatchUpdateRowsResponse> batchUpdateRowsCallable()1157 batchUpdateRowsCallable() { 1158 return stub.batchUpdateRowsCallable(); 1159 } 1160 1161 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1162 /** 1163 * Deletes a row. 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 (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 1174 * RowName name = RowName.of("[TABLE]", "[ROW]"); 1175 * tablesServiceClient.deleteRow(name); 1176 * } 1177 * }</pre> 1178 * 1179 * @param name Required. The name of the row to delete. Format: tables/{table}/rows/{row} 1180 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1181 */ deleteRow(RowName name)1182 public final void deleteRow(RowName name) { 1183 DeleteRowRequest request = 1184 DeleteRowRequest.newBuilder().setName(name == null ? null : name.toString()).build(); 1185 deleteRow(request); 1186 } 1187 1188 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1189 /** 1190 * Deletes a row. 1191 * 1192 * <p>Sample code: 1193 * 1194 * <pre>{@code 1195 * // This snippet has been automatically generated and should be regarded as a code template only. 1196 * // It will require modifications to work: 1197 * // - It may require correct/in-range values for request initialization. 1198 * // - It may require specifying regional endpoints when creating the service client as shown in 1199 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1200 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 1201 * String name = RowName.of("[TABLE]", "[ROW]").toString(); 1202 * tablesServiceClient.deleteRow(name); 1203 * } 1204 * }</pre> 1205 * 1206 * @param name Required. The name of the row to delete. Format: tables/{table}/rows/{row} 1207 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1208 */ deleteRow(String name)1209 public final void deleteRow(String name) { 1210 DeleteRowRequest request = DeleteRowRequest.newBuilder().setName(name).build(); 1211 deleteRow(request); 1212 } 1213 1214 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1215 /** 1216 * Deletes a row. 1217 * 1218 * <p>Sample code: 1219 * 1220 * <pre>{@code 1221 * // This snippet has been automatically generated and should be regarded as a code template only. 1222 * // It will require modifications to work: 1223 * // - It may require correct/in-range values for request initialization. 1224 * // - It may require specifying regional endpoints when creating the service client as shown in 1225 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1226 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 1227 * DeleteRowRequest request = 1228 * DeleteRowRequest.newBuilder().setName(RowName.of("[TABLE]", "[ROW]").toString()).build(); 1229 * tablesServiceClient.deleteRow(request); 1230 * } 1231 * }</pre> 1232 * 1233 * @param request The request object containing all of the parameters for the API call. 1234 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1235 */ deleteRow(DeleteRowRequest request)1236 public final void deleteRow(DeleteRowRequest request) { 1237 deleteRowCallable().call(request); 1238 } 1239 1240 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1241 /** 1242 * Deletes a row. 1243 * 1244 * <p>Sample code: 1245 * 1246 * <pre>{@code 1247 * // This snippet has been automatically generated and should be regarded as a code template only. 1248 * // It will require modifications to work: 1249 * // - It may require correct/in-range values for request initialization. 1250 * // - It may require specifying regional endpoints when creating the service client as shown in 1251 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1252 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 1253 * DeleteRowRequest request = 1254 * DeleteRowRequest.newBuilder().setName(RowName.of("[TABLE]", "[ROW]").toString()).build(); 1255 * ApiFuture<Empty> future = tablesServiceClient.deleteRowCallable().futureCall(request); 1256 * // Do something. 1257 * future.get(); 1258 * } 1259 * }</pre> 1260 */ deleteRowCallable()1261 public final UnaryCallable<DeleteRowRequest, Empty> deleteRowCallable() { 1262 return stub.deleteRowCallable(); 1263 } 1264 1265 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1266 /** 1267 * Deletes multiple rows. 1268 * 1269 * <p>Sample code: 1270 * 1271 * <pre>{@code 1272 * // This snippet has been automatically generated and should be regarded as a code template only. 1273 * // It will require modifications to work: 1274 * // - It may require correct/in-range values for request initialization. 1275 * // - It may require specifying regional endpoints when creating the service client as shown in 1276 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1277 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 1278 * BatchDeleteRowsRequest request = 1279 * BatchDeleteRowsRequest.newBuilder() 1280 * .setParent(TableName.of("[TABLE]").toString()) 1281 * .addAllNames(new ArrayList<String>()) 1282 * .build(); 1283 * tablesServiceClient.batchDeleteRows(request); 1284 * } 1285 * }</pre> 1286 * 1287 * @param request The request object containing all of the parameters for the API call. 1288 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1289 */ batchDeleteRows(BatchDeleteRowsRequest request)1290 public final void batchDeleteRows(BatchDeleteRowsRequest request) { 1291 batchDeleteRowsCallable().call(request); 1292 } 1293 1294 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1295 /** 1296 * Deletes multiple rows. 1297 * 1298 * <p>Sample code: 1299 * 1300 * <pre>{@code 1301 * // This snippet has been automatically generated and should be regarded as a code template only. 1302 * // It will require modifications to work: 1303 * // - It may require correct/in-range values for request initialization. 1304 * // - It may require specifying regional endpoints when creating the service client as shown in 1305 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1306 * try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) { 1307 * BatchDeleteRowsRequest request = 1308 * BatchDeleteRowsRequest.newBuilder() 1309 * .setParent(TableName.of("[TABLE]").toString()) 1310 * .addAllNames(new ArrayList<String>()) 1311 * .build(); 1312 * ApiFuture<Empty> future = tablesServiceClient.batchDeleteRowsCallable().futureCall(request); 1313 * // Do something. 1314 * future.get(); 1315 * } 1316 * }</pre> 1317 */ batchDeleteRowsCallable()1318 public final UnaryCallable<BatchDeleteRowsRequest, Empty> batchDeleteRowsCallable() { 1319 return stub.batchDeleteRowsCallable(); 1320 } 1321 1322 @Override close()1323 public final void close() { 1324 stub.close(); 1325 } 1326 1327 @Override shutdown()1328 public void shutdown() { 1329 stub.shutdown(); 1330 } 1331 1332 @Override isShutdown()1333 public boolean isShutdown() { 1334 return stub.isShutdown(); 1335 } 1336 1337 @Override isTerminated()1338 public boolean isTerminated() { 1339 return stub.isTerminated(); 1340 } 1341 1342 @Override shutdownNow()1343 public void shutdownNow() { 1344 stub.shutdownNow(); 1345 } 1346 1347 @Override awaitTermination(long duration, TimeUnit unit)1348 public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { 1349 return stub.awaitTermination(duration, unit); 1350 } 1351 1352 public static class ListTablesPagedResponse 1353 extends AbstractPagedListResponse< 1354 ListTablesRequest, 1355 ListTablesResponse, 1356 Table, 1357 ListTablesPage, 1358 ListTablesFixedSizeCollection> { 1359 createAsync( PageContext<ListTablesRequest, ListTablesResponse, Table> context, ApiFuture<ListTablesResponse> futureResponse)1360 public static ApiFuture<ListTablesPagedResponse> createAsync( 1361 PageContext<ListTablesRequest, ListTablesResponse, Table> context, 1362 ApiFuture<ListTablesResponse> futureResponse) { 1363 ApiFuture<ListTablesPage> futurePage = 1364 ListTablesPage.createEmptyPage().createPageAsync(context, futureResponse); 1365 return ApiFutures.transform( 1366 futurePage, input -> new ListTablesPagedResponse(input), MoreExecutors.directExecutor()); 1367 } 1368 ListTablesPagedResponse(ListTablesPage page)1369 private ListTablesPagedResponse(ListTablesPage page) { 1370 super(page, ListTablesFixedSizeCollection.createEmptyCollection()); 1371 } 1372 } 1373 1374 public static class ListTablesPage 1375 extends AbstractPage<ListTablesRequest, ListTablesResponse, Table, ListTablesPage> { 1376 ListTablesPage( PageContext<ListTablesRequest, ListTablesResponse, Table> context, ListTablesResponse response)1377 private ListTablesPage( 1378 PageContext<ListTablesRequest, ListTablesResponse, Table> context, 1379 ListTablesResponse response) { 1380 super(context, response); 1381 } 1382 createEmptyPage()1383 private static ListTablesPage createEmptyPage() { 1384 return new ListTablesPage(null, null); 1385 } 1386 1387 @Override createPage( PageContext<ListTablesRequest, ListTablesResponse, Table> context, ListTablesResponse response)1388 protected ListTablesPage createPage( 1389 PageContext<ListTablesRequest, ListTablesResponse, Table> context, 1390 ListTablesResponse response) { 1391 return new ListTablesPage(context, response); 1392 } 1393 1394 @Override createPageAsync( PageContext<ListTablesRequest, ListTablesResponse, Table> context, ApiFuture<ListTablesResponse> futureResponse)1395 public ApiFuture<ListTablesPage> createPageAsync( 1396 PageContext<ListTablesRequest, ListTablesResponse, Table> context, 1397 ApiFuture<ListTablesResponse> futureResponse) { 1398 return super.createPageAsync(context, futureResponse); 1399 } 1400 } 1401 1402 public static class ListTablesFixedSizeCollection 1403 extends AbstractFixedSizeCollection< 1404 ListTablesRequest, 1405 ListTablesResponse, 1406 Table, 1407 ListTablesPage, 1408 ListTablesFixedSizeCollection> { 1409 ListTablesFixedSizeCollection(List<ListTablesPage> pages, int collectionSize)1410 private ListTablesFixedSizeCollection(List<ListTablesPage> pages, int collectionSize) { 1411 super(pages, collectionSize); 1412 } 1413 createEmptyCollection()1414 private static ListTablesFixedSizeCollection createEmptyCollection() { 1415 return new ListTablesFixedSizeCollection(null, 0); 1416 } 1417 1418 @Override createCollection( List<ListTablesPage> pages, int collectionSize)1419 protected ListTablesFixedSizeCollection createCollection( 1420 List<ListTablesPage> pages, int collectionSize) { 1421 return new ListTablesFixedSizeCollection(pages, collectionSize); 1422 } 1423 } 1424 1425 public static class ListWorkspacesPagedResponse 1426 extends AbstractPagedListResponse< 1427 ListWorkspacesRequest, 1428 ListWorkspacesResponse, 1429 Workspace, 1430 ListWorkspacesPage, 1431 ListWorkspacesFixedSizeCollection> { 1432 createAsync( PageContext<ListWorkspacesRequest, ListWorkspacesResponse, Workspace> context, ApiFuture<ListWorkspacesResponse> futureResponse)1433 public static ApiFuture<ListWorkspacesPagedResponse> createAsync( 1434 PageContext<ListWorkspacesRequest, ListWorkspacesResponse, Workspace> context, 1435 ApiFuture<ListWorkspacesResponse> futureResponse) { 1436 ApiFuture<ListWorkspacesPage> futurePage = 1437 ListWorkspacesPage.createEmptyPage().createPageAsync(context, futureResponse); 1438 return ApiFutures.transform( 1439 futurePage, 1440 input -> new ListWorkspacesPagedResponse(input), 1441 MoreExecutors.directExecutor()); 1442 } 1443 ListWorkspacesPagedResponse(ListWorkspacesPage page)1444 private ListWorkspacesPagedResponse(ListWorkspacesPage page) { 1445 super(page, ListWorkspacesFixedSizeCollection.createEmptyCollection()); 1446 } 1447 } 1448 1449 public static class ListWorkspacesPage 1450 extends AbstractPage< 1451 ListWorkspacesRequest, ListWorkspacesResponse, Workspace, ListWorkspacesPage> { 1452 ListWorkspacesPage( PageContext<ListWorkspacesRequest, ListWorkspacesResponse, Workspace> context, ListWorkspacesResponse response)1453 private ListWorkspacesPage( 1454 PageContext<ListWorkspacesRequest, ListWorkspacesResponse, Workspace> context, 1455 ListWorkspacesResponse response) { 1456 super(context, response); 1457 } 1458 createEmptyPage()1459 private static ListWorkspacesPage createEmptyPage() { 1460 return new ListWorkspacesPage(null, null); 1461 } 1462 1463 @Override createPage( PageContext<ListWorkspacesRequest, ListWorkspacesResponse, Workspace> context, ListWorkspacesResponse response)1464 protected ListWorkspacesPage createPage( 1465 PageContext<ListWorkspacesRequest, ListWorkspacesResponse, Workspace> context, 1466 ListWorkspacesResponse response) { 1467 return new ListWorkspacesPage(context, response); 1468 } 1469 1470 @Override createPageAsync( PageContext<ListWorkspacesRequest, ListWorkspacesResponse, Workspace> context, ApiFuture<ListWorkspacesResponse> futureResponse)1471 public ApiFuture<ListWorkspacesPage> createPageAsync( 1472 PageContext<ListWorkspacesRequest, ListWorkspacesResponse, Workspace> context, 1473 ApiFuture<ListWorkspacesResponse> futureResponse) { 1474 return super.createPageAsync(context, futureResponse); 1475 } 1476 } 1477 1478 public static class ListWorkspacesFixedSizeCollection 1479 extends AbstractFixedSizeCollection< 1480 ListWorkspacesRequest, 1481 ListWorkspacesResponse, 1482 Workspace, 1483 ListWorkspacesPage, 1484 ListWorkspacesFixedSizeCollection> { 1485 ListWorkspacesFixedSizeCollection(List<ListWorkspacesPage> pages, int collectionSize)1486 private ListWorkspacesFixedSizeCollection(List<ListWorkspacesPage> pages, int collectionSize) { 1487 super(pages, collectionSize); 1488 } 1489 createEmptyCollection()1490 private static ListWorkspacesFixedSizeCollection createEmptyCollection() { 1491 return new ListWorkspacesFixedSizeCollection(null, 0); 1492 } 1493 1494 @Override createCollection( List<ListWorkspacesPage> pages, int collectionSize)1495 protected ListWorkspacesFixedSizeCollection createCollection( 1496 List<ListWorkspacesPage> pages, int collectionSize) { 1497 return new ListWorkspacesFixedSizeCollection(pages, collectionSize); 1498 } 1499 } 1500 1501 public static class ListRowsPagedResponse 1502 extends AbstractPagedListResponse< 1503 ListRowsRequest, ListRowsResponse, Row, ListRowsPage, ListRowsFixedSizeCollection> { 1504 createAsync( PageContext<ListRowsRequest, ListRowsResponse, Row> context, ApiFuture<ListRowsResponse> futureResponse)1505 public static ApiFuture<ListRowsPagedResponse> createAsync( 1506 PageContext<ListRowsRequest, ListRowsResponse, Row> context, 1507 ApiFuture<ListRowsResponse> futureResponse) { 1508 ApiFuture<ListRowsPage> futurePage = 1509 ListRowsPage.createEmptyPage().createPageAsync(context, futureResponse); 1510 return ApiFutures.transform( 1511 futurePage, input -> new ListRowsPagedResponse(input), MoreExecutors.directExecutor()); 1512 } 1513 ListRowsPagedResponse(ListRowsPage page)1514 private ListRowsPagedResponse(ListRowsPage page) { 1515 super(page, ListRowsFixedSizeCollection.createEmptyCollection()); 1516 } 1517 } 1518 1519 public static class ListRowsPage 1520 extends AbstractPage<ListRowsRequest, ListRowsResponse, Row, ListRowsPage> { 1521 ListRowsPage( PageContext<ListRowsRequest, ListRowsResponse, Row> context, ListRowsResponse response)1522 private ListRowsPage( 1523 PageContext<ListRowsRequest, ListRowsResponse, Row> context, ListRowsResponse response) { 1524 super(context, response); 1525 } 1526 createEmptyPage()1527 private static ListRowsPage createEmptyPage() { 1528 return new ListRowsPage(null, null); 1529 } 1530 1531 @Override createPage( PageContext<ListRowsRequest, ListRowsResponse, Row> context, ListRowsResponse response)1532 protected ListRowsPage createPage( 1533 PageContext<ListRowsRequest, ListRowsResponse, Row> context, ListRowsResponse response) { 1534 return new ListRowsPage(context, response); 1535 } 1536 1537 @Override createPageAsync( PageContext<ListRowsRequest, ListRowsResponse, Row> context, ApiFuture<ListRowsResponse> futureResponse)1538 public ApiFuture<ListRowsPage> createPageAsync( 1539 PageContext<ListRowsRequest, ListRowsResponse, Row> context, 1540 ApiFuture<ListRowsResponse> futureResponse) { 1541 return super.createPageAsync(context, futureResponse); 1542 } 1543 } 1544 1545 public static class ListRowsFixedSizeCollection 1546 extends AbstractFixedSizeCollection< 1547 ListRowsRequest, ListRowsResponse, Row, ListRowsPage, ListRowsFixedSizeCollection> { 1548 ListRowsFixedSizeCollection(List<ListRowsPage> pages, int collectionSize)1549 private ListRowsFixedSizeCollection(List<ListRowsPage> pages, int collectionSize) { 1550 super(pages, collectionSize); 1551 } 1552 createEmptyCollection()1553 private static ListRowsFixedSizeCollection createEmptyCollection() { 1554 return new ListRowsFixedSizeCollection(null, 0); 1555 } 1556 1557 @Override createCollection( List<ListRowsPage> pages, int collectionSize)1558 protected ListRowsFixedSizeCollection createCollection( 1559 List<ListRowsPage> pages, int collectionSize) { 1560 return new ListRowsFixedSizeCollection(pages, collectionSize); 1561 } 1562 } 1563 } 1564