- The API has a collection of [Table][google.area120.tables.v1alpha1.Table] resources, named - * `tables/*` - * - *
- Each Table has a collection of [Row][google.area120.tables.v1alpha1.Row] resources, named - * `tables/*/rows/*` - * - *
- The API has a collection of [Workspace][google.area120.tables.v1alpha1.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: - * - *
{@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);
- * }
- * }
- *
- * 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(). - * - *
| 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. - *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - *
|
- *
ListTables |
- * Lists tables for the user. |
- *
- * Request object method variants only take one parameter, a request object, which must be constructed before the call. - *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - *
|
- *
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. - *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - *
|
- *
ListWorkspaces |
- * Lists workspaces for the user. |
- *
- * Request object method variants only take one parameter, a request object, which must be constructed before the call. - *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - *
|
- *
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. - *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - *
|
- *
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. - *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - *
|
- *
CreateRow |
- * Creates a row. |
- *
- * Request object method variants only take one parameter, a request object, which must be constructed before the call. - *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - *
|
- *
BatchCreateRows |
- * Creates multiple rows. |
- *
- * Request object method variants only take one parameter, a request object, which must be constructed before the call. - *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - *
|
- *
UpdateRow |
- * Updates a row. |
- *
- * Request object method variants only take one parameter, a request object, which must be constructed before the call. - *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - *
|
- *
BatchUpdateRows |
- * Updates multiple rows. |
- *
- * Request object method variants only take one parameter, a request object, which must be constructed before the call. - *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - *
|
- *
DeleteRow |
- * Deletes a row. |
- *
- * Request object method variants only take one parameter, a request object, which must be constructed before the call. - *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - *
|
- *
BatchDeleteRows |
- * Deletes multiple rows. |
- *
- * Request object method variants only take one parameter, a request object, which must be constructed before the call. - *
Callable method variants take no parameters and return 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: - * - *
{@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
- * TablesServiceSettings tablesServiceSettings =
- * TablesServiceSettings.newBuilder()
- * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- * .build();
- * TablesServiceClient tablesServiceClient = TablesServiceClient.create(tablesServiceSettings);
- * }
- *
- * To customize the endpoint: - * - *
{@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
- * 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: - * - *
{@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
- * TablesServiceSettings tablesServiceSettings =
- * TablesServiceSettings.newHttpJsonBuilder().build();
- * TablesServiceClient tablesServiceClient = TablesServiceClient.create(tablesServiceSettings);
- * }
- *
- * Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@NullMarked -@BetaApi -@Generated("by gapic-generator-java") -public class TablesServiceClient implements BackgroundResource { - private final @Nullable TablesServiceSettings settings; - private final TablesServiceStub stub; - - /** Constructs an instance of TablesServiceClient with default settings. */ - public static final TablesServiceClient create() throws IOException { - return create(TablesServiceSettings.newBuilder().build()); - } - - /** - * 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. - */ - public static final TablesServiceClient create(TablesServiceSettings settings) - throws IOException { - return new TablesServiceClient(settings); - } - - /** - * Constructs an instance of TablesServiceClient, using the given stub for making calls. This is - * for advanced usage - prefer using create(TablesServiceSettings). - */ - public static final TablesServiceClient create(TablesServiceStub stub) { - return new TablesServiceClient(stub); - } - - /** - * 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. - */ - protected TablesServiceClient(TablesServiceSettings settings) throws IOException { - this.settings = settings; - this.stub = ((TablesServiceStubSettings) settings.getStubSettings()).createStub(); - } - - protected TablesServiceClient(TablesServiceStub stub) { - this.settings = null; - this.stub = stub; - } - - public final @Nullable TablesServiceSettings getSettings() { - return settings; - } - - public TablesServiceStub getStub() { - return stub; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets a table. Returns NOT_FOUND if the table does not exist. - * - *
Sample code: - * - *
{@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);
- * }
- * }
- *
- * @param name Required. The name of the table to retrieve. Format: tables/{table}
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Table getTable(@Nullable TableName name) {
- GetTableRequest request =
- GetTableRequest.newBuilder().setName(name == null ? null : name.toString()).build();
- return getTable(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD.
- /**
- * Gets a table. Returns NOT_FOUND if the table does not exist.
- *
- * Sample code: - * - *
{@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);
- * }
- * }
- *
- * @param name Required. The name of the table to retrieve. Format: tables/{table}
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Table getTable(String name) {
- GetTableRequest request = GetTableRequest.newBuilder().setName(name).build();
- return getTable(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD.
- /**
- * Gets a table. Returns NOT_FOUND if the table does not exist.
- *
- * Sample code: - * - *
{@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);
- * }
- * }
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Table getTable(GetTableRequest request) {
- return getTableCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD.
- /**
- * Gets a table. Returns NOT_FOUND if the table does not exist.
- *
- * Sample code: - * - *
{@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