Class TablesServiceClient (0.8.0)

public class TablesServiceClient implements BackgroundResource

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().

The surface of this class includes several types of Java methods for each of the API's methods:

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

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.newBuilder()
         .setTransportChannelProvider(
             TablesServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
         .build();
 TablesServiceClient tablesServiceClient = TablesServiceClient.create(tablesServiceSettings);
 

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

Inheritance

java.lang.Object > TablesServiceClient

Implements

BackgroundResource

Static Methods

create()

public static final TablesServiceClient create()

Constructs an instance of TablesServiceClient with default settings.

Returns
TypeDescription
TablesServiceClient
Exceptions
TypeDescription
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
NameDescription
settingsTablesServiceSettings
Returns
TypeDescription
TablesServiceClient
Exceptions
TypeDescription
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
NameDescription
stubTablesServiceStub
Returns
TypeDescription
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
NameDescription
settingsTablesServiceSettings

TablesServiceClient(TablesServiceStub stub)

protected TablesServiceClient(TablesServiceStub stub)
Parameter
NameDescription
stubTablesServiceStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
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
NameDescription
requestBatchCreateRowsRequest

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

Returns
TypeDescription
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
TypeDescription
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
NameDescription
requestBatchDeleteRowsRequest

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
TypeDescription
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
NameDescription
requestBatchUpdateRowsRequest

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

Returns
TypeDescription
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
TypeDescription
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
NameDescription
requestCreateRowRequest

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

Returns
TypeDescription
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
NameDescription
parentString

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

rowRow

Required. The row to create.

Returns
TypeDescription
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
TypeDescription
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
NameDescription
requestDeleteRowRequest

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
NameDescription
nameRowName

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
NameDescription
nameString

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
TypeDescription
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
NameDescription
requestGetRowRequest

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

Returns
TypeDescription
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
NameDescription
nameRowName

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

Returns
TypeDescription
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
NameDescription
nameString

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

Returns
TypeDescription
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
TypeDescription
UnaryCallable<GetRowRequest,Row>

getSettings()

public final TablesServiceSettings getSettings()
Returns
TypeDescription
TablesServiceSettings

getStub()

public TablesServiceStub getStub()
Returns
TypeDescription
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
NameDescription
requestGetTableRequest

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

Returns
TypeDescription
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
NameDescription
nameTableName

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

Returns
TypeDescription
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
NameDescription
nameString

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

Returns
TypeDescription
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
TypeDescription
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
NameDescription
requestGetWorkspaceRequest

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

Returns
TypeDescription
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
NameDescription
nameWorkspaceName

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

Returns
TypeDescription
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
NameDescription
nameString

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

Returns
TypeDescription
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
TypeDescription
UnaryCallable<GetWorkspaceRequest,Workspace>

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
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
NameDescription
requestListRowsRequest

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

Returns
TypeDescription
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
NameDescription
parentString

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

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
requestListTablesRequest

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

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
requestListWorkspacesRequest

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

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
rowRow

Required. The row to update.

updateMaskFieldMask

The list of fields to update.

Returns
TypeDescription
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
NameDescription
requestUpdateRowRequest

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

Returns
TypeDescription
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
TypeDescription
UnaryCallable<UpdateRowRequest,Row>