| GitHub Repository | Product Reference |
Service Description: Service for creating and managing data objects.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
CollectionName parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]");
DataObject dataObject = DataObject.newBuilder().build();
String dataObjectId = "dataObjectId1417732740";
DataObject response =
dataObjectServiceClient.createDataObject(parent, dataObject, dataObjectId);
}
Note: close() needs to be called on the DataObjectServiceClient 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 |
|---|---|---|
CreateDataObject |
Creates a dataObject. |
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.
|
BatchCreateDataObjects |
Creates a batch of dataObjects. |
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.
|
GetDataObject |
Gets a data object. |
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.
|
UpdateDataObject |
Updates a dataObject. |
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.
|
BatchUpdateDataObjects |
Updates dataObjects in a batch. |
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.
|
DeleteDataObject |
Deletes a dataObject. |
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.
|
BatchDeleteDataObjects |
Deletes dataObjects in a batch. |
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.
|
ListLocations |
Lists information about the supported locations for this service. |
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.
|
GetLocation |
Gets information about a location. |
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 DataObjectServiceSettings 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
DataObjectServiceSettings dataObjectServiceSettings =
DataObjectServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
DataObjectServiceClient dataObjectServiceClient =
DataObjectServiceClient.create(dataObjectServiceSettings);
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
DataObjectServiceSettings dataObjectServiceSettings =
DataObjectServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
DataObjectServiceClient dataObjectServiceClient =
DataObjectServiceClient.create(dataObjectServiceSettings);
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
DataObjectServiceSettings dataObjectServiceSettings =
DataObjectServiceSettings.newHttpJsonBuilder().build();
DataObjectServiceClient dataObjectServiceClient =
DataObjectServiceClient.create(dataObjectServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final DataObjectServiceClient create()Constructs an instance of DataObjectServiceClient with default settings.
| Returns | |
|---|---|
| Type | Description |
DataObjectServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(DataObjectServiceSettings settings)
public static final DataObjectServiceClient create(DataObjectServiceSettings settings)Constructs an instance of DataObjectServiceClient, 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 |
DataObjectServiceSettings |
| Returns | |
|---|---|
| Type | Description |
DataObjectServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(DataObjectServiceStub stub)
public static final DataObjectServiceClient create(DataObjectServiceStub stub)Constructs an instance of DataObjectServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(DataObjectServiceSettings).
| Parameter | |
|---|---|
| Name | Description |
stub |
DataObjectServiceStub |
| Returns | |
|---|---|
| Type | Description |
DataObjectServiceClient |
|
Constructors
DataObjectServiceClient(DataObjectServiceSettings settings)
protected DataObjectServiceClient(DataObjectServiceSettings settings)Constructs an instance of DataObjectServiceClient, 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 |
DataObjectServiceSettings |
DataObjectServiceClient(DataObjectServiceStub stub)
protected DataObjectServiceClient(DataObjectServiceStub stub)| Parameter | |
|---|---|
| Name | Description |
stub |
DataObjectServiceStub |
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 |
|
batchCreateDataObjects(BatchCreateDataObjectsRequest request)
public final BatchCreateDataObjectsResponse batchCreateDataObjects(BatchCreateDataObjectsRequest request)Creates a batch of dataObjects.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
BatchCreateDataObjectsRequest request =
BatchCreateDataObjectsRequest.newBuilder()
.setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
.addAllRequests(new ArrayList<CreateDataObjectRequest>())
.build();
BatchCreateDataObjectsResponse response =
dataObjectServiceClient.batchCreateDataObjects(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
BatchCreateDataObjectsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
BatchCreateDataObjectsResponse |
|
batchCreateDataObjectsCallable()
public final UnaryCallable<BatchCreateDataObjectsRequest,BatchCreateDataObjectsResponse> batchCreateDataObjectsCallable()Creates a batch of dataObjects.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
BatchCreateDataObjectsRequest request =
BatchCreateDataObjectsRequest.newBuilder()
.setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
.addAllRequests(new ArrayList<CreateDataObjectRequest>())
.build();
ApiFuture<BatchCreateDataObjectsResponse> future =
dataObjectServiceClient.batchCreateDataObjectsCallable().futureCall(request);
// Do something.
BatchCreateDataObjectsResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<BatchCreateDataObjectsRequest,BatchCreateDataObjectsResponse> |
|
batchDeleteDataObjects(BatchDeleteDataObjectsRequest request)
public final void batchDeleteDataObjects(BatchDeleteDataObjectsRequest request)Deletes dataObjects in a batch.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
BatchDeleteDataObjectsRequest request =
BatchDeleteDataObjectsRequest.newBuilder()
.setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
.addAllRequests(new ArrayList<DeleteDataObjectRequest>())
.build();
dataObjectServiceClient.batchDeleteDataObjects(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
BatchDeleteDataObjectsRequestThe request object containing all of the parameters for the API call. |
batchDeleteDataObjects(CollectionName parent, List<DeleteDataObjectRequest> requests)
public final void batchDeleteDataObjects(CollectionName parent, List<DeleteDataObjectRequest> requests)Deletes dataObjects in a batch.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
CollectionName parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]");
List<DeleteDataObjectRequest> requests = new ArrayList<>();
dataObjectServiceClient.batchDeleteDataObjects(parent, requests);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
CollectionNameRequired. The resource name of the Collection to delete the DataObjects in.
Format: |
requests |
List<DeleteDataObjectRequest>Required. The request message specifying the resources to delete. A maximum of 1000 DataObjects can be deleted in a batch. |
batchDeleteDataObjects(String parent, List<DeleteDataObjectRequest> requests)
public final void batchDeleteDataObjects(String parent, List<DeleteDataObjectRequest> requests)Deletes dataObjects in a batch.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
String parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString();
List<DeleteDataObjectRequest> requests = new ArrayList<>();
dataObjectServiceClient.batchDeleteDataObjects(parent, requests);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. The resource name of the Collection to delete the DataObjects in.
Format: |
requests |
List<DeleteDataObjectRequest>Required. The request message specifying the resources to delete. A maximum of 1000 DataObjects can be deleted in a batch. |
batchDeleteDataObjectsCallable()
public final UnaryCallable<BatchDeleteDataObjectsRequest,Empty> batchDeleteDataObjectsCallable()Deletes dataObjects in a batch.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
BatchDeleteDataObjectsRequest request =
BatchDeleteDataObjectsRequest.newBuilder()
.setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
.addAllRequests(new ArrayList<DeleteDataObjectRequest>())
.build();
ApiFuture<Empty> future =
dataObjectServiceClient.batchDeleteDataObjectsCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<BatchDeleteDataObjectsRequest,Empty> |
|
batchUpdateDataObjects(BatchUpdateDataObjectsRequest request)
public final BatchUpdateDataObjectsResponse batchUpdateDataObjects(BatchUpdateDataObjectsRequest request)Updates dataObjects in a batch.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
BatchUpdateDataObjectsRequest request =
BatchUpdateDataObjectsRequest.newBuilder()
.setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
.addAllRequests(new ArrayList<UpdateDataObjectRequest>())
.build();
BatchUpdateDataObjectsResponse response =
dataObjectServiceClient.batchUpdateDataObjects(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
BatchUpdateDataObjectsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
BatchUpdateDataObjectsResponse |
|
batchUpdateDataObjects(CollectionName parent, List<UpdateDataObjectRequest> requests)
public final BatchUpdateDataObjectsResponse batchUpdateDataObjects(CollectionName parent, List<UpdateDataObjectRequest> requests)Updates dataObjects in a batch.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
CollectionName parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]");
List<UpdateDataObjectRequest> requests = new ArrayList<>();
BatchUpdateDataObjectsResponse response =
dataObjectServiceClient.batchUpdateDataObjects(parent, requests);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
CollectionNameRequired. The resource name of the Collection to update the DataObjects in.
Format: |
requests |
List<UpdateDataObjectRequest>Required. The request message specifying the resources to update. A maximum of 1000 DataObjects can be updated in a batch. |
| Returns | |
|---|---|
| Type | Description |
BatchUpdateDataObjectsResponse |
|
batchUpdateDataObjects(String parent, List<UpdateDataObjectRequest> requests)
public final BatchUpdateDataObjectsResponse batchUpdateDataObjects(String parent, List<UpdateDataObjectRequest> requests)Updates dataObjects in a batch.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
String parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString();
List<UpdateDataObjectRequest> requests = new ArrayList<>();
BatchUpdateDataObjectsResponse response =
dataObjectServiceClient.batchUpdateDataObjects(parent, requests);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. The resource name of the Collection to update the DataObjects in.
Format: |
requests |
List<UpdateDataObjectRequest>Required. The request message specifying the resources to update. A maximum of 1000 DataObjects can be updated in a batch. |
| Returns | |
|---|---|
| Type | Description |
BatchUpdateDataObjectsResponse |
|
batchUpdateDataObjectsCallable()
public final UnaryCallable<BatchUpdateDataObjectsRequest,BatchUpdateDataObjectsResponse> batchUpdateDataObjectsCallable()Updates dataObjects in a batch.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
BatchUpdateDataObjectsRequest request =
BatchUpdateDataObjectsRequest.newBuilder()
.setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
.addAllRequests(new ArrayList<UpdateDataObjectRequest>())
.build();
ApiFuture<BatchUpdateDataObjectsResponse> future =
dataObjectServiceClient.batchUpdateDataObjectsCallable().futureCall(request);
// Do something.
BatchUpdateDataObjectsResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<BatchUpdateDataObjectsRequest,BatchUpdateDataObjectsResponse> |
|
close()
public final void close()createDataObject(CollectionName parent, DataObject dataObject, String dataObjectId)
public final DataObject createDataObject(CollectionName parent, DataObject dataObject, String dataObjectId)Creates a dataObject.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
CollectionName parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]");
DataObject dataObject = DataObject.newBuilder().build();
String dataObjectId = "dataObjectId1417732740";
DataObject response =
dataObjectServiceClient.createDataObject(parent, dataObject, dataObjectId);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
CollectionNameRequired. The resource name of the Collection to create the DataObject in.
Format: |
dataObject |
DataObjectRequired. The DataObject to create. |
dataObjectId |
StringRequired. The id of the dataObject to create. The id must be 1-63
characters long, and comply with <a href="https://www.ietf.org/rfc/rfc1035.txt"
target="_blank">RFC1035</a>. Specifically, it must be 1-63 characters long and
match the regular expression |
| Returns | |
|---|---|
| Type | Description |
DataObject |
|
createDataObject(CreateDataObjectRequest request)
public final DataObject createDataObject(CreateDataObjectRequest request)Creates a dataObject.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
CreateDataObjectRequest request =
CreateDataObjectRequest.newBuilder()
.setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
.setDataObjectId("dataObjectId1417732740")
.setDataObject(DataObject.newBuilder().build())
.build();
DataObject response = dataObjectServiceClient.createDataObject(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
CreateDataObjectRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
DataObject |
|
createDataObject(String parent, DataObject dataObject, String dataObjectId)
public final DataObject createDataObject(String parent, DataObject dataObject, String dataObjectId)Creates a dataObject.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
String parent = CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString();
DataObject dataObject = DataObject.newBuilder().build();
String dataObjectId = "dataObjectId1417732740";
DataObject response =
dataObjectServiceClient.createDataObject(parent, dataObject, dataObjectId);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. The resource name of the Collection to create the DataObject in.
Format: |
dataObject |
DataObjectRequired. The DataObject to create. |
dataObjectId |
StringRequired. The id of the dataObject to create. The id must be 1-63
characters long, and comply with <a href="https://www.ietf.org/rfc/rfc1035.txt"
target="_blank">RFC1035</a>. Specifically, it must be 1-63 characters long and
match the regular expression |
| Returns | |
|---|---|
| Type | Description |
DataObject |
|
createDataObjectCallable()
public final UnaryCallable<CreateDataObjectRequest,DataObject> createDataObjectCallable()Creates a dataObject.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
CreateDataObjectRequest request =
CreateDataObjectRequest.newBuilder()
.setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
.setDataObjectId("dataObjectId1417732740")
.setDataObject(DataObject.newBuilder().build())
.build();
ApiFuture<DataObject> future =
dataObjectServiceClient.createDataObjectCallable().futureCall(request);
// Do something.
DataObject response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CreateDataObjectRequest,DataObject> |
|
deleteDataObject(DataObjectName name)
public final void deleteDataObject(DataObjectName name)Deletes a dataObject.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
DataObjectName name =
DataObjectName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATAOBJECT]");
dataObjectServiceClient.deleteDataObject(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
DataObjectNameRequired. The name of the DataObject resource to be deleted. Format:
|
deleteDataObject(DeleteDataObjectRequest request)
public final void deleteDataObject(DeleteDataObjectRequest request)Deletes a dataObject.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
DeleteDataObjectRequest request =
DeleteDataObjectRequest.newBuilder()
.setName(
DataObjectName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATAOBJECT]")
.toString())
.build();
dataObjectServiceClient.deleteDataObject(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
DeleteDataObjectRequestThe request object containing all of the parameters for the API call. |
deleteDataObject(String name)
public final void deleteDataObject(String name)Deletes a dataObject.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
String name =
DataObjectName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATAOBJECT]").toString();
dataObjectServiceClient.deleteDataObject(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the DataObject resource to be deleted. Format:
|
deleteDataObjectCallable()
public final UnaryCallable<DeleteDataObjectRequest,Empty> deleteDataObjectCallable()Deletes a dataObject.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
DeleteDataObjectRequest request =
DeleteDataObjectRequest.newBuilder()
.setName(
DataObjectName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATAOBJECT]")
.toString())
.build();
ApiFuture<Empty> future =
dataObjectServiceClient.deleteDataObjectCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<DeleteDataObjectRequest,Empty> |
|
getDataObject(DataObjectName name)
public final DataObject getDataObject(DataObjectName name)Gets a data object.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
DataObjectName name =
DataObjectName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATAOBJECT]");
DataObject response = dataObjectServiceClient.getDataObject(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
DataObjectNameRequired. The name of the DataObject resource. Format:
|
| Returns | |
|---|---|
| Type | Description |
DataObject |
|
getDataObject(GetDataObjectRequest request)
public final DataObject getDataObject(GetDataObjectRequest request)Gets a data object.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
GetDataObjectRequest request =
GetDataObjectRequest.newBuilder()
.setName(
DataObjectName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATAOBJECT]")
.toString())
.build();
DataObject response = dataObjectServiceClient.getDataObject(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetDataObjectRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
DataObject |
|
getDataObject(String name)
public final DataObject getDataObject(String name)Gets a data object.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
String name =
DataObjectName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATAOBJECT]").toString();
DataObject response = dataObjectServiceClient.getDataObject(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the DataObject resource. Format:
|
| Returns | |
|---|---|
| Type | Description |
DataObject |
|
getDataObjectCallable()
public final UnaryCallable<GetDataObjectRequest,DataObject> getDataObjectCallable()Gets a data object.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
GetDataObjectRequest request =
GetDataObjectRequest.newBuilder()
.setName(
DataObjectName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATAOBJECT]")
.toString())
.build();
ApiFuture<DataObject> future =
dataObjectServiceClient.getDataObjectCallable().futureCall(request);
// Do something.
DataObject response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetDataObjectRequest,DataObject> |
|
getLocation(GetLocationRequest request)
public final Location getLocation(GetLocationRequest request)Gets information about a location.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = dataObjectServiceClient.getLocation(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.cloud.location.GetLocationRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
com.google.cloud.location.Location |
|
getLocationCallable()
public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()Gets information about a location.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future =
dataObjectServiceClient.getLocationCallable().futureCall(request);
// Do something.
Location response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
|
getSettings()
public final DataObjectServiceSettings getSettings()| Returns | |
|---|---|
| Type | Description |
DataObjectServiceSettings |
|
getStub()
public DataObjectServiceStub getStub()| Returns | |
|---|---|
| Type | Description |
DataObjectServiceStub |
|
isShutdown()
public boolean isShutdown()| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTerminated()
public boolean isTerminated()| Returns | |
|---|---|
| Type | Description |
boolean |
|
listLocations(ListLocationsRequest request)
public final DataObjectServiceClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)Lists information about the supported locations for this service.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Location element : dataObjectServiceClient.listLocations(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.cloud.location.ListLocationsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
DataObjectServiceClient.ListLocationsPagedResponse |
|
listLocationsCallable()
public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()Lists information about the supported locations for this service.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListLocationsResponse response =
dataObjectServiceClient.listLocationsCallable().call(request);
for (Location element : response.getLocationsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
|
listLocationsPagedCallable()
public final UnaryCallable<ListLocationsRequest,DataObjectServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location> future =
dataObjectServiceClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for (Location element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse> |
|
shutdown()
public void shutdown()shutdownNow()
public void shutdownNow()updateDataObject(DataObject dataObject, FieldMask updateMask)
public final DataObject updateDataObject(DataObject dataObject, FieldMask updateMask)Updates a dataObject.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
DataObject dataObject = DataObject.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
DataObject response = dataObjectServiceClient.updateDataObject(dataObject, updateMask);
}
| Parameters | |
|---|---|
| Name | Description |
dataObject |
DataObjectRequired. The DataObject which replaces the resource on the server. |
updateMask |
FieldMaskOptional. The update mask applies to the resource. See google.protobuf.FieldMask. |
| Returns | |
|---|---|
| Type | Description |
DataObject |
|
updateDataObject(UpdateDataObjectRequest request)
public final DataObject updateDataObject(UpdateDataObjectRequest request)Updates a dataObject.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
UpdateDataObjectRequest request =
UpdateDataObjectRequest.newBuilder()
.setDataObject(DataObject.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
DataObject response = dataObjectServiceClient.updateDataObject(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdateDataObjectRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
DataObject |
|
updateDataObjectCallable()
public final UnaryCallable<UpdateDataObjectRequest,DataObject> updateDataObjectCallable()Updates a dataObject.
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 (DataObjectServiceClient dataObjectServiceClient = DataObjectServiceClient.create()) {
UpdateDataObjectRequest request =
UpdateDataObjectRequest.newBuilder()
.setDataObject(DataObject.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<DataObject> future =
dataObjectServiceClient.updateDataObjectCallable().futureCall(request);
// Do something.
DataObject response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdateDataObjectRequest,DataObject> |
|