Class TablesServiceClient (0.49.0)

GitHub RepositoryProduct Reference

Service Description: The Tables Service provides an API for reading and updating tables. It defines the following resource model:

- The API has a collection of Table resources, named tables/*

- Each Table has a collection of Row resources, named tables/*/rows/*

- The API has a collection of Workspace resources, named workspaces/*.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   TableName name = TableName.of("[TABLE]");
   Table response = tablesServiceClient.getTable(name);
 }
 

Note: close() needs to be called on the TablesServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

Methods
Method Description Method Variants

GetTable

Gets a table. Returns NOT_FOUND if the table does not exist.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getTable(GetTableRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getTable(TableName name)

  • getTable(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getTableCallable()

ListTables

Lists tables for the user.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listTables(ListTablesRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listTablesPagedCallable()

  • listTablesCallable()

GetWorkspace

Gets a workspace. Returns NOT_FOUND if the workspace does not exist.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getWorkspace(GetWorkspaceRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getWorkspace(WorkspaceName name)

  • getWorkspace(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getWorkspaceCallable()

ListWorkspaces

Lists workspaces for the user.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listWorkspaces(ListWorkspacesRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listWorkspacesPagedCallable()

  • listWorkspacesCallable()

GetRow

Gets a row. Returns NOT_FOUND if the row does not exist in the table.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getRow(GetRowRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getRow(RowName name)

  • getRow(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getRowCallable()

ListRows

Lists rows in a table. Returns NOT_FOUND if the table does not exist.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listRows(ListRowsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listRows(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listRowsPagedCallable()

  • listRowsCallable()

CreateRow

Creates a row.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createRow(CreateRowRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createRow(String parent, Row row)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createRowCallable()

BatchCreateRows

Creates multiple rows.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • batchCreateRows(BatchCreateRowsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • batchCreateRowsCallable()

UpdateRow

Updates a row.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateRow(UpdateRowRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateRow(Row row, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateRowCallable()

BatchUpdateRows

Updates multiple rows.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • batchUpdateRows(BatchUpdateRowsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • batchUpdateRowsCallable()

DeleteRow

Deletes a row.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteRow(DeleteRowRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteRow(RowName name)

  • deleteRow(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteRowCallable()

BatchDeleteRows

Deletes multiple rows.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • batchDeleteRows(BatchDeleteRowsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • batchDeleteRowsCallable()

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of TablesServiceSettings to create(). For example:

To customize credentials:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 TablesServiceSettings tablesServiceSettings =
     TablesServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 TablesServiceClient tablesServiceClient = TablesServiceClient.create(tablesServiceSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 TablesServiceSettings tablesServiceSettings =
     TablesServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 TablesServiceClient tablesServiceClient = TablesServiceClient.create(tablesServiceSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 TablesServiceSettings tablesServiceSettings =
     TablesServiceSettings.newHttpJsonBuilder().build();
 TablesServiceClient tablesServiceClient = TablesServiceClient.create(tablesServiceSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > TablesServiceClient

Static Methods

create()

public static final TablesServiceClient create()

Constructs an instance of TablesServiceClient with default settings.

Returns
Type Description
TablesServiceClient
Exceptions
Type Description
IOException

create(TablesServiceSettings settings)

public static final TablesServiceClient create(TablesServiceSettings settings)

Constructs an instance of TablesServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
Name Description
settings TablesServiceSettings
Returns
Type Description
TablesServiceClient
Exceptions
Type Description
IOException

create(TablesServiceStub stub)

public static final TablesServiceClient create(TablesServiceStub stub)

Constructs an instance of TablesServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(TablesServiceSettings).

Parameter
Name Description
stub TablesServiceStub
Returns
Type Description
TablesServiceClient

Constructors

TablesServiceClient(TablesServiceSettings settings)

protected TablesServiceClient(TablesServiceSettings settings)

Constructs an instance of TablesServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.

Parameter
Name Description
settings TablesServiceSettings

TablesServiceClient(TablesServiceStub stub)

protected TablesServiceClient(TablesServiceStub stub)
Parameter
Name Description
stub TablesServiceStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

batchCreateRows(BatchCreateRowsRequest request)

public final BatchCreateRowsResponse batchCreateRows(BatchCreateRowsRequest request)

Creates multiple rows.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   BatchCreateRowsRequest request =
       BatchCreateRowsRequest.newBuilder()
           .setParent("parent-995424086")
           .addAllRequests(new ArrayList<CreateRowRequest>())
           .build();
   BatchCreateRowsResponse response = tablesServiceClient.batchCreateRows(request);
 }
 
Parameter
Name Description
request BatchCreateRowsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
BatchCreateRowsResponse

batchCreateRowsCallable()

public final UnaryCallable<BatchCreateRowsRequest,BatchCreateRowsResponse> batchCreateRowsCallable()

Creates multiple rows.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   BatchCreateRowsRequest request =
       BatchCreateRowsRequest.newBuilder()
           .setParent("parent-995424086")
           .addAllRequests(new ArrayList<CreateRowRequest>())
           .build();
   ApiFuture<BatchCreateRowsResponse> future =
       tablesServiceClient.batchCreateRowsCallable().futureCall(request);
   // Do something.
   BatchCreateRowsResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<BatchCreateRowsRequest,BatchCreateRowsResponse>

batchDeleteRows(BatchDeleteRowsRequest request)

public final void batchDeleteRows(BatchDeleteRowsRequest request)

Deletes multiple rows.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   BatchDeleteRowsRequest request =
       BatchDeleteRowsRequest.newBuilder()
           .setParent(TableName.of("[TABLE]").toString())
           .addAllNames(new ArrayList<String>())
           .build();
   tablesServiceClient.batchDeleteRows(request);
 }
 
Parameter
Name Description
request BatchDeleteRowsRequest

The request object containing all of the parameters for the API call.

batchDeleteRowsCallable()

public final UnaryCallable<BatchDeleteRowsRequest,Empty> batchDeleteRowsCallable()

Deletes multiple rows.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   BatchDeleteRowsRequest request =
       BatchDeleteRowsRequest.newBuilder()
           .setParent(TableName.of("[TABLE]").toString())
           .addAllNames(new ArrayList<String>())
           .build();
   ApiFuture<Empty> future = tablesServiceClient.batchDeleteRowsCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<BatchDeleteRowsRequest,Empty>

batchUpdateRows(BatchUpdateRowsRequest request)

public final BatchUpdateRowsResponse batchUpdateRows(BatchUpdateRowsRequest request)

Updates multiple rows.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   BatchUpdateRowsRequest request =
       BatchUpdateRowsRequest.newBuilder()
           .setParent("parent-995424086")
           .addAllRequests(new ArrayList<UpdateRowRequest>())
           .build();
   BatchUpdateRowsResponse response = tablesServiceClient.batchUpdateRows(request);
 }
 
Parameter
Name Description
request BatchUpdateRowsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
BatchUpdateRowsResponse

batchUpdateRowsCallable()

public final UnaryCallable<BatchUpdateRowsRequest,BatchUpdateRowsResponse> batchUpdateRowsCallable()

Updates multiple rows.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   BatchUpdateRowsRequest request =
       BatchUpdateRowsRequest.newBuilder()
           .setParent("parent-995424086")
           .addAllRequests(new ArrayList<UpdateRowRequest>())
           .build();
   ApiFuture<BatchUpdateRowsResponse> future =
       tablesServiceClient.batchUpdateRowsCallable().futureCall(request);
   // Do something.
   BatchUpdateRowsResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<BatchUpdateRowsRequest,BatchUpdateRowsResponse>

close()

public final void close()

createRow(CreateRowRequest request)

public final Row createRow(CreateRowRequest request)

Creates a row.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   CreateRowRequest request =
       CreateRowRequest.newBuilder()
           .setParent("parent-995424086")
           .setRow(Row.newBuilder().build())
           .setView(View.forNumber(0))
           .build();
   Row response = tablesServiceClient.createRow(request);
 }
 
Parameter
Name Description
request CreateRowRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Row

createRow(String parent, Row row)

public final Row createRow(String parent, Row row)

Creates a row.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   String parent = "parent-995424086";
   Row row = Row.newBuilder().build();
   Row response = tablesServiceClient.createRow(parent, row);
 }
 
Parameters
Name Description
parent String

Required. The parent table where this row will be created. Format: tables/{table}

row Row

Required. The row to create.

Returns
Type Description
Row

createRowCallable()

public final UnaryCallable<CreateRowRequest,Row> createRowCallable()

Creates a row.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   CreateRowRequest request =
       CreateRowRequest.newBuilder()
           .setParent("parent-995424086")
           .setRow(Row.newBuilder().build())
           .setView(View.forNumber(0))
           .build();
   ApiFuture<Row> future = tablesServiceClient.createRowCallable().futureCall(request);
   // Do something.
   Row response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateRowRequest,Row>

deleteRow(DeleteRowRequest request)

public final void deleteRow(DeleteRowRequest request)

Deletes a row.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   DeleteRowRequest request =
       DeleteRowRequest.newBuilder().setName(RowName.of("[TABLE]", "[ROW]").toString()).build();
   tablesServiceClient.deleteRow(request);
 }
 
Parameter
Name Description
request DeleteRowRequest

The request object containing all of the parameters for the API call.

deleteRow(RowName name)

public final void deleteRow(RowName name)

Deletes a row.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   RowName name = RowName.of("[TABLE]", "[ROW]");
   tablesServiceClient.deleteRow(name);
 }
 
Parameter
Name Description
name RowName

Required. The name of the row to delete. Format: tables/{table}/rows/{row}

deleteRow(String name)

public final void deleteRow(String name)

Deletes a row.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   String name = RowName.of("[TABLE]", "[ROW]").toString();
   tablesServiceClient.deleteRow(name);
 }
 
Parameter
Name Description
name String

Required. The name of the row to delete. Format: tables/{table}/rows/{row}

deleteRowCallable()

public final UnaryCallable<DeleteRowRequest,Empty> deleteRowCallable()

Deletes a row.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   DeleteRowRequest request =
       DeleteRowRequest.newBuilder().setName(RowName.of("[TABLE]", "[ROW]").toString()).build();
   ApiFuture<Empty> future = tablesServiceClient.deleteRowCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteRowRequest,Empty>

getRow(GetRowRequest request)

public final Row getRow(GetRowRequest request)

Gets a row. Returns NOT_FOUND if the row does not exist in the table.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   GetRowRequest request =
       GetRowRequest.newBuilder()
           .setName(RowName.of("[TABLE]", "[ROW]").toString())
           .setView(View.forNumber(0))
           .build();
   Row response = tablesServiceClient.getRow(request);
 }
 
Parameter
Name Description
request GetRowRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Row

getRow(RowName name)

public final Row getRow(RowName name)

Gets a row. Returns NOT_FOUND if the row does not exist in the table.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   RowName name = RowName.of("[TABLE]", "[ROW]");
   Row response = tablesServiceClient.getRow(name);
 }
 
Parameter
Name Description
name RowName

Required. The name of the row to retrieve. Format: tables/{table}/rows/{row}

Returns
Type Description
Row

getRow(String name)

public final Row getRow(String name)

Gets a row. Returns NOT_FOUND if the row does not exist in the table.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   String name = RowName.of("[TABLE]", "[ROW]").toString();
   Row response = tablesServiceClient.getRow(name);
 }
 
Parameter
Name Description
name String

Required. The name of the row to retrieve. Format: tables/{table}/rows/{row}

Returns
Type Description
Row

getRowCallable()

public final UnaryCallable<GetRowRequest,Row> getRowCallable()

Gets a row. Returns NOT_FOUND if the row does not exist in the table.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   GetRowRequest request =
       GetRowRequest.newBuilder()
           .setName(RowName.of("[TABLE]", "[ROW]").toString())
           .setView(View.forNumber(0))
           .build();
   ApiFuture<Row> future = tablesServiceClient.getRowCallable().futureCall(request);
   // Do something.
   Row response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetRowRequest,Row>

getSettings()

public final TablesServiceSettings getSettings()
Returns
Type Description
TablesServiceSettings

getStub()

public TablesServiceStub getStub()
Returns
Type Description
TablesServiceStub

getTable(GetTableRequest request)

public final Table getTable(GetTableRequest request)

Gets a table. Returns NOT_FOUND if the table does not exist.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   GetTableRequest request =
       GetTableRequest.newBuilder().setName(TableName.of("[TABLE]").toString()).build();
   Table response = tablesServiceClient.getTable(request);
 }
 
Parameter
Name Description
request GetTableRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Table

getTable(TableName name)

public final Table getTable(TableName name)

Gets a table. Returns NOT_FOUND if the table does not exist.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   TableName name = TableName.of("[TABLE]");
   Table response = tablesServiceClient.getTable(name);
 }
 
Parameter
Name Description
name TableName

Required. The name of the table to retrieve. Format: tables/{table}

Returns
Type Description
Table

getTable(String name)

public final Table getTable(String name)

Gets a table. Returns NOT_FOUND if the table does not exist.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   String name = TableName.of("[TABLE]").toString();
   Table response = tablesServiceClient.getTable(name);
 }
 
Parameter
Name Description
name String

Required. The name of the table to retrieve. Format: tables/{table}

Returns
Type Description
Table

getTableCallable()

public final UnaryCallable<GetTableRequest,Table> getTableCallable()

Gets a table. Returns NOT_FOUND if the table does not exist.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   GetTableRequest request =
       GetTableRequest.newBuilder().setName(TableName.of("[TABLE]").toString()).build();
   ApiFuture<Table> future = tablesServiceClient.getTableCallable().futureCall(request);
   // Do something.
   Table response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetTableRequest,Table>

getWorkspace(GetWorkspaceRequest request)

public final Workspace getWorkspace(GetWorkspaceRequest request)

Gets a workspace. Returns NOT_FOUND if the workspace does not exist.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   GetWorkspaceRequest request =
       GetWorkspaceRequest.newBuilder()
           .setName(WorkspaceName.of("[WORKSPACE]").toString())
           .build();
   Workspace response = tablesServiceClient.getWorkspace(request);
 }
 
Parameter
Name Description
request GetWorkspaceRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Workspace

getWorkspace(WorkspaceName name)

public final Workspace getWorkspace(WorkspaceName name)

Gets a workspace. Returns NOT_FOUND if the workspace does not exist.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   WorkspaceName name = WorkspaceName.of("[WORKSPACE]");
   Workspace response = tablesServiceClient.getWorkspace(name);
 }
 
Parameter
Name Description
name WorkspaceName

Required. The name of the workspace to retrieve. Format: workspaces/{workspace}

Returns
Type Description
Workspace

getWorkspace(String name)

public final Workspace getWorkspace(String name)

Gets a workspace. Returns NOT_FOUND if the workspace does not exist.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   String name = WorkspaceName.of("[WORKSPACE]").toString();
   Workspace response = tablesServiceClient.getWorkspace(name);
 }
 
Parameter
Name Description
name String

Required. The name of the workspace to retrieve. Format: workspaces/{workspace}

Returns
Type Description
Workspace

getWorkspaceCallable()

public final UnaryCallable<GetWorkspaceRequest,Workspace> getWorkspaceCallable()

Gets a workspace. Returns NOT_FOUND if the workspace does not exist.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   GetWorkspaceRequest request =
       GetWorkspaceRequest.newBuilder()
           .setName(WorkspaceName.of("[WORKSPACE]").toString())
           .build();
   ApiFuture<Workspace> future = tablesServiceClient.getWorkspaceCallable().futureCall(request);
   // Do something.
   Workspace response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetWorkspaceRequest,Workspace>

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listRows(ListRowsRequest request)

public final TablesServiceClient.ListRowsPagedResponse listRows(ListRowsRequest request)

Lists rows in a table. Returns NOT_FOUND if the table does not exist.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   ListRowsRequest request =
       ListRowsRequest.newBuilder()
           .setParent("parent-995424086")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setView(View.forNumber(0))
           .setFilter("filter-1274492040")
           .build();
   for (Row element : tablesServiceClient.listRows(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListRowsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
TablesServiceClient.ListRowsPagedResponse

listRows(String parent)

public final TablesServiceClient.ListRowsPagedResponse listRows(String parent)

Lists rows in a table. Returns NOT_FOUND if the table does not exist.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   String parent = "parent-995424086";
   for (Row element : tablesServiceClient.listRows(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The parent table. Format: tables/{table}

Returns
Type Description
TablesServiceClient.ListRowsPagedResponse

listRowsCallable()

public final UnaryCallable<ListRowsRequest,ListRowsResponse> listRowsCallable()

Lists rows in a table. Returns NOT_FOUND if the table does not exist.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   ListRowsRequest request =
       ListRowsRequest.newBuilder()
           .setParent("parent-995424086")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setView(View.forNumber(0))
           .setFilter("filter-1274492040")
           .build();
   while (true) {
     ListRowsResponse response = tablesServiceClient.listRowsCallable().call(request);
     for (Row element : response.getRowsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListRowsRequest,ListRowsResponse>

listRowsPagedCallable()

public final UnaryCallable<ListRowsRequest,TablesServiceClient.ListRowsPagedResponse> listRowsPagedCallable()

Lists rows in a table. Returns NOT_FOUND if the table does not exist.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   ListRowsRequest request =
       ListRowsRequest.newBuilder()
           .setParent("parent-995424086")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setView(View.forNumber(0))
           .setFilter("filter-1274492040")
           .build();
   ApiFuture<Row> future = tablesServiceClient.listRowsPagedCallable().futureCall(request);
   // Do something.
   for (Row element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListRowsRequest,ListRowsPagedResponse>

listTables(ListTablesRequest request)

public final TablesServiceClient.ListTablesPagedResponse listTables(ListTablesRequest request)

Lists tables for the user.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   ListTablesRequest request =
       ListTablesRequest.newBuilder()
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Table element : tablesServiceClient.listTables(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListTablesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
TablesServiceClient.ListTablesPagedResponse

listTablesCallable()

public final UnaryCallable<ListTablesRequest,ListTablesResponse> listTablesCallable()

Lists tables for the user.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   ListTablesRequest request =
       ListTablesRequest.newBuilder()
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListTablesResponse response = tablesServiceClient.listTablesCallable().call(request);
     for (Table element : response.getTablesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListTablesRequest,ListTablesResponse>

listTablesPagedCallable()

public final UnaryCallable<ListTablesRequest,TablesServiceClient.ListTablesPagedResponse> listTablesPagedCallable()

Lists tables for the user.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   ListTablesRequest request =
       ListTablesRequest.newBuilder()
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Table> future = tablesServiceClient.listTablesPagedCallable().futureCall(request);
   // Do something.
   for (Table element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListTablesRequest,ListTablesPagedResponse>

listWorkspaces(ListWorkspacesRequest request)

public final TablesServiceClient.ListWorkspacesPagedResponse listWorkspaces(ListWorkspacesRequest request)

Lists workspaces for the user.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   ListWorkspacesRequest request =
       ListWorkspacesRequest.newBuilder()
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Workspace element : tablesServiceClient.listWorkspaces(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListWorkspacesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
TablesServiceClient.ListWorkspacesPagedResponse

listWorkspacesCallable()

public final UnaryCallable<ListWorkspacesRequest,ListWorkspacesResponse> listWorkspacesCallable()

Lists workspaces for the user.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   ListWorkspacesRequest request =
       ListWorkspacesRequest.newBuilder()
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListWorkspacesResponse response =
         tablesServiceClient.listWorkspacesCallable().call(request);
     for (Workspace element : response.getWorkspacesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListWorkspacesRequest,ListWorkspacesResponse>

listWorkspacesPagedCallable()

public final UnaryCallable<ListWorkspacesRequest,TablesServiceClient.ListWorkspacesPagedResponse> listWorkspacesPagedCallable()

Lists workspaces for the user.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   ListWorkspacesRequest request =
       ListWorkspacesRequest.newBuilder()
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Workspace> future =
       tablesServiceClient.listWorkspacesPagedCallable().futureCall(request);
   // Do something.
   for (Workspace element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListWorkspacesRequest,ListWorkspacesPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateRow(Row row, FieldMask updateMask)

public final Row updateRow(Row row, FieldMask updateMask)

Updates a row.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   Row row = Row.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Row response = tablesServiceClient.updateRow(row, updateMask);
 }
 
Parameters
Name Description
row Row

Required. The row to update.

updateMask FieldMask

The list of fields to update.

Returns
Type Description
Row

updateRow(UpdateRowRequest request)

public final Row updateRow(UpdateRowRequest request)

Updates a row.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   UpdateRowRequest request =
       UpdateRowRequest.newBuilder()
           .setRow(Row.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .setView(View.forNumber(0))
           .build();
   Row response = tablesServiceClient.updateRow(request);
 }
 
Parameter
Name Description
request UpdateRowRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Row

updateRowCallable()

public final UnaryCallable<UpdateRowRequest,Row> updateRowCallable()

Updates a row.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TablesServiceClient tablesServiceClient = TablesServiceClient.create()) {
   UpdateRowRequest request =
       UpdateRowRequest.newBuilder()
           .setRow(Row.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .setView(View.forNumber(0))
           .build();
   ApiFuture<Row> future = tablesServiceClient.updateRowCallable().futureCall(request);
   // Do something.
   Row response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateRowRequest,Row>