Class WarehouseClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
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 (WarehouseClient warehouseClient = WarehouseClient.create()) {
CorpusName parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]");
Asset asset = Asset.newBuilder().build();
String assetId = "assetId-704776149";
Asset response = warehouseClient.createAsset(parent, asset, assetId);
}
Note: close() needs to be called on the WarehouseClient 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 |
|---|---|---|
CreateAsset |
Creates an asset inside corpus. |
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.
|
UpdateAsset |
Updates an asset inside corpus. |
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.
|
GetAsset |
Reads an asset inside corpus. |
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.
|
ListAssets |
Lists an list of assets inside corpus. |
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.
|
DeleteAsset |
Deletes asset inside corpus. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UploadAsset |
Upload asset by specifing the asset Cloud Storage uri. For video warehouse, it requires users who call this API have read access to the cloud storage file. Once it is uploaded, it can be retrieved by GenerateRetrievalUrl API which by default, only can retrieve cloud storage files from the same project of the warehouse. To allow retrieval cloud storage files that are in a separate project, it requires to find the vision ai service account (Go to IAM, check checkbox to show "Include Google-provided role grants", search for "Cloud Vision AI Service Agent") and grant the read access of the cloud storage files to that service account. |
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.
|
GenerateRetrievalUrl |
Generates a signed url for downloading the asset. For video warehouse, please see comment of UploadAsset about how to allow retrieval of cloud storage files in a different project. |
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.
|
AnalyzeAsset |
Analyze asset to power search capability. |
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.
|
IndexAsset |
Index one asset for search. Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND |
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.
|
RemoveIndexAsset |
Remove one asset's index data for search. Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND |
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.
|
ViewIndexedAssets |
Lists assets inside an index. |
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.
|
CreateIndex |
Creates an Index under the corpus. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateIndex |
Updates an Index under the corpus. Users can perform a metadata-only update or trigger a full index rebuild with different update_mask values. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetIndex |
Gets the details of a single Index under a Corpus. |
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.
|
ListIndexes |
List all Indexes in a given Corpus. |
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.
|
DeleteIndex |
Delete a single Index. In order to delete an index, the caller must make sure that it is not deployed to any index endpoint. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateCorpus |
Creates a corpus inside a project. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetCorpus |
Gets corpus details inside a project. |
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.
|
UpdateCorpus |
Updates a corpus in a project. |
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.
|
ListCorpora |
Lists all corpora in a project. |
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.
|
DeleteCorpus |
Deletes a corpus only if its empty. Returns empty response. |
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.
|
AnalyzeCorpus |
Analyzes a corpus. |
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.
|
CreateDataSchema |
Creates data schema inside corpus. |
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.
|
UpdateDataSchema |
Updates data schema inside corpus. |
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.
|
GetDataSchema |
Gets data schema inside corpus. |
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.
|
DeleteDataSchema |
Deletes data schema inside corpus. |
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.
|
ListDataSchemas |
Lists a list of data schemas inside corpus. |
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.
|
CreateAnnotation |
Creates annotation inside asset. |
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.
|
GetAnnotation |
Reads annotation inside asset. |
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.
|
ListAnnotations |
Lists a list of annotations inside asset. |
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.
|
UpdateAnnotation |
Updates annotation inside asset. |
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.
|
DeleteAnnotation |
Deletes annotation inside asset. |
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.
|
IngestAsset |
Ingests data for the asset. It is not allowed to ingest a data chunk which is already expired according to TTL. This method is only available via the gRPC API (not HTTP since bi-directional streaming is not supported via HTTP). |
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ClipAsset |
Supported by STREAM_VIDEO corpus type. Generates clips for downloading. The api takes in a time range, and generates a clip of the first content available after start_time and before end_time, which may overflow beyond these bounds. Returned clips are truncated if the total size of the clips are larger than 100MB. |
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.
|
GenerateHlsUri |
Generates a uri for an HLS manifest. The api takes in a collection of time ranges, and generates a URI for an HLS manifest that covers all the requested time ranges. |
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.
|
ImportAssets |
Imports assets (images plus annotations) from a meta file on cloud storage. Each row in the meta file is corresponding to an image (specified by a cloud storage uri) and its annotations. |
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.
|
CreateSearchConfig |
Creates a search configuration inside a corpus. Please follow the rules below to create a valid CreateSearchConfigRequest. --- General Rules --- 1. Request.search_config_id must not be associated with an existing SearchConfig. 2. Request must contain at least one non-empty search_criteria_property or facet_property. 3. mapped_fields must not be empty, and must map to existing UGA keys. 4. All mapped_fields must be of the same type. 5. All mapped_fields must share the same granularity. 6. All mapped_fields must share the same semantic SearchConfig match options. For property-specific rules, please reference the comments for FacetProperty and SearchCriteriaProperty. |
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.
|
UpdateSearchConfig |
Updates a search configuration inside a corpus. Please follow the rules below to create a valid UpdateSearchConfigRequest. --- General Rules --- 1. Request.search_configuration.name must already exist. 2. Request must contain at least one non-empty search_criteria_property or facet_property. 3. mapped_fields must not be empty, and must map to existing UGA keys. 4. All mapped_fields must be of the same type. 5. All mapped_fields must share the same granularity. 6. All mapped_fields must share the same semantic SearchConfig match options. For property-specific rules, please reference the comments for FacetProperty and SearchCriteriaProperty. |
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.
|
GetSearchConfig |
Gets a search configuration inside a corpus. |
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.
|
DeleteSearchConfig |
Deletes a search configuration inside a corpus. For a DeleteSearchConfigRequest to be valid, Request.search_configuration.name must already 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.
|
ListSearchConfigs |
Lists all search configurations inside a corpus. |
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.
|
CreateSearchHypernym |
Creates a SearchHypernym inside a corpus. |
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.
|
UpdateSearchHypernym |
Updates a SearchHypernym inside a corpus. |
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.
|
GetSearchHypernym |
Gets a SearchHypernym inside a corpus. |
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.
|
DeleteSearchHypernym |
Deletes a SearchHypernym inside a corpus. |
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.
|
ListSearchHypernyms |
Lists SearchHypernyms inside a corpus. |
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.
|
SearchAssets |
Search media asset. |
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.
|
SearchIndexEndpoint |
Search a deployed index endpoint (IMAGE corpus type only). |
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.
|
CreateIndexEndpoint |
Creates an IndexEndpoint. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetIndexEndpoint |
Gets an IndexEndpoint. |
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.
|
ListIndexEndpoints |
Lists all IndexEndpoints in a project. |
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.
|
UpdateIndexEndpoint |
Updates an IndexEndpoint. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteIndexEndpoint |
Deletes an IndexEndpoint. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeployIndex |
Deploys an Index to IndexEndpoint. |
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.
|
UndeployIndex |
Undeploys an Index from IndexEndpoint. |
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.
|
CreateCollection |
Creates a collection. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteCollection |
Deletes a collection. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetCollection |
Gets a collection. |
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.
|
UpdateCollection |
Updates a collection. |
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.
|
ListCollections |
Lists collections inside a corpus. |
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.
|
AddCollectionItem |
Adds an item into a Collection. |
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.
|
RemoveCollectionItem |
Removes an item from a collection. |
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.
|
ViewCollectionItems |
View items inside a collection. |
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.
|
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 WarehouseSettings 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
WarehouseSettings warehouseSettings =
WarehouseSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
WarehouseClient warehouseClient = WarehouseClient.create(warehouseSettings);
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
WarehouseSettings warehouseSettings =
WarehouseSettings.newBuilder().setEndpoint(myEndpoint).build();
WarehouseClient warehouseClient = WarehouseClient.create(warehouseSettings);
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
WarehouseSettings warehouseSettings = WarehouseSettings.newHttpJsonBuilder().build();
WarehouseClient warehouseClient = WarehouseClient.create(warehouseSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedWarehouseClient(WarehouseStub stub) protectedWarehouseClient(WarehouseSettings settings) Constructs an instance of WarehouseClient, using the given settings. -
Method Summary
Modifier and TypeMethodDescriptionAdds an item into a Collection.Adds an item into a Collection.Adds an item into a Collection.analyzeAssetAsync(AnalyzeAssetRequest request) Analyze asset to power search capability.Analyze asset to power search capability.Analyze asset to power search capability.analyzeCorpusAsync(AnalyzeCorpusRequest request) Analyzes a corpus.Analyzes a corpus.Analyzes a corpus.booleanawaitTermination(long duration, TimeUnit unit) final ClipAssetResponseclipAsset(ClipAssetRequest request) Supported by STREAM_VIDEO corpus type.Supported by STREAM_VIDEO corpus type.final voidclose()static final WarehouseClientcreate()Constructs an instance of WarehouseClient with default settings.static final WarehouseClientcreate(WarehouseStub stub) Constructs an instance of WarehouseClient, using the given stub for making calls.static final WarehouseClientcreate(WarehouseSettings settings) Constructs an instance of WarehouseClient, using the given settings.final AnnotationcreateAnnotation(AssetName parent, Annotation annotation, String annotationId) Creates annotation inside asset.final AnnotationcreateAnnotation(CreateAnnotationRequest request) Creates annotation inside asset.final AnnotationcreateAnnotation(String parent, Annotation annotation, String annotationId) Creates annotation inside asset.Creates annotation inside asset.final AssetcreateAsset(CorpusName parent, Asset asset, String assetId) Creates an asset inside corpus.final AssetcreateAsset(CreateAssetRequest request) Creates an asset inside corpus.final AssetcreateAsset(String parent, Asset asset, String assetId) Creates an asset inside corpus.final UnaryCallable<CreateAssetRequest,Asset> Creates an asset inside corpus.createCollectionAsync(CorpusName parent, Collection collection, String collectionId) Creates a collection.Creates a collection.createCollectionAsync(String parent, Collection collection, String collectionId) Creates a collection.Creates a collection.Creates a collection.createCorpusAsync(CreateCorpusRequest request) Creates a corpus inside a project.createCorpusAsync(String parent, Corpus corpus) Creates a corpus inside a project.Creates a corpus inside a project.Creates a corpus inside a project.final DataSchemacreateDataSchema(CorpusName parent, DataSchema dataSchema) Creates data schema inside corpus.final DataSchemacreateDataSchema(CreateDataSchemaRequest request) Creates data schema inside corpus.final DataSchemacreateDataSchema(String parent, DataSchema dataSchema) Creates data schema inside corpus.Creates data schema inside corpus.createIndexAsync(CorpusName parent, Index index, String indexId) Creates an Index under the corpus.createIndexAsync(CreateIndexRequest request) Creates an Index under the corpus.createIndexAsync(String parent, Index index, String indexId) Creates an Index under the corpus.Creates an Index under the corpus.Creates an IndexEndpoint.createIndexEndpointAsync(LocationName parent, IndexEndpoint indexEndpoint, String indexEndpointId) Creates an IndexEndpoint.createIndexEndpointAsync(String parent, IndexEndpoint indexEndpoint, String indexEndpointId) Creates an IndexEndpoint.Creates an IndexEndpoint.Creates an IndexEndpoint.Creates an Index under the corpus.final SearchConfigcreateSearchConfig(CorpusName parent, SearchConfig searchConfig, String searchConfigId) Creates a search configuration inside a corpus.final SearchConfigCreates a search configuration inside a corpus.final SearchConfigcreateSearchConfig(String parent, SearchConfig searchConfig, String searchConfigId) Creates a search configuration inside a corpus.Creates a search configuration inside a corpus.final SearchHypernymcreateSearchHypernym(CorpusName parent, SearchHypernym searchHypernym, String searchHypernymId) Creates a SearchHypernym inside a corpus.final SearchHypernymCreates a SearchHypernym inside a corpus.final SearchHypernymcreateSearchHypernym(String parent, SearchHypernym searchHypernym, String searchHypernymId) Creates a SearchHypernym inside a corpus.Creates a SearchHypernym inside a corpus.final voidDeletes annotation inside asset.final voiddeleteAnnotation(DeleteAnnotationRequest request) Deletes annotation inside asset.final voiddeleteAnnotation(String name) Deletes annotation inside asset.final UnaryCallable<DeleteAnnotationRequest,com.google.protobuf.Empty> Deletes annotation inside asset.final OperationFuture<com.google.protobuf.Empty,DeleteAssetMetadata> deleteAssetAsync(AssetName name) Deletes asset inside corpus.final OperationFuture<com.google.protobuf.Empty,DeleteAssetMetadata> deleteAssetAsync(DeleteAssetRequest request) Deletes asset inside corpus.final OperationFuture<com.google.protobuf.Empty,DeleteAssetMetadata> deleteAssetAsync(String name) Deletes asset inside corpus.Deletes asset inside corpus.final OperationCallable<DeleteAssetRequest,com.google.protobuf.Empty, DeleteAssetMetadata> Deletes asset inside corpus.final OperationFuture<com.google.protobuf.Empty,DeleteCollectionMetadata> Deletes a collection.final OperationFuture<com.google.protobuf.Empty,DeleteCollectionMetadata> Deletes a collection.final OperationFuture<com.google.protobuf.Empty,DeleteCollectionMetadata> deleteCollectionAsync(String name) Deletes a collection.Deletes a collection.final OperationCallable<DeleteCollectionRequest,com.google.protobuf.Empty, DeleteCollectionMetadata> Deletes a collection.final voiddeleteCorpus(CorpusName name) Deletes a corpus only if its empty.final voiddeleteCorpus(DeleteCorpusRequest request) Deletes a corpus only if its empty.final voiddeleteCorpus(String name) Deletes a corpus only if its empty.final UnaryCallable<DeleteCorpusRequest,com.google.protobuf.Empty> Deletes a corpus only if its empty.final voidDeletes data schema inside corpus.final voiddeleteDataSchema(DeleteDataSchemaRequest request) Deletes data schema inside corpus.final voiddeleteDataSchema(String name) Deletes data schema inside corpus.final UnaryCallable<DeleteDataSchemaRequest,com.google.protobuf.Empty> Deletes data schema inside corpus.final OperationFuture<com.google.protobuf.Empty,DeleteIndexMetadata> deleteIndexAsync(DeleteIndexRequest request) Delete a single Index.final OperationFuture<com.google.protobuf.Empty,DeleteIndexMetadata> deleteIndexAsync(IndexName name) Delete a single Index.final OperationFuture<com.google.protobuf.Empty,DeleteIndexMetadata> deleteIndexAsync(String name) Delete a single Index.Delete a single Index.final OperationFuture<com.google.protobuf.Empty,DeleteIndexEndpointMetadata> Deletes an IndexEndpoint.final OperationFuture<com.google.protobuf.Empty,DeleteIndexEndpointMetadata> Deletes an IndexEndpoint.final OperationFuture<com.google.protobuf.Empty,DeleteIndexEndpointMetadata> Deletes an IndexEndpoint.Deletes an IndexEndpoint.final OperationCallable<DeleteIndexEndpointRequest,com.google.protobuf.Empty, DeleteIndexEndpointMetadata> Deletes an IndexEndpoint.final OperationCallable<DeleteIndexRequest,com.google.protobuf.Empty, DeleteIndexMetadata> Delete a single Index.final voidDeletes a search configuration inside a corpus.final voidDeletes a search configuration inside a corpus.final voiddeleteSearchConfig(String name) Deletes a search configuration inside a corpus.final UnaryCallable<DeleteSearchConfigRequest,com.google.protobuf.Empty> Deletes a search configuration inside a corpus.final voidDeletes a SearchHypernym inside a corpus.final voidDeletes a SearchHypernym inside a corpus.final voiddeleteSearchHypernym(String name) Deletes a SearchHypernym inside a corpus.final UnaryCallable<DeleteSearchHypernymRequest,com.google.protobuf.Empty> Deletes a SearchHypernym inside a corpus.deployIndexAsync(DeployIndexRequest request) Deploys an Index to IndexEndpoint.Deploys an Index to IndexEndpoint.Deploys an Index to IndexEndpoint.final GenerateHlsUriResponsegenerateHlsUri(GenerateHlsUriRequest request) Generates a uri for an HLS manifest.Generates a uri for an HLS manifest.Generates a signed url for downloading the asset.Generates a signed url for downloading the asset.final AnnotationgetAnnotation(AnnotationName name) Reads annotation inside asset.final AnnotationgetAnnotation(GetAnnotationRequest request) Reads annotation inside asset.final AnnotationgetAnnotation(String name) Reads annotation inside asset.Reads annotation inside asset.final AssetReads an asset inside corpus.final AssetgetAsset(GetAssetRequest request) Reads an asset inside corpus.final AssetReads an asset inside corpus.final UnaryCallable<GetAssetRequest,Asset> Reads an asset inside corpus.final CollectiongetCollection(CollectionName name) Gets a collection.final CollectiongetCollection(GetCollectionRequest request) Gets a collection.final CollectiongetCollection(String name) Gets a collection.Gets a collection.final CorpusgetCorpus(CorpusName name) Gets corpus details inside a project.final CorpusgetCorpus(GetCorpusRequest request) Gets corpus details inside a project.final CorpusGets corpus details inside a project.final UnaryCallable<GetCorpusRequest,Corpus> Gets corpus details inside a project.final DataSchemagetDataSchema(DataSchemaName name) Gets data schema inside corpus.final DataSchemagetDataSchema(GetDataSchemaRequest request) Gets data schema inside corpus.final DataSchemagetDataSchema(String name) Gets data schema inside corpus.Gets data schema inside corpus.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final IndexgetIndex(GetIndexRequest request) Gets the details of a single Index under a Corpus.final IndexGets the details of a single Index under a Corpus.final IndexGets the details of a single Index under a Corpus.final UnaryCallable<GetIndexRequest,Index> Gets the details of a single Index under a Corpus.final IndexEndpointgetIndexEndpoint(GetIndexEndpointRequest request) Gets an IndexEndpoint.final IndexEndpointGets an IndexEndpoint.final IndexEndpointgetIndexEndpoint(String name) Gets an IndexEndpoint.Gets an IndexEndpoint.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final SearchConfiggetSearchConfig(GetSearchConfigRequest request) Gets a search configuration inside a corpus.final SearchConfigGets a search configuration inside a corpus.final SearchConfiggetSearchConfig(String name) Gets a search configuration inside a corpus.Gets a search configuration inside a corpus.final SearchHypernymGets a SearchHypernym inside a corpus.final SearchHypernymGets a SearchHypernym inside a corpus.final SearchHypernymgetSearchHypernym(String name) Gets a SearchHypernym inside a corpus.Gets a SearchHypernym inside a corpus.final WarehouseSettingsgetStub()importAssetsAsync(ImportAssetsRequest request) Imports assets (images plus annotations) from a meta file on cloud storage.Imports assets (images plus annotations) from a meta file on cloud storage.Imports assets (images plus annotations) from a meta file on cloud storage.indexAssetAsync(IndexAssetRequest request) Index one asset for search.Index one asset for search.Index one asset for search.Ingests data for the asset.booleanbooleanlistAnnotations(AssetName parent) Lists a list of annotations inside asset.listAnnotations(ListAnnotationsRequest request) Lists a list of annotations inside asset.listAnnotations(String parent) Lists a list of annotations inside asset.Lists a list of annotations inside asset.Lists a list of annotations inside asset.listAssets(CorpusName parent) Lists an list of assets inside corpus.listAssets(ListAssetsRequest request) Lists an list of assets inside corpus.listAssets(String parent) Lists an list of assets inside corpus.Lists an list of assets inside corpus.Lists an list of assets inside corpus.listCollections(CorpusName parent) Lists collections inside a corpus.listCollections(ListCollectionsRequest request) Lists collections inside a corpus.listCollections(String parent) Lists collections inside a corpus.Lists collections inside a corpus.Lists collections inside a corpus.listCorpora(ListCorporaRequest request) Lists all corpora in a project.listCorpora(String parent) Lists all corpora in a project.Lists all corpora in a project.Lists all corpora in a project.listDataSchemas(CorpusName parent) Lists a list of data schemas inside corpus.listDataSchemas(ListDataSchemasRequest request) Lists a list of data schemas inside corpus.listDataSchemas(String parent) Lists a list of data schemas inside corpus.Lists a list of data schemas inside corpus.Lists a list of data schemas inside corpus.Lists all IndexEndpoints in a project.listIndexEndpoints(LocationName parent) Lists all IndexEndpoints in a project.listIndexEndpoints(String parent) Lists all IndexEndpoints in a project.Lists all IndexEndpoints in a project.Lists all IndexEndpoints in a project.listIndexes(CorpusName parent) List all Indexes in a given Corpus.listIndexes(ListIndexesRequest request) List all Indexes in a given Corpus.listIndexes(String parent) List all Indexes in a given Corpus.List all Indexes in a given Corpus.List all Indexes in a given Corpus.listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists information about the supported locations for this service.listSearchConfigs(CorpusName parent) Lists all search configurations inside a corpus.Lists all search configurations inside a corpus.listSearchConfigs(String parent) Lists all search configurations inside a corpus.Lists all search configurations inside a corpus.Lists all search configurations inside a corpus.listSearchHypernyms(CorpusName parent) Lists SearchHypernyms inside a corpus.Lists SearchHypernyms inside a corpus.listSearchHypernyms(String parent) Lists SearchHypernyms inside a corpus.Lists SearchHypernyms inside a corpus.Lists SearchHypernyms inside a corpus.Removes an item from a collection.Removes an item from a collection.Removes an item from a collection.Remove one asset's index data for search.Remove one asset's index data for search.Remove one asset's index data for search.searchAssets(SearchAssetsRequest request) Search media asset.Search media asset.Search media asset.Search a deployed index endpoint (IMAGE corpus type only).Search a deployed index endpoint (IMAGE corpus type only).Search a deployed index endpoint (IMAGE corpus type only).voidshutdown()voidundeployIndexAsync(UndeployIndexRequest request) Undeploys an Index from IndexEndpoint.Undeploys an Index from IndexEndpoint.Undeploys an Index from IndexEndpoint.final AnnotationupdateAnnotation(Annotation annotation, com.google.protobuf.FieldMask updateMask) Updates annotation inside asset.final AnnotationupdateAnnotation(UpdateAnnotationRequest request) Updates annotation inside asset.Updates annotation inside asset.final AssetupdateAsset(Asset asset, com.google.protobuf.FieldMask updateMask) Updates an asset inside corpus.final AssetupdateAsset(UpdateAssetRequest request) Updates an asset inside corpus.final UnaryCallable<UpdateAssetRequest,Asset> Updates an asset inside corpus.final CollectionupdateCollection(Collection collection, com.google.protobuf.FieldMask updateMask) Updates a collection.final CollectionupdateCollection(UpdateCollectionRequest request) Updates a collection.Updates a collection.final CorpusupdateCorpus(Corpus corpus, com.google.protobuf.FieldMask updateMask) Updates a corpus in a project.final CorpusupdateCorpus(UpdateCorpusRequest request) Updates a corpus in a project.Updates a corpus in a project.final DataSchemaupdateDataSchema(DataSchema dataSchema, com.google.protobuf.FieldMask updateMask) Updates data schema inside corpus.final DataSchemaupdateDataSchema(UpdateDataSchemaRequest request) Updates data schema inside corpus.Updates data schema inside corpus.updateIndexAsync(Index index, com.google.protobuf.FieldMask updateMask) Updates an Index under the corpus.updateIndexAsync(UpdateIndexRequest request) Updates an Index under the corpus.Updates an Index under the corpus.updateIndexEndpointAsync(IndexEndpoint indexEndpoint, com.google.protobuf.FieldMask updateMask) Updates an IndexEndpoint.Updates an IndexEndpoint.Updates an IndexEndpoint.Updates an IndexEndpoint.Updates an Index under the corpus.final SearchConfigupdateSearchConfig(SearchConfig searchConfig, com.google.protobuf.FieldMask updateMask) Updates a search configuration inside a corpus.final SearchConfigUpdates a search configuration inside a corpus.Updates a search configuration inside a corpus.final SearchHypernymupdateSearchHypernym(SearchHypernym searchHypernym, com.google.protobuf.FieldMask updateMask) Updates a SearchHypernym inside a corpus.final SearchHypernymUpdates a SearchHypernym inside a corpus.Updates a SearchHypernym inside a corpus.uploadAssetAsync(UploadAssetRequest request) Upload asset by specifing the asset Cloud Storage uri.Upload asset by specifing the asset Cloud Storage uri.Upload asset by specifing the asset Cloud Storage uri.viewCollectionItems(CollectionName collection) View items inside a collection.View items inside a collection.viewCollectionItems(String collection) View items inside a collection.View items inside a collection.View items inside a collection.viewIndexedAssets(IndexName index) Lists assets inside an index.Lists assets inside an index.viewIndexedAssets(String index) Lists assets inside an index.Lists assets inside an index.Lists assets inside an index.
-
Constructor Details
-
WarehouseClient
Constructs an instance of WarehouseClient, 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.- Throws:
IOException
-
WarehouseClient
-
-
Method Details
-
create
Constructs an instance of WarehouseClient with default settings.- Throws:
IOException
-
create
Constructs an instance of WarehouseClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
Constructs an instance of WarehouseClient, using the given stub for making calls. This is for advanced usage - prefer using create(WarehouseSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
getHttpJsonOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
createAsset
Creates an asset inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CorpusName parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]"); Asset asset = Asset.newBuilder().build(); String assetId = "assetId-704776149"; Asset response = warehouseClient.createAsset(parent, asset, assetId); }- Parameters:
parent- Required. The parent resource where this asset will be created. Format: `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}`asset- Required. The asset to create.assetId- Optional. The ID to use for the asset, which will become the final component of the asset's resource name if user choose to specify. Otherwise, asset id will be generated by system.This value should be up to 63 characters, and valid characters are /[a-z][0-9]-/. The first character must be a letter, the last could be a letter or a number.
- Throws:
ApiException- if the remote call fails
-
createAsset
Creates an asset inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString(); Asset asset = Asset.newBuilder().build(); String assetId = "assetId-704776149"; Asset response = warehouseClient.createAsset(parent, asset, assetId); }- Parameters:
parent- Required. The parent resource where this asset will be created. Format: `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}`asset- Required. The asset to create.assetId- Optional. The ID to use for the asset, which will become the final component of the asset's resource name if user choose to specify. Otherwise, asset id will be generated by system.This value should be up to 63 characters, and valid characters are /[a-z][0-9]-/. The first character must be a letter, the last could be a letter or a number.
- Throws:
ApiException- if the remote call fails
-
createAsset
Creates an asset inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CreateAssetRequest request = CreateAssetRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setAsset(Asset.newBuilder().build()) .setAssetId("assetId-704776149") .build(); Asset response = warehouseClient.createAsset(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createAssetCallable
Creates an asset inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CreateAssetRequest request = CreateAssetRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setAsset(Asset.newBuilder().build()) .setAssetId("assetId-704776149") .build(); ApiFuture<Asset> future = warehouseClient.createAssetCallable().futureCall(request); // Do something. Asset response = future.get(); } -
updateAsset
Updates an asset inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { Asset asset = Asset.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Asset response = warehouseClient.updateAsset(asset, updateMask); }- Parameters:
asset- Required. The asset to update.The asset's `name` field is used to identify the asset to be updated. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}`
updateMask- The list of fields to be updated.- Throws:
ApiException- if the remote call fails
-
updateAsset
Updates an asset inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UpdateAssetRequest request = UpdateAssetRequest.newBuilder() .setAsset(Asset.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Asset response = warehouseClient.updateAsset(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateAssetCallable
Updates an asset inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UpdateAssetRequest request = UpdateAssetRequest.newBuilder() .setAsset(Asset.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Asset> future = warehouseClient.updateAssetCallable().futureCall(request); // Do something. Asset response = future.get(); } -
getAsset
Reads an asset inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { AssetName name = AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]"); Asset response = warehouseClient.getAsset(name); }- Parameters:
name- Required. The name of the asset to retrieve. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}- Throws:
ApiException- if the remote call fails
-
getAsset
Reads an asset inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String name = AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString(); Asset response = warehouseClient.getAsset(name); }- Parameters:
name- Required. The name of the asset to retrieve. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}- Throws:
ApiException- if the remote call fails
-
getAsset
Reads an asset inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GetAssetRequest request = GetAssetRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .build(); Asset response = warehouseClient.getAsset(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getAssetCallable
Reads an asset inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GetAssetRequest request = GetAssetRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .build(); ApiFuture<Asset> future = warehouseClient.getAssetCallable().futureCall(request); // Do something. Asset response = future.get(); } -
listAssets
Lists an list of assets inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CorpusName parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]"); for (Asset element : warehouseClient.listAssets(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of assets. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}`- Throws:
ApiException- if the remote call fails
-
listAssets
Lists an list of assets inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString(); for (Asset element : warehouseClient.listAssets(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of assets. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}`- Throws:
ApiException- if the remote call fails
-
listAssets
Lists an list of assets inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListAssetsRequest request = ListAssetsRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); for (Asset element : warehouseClient.listAssets(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listAssetsPagedCallable
public final UnaryCallable<ListAssetsRequest,WarehouseClient.ListAssetsPagedResponse> listAssetsPagedCallable()Lists an list of assets inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListAssetsRequest request = ListAssetsRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); ApiFuture<Asset> future = warehouseClient.listAssetsPagedCallable().futureCall(request); // Do something. for (Asset element : future.get().iterateAll()) { // doThingsWith(element); } } -
listAssetsCallable
Lists an list of assets inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListAssetsRequest request = ListAssetsRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); while (true) { ListAssetsResponse response = warehouseClient.listAssetsCallable().call(request); for (Asset element : response.getAssetsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
deleteAssetAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteAssetMetadata> deleteAssetAsync(AssetName name) Deletes asset inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { AssetName name = AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]"); warehouseClient.deleteAssetAsync(name).get(); }- Parameters:
name- Required. The name of the asset to delete. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}`- Throws:
ApiException- if the remote call fails
-
deleteAssetAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteAssetMetadata> deleteAssetAsync(String name) Deletes asset inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String name = AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString(); warehouseClient.deleteAssetAsync(name).get(); }- Parameters:
name- Required. The name of the asset to delete. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}`- Throws:
ApiException- if the remote call fails
-
deleteAssetAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteAssetMetadata> deleteAssetAsync(DeleteAssetRequest request) Deletes asset inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeleteAssetRequest request = DeleteAssetRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .build(); warehouseClient.deleteAssetAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteAssetOperationCallable
public final OperationCallable<DeleteAssetRequest,com.google.protobuf.Empty, deleteAssetOperationCallable()DeleteAssetMetadata> Deletes asset inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeleteAssetRequest request = DeleteAssetRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .build(); OperationFuture<Empty, DeleteAssetMetadata> future = warehouseClient.deleteAssetOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteAssetCallable
Deletes asset inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeleteAssetRequest request = DeleteAssetRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .build(); ApiFuture<Operation> future = warehouseClient.deleteAssetCallable().futureCall(request); // Do something. future.get(); } -
uploadAssetAsync
public final OperationFuture<UploadAssetResponse,UploadAssetMetadata> uploadAssetAsync(UploadAssetRequest request) Upload asset by specifing the asset Cloud Storage uri. For video warehouse, it requires users who call this API have read access to the cloud storage file. Once it is uploaded, it can be retrieved by GenerateRetrievalUrl API which by default, only can retrieve cloud storage files from the same project of the warehouse. To allow retrieval cloud storage files that are in a separate project, it requires to find the vision ai service account (Go to IAM, check checkbox to show "Include Google-provided role grants", search for "Cloud Vision AI Service Agent") and grant the read access of the cloud storage files to that service account.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UploadAssetRequest request = UploadAssetRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .setAssetSource(AssetSource.newBuilder().build()) .build(); UploadAssetResponse response = warehouseClient.uploadAssetAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
uploadAssetOperationCallable
public final OperationCallable<UploadAssetRequest,UploadAssetResponse, uploadAssetOperationCallable()UploadAssetMetadata> Upload asset by specifing the asset Cloud Storage uri. For video warehouse, it requires users who call this API have read access to the cloud storage file. Once it is uploaded, it can be retrieved by GenerateRetrievalUrl API which by default, only can retrieve cloud storage files from the same project of the warehouse. To allow retrieval cloud storage files that are in a separate project, it requires to find the vision ai service account (Go to IAM, check checkbox to show "Include Google-provided role grants", search for "Cloud Vision AI Service Agent") and grant the read access of the cloud storage files to that service account.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UploadAssetRequest request = UploadAssetRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .setAssetSource(AssetSource.newBuilder().build()) .build(); OperationFuture<UploadAssetResponse, UploadAssetMetadata> future = warehouseClient.uploadAssetOperationCallable().futureCall(request); // Do something. UploadAssetResponse response = future.get(); } -
uploadAssetCallable
Upload asset by specifing the asset Cloud Storage uri. For video warehouse, it requires users who call this API have read access to the cloud storage file. Once it is uploaded, it can be retrieved by GenerateRetrievalUrl API which by default, only can retrieve cloud storage files from the same project of the warehouse. To allow retrieval cloud storage files that are in a separate project, it requires to find the vision ai service account (Go to IAM, check checkbox to show "Include Google-provided role grants", search for "Cloud Vision AI Service Agent") and grant the read access of the cloud storage files to that service account.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UploadAssetRequest request = UploadAssetRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .setAssetSource(AssetSource.newBuilder().build()) .build(); ApiFuture<Operation> future = warehouseClient.uploadAssetCallable().futureCall(request); // Do something. Operation response = future.get(); } -
generateRetrievalUrl
Generates a signed url for downloading the asset. For video warehouse, please see comment of UploadAsset about how to allow retrieval of cloud storage files in a different project.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GenerateRetrievalUrlRequest request = GenerateRetrievalUrlRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .build(); GenerateRetrievalUrlResponse response = warehouseClient.generateRetrievalUrl(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
generateRetrievalUrlCallable
public final UnaryCallable<GenerateRetrievalUrlRequest,GenerateRetrievalUrlResponse> generateRetrievalUrlCallable()Generates a signed url for downloading the asset. For video warehouse, please see comment of UploadAsset about how to allow retrieval of cloud storage files in a different project.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GenerateRetrievalUrlRequest request = GenerateRetrievalUrlRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .build(); ApiFuture<GenerateRetrievalUrlResponse> future = warehouseClient.generateRetrievalUrlCallable().futureCall(request); // Do something. GenerateRetrievalUrlResponse response = future.get(); } -
analyzeAssetAsync
public final OperationFuture<AnalyzeAssetResponse,AnalyzeAssetMetadata> analyzeAssetAsync(AnalyzeAssetRequest request) Analyze asset to power search capability.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { AnalyzeAssetRequest request = AnalyzeAssetRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .build(); AnalyzeAssetResponse response = warehouseClient.analyzeAssetAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
analyzeAssetOperationCallable
public final OperationCallable<AnalyzeAssetRequest,AnalyzeAssetResponse, analyzeAssetOperationCallable()AnalyzeAssetMetadata> Analyze asset to power search capability.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { AnalyzeAssetRequest request = AnalyzeAssetRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .build(); OperationFuture<AnalyzeAssetResponse, AnalyzeAssetMetadata> future = warehouseClient.analyzeAssetOperationCallable().futureCall(request); // Do something. AnalyzeAssetResponse response = future.get(); } -
analyzeAssetCallable
Analyze asset to power search capability.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { AnalyzeAssetRequest request = AnalyzeAssetRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .build(); ApiFuture<Operation> future = warehouseClient.analyzeAssetCallable().futureCall(request); // Do something. Operation response = future.get(); } -
indexAssetAsync
public final OperationFuture<IndexAssetResponse,IndexAssetMetadata> indexAssetAsync(IndexAssetRequest request) Index one asset for search. Supported corpus type: Corpus.Type.VIDEO_ON_DEMANDSample 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 (WarehouseClient warehouseClient = WarehouseClient.create()) { IndexAssetRequest request = IndexAssetRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .setIndex( IndexName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[INDEX]").toString()) .build(); IndexAssetResponse response = warehouseClient.indexAssetAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
indexAssetOperationCallable
public final OperationCallable<IndexAssetRequest,IndexAssetResponse, indexAssetOperationCallable()IndexAssetMetadata> Index one asset for search. Supported corpus type: Corpus.Type.VIDEO_ON_DEMANDSample 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 (WarehouseClient warehouseClient = WarehouseClient.create()) { IndexAssetRequest request = IndexAssetRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .setIndex( IndexName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[INDEX]").toString()) .build(); OperationFuture<IndexAssetResponse, IndexAssetMetadata> future = warehouseClient.indexAssetOperationCallable().futureCall(request); // Do something. IndexAssetResponse response = future.get(); } -
indexAssetCallable
Index one asset for search. Supported corpus type: Corpus.Type.VIDEO_ON_DEMANDSample 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 (WarehouseClient warehouseClient = WarehouseClient.create()) { IndexAssetRequest request = IndexAssetRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .setIndex( IndexName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[INDEX]").toString()) .build(); ApiFuture<Operation> future = warehouseClient.indexAssetCallable().futureCall(request); // Do something. Operation response = future.get(); } -
removeIndexAssetAsync
public final OperationFuture<RemoveIndexAssetResponse,RemoveIndexAssetMetadata> removeIndexAssetAsync(RemoveIndexAssetRequest request) Remove one asset's index data for search. Supported corpus type: Corpus.Type.VIDEO_ON_DEMANDSample 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 (WarehouseClient warehouseClient = WarehouseClient.create()) { RemoveIndexAssetRequest request = RemoveIndexAssetRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .setIndex( IndexName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[INDEX]").toString()) .build(); RemoveIndexAssetResponse response = warehouseClient.removeIndexAssetAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
removeIndexAssetOperationCallable
public final OperationCallable<RemoveIndexAssetRequest,RemoveIndexAssetResponse, removeIndexAssetOperationCallable()RemoveIndexAssetMetadata> Remove one asset's index data for search. Supported corpus type: Corpus.Type.VIDEO_ON_DEMANDSample 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 (WarehouseClient warehouseClient = WarehouseClient.create()) { RemoveIndexAssetRequest request = RemoveIndexAssetRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .setIndex( IndexName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[INDEX]").toString()) .build(); OperationFuture<RemoveIndexAssetResponse, RemoveIndexAssetMetadata> future = warehouseClient.removeIndexAssetOperationCallable().futureCall(request); // Do something. RemoveIndexAssetResponse response = future.get(); } -
removeIndexAssetCallable
Remove one asset's index data for search. Supported corpus type: Corpus.Type.VIDEO_ON_DEMANDSample 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 (WarehouseClient warehouseClient = WarehouseClient.create()) { RemoveIndexAssetRequest request = RemoveIndexAssetRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .setIndex( IndexName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[INDEX]").toString()) .build(); ApiFuture<Operation> future = warehouseClient.removeIndexAssetCallable().futureCall(request); // Do something. Operation response = future.get(); } -
viewIndexedAssets
Lists assets inside an index.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { IndexName index = IndexName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[INDEX]"); for (IndexedAsset element : warehouseClient.viewIndexedAssets(index).iterateAll()) { // doThingsWith(element); } }- Parameters:
index- Required. The index that owns this collection of assets. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}`- Throws:
ApiException- if the remote call fails
-
viewIndexedAssets
Lists assets inside an index.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String index = IndexName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[INDEX]").toString(); for (IndexedAsset element : warehouseClient.viewIndexedAssets(index).iterateAll()) { // doThingsWith(element); } }- Parameters:
index- Required. The index that owns this collection of assets. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}`- Throws:
ApiException- if the remote call fails
-
viewIndexedAssets
public final WarehouseClient.ViewIndexedAssetsPagedResponse viewIndexedAssets(ViewIndexedAssetsRequest request) Lists assets inside an index.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ViewIndexedAssetsRequest request = ViewIndexedAssetsRequest.newBuilder() .setIndex( IndexName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[INDEX]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); for (IndexedAsset element : warehouseClient.viewIndexedAssets(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
viewIndexedAssetsPagedCallable
public final UnaryCallable<ViewIndexedAssetsRequest,WarehouseClient.ViewIndexedAssetsPagedResponse> viewIndexedAssetsPagedCallable()Lists assets inside an index.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ViewIndexedAssetsRequest request = ViewIndexedAssetsRequest.newBuilder() .setIndex( IndexName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[INDEX]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); ApiFuture<IndexedAsset> future = warehouseClient.viewIndexedAssetsPagedCallable().futureCall(request); // Do something. for (IndexedAsset element : future.get().iterateAll()) { // doThingsWith(element); } } -
viewIndexedAssetsCallable
public final UnaryCallable<ViewIndexedAssetsRequest,ViewIndexedAssetsResponse> viewIndexedAssetsCallable()Lists assets inside an index.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ViewIndexedAssetsRequest request = ViewIndexedAssetsRequest.newBuilder() .setIndex( IndexName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[INDEX]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); while (true) { ViewIndexedAssetsResponse response = warehouseClient.viewIndexedAssetsCallable().call(request); for (IndexedAsset element : response.getIndexedAssetsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
createIndexAsync
public final OperationFuture<Index,CreateIndexMetadata> createIndexAsync(CorpusName parent, Index index, String indexId) Creates an Index under the corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CorpusName parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]"); Index index = Index.newBuilder().build(); String indexId = "indexId1943291277"; Index response = warehouseClient.createIndexAsync(parent, index, indexId).get(); }- Parameters:
parent- Required. Value for the parent. The resource name of the Corpus under which this index is created. Format: `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}`index- Required. The index being created.indexId- Optional. The ID for the index. This will become the final resource name for the index. If the user does not specify this value, it will be generated by system.This value should be up to 63 characters, and valid characters are /[a-z][0-9]-/. The first character must be a letter, the last could be a letter or a number.
- Throws:
ApiException- if the remote call fails
-
createIndexAsync
public final OperationFuture<Index,CreateIndexMetadata> createIndexAsync(String parent, Index index, String indexId) Creates an Index under the corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString(); Index index = Index.newBuilder().build(); String indexId = "indexId1943291277"; Index response = warehouseClient.createIndexAsync(parent, index, indexId).get(); }- Parameters:
parent- Required. Value for the parent. The resource name of the Corpus under which this index is created. Format: `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}`index- Required. The index being created.indexId- Optional. The ID for the index. This will become the final resource name for the index. If the user does not specify this value, it will be generated by system.This value should be up to 63 characters, and valid characters are /[a-z][0-9]-/. The first character must be a letter, the last could be a letter or a number.
- Throws:
ApiException- if the remote call fails
-
createIndexAsync
public final OperationFuture<Index,CreateIndexMetadata> createIndexAsync(CreateIndexRequest request) Creates an Index under the corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CreateIndexRequest request = CreateIndexRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setIndexId("indexId1943291277") .setIndex(Index.newBuilder().build()) .build(); Index response = warehouseClient.createIndexAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createIndexOperationCallable
public final OperationCallable<CreateIndexRequest,Index, createIndexOperationCallable()CreateIndexMetadata> Creates an Index under the corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CreateIndexRequest request = CreateIndexRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setIndexId("indexId1943291277") .setIndex(Index.newBuilder().build()) .build(); OperationFuture<Index, CreateIndexMetadata> future = warehouseClient.createIndexOperationCallable().futureCall(request); // Do something. Index response = future.get(); } -
createIndexCallable
Creates an Index under the corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CreateIndexRequest request = CreateIndexRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setIndexId("indexId1943291277") .setIndex(Index.newBuilder().build()) .build(); ApiFuture<Operation> future = warehouseClient.createIndexCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateIndexAsync
public final OperationFuture<Index,UpdateIndexMetadata> updateIndexAsync(Index index, com.google.protobuf.FieldMask updateMask) Updates an Index under the corpus. Users can perform a metadata-only update or trigger a full index rebuild with different update_mask values.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { Index index = Index.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Index response = warehouseClient.updateIndexAsync(index, updateMask).get(); }- Parameters:
index- Required. The resource being updated.updateMask- Required. Field mask is used to specify the fields to be overwritten in the Index resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field of the resource will be overwritten if it is in the mask. Empty field mask is not allowed. If the mask is "*", it triggers a full update of the index, and also a whole rebuild of index data.- Throws:
ApiException- if the remote call fails
-
updateIndexAsync
public final OperationFuture<Index,UpdateIndexMetadata> updateIndexAsync(UpdateIndexRequest request) Updates an Index under the corpus. Users can perform a metadata-only update or trigger a full index rebuild with different update_mask values.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UpdateIndexRequest request = UpdateIndexRequest.newBuilder() .setIndex(Index.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Index response = warehouseClient.updateIndexAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateIndexOperationCallable
public final OperationCallable<UpdateIndexRequest,Index, updateIndexOperationCallable()UpdateIndexMetadata> Updates an Index under the corpus. Users can perform a metadata-only update or trigger a full index rebuild with different update_mask values.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UpdateIndexRequest request = UpdateIndexRequest.newBuilder() .setIndex(Index.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); OperationFuture<Index, UpdateIndexMetadata> future = warehouseClient.updateIndexOperationCallable().futureCall(request); // Do something. Index response = future.get(); } -
updateIndexCallable
Updates an Index under the corpus. Users can perform a metadata-only update or trigger a full index rebuild with different update_mask values.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UpdateIndexRequest request = UpdateIndexRequest.newBuilder() .setIndex(Index.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Operation> future = warehouseClient.updateIndexCallable().futureCall(request); // Do something. Operation response = future.get(); } -
getIndex
Gets the details of a single Index under a Corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { IndexName name = IndexName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[INDEX]"); Index response = warehouseClient.getIndex(name); }- Parameters:
name- Required. Name of the Index resource. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}`- Throws:
ApiException- if the remote call fails
-
getIndex
Gets the details of a single Index under a Corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String name = IndexName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[INDEX]").toString(); Index response = warehouseClient.getIndex(name); }- Parameters:
name- Required. Name of the Index resource. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}`- Throws:
ApiException- if the remote call fails
-
getIndex
Gets the details of a single Index under a Corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GetIndexRequest request = GetIndexRequest.newBuilder() .setName( IndexName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[INDEX]").toString()) .build(); Index response = warehouseClient.getIndex(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getIndexCallable
Gets the details of a single Index under a Corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GetIndexRequest request = GetIndexRequest.newBuilder() .setName( IndexName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[INDEX]").toString()) .build(); ApiFuture<Index> future = warehouseClient.getIndexCallable().futureCall(request); // Do something. Index response = future.get(); } -
listIndexes
List all Indexes in a given Corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CorpusName parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]"); for (Index element : warehouseClient.listIndexes(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent corpus that owns this collection of indexes. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}`- Throws:
ApiException- if the remote call fails
-
listIndexes
List all Indexes in a given Corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString(); for (Index element : warehouseClient.listIndexes(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent corpus that owns this collection of indexes. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}`- Throws:
ApiException- if the remote call fails
-
listIndexes
List all Indexes in a given Corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListIndexesRequest request = ListIndexesRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Index element : warehouseClient.listIndexes(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listIndexesPagedCallable
public final UnaryCallable<ListIndexesRequest,WarehouseClient.ListIndexesPagedResponse> listIndexesPagedCallable()List all Indexes in a given Corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListIndexesRequest request = ListIndexesRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Index> future = warehouseClient.listIndexesPagedCallable().futureCall(request); // Do something. for (Index element : future.get().iterateAll()) { // doThingsWith(element); } } -
listIndexesCallable
List all Indexes in a given Corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListIndexesRequest request = ListIndexesRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListIndexesResponse response = warehouseClient.listIndexesCallable().call(request); for (Index element : response.getIndexesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
deleteIndexAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteIndexMetadata> deleteIndexAsync(IndexName name) Delete a single Index. In order to delete an index, the caller must make sure that it is not deployed to any index endpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { IndexName name = IndexName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[INDEX]"); warehouseClient.deleteIndexAsync(name).get(); }- Parameters:
name- Required. The name of the index to delete. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}`- Throws:
ApiException- if the remote call fails
-
deleteIndexAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteIndexMetadata> deleteIndexAsync(String name) Delete a single Index. In order to delete an index, the caller must make sure that it is not deployed to any index endpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String name = IndexName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[INDEX]").toString(); warehouseClient.deleteIndexAsync(name).get(); }- Parameters:
name- Required. The name of the index to delete. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}`- Throws:
ApiException- if the remote call fails
-
deleteIndexAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteIndexMetadata> deleteIndexAsync(DeleteIndexRequest request) Delete a single Index. In order to delete an index, the caller must make sure that it is not deployed to any index endpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeleteIndexRequest request = DeleteIndexRequest.newBuilder() .setName( IndexName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[INDEX]").toString()) .build(); warehouseClient.deleteIndexAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteIndexOperationCallable
public final OperationCallable<DeleteIndexRequest,com.google.protobuf.Empty, deleteIndexOperationCallable()DeleteIndexMetadata> Delete a single Index. In order to delete an index, the caller must make sure that it is not deployed to any index endpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeleteIndexRequest request = DeleteIndexRequest.newBuilder() .setName( IndexName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[INDEX]").toString()) .build(); OperationFuture<Empty, DeleteIndexMetadata> future = warehouseClient.deleteIndexOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteIndexCallable
Delete a single Index. In order to delete an index, the caller must make sure that it is not deployed to any index endpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeleteIndexRequest request = DeleteIndexRequest.newBuilder() .setName( IndexName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[INDEX]").toString()) .build(); ApiFuture<Operation> future = warehouseClient.deleteIndexCallable().futureCall(request); // Do something. future.get(); } -
createCorpusAsync
public final OperationFuture<Corpus,CreateCorpusMetadata> createCorpusAsync(String parent, Corpus corpus) Creates a corpus inside a project.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String parent = "parent-995424086"; Corpus corpus = Corpus.newBuilder().build(); Corpus response = warehouseClient.createCorpusAsync(parent, corpus).get(); }- Parameters:
parent- Required. Form: `projects/{project_number}/locations/{location_id}`corpus- Required. The corpus to be created.- Throws:
ApiException- if the remote call fails
-
createCorpusAsync
public final OperationFuture<Corpus,CreateCorpusMetadata> createCorpusAsync(CreateCorpusRequest request) Creates a corpus inside a project.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CreateCorpusRequest request = CreateCorpusRequest.newBuilder() .setParent("parent-995424086") .setCorpus(Corpus.newBuilder().build()) .build(); Corpus response = warehouseClient.createCorpusAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createCorpusOperationCallable
public final OperationCallable<CreateCorpusRequest,Corpus, createCorpusOperationCallable()CreateCorpusMetadata> Creates a corpus inside a project.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CreateCorpusRequest request = CreateCorpusRequest.newBuilder() .setParent("parent-995424086") .setCorpus(Corpus.newBuilder().build()) .build(); OperationFuture<Corpus, CreateCorpusMetadata> future = warehouseClient.createCorpusOperationCallable().futureCall(request); // Do something. Corpus response = future.get(); } -
createCorpusCallable
Creates a corpus inside a project.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CreateCorpusRequest request = CreateCorpusRequest.newBuilder() .setParent("parent-995424086") .setCorpus(Corpus.newBuilder().build()) .build(); ApiFuture<Operation> future = warehouseClient.createCorpusCallable().futureCall(request); // Do something. Operation response = future.get(); } -
getCorpus
Gets corpus details inside a project.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CorpusName name = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]"); Corpus response = warehouseClient.getCorpus(name); }- Parameters:
name- Required. The resource name of the corpus to retrieve.- Throws:
ApiException- if the remote call fails
-
getCorpus
Gets corpus details inside a project.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String name = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString(); Corpus response = warehouseClient.getCorpus(name); }- Parameters:
name- Required. The resource name of the corpus to retrieve.- Throws:
ApiException- if the remote call fails
-
getCorpus
Gets corpus details inside a project.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GetCorpusRequest request = GetCorpusRequest.newBuilder() .setName(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .build(); Corpus response = warehouseClient.getCorpus(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getCorpusCallable
Gets corpus details inside a project.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GetCorpusRequest request = GetCorpusRequest.newBuilder() .setName(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .build(); ApiFuture<Corpus> future = warehouseClient.getCorpusCallable().futureCall(request); // Do something. Corpus response = future.get(); } -
updateCorpus
Updates a corpus in a project.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { Corpus corpus = Corpus.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Corpus response = warehouseClient.updateCorpus(corpus, updateMask); }- Parameters:
corpus- Required. The corpus which replaces the resource on the server.updateMask- The list of fields to be updated.- Throws:
ApiException- if the remote call fails
-
updateCorpus
Updates a corpus in a project.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UpdateCorpusRequest request = UpdateCorpusRequest.newBuilder() .setCorpus(Corpus.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Corpus response = warehouseClient.updateCorpus(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateCorpusCallable
Updates a corpus in a project.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UpdateCorpusRequest request = UpdateCorpusRequest.newBuilder() .setCorpus(Corpus.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Corpus> future = warehouseClient.updateCorpusCallable().futureCall(request); // Do something. Corpus response = future.get(); } -
listCorpora
Lists all corpora in a project.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String parent = "parent-995424086"; for (Corpus element : warehouseClient.listCorpora(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the project from which to list corpora.- Throws:
ApiException- if the remote call fails
-
listCorpora
Lists all corpora in a project.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListCorporaRequest request = ListCorporaRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); for (Corpus element : warehouseClient.listCorpora(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listCorporaPagedCallable
public final UnaryCallable<ListCorporaRequest,WarehouseClient.ListCorporaPagedResponse> listCorporaPagedCallable()Lists all corpora in a project.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListCorporaRequest request = ListCorporaRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); ApiFuture<Corpus> future = warehouseClient.listCorporaPagedCallable().futureCall(request); // Do something. for (Corpus element : future.get().iterateAll()) { // doThingsWith(element); } } -
listCorporaCallable
Lists all corpora in a project.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListCorporaRequest request = ListCorporaRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); while (true) { ListCorporaResponse response = warehouseClient.listCorporaCallable().call(request); for (Corpus element : response.getCorporaList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
deleteCorpus
Deletes a corpus only if its empty. Returns empty response.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CorpusName name = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]"); warehouseClient.deleteCorpus(name); }- Parameters:
name- Required. The resource name of the corpus to delete.- Throws:
ApiException- if the remote call fails
-
deleteCorpus
Deletes a corpus only if its empty. Returns empty response.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String name = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString(); warehouseClient.deleteCorpus(name); }- Parameters:
name- Required. The resource name of the corpus to delete.- Throws:
ApiException- if the remote call fails
-
deleteCorpus
Deletes a corpus only if its empty. Returns empty response.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeleteCorpusRequest request = DeleteCorpusRequest.newBuilder() .setName(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .build(); warehouseClient.deleteCorpus(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteCorpusCallable
Deletes a corpus only if its empty. Returns empty response.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeleteCorpusRequest request = DeleteCorpusRequest.newBuilder() .setName(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .build(); ApiFuture<Empty> future = warehouseClient.deleteCorpusCallable().futureCall(request); // Do something. future.get(); } -
analyzeCorpusAsync
public final OperationFuture<AnalyzeCorpusResponse,AnalyzeCorpusMetadata> analyzeCorpusAsync(AnalyzeCorpusRequest request) Analyzes a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { AnalyzeCorpusRequest request = AnalyzeCorpusRequest.newBuilder() .setName(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .build(); AnalyzeCorpusResponse response = warehouseClient.analyzeCorpusAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
analyzeCorpusOperationCallable
public final OperationCallable<AnalyzeCorpusRequest,AnalyzeCorpusResponse, analyzeCorpusOperationCallable()AnalyzeCorpusMetadata> Analyzes a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { AnalyzeCorpusRequest request = AnalyzeCorpusRequest.newBuilder() .setName(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .build(); OperationFuture<AnalyzeCorpusResponse, AnalyzeCorpusMetadata> future = warehouseClient.analyzeCorpusOperationCallable().futureCall(request); // Do something. AnalyzeCorpusResponse response = future.get(); } -
analyzeCorpusCallable
Analyzes a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { AnalyzeCorpusRequest request = AnalyzeCorpusRequest.newBuilder() .setName(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .build(); ApiFuture<Operation> future = warehouseClient.analyzeCorpusCallable().futureCall(request); // Do something. Operation response = future.get(); } -
createDataSchema
Creates data schema inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CorpusName parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]"); DataSchema dataSchema = DataSchema.newBuilder().build(); DataSchema response = warehouseClient.createDataSchema(parent, dataSchema); }- Parameters:
parent- Required. The parent resource where this data schema will be created. Format: `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}`dataSchema- Required. The data schema to create.- Throws:
ApiException- if the remote call fails
-
createDataSchema
Creates data schema inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString(); DataSchema dataSchema = DataSchema.newBuilder().build(); DataSchema response = warehouseClient.createDataSchema(parent, dataSchema); }- Parameters:
parent- Required. The parent resource where this data schema will be created. Format: `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}`dataSchema- Required. The data schema to create.- Throws:
ApiException- if the remote call fails
-
createDataSchema
Creates data schema inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CreateDataSchemaRequest request = CreateDataSchemaRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setDataSchema(DataSchema.newBuilder().build()) .build(); DataSchema response = warehouseClient.createDataSchema(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createDataSchemaCallable
Creates data schema inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CreateDataSchemaRequest request = CreateDataSchemaRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setDataSchema(DataSchema.newBuilder().build()) .build(); ApiFuture<DataSchema> future = warehouseClient.createDataSchemaCallable().futureCall(request); // Do something. DataSchema response = future.get(); } -
updateDataSchema
public final DataSchema updateDataSchema(DataSchema dataSchema, com.google.protobuf.FieldMask updateMask) Updates data schema inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DataSchema dataSchema = DataSchema.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); DataSchema response = warehouseClient.updateDataSchema(dataSchema, updateMask); }- Parameters:
dataSchema- Required. The data schema's `name` field is used to identify the data schema to be updated. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}`updateMask- The list of fields to be updated.- Throws:
ApiException- if the remote call fails
-
updateDataSchema
Updates data schema inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UpdateDataSchemaRequest request = UpdateDataSchemaRequest.newBuilder() .setDataSchema(DataSchema.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); DataSchema response = warehouseClient.updateDataSchema(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateDataSchemaCallable
Updates data schema inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UpdateDataSchemaRequest request = UpdateDataSchemaRequest.newBuilder() .setDataSchema(DataSchema.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<DataSchema> future = warehouseClient.updateDataSchemaCallable().futureCall(request); // Do something. DataSchema response = future.get(); } -
getDataSchema
Gets data schema inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DataSchemaName name = DataSchemaName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[DATA_SCHEMA]"); DataSchema response = warehouseClient.getDataSchema(name); }- Parameters:
name- Required. The name of the data schema to retrieve. Format: `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}`- Throws:
ApiException- if the remote call fails
-
getDataSchema
Gets data schema inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String name = DataSchemaName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[DATA_SCHEMA]") .toString(); DataSchema response = warehouseClient.getDataSchema(name); }- Parameters:
name- Required. The name of the data schema to retrieve. Format: `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}`- Throws:
ApiException- if the remote call fails
-
getDataSchema
Gets data schema inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GetDataSchemaRequest request = GetDataSchemaRequest.newBuilder() .setName( DataSchemaName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[DATA_SCHEMA]") .toString()) .build(); DataSchema response = warehouseClient.getDataSchema(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getDataSchemaCallable
Gets data schema inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GetDataSchemaRequest request = GetDataSchemaRequest.newBuilder() .setName( DataSchemaName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[DATA_SCHEMA]") .toString()) .build(); ApiFuture<DataSchema> future = warehouseClient.getDataSchemaCallable().futureCall(request); // Do something. DataSchema response = future.get(); } -
deleteDataSchema
Deletes data schema inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DataSchemaName name = DataSchemaName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[DATA_SCHEMA]"); warehouseClient.deleteDataSchema(name); }- Parameters:
name- Required. The name of the data schema to delete. Format: `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}`- Throws:
ApiException- if the remote call fails
-
deleteDataSchema
Deletes data schema inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String name = DataSchemaName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[DATA_SCHEMA]") .toString(); warehouseClient.deleteDataSchema(name); }- Parameters:
name- Required. The name of the data schema to delete. Format: `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}`- Throws:
ApiException- if the remote call fails
-
deleteDataSchema
Deletes data schema inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeleteDataSchemaRequest request = DeleteDataSchemaRequest.newBuilder() .setName( DataSchemaName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[DATA_SCHEMA]") .toString()) .build(); warehouseClient.deleteDataSchema(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteDataSchemaCallable
public final UnaryCallable<DeleteDataSchemaRequest,com.google.protobuf.Empty> deleteDataSchemaCallable()Deletes data schema inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeleteDataSchemaRequest request = DeleteDataSchemaRequest.newBuilder() .setName( DataSchemaName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[DATA_SCHEMA]") .toString()) .build(); ApiFuture<Empty> future = warehouseClient.deleteDataSchemaCallable().futureCall(request); // Do something. future.get(); } -
listDataSchemas
Lists a list of data schemas inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CorpusName parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]"); for (DataSchema element : warehouseClient.listDataSchemas(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of data schemas. Format: `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}`- Throws:
ApiException- if the remote call fails
-
listDataSchemas
Lists a list of data schemas inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString(); for (DataSchema element : warehouseClient.listDataSchemas(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of data schemas. Format: `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}`- Throws:
ApiException- if the remote call fails
-
listDataSchemas
public final WarehouseClient.ListDataSchemasPagedResponse listDataSchemas(ListDataSchemasRequest request) Lists a list of data schemas inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListDataSchemasRequest request = ListDataSchemasRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (DataSchema element : warehouseClient.listDataSchemas(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listDataSchemasPagedCallable
public final UnaryCallable<ListDataSchemasRequest,WarehouseClient.ListDataSchemasPagedResponse> listDataSchemasPagedCallable()Lists a list of data schemas inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListDataSchemasRequest request = ListDataSchemasRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<DataSchema> future = warehouseClient.listDataSchemasPagedCallable().futureCall(request); // Do something. for (DataSchema element : future.get().iterateAll()) { // doThingsWith(element); } } -
listDataSchemasCallable
public final UnaryCallable<ListDataSchemasRequest,ListDataSchemasResponse> listDataSchemasCallable()Lists a list of data schemas inside corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListDataSchemasRequest request = ListDataSchemasRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListDataSchemasResponse response = warehouseClient.listDataSchemasCallable().call(request); for (DataSchema element : response.getDataSchemasList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
createAnnotation
public final Annotation createAnnotation(AssetName parent, Annotation annotation, String annotationId) Creates annotation inside asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { AssetName parent = AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]"); Annotation annotation = Annotation.newBuilder().build(); String annotationId = "annotationId251782314"; Annotation response = warehouseClient.createAnnotation(parent, annotation, annotationId); }- Parameters:
parent- Required. The parent resource where this annotation will be created. Format: `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`annotation- Required. The annotation to create.annotationId- Optional. The ID to use for the annotation, which will become the final component of the annotation's resource name if user choose to specify. Otherwise, annotation id will be generated by system.This value should be up to 63 characters, and valid characters are /[a-z][0-9]-/. The first character must be a letter, the last could be a letter or a number.
- Throws:
ApiException- if the remote call fails
-
createAnnotation
Creates annotation inside asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String parent = AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString(); Annotation annotation = Annotation.newBuilder().build(); String annotationId = "annotationId251782314"; Annotation response = warehouseClient.createAnnotation(parent, annotation, annotationId); }- Parameters:
parent- Required. The parent resource where this annotation will be created. Format: `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`annotation- Required. The annotation to create.annotationId- Optional. The ID to use for the annotation, which will become the final component of the annotation's resource name if user choose to specify. Otherwise, annotation id will be generated by system.This value should be up to 63 characters, and valid characters are /[a-z][0-9]-/. The first character must be a letter, the last could be a letter or a number.
- Throws:
ApiException- if the remote call fails
-
createAnnotation
Creates annotation inside asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CreateAnnotationRequest request = CreateAnnotationRequest.newBuilder() .setParent( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .setAnnotation(Annotation.newBuilder().build()) .setAnnotationId("annotationId251782314") .build(); Annotation response = warehouseClient.createAnnotation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createAnnotationCallable
Creates annotation inside asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CreateAnnotationRequest request = CreateAnnotationRequest.newBuilder() .setParent( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .setAnnotation(Annotation.newBuilder().build()) .setAnnotationId("annotationId251782314") .build(); ApiFuture<Annotation> future = warehouseClient.createAnnotationCallable().futureCall(request); // Do something. Annotation response = future.get(); } -
getAnnotation
Reads annotation inside asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { AnnotationName name = AnnotationName.of( "[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]", "[ANNOTATION]"); Annotation response = warehouseClient.getAnnotation(name); }- Parameters:
name- Required. The name of the annotation to retrieve. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}`- Throws:
ApiException- if the remote call fails
-
getAnnotation
Reads annotation inside asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String name = AnnotationName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]", "[ANNOTATION]") .toString(); Annotation response = warehouseClient.getAnnotation(name); }- Parameters:
name- Required. The name of the annotation to retrieve. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}`- Throws:
ApiException- if the remote call fails
-
getAnnotation
Reads annotation inside asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GetAnnotationRequest request = GetAnnotationRequest.newBuilder() .setName( AnnotationName.of( "[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]", "[ANNOTATION]") .toString()) .build(); Annotation response = warehouseClient.getAnnotation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getAnnotationCallable
Reads annotation inside asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GetAnnotationRequest request = GetAnnotationRequest.newBuilder() .setName( AnnotationName.of( "[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]", "[ANNOTATION]") .toString()) .build(); ApiFuture<Annotation> future = warehouseClient.getAnnotationCallable().futureCall(request); // Do something. Annotation response = future.get(); } -
listAnnotations
Lists a list of annotations inside asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { AssetName parent = AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]"); for (Annotation element : warehouseClient.listAnnotations(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- The parent, which owns this collection of annotations. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}`- Throws:
ApiException- if the remote call fails
-
listAnnotations
Lists a list of annotations inside asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String parent = AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString(); for (Annotation element : warehouseClient.listAnnotations(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- The parent, which owns this collection of annotations. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}`- Throws:
ApiException- if the remote call fails
-
listAnnotations
public final WarehouseClient.ListAnnotationsPagedResponse listAnnotations(ListAnnotationsRequest request) Lists a list of annotations inside asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListAnnotationsRequest request = ListAnnotationsRequest.newBuilder() .setParent( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); for (Annotation element : warehouseClient.listAnnotations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listAnnotationsPagedCallable
public final UnaryCallable<ListAnnotationsRequest,WarehouseClient.ListAnnotationsPagedResponse> listAnnotationsPagedCallable()Lists a list of annotations inside asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListAnnotationsRequest request = ListAnnotationsRequest.newBuilder() .setParent( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); ApiFuture<Annotation> future = warehouseClient.listAnnotationsPagedCallable().futureCall(request); // Do something. for (Annotation element : future.get().iterateAll()) { // doThingsWith(element); } } -
listAnnotationsCallable
public final UnaryCallable<ListAnnotationsRequest,ListAnnotationsResponse> listAnnotationsCallable()Lists a list of annotations inside asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListAnnotationsRequest request = ListAnnotationsRequest.newBuilder() .setParent( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); while (true) { ListAnnotationsResponse response = warehouseClient.listAnnotationsCallable().call(request); for (Annotation element : response.getAnnotationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
updateAnnotation
public final Annotation updateAnnotation(Annotation annotation, com.google.protobuf.FieldMask updateMask) Updates annotation inside asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { Annotation annotation = Annotation.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Annotation response = warehouseClient.updateAnnotation(annotation, updateMask); }- Parameters:
annotation- Required. The annotation to update. The annotation's `name` field is used to identify the annotation to be updated. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}`updateMask- The list of fields to be updated.- Throws:
ApiException- if the remote call fails
-
updateAnnotation
Updates annotation inside asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UpdateAnnotationRequest request = UpdateAnnotationRequest.newBuilder() .setAnnotation(Annotation.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Annotation response = warehouseClient.updateAnnotation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateAnnotationCallable
Updates annotation inside asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UpdateAnnotationRequest request = UpdateAnnotationRequest.newBuilder() .setAnnotation(Annotation.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Annotation> future = warehouseClient.updateAnnotationCallable().futureCall(request); // Do something. Annotation response = future.get(); } -
deleteAnnotation
Deletes annotation inside asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { AnnotationName name = AnnotationName.of( "[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]", "[ANNOTATION]"); warehouseClient.deleteAnnotation(name); }- Parameters:
name- Required. The name of the annotation to delete. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}`- Throws:
ApiException- if the remote call fails
-
deleteAnnotation
Deletes annotation inside asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String name = AnnotationName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]", "[ANNOTATION]") .toString(); warehouseClient.deleteAnnotation(name); }- Parameters:
name- Required. The name of the annotation to delete. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}`- Throws:
ApiException- if the remote call fails
-
deleteAnnotation
Deletes annotation inside asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeleteAnnotationRequest request = DeleteAnnotationRequest.newBuilder() .setName( AnnotationName.of( "[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]", "[ANNOTATION]") .toString()) .build(); warehouseClient.deleteAnnotation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteAnnotationCallable
public final UnaryCallable<DeleteAnnotationRequest,com.google.protobuf.Empty> deleteAnnotationCallable()Deletes annotation inside asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeleteAnnotationRequest request = DeleteAnnotationRequest.newBuilder() .setName( AnnotationName.of( "[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]", "[ANNOTATION]") .toString()) .build(); ApiFuture<Empty> future = warehouseClient.deleteAnnotationCallable().futureCall(request); // Do something. future.get(); } -
ingestAssetCallable
Ingests data for the asset. It is not allowed to ingest a data chunk which is already expired according to TTL. This method is only available via the gRPC API (not HTTP since bi-directional streaming is not supported via HTTP).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 (WarehouseClient warehouseClient = WarehouseClient.create()) { BidiStream<IngestAssetRequest, IngestAssetResponse> bidiStream = warehouseClient.ingestAssetCallable().call(); IngestAssetRequest request = IngestAssetRequest.newBuilder().build(); bidiStream.send(request); for (IngestAssetResponse response : bidiStream) { // Do something when a response is received. } } -
clipAsset
Supported by STREAM_VIDEO corpus type. Generates clips for downloading. The api takes in a time range, and generates a clip of the first content available after start_time and before end_time, which may overflow beyond these bounds. Returned clips are truncated if the total size of the clips are larger than 100MB.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ClipAssetRequest request = ClipAssetRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .setTemporalPartition(Partition.TemporalPartition.newBuilder().build()) .build(); ClipAssetResponse response = warehouseClient.clipAsset(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
clipAssetCallable
Supported by STREAM_VIDEO corpus type. Generates clips for downloading. The api takes in a time range, and generates a clip of the first content available after start_time and before end_time, which may overflow beyond these bounds. Returned clips are truncated if the total size of the clips are larger than 100MB.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ClipAssetRequest request = ClipAssetRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .setTemporalPartition(Partition.TemporalPartition.newBuilder().build()) .build(); ApiFuture<ClipAssetResponse> future = warehouseClient.clipAssetCallable().futureCall(request); // Do something. ClipAssetResponse response = future.get(); } -
generateHlsUri
Generates a uri for an HLS manifest. The api takes in a collection of time ranges, and generates a URI for an HLS manifest that covers all the requested time ranges.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GenerateHlsUriRequest request = GenerateHlsUriRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .addAllTemporalPartitions(new ArrayList<Partition.TemporalPartition>()) .setLiveViewEnabled(true) .build(); GenerateHlsUriResponse response = warehouseClient.generateHlsUri(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
generateHlsUriCallable
Generates a uri for an HLS manifest. The api takes in a collection of time ranges, and generates a URI for an HLS manifest that covers all the requested time ranges.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GenerateHlsUriRequest request = GenerateHlsUriRequest.newBuilder() .setName( AssetName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[ASSET]").toString()) .addAllTemporalPartitions(new ArrayList<Partition.TemporalPartition>()) .setLiveViewEnabled(true) .build(); ApiFuture<GenerateHlsUriResponse> future = warehouseClient.generateHlsUriCallable().futureCall(request); // Do something. GenerateHlsUriResponse response = future.get(); } -
importAssetsAsync
public final OperationFuture<ImportAssetsResponse,ImportAssetsMetadata> importAssetsAsync(ImportAssetsRequest request) Imports assets (images plus annotations) from a meta file on cloud storage. Each row in the meta file is corresponding to an image (specified by a cloud storage uri) and its annotations.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ImportAssetsRequest request = ImportAssetsRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .build(); ImportAssetsResponse response = warehouseClient.importAssetsAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
importAssetsOperationCallable
public final OperationCallable<ImportAssetsRequest,ImportAssetsResponse, importAssetsOperationCallable()ImportAssetsMetadata> Imports assets (images plus annotations) from a meta file on cloud storage. Each row in the meta file is corresponding to an image (specified by a cloud storage uri) and its annotations.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ImportAssetsRequest request = ImportAssetsRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .build(); OperationFuture<ImportAssetsResponse, ImportAssetsMetadata> future = warehouseClient.importAssetsOperationCallable().futureCall(request); // Do something. ImportAssetsResponse response = future.get(); } -
importAssetsCallable
Imports assets (images plus annotations) from a meta file on cloud storage. Each row in the meta file is corresponding to an image (specified by a cloud storage uri) and its annotations.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ImportAssetsRequest request = ImportAssetsRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .build(); ApiFuture<Operation> future = warehouseClient.importAssetsCallable().futureCall(request); // Do something. Operation response = future.get(); } -
createSearchConfig
public final SearchConfig createSearchConfig(CorpusName parent, SearchConfig searchConfig, String searchConfigId) Creates a search configuration inside a corpus.Please follow the rules below to create a valid CreateSearchConfigRequest. --- General Rules --- 1. Request.search_config_id must not be associated with an existing SearchConfig. 2. Request must contain at least one non-empty search_criteria_property or facet_property. 3. mapped_fields must not be empty, and must map to existing UGA keys. 4. All mapped_fields must be of the same type. 5. All mapped_fields must share the same granularity. 6. All mapped_fields must share the same semantic SearchConfig match options. For property-specific rules, please reference the comments for FacetProperty and SearchCriteriaProperty.
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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CorpusName parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]"); SearchConfig searchConfig = SearchConfig.newBuilder().build(); String searchConfigId = "searchConfigId1576297925"; SearchConfig response = warehouseClient.createSearchConfig(parent, searchConfig, searchConfigId); }- Parameters:
parent- Required. The parent resource where this search configuration will be created. Format: `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}`searchConfig- Required. The search config to create.searchConfigId- Required. ID to use for the new search config. Will become the final component of the SearchConfig's resource name. This value should be up to 63 characters, and valid characters are /[a-z][0-9]-_/. The first character must be a letter, the last could be a letter or a number.- Throws:
ApiException- if the remote call fails
-
createSearchConfig
public final SearchConfig createSearchConfig(String parent, SearchConfig searchConfig, String searchConfigId) Creates a search configuration inside a corpus.Please follow the rules below to create a valid CreateSearchConfigRequest. --- General Rules --- 1. Request.search_config_id must not be associated with an existing SearchConfig. 2. Request must contain at least one non-empty search_criteria_property or facet_property. 3. mapped_fields must not be empty, and must map to existing UGA keys. 4. All mapped_fields must be of the same type. 5. All mapped_fields must share the same granularity. 6. All mapped_fields must share the same semantic SearchConfig match options. For property-specific rules, please reference the comments for FacetProperty and SearchCriteriaProperty.
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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString(); SearchConfig searchConfig = SearchConfig.newBuilder().build(); String searchConfigId = "searchConfigId1576297925"; SearchConfig response = warehouseClient.createSearchConfig(parent, searchConfig, searchConfigId); }- Parameters:
parent- Required. The parent resource where this search configuration will be created. Format: `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}`searchConfig- Required. The search config to create.searchConfigId- Required. ID to use for the new search config. Will become the final component of the SearchConfig's resource name. This value should be up to 63 characters, and valid characters are /[a-z][0-9]-_/. The first character must be a letter, the last could be a letter or a number.- Throws:
ApiException- if the remote call fails
-
createSearchConfig
Creates a search configuration inside a corpus.Please follow the rules below to create a valid CreateSearchConfigRequest. --- General Rules --- 1. Request.search_config_id must not be associated with an existing SearchConfig. 2. Request must contain at least one non-empty search_criteria_property or facet_property. 3. mapped_fields must not be empty, and must map to existing UGA keys. 4. All mapped_fields must be of the same type. 5. All mapped_fields must share the same granularity. 6. All mapped_fields must share the same semantic SearchConfig match options. For property-specific rules, please reference the comments for FacetProperty and SearchCriteriaProperty.
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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CreateSearchConfigRequest request = CreateSearchConfigRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setSearchConfig(SearchConfig.newBuilder().build()) .setSearchConfigId("searchConfigId1576297925") .build(); SearchConfig response = warehouseClient.createSearchConfig(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createSearchConfigCallable
Creates a search configuration inside a corpus.Please follow the rules below to create a valid CreateSearchConfigRequest. --- General Rules --- 1. Request.search_config_id must not be associated with an existing SearchConfig. 2. Request must contain at least one non-empty search_criteria_property or facet_property. 3. mapped_fields must not be empty, and must map to existing UGA keys. 4. All mapped_fields must be of the same type. 5. All mapped_fields must share the same granularity. 6. All mapped_fields must share the same semantic SearchConfig match options. For property-specific rules, please reference the comments for FacetProperty and SearchCriteriaProperty.
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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CreateSearchConfigRequest request = CreateSearchConfigRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setSearchConfig(SearchConfig.newBuilder().build()) .setSearchConfigId("searchConfigId1576297925") .build(); ApiFuture<SearchConfig> future = warehouseClient.createSearchConfigCallable().futureCall(request); // Do something. SearchConfig response = future.get(); } -
updateSearchConfig
public final SearchConfig updateSearchConfig(SearchConfig searchConfig, com.google.protobuf.FieldMask updateMask) Updates a search configuration inside a corpus.Please follow the rules below to create a valid UpdateSearchConfigRequest. --- General Rules --- 1. Request.search_configuration.name must already exist. 2. Request must contain at least one non-empty search_criteria_property or facet_property. 3. mapped_fields must not be empty, and must map to existing UGA keys. 4. All mapped_fields must be of the same type. 5. All mapped_fields must share the same granularity. 6. All mapped_fields must share the same semantic SearchConfig match options. For property-specific rules, please reference the comments for FacetProperty and SearchCriteriaProperty.
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 (WarehouseClient warehouseClient = WarehouseClient.create()) { SearchConfig searchConfig = SearchConfig.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); SearchConfig response = warehouseClient.updateSearchConfig(searchConfig, updateMask); }- Parameters:
searchConfig- Required. The search configuration to update.The search configuration's `name` field is used to identify the resource to be updated. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}`
updateMask- The list of fields to be updated. If left unset, all field paths will be updated/overwritten.- Throws:
ApiException- if the remote call fails
-
updateSearchConfig
Updates a search configuration inside a corpus.Please follow the rules below to create a valid UpdateSearchConfigRequest. --- General Rules --- 1. Request.search_configuration.name must already exist. 2. Request must contain at least one non-empty search_criteria_property or facet_property. 3. mapped_fields must not be empty, and must map to existing UGA keys. 4. All mapped_fields must be of the same type. 5. All mapped_fields must share the same granularity. 6. All mapped_fields must share the same semantic SearchConfig match options. For property-specific rules, please reference the comments for FacetProperty and SearchCriteriaProperty.
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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UpdateSearchConfigRequest request = UpdateSearchConfigRequest.newBuilder() .setSearchConfig(SearchConfig.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); SearchConfig response = warehouseClient.updateSearchConfig(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateSearchConfigCallable
Updates a search configuration inside a corpus.Please follow the rules below to create a valid UpdateSearchConfigRequest. --- General Rules --- 1. Request.search_configuration.name must already exist. 2. Request must contain at least one non-empty search_criteria_property or facet_property. 3. mapped_fields must not be empty, and must map to existing UGA keys. 4. All mapped_fields must be of the same type. 5. All mapped_fields must share the same granularity. 6. All mapped_fields must share the same semantic SearchConfig match options. For property-specific rules, please reference the comments for FacetProperty and SearchCriteriaProperty.
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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UpdateSearchConfigRequest request = UpdateSearchConfigRequest.newBuilder() .setSearchConfig(SearchConfig.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<SearchConfig> future = warehouseClient.updateSearchConfigCallable().futureCall(request); // Do something. SearchConfig response = future.get(); } -
getSearchConfig
Gets a search configuration inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { SearchConfigName name = SearchConfigName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[SEARCH_CONFIG]"); SearchConfig response = warehouseClient.getSearchConfig(name); }- Parameters:
name- Required. The name of the search configuration to retrieve. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}`- Throws:
ApiException- if the remote call fails
-
getSearchConfig
Gets a search configuration inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String name = SearchConfigName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[SEARCH_CONFIG]") .toString(); SearchConfig response = warehouseClient.getSearchConfig(name); }- Parameters:
name- Required. The name of the search configuration to retrieve. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}`- Throws:
ApiException- if the remote call fails
-
getSearchConfig
Gets a search configuration inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GetSearchConfigRequest request = GetSearchConfigRequest.newBuilder() .setName( SearchConfigName.of( "[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[SEARCH_CONFIG]") .toString()) .build(); SearchConfig response = warehouseClient.getSearchConfig(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getSearchConfigCallable
Gets a search configuration inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GetSearchConfigRequest request = GetSearchConfigRequest.newBuilder() .setName( SearchConfigName.of( "[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[SEARCH_CONFIG]") .toString()) .build(); ApiFuture<SearchConfig> future = warehouseClient.getSearchConfigCallable().futureCall(request); // Do something. SearchConfig response = future.get(); } -
deleteSearchConfig
Deletes a search configuration inside a corpus.For a DeleteSearchConfigRequest to be valid, Request.search_configuration.name must already 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 (WarehouseClient warehouseClient = WarehouseClient.create()) { SearchConfigName name = SearchConfigName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[SEARCH_CONFIG]"); warehouseClient.deleteSearchConfig(name); }- Parameters:
name- Required. The name of the search configuration to delete. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}`- Throws:
ApiException- if the remote call fails
-
deleteSearchConfig
Deletes a search configuration inside a corpus.For a DeleteSearchConfigRequest to be valid, Request.search_configuration.name must already 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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String name = SearchConfigName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[SEARCH_CONFIG]") .toString(); warehouseClient.deleteSearchConfig(name); }- Parameters:
name- Required. The name of the search configuration to delete. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}`- Throws:
ApiException- if the remote call fails
-
deleteSearchConfig
Deletes a search configuration inside a corpus.For a DeleteSearchConfigRequest to be valid, Request.search_configuration.name must already 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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeleteSearchConfigRequest request = DeleteSearchConfigRequest.newBuilder() .setName( SearchConfigName.of( "[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[SEARCH_CONFIG]") .toString()) .build(); warehouseClient.deleteSearchConfig(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteSearchConfigCallable
public final UnaryCallable<DeleteSearchConfigRequest,com.google.protobuf.Empty> deleteSearchConfigCallable()Deletes a search configuration inside a corpus.For a DeleteSearchConfigRequest to be valid, Request.search_configuration.name must already 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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeleteSearchConfigRequest request = DeleteSearchConfigRequest.newBuilder() .setName( SearchConfigName.of( "[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[SEARCH_CONFIG]") .toString()) .build(); ApiFuture<Empty> future = warehouseClient.deleteSearchConfigCallable().futureCall(request); // Do something. future.get(); } -
listSearchConfigs
Lists all search configurations inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CorpusName parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]"); for (SearchConfig element : warehouseClient.listSearchConfigs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of search configurations. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}`- Throws:
ApiException- if the remote call fails
-
listSearchConfigs
Lists all search configurations inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString(); for (SearchConfig element : warehouseClient.listSearchConfigs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of search configurations. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}`- Throws:
ApiException- if the remote call fails
-
listSearchConfigs
public final WarehouseClient.ListSearchConfigsPagedResponse listSearchConfigs(ListSearchConfigsRequest request) Lists all search configurations inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListSearchConfigsRequest request = ListSearchConfigsRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (SearchConfig element : warehouseClient.listSearchConfigs(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listSearchConfigsPagedCallable
public final UnaryCallable<ListSearchConfigsRequest,WarehouseClient.ListSearchConfigsPagedResponse> listSearchConfigsPagedCallable()Lists all search configurations inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListSearchConfigsRequest request = ListSearchConfigsRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<SearchConfig> future = warehouseClient.listSearchConfigsPagedCallable().futureCall(request); // Do something. for (SearchConfig element : future.get().iterateAll()) { // doThingsWith(element); } } -
listSearchConfigsCallable
public final UnaryCallable<ListSearchConfigsRequest,ListSearchConfigsResponse> listSearchConfigsCallable()Lists all search configurations inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListSearchConfigsRequest request = ListSearchConfigsRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListSearchConfigsResponse response = warehouseClient.listSearchConfigsCallable().call(request); for (SearchConfig element : response.getSearchConfigsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
createSearchHypernym
public final SearchHypernym createSearchHypernym(CorpusName parent, SearchHypernym searchHypernym, String searchHypernymId) Creates a SearchHypernym inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CorpusName parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]"); SearchHypernym searchHypernym = SearchHypernym.newBuilder().build(); String searchHypernymId = "searchHypernymId-314707559"; SearchHypernym response = warehouseClient.createSearchHypernym(parent, searchHypernym, searchHypernymId); }- Parameters:
parent- Required. The parent resource where this SearchHypernym will be created. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}`searchHypernym- Required. The SearchHypernym to create.searchHypernymId- Optional. The search hypernym id. If omitted, a random UUID will be generated.- Throws:
ApiException- if the remote call fails
-
createSearchHypernym
public final SearchHypernym createSearchHypernym(String parent, SearchHypernym searchHypernym, String searchHypernymId) Creates a SearchHypernym inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString(); SearchHypernym searchHypernym = SearchHypernym.newBuilder().build(); String searchHypernymId = "searchHypernymId-314707559"; SearchHypernym response = warehouseClient.createSearchHypernym(parent, searchHypernym, searchHypernymId); }- Parameters:
parent- Required. The parent resource where this SearchHypernym will be created. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}`searchHypernym- Required. The SearchHypernym to create.searchHypernymId- Optional. The search hypernym id. If omitted, a random UUID will be generated.- Throws:
ApiException- if the remote call fails
-
createSearchHypernym
Creates a SearchHypernym inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CreateSearchHypernymRequest request = CreateSearchHypernymRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setSearchHypernym(SearchHypernym.newBuilder().build()) .setSearchHypernymId("searchHypernymId-314707559") .build(); SearchHypernym response = warehouseClient.createSearchHypernym(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createSearchHypernymCallable
public final UnaryCallable<CreateSearchHypernymRequest,SearchHypernym> createSearchHypernymCallable()Creates a SearchHypernym inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CreateSearchHypernymRequest request = CreateSearchHypernymRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setSearchHypernym(SearchHypernym.newBuilder().build()) .setSearchHypernymId("searchHypernymId-314707559") .build(); ApiFuture<SearchHypernym> future = warehouseClient.createSearchHypernymCallable().futureCall(request); // Do something. SearchHypernym response = future.get(); } -
updateSearchHypernym
public final SearchHypernym updateSearchHypernym(SearchHypernym searchHypernym, com.google.protobuf.FieldMask updateMask) Updates a SearchHypernym inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { SearchHypernym searchHypernym = SearchHypernym.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); SearchHypernym response = warehouseClient.updateSearchHypernym(searchHypernym, updateMask); }- Parameters:
searchHypernym- Required. The SearchHypernym to update. The search hypernym's `name` field is used to identify the search hypernym to be updated. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}`updateMask- The list of fields to be updated. If left unset, all field paths will be updated/overwritten.- Throws:
ApiException- if the remote call fails
-
updateSearchHypernym
Updates a SearchHypernym inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UpdateSearchHypernymRequest request = UpdateSearchHypernymRequest.newBuilder() .setSearchHypernym(SearchHypernym.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); SearchHypernym response = warehouseClient.updateSearchHypernym(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateSearchHypernymCallable
public final UnaryCallable<UpdateSearchHypernymRequest,SearchHypernym> updateSearchHypernymCallable()Updates a SearchHypernym inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UpdateSearchHypernymRequest request = UpdateSearchHypernymRequest.newBuilder() .setSearchHypernym(SearchHypernym.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<SearchHypernym> future = warehouseClient.updateSearchHypernymCallable().futureCall(request); // Do something. SearchHypernym response = future.get(); } -
getSearchHypernym
Gets a SearchHypernym inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { SearchHypernymName name = SearchHypernymName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[SEARCH_HYPERNYM]"); SearchHypernym response = warehouseClient.getSearchHypernym(name); }- Parameters:
name- Required. The name of the SearchHypernym to retrieve. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}`- Throws:
ApiException- if the remote call fails
-
getSearchHypernym
Gets a SearchHypernym inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String name = SearchHypernymName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[SEARCH_HYPERNYM]") .toString(); SearchHypernym response = warehouseClient.getSearchHypernym(name); }- Parameters:
name- Required. The name of the SearchHypernym to retrieve. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}`- Throws:
ApiException- if the remote call fails
-
getSearchHypernym
Gets a SearchHypernym inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GetSearchHypernymRequest request = GetSearchHypernymRequest.newBuilder() .setName( SearchHypernymName.of( "[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[SEARCH_HYPERNYM]") .toString()) .build(); SearchHypernym response = warehouseClient.getSearchHypernym(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getSearchHypernymCallable
Gets a SearchHypernym inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GetSearchHypernymRequest request = GetSearchHypernymRequest.newBuilder() .setName( SearchHypernymName.of( "[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[SEARCH_HYPERNYM]") .toString()) .build(); ApiFuture<SearchHypernym> future = warehouseClient.getSearchHypernymCallable().futureCall(request); // Do something. SearchHypernym response = future.get(); } -
deleteSearchHypernym
Deletes a SearchHypernym inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { SearchHypernymName name = SearchHypernymName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[SEARCH_HYPERNYM]"); warehouseClient.deleteSearchHypernym(name); }- Parameters:
name- Required. The name of the SearchHypernym to delete. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}`- Throws:
ApiException- if the remote call fails
-
deleteSearchHypernym
Deletes a SearchHypernym inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String name = SearchHypernymName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[SEARCH_HYPERNYM]") .toString(); warehouseClient.deleteSearchHypernym(name); }- Parameters:
name- Required. The name of the SearchHypernym to delete. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}`- Throws:
ApiException- if the remote call fails
-
deleteSearchHypernym
Deletes a SearchHypernym inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeleteSearchHypernymRequest request = DeleteSearchHypernymRequest.newBuilder() .setName( SearchHypernymName.of( "[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[SEARCH_HYPERNYM]") .toString()) .build(); warehouseClient.deleteSearchHypernym(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteSearchHypernymCallable
public final UnaryCallable<DeleteSearchHypernymRequest,com.google.protobuf.Empty> deleteSearchHypernymCallable()Deletes a SearchHypernym inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeleteSearchHypernymRequest request = DeleteSearchHypernymRequest.newBuilder() .setName( SearchHypernymName.of( "[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[SEARCH_HYPERNYM]") .toString()) .build(); ApiFuture<Empty> future = warehouseClient.deleteSearchHypernymCallable().futureCall(request); // Do something. future.get(); } -
listSearchHypernyms
public final WarehouseClient.ListSearchHypernymsPagedResponse listSearchHypernyms(CorpusName parent) Lists SearchHypernyms inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CorpusName parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]"); for (SearchHypernym element : warehouseClient.listSearchHypernyms(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of SearchHypernyms. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}`- Throws:
ApiException- if the remote call fails
-
listSearchHypernyms
Lists SearchHypernyms inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString(); for (SearchHypernym element : warehouseClient.listSearchHypernyms(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of SearchHypernyms. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}`- Throws:
ApiException- if the remote call fails
-
listSearchHypernyms
public final WarehouseClient.ListSearchHypernymsPagedResponse listSearchHypernyms(ListSearchHypernymsRequest request) Lists SearchHypernyms inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListSearchHypernymsRequest request = ListSearchHypernymsRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (SearchHypernym element : warehouseClient.listSearchHypernyms(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listSearchHypernymsPagedCallable
public final UnaryCallable<ListSearchHypernymsRequest,WarehouseClient.ListSearchHypernymsPagedResponse> listSearchHypernymsPagedCallable()Lists SearchHypernyms inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListSearchHypernymsRequest request = ListSearchHypernymsRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<SearchHypernym> future = warehouseClient.listSearchHypernymsPagedCallable().futureCall(request); // Do something. for (SearchHypernym element : future.get().iterateAll()) { // doThingsWith(element); } } -
listSearchHypernymsCallable
public final UnaryCallable<ListSearchHypernymsRequest,ListSearchHypernymsResponse> listSearchHypernymsCallable()Lists SearchHypernyms inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListSearchHypernymsRequest request = ListSearchHypernymsRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListSearchHypernymsResponse response = warehouseClient.listSearchHypernymsCallable().call(request); for (SearchHypernym element : response.getSearchHypernymsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
searchAssets
Search media asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { SearchAssetsRequest request = SearchAssetsRequest.newBuilder() .setCorpus(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setContentTimeRanges(DateTimeRangeArray.newBuilder().build()) .addAllCriteria(new ArrayList<Criteria>()) .addAllFacetSelections(new ArrayList<FacetGroup>()) .addAllResultAnnotationKeys(new ArrayList<String>()) .setSearchQuery("searchQuery-552137728") .build(); for (SearchResultItem element : warehouseClient.searchAssets(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
searchAssetsPagedCallable
public final UnaryCallable<SearchAssetsRequest,WarehouseClient.SearchAssetsPagedResponse> searchAssetsPagedCallable()Search media asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { SearchAssetsRequest request = SearchAssetsRequest.newBuilder() .setCorpus(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setContentTimeRanges(DateTimeRangeArray.newBuilder().build()) .addAllCriteria(new ArrayList<Criteria>()) .addAllFacetSelections(new ArrayList<FacetGroup>()) .addAllResultAnnotationKeys(new ArrayList<String>()) .setSearchQuery("searchQuery-552137728") .build(); ApiFuture<SearchResultItem> future = warehouseClient.searchAssetsPagedCallable().futureCall(request); // Do something. for (SearchResultItem element : future.get().iterateAll()) { // doThingsWith(element); } } -
searchAssetsCallable
Search media asset.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { SearchAssetsRequest request = SearchAssetsRequest.newBuilder() .setCorpus(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setContentTimeRanges(DateTimeRangeArray.newBuilder().build()) .addAllCriteria(new ArrayList<Criteria>()) .addAllFacetSelections(new ArrayList<FacetGroup>()) .addAllResultAnnotationKeys(new ArrayList<String>()) .setSearchQuery("searchQuery-552137728") .build(); while (true) { SearchAssetsResponse response = warehouseClient.searchAssetsCallable().call(request); for (SearchResultItem element : response.getSearchResultItemsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
searchIndexEndpoint
public final WarehouseClient.SearchIndexEndpointPagedResponse searchIndexEndpoint(SearchIndexEndpointRequest request) Search a deployed index endpoint (IMAGE corpus type only).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 (WarehouseClient warehouseClient = WarehouseClient.create()) { SearchIndexEndpointRequest request = SearchIndexEndpointRequest.newBuilder() .setIndexEndpoint( IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString()) .addAllCriteria(new ArrayList<Criteria>()) .addAllExclusionCriteria(new ArrayList<Criteria>()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (SearchResultItem element : warehouseClient.searchIndexEndpoint(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
searchIndexEndpointPagedCallable
public final UnaryCallable<SearchIndexEndpointRequest,WarehouseClient.SearchIndexEndpointPagedResponse> searchIndexEndpointPagedCallable()Search a deployed index endpoint (IMAGE corpus type only).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 (WarehouseClient warehouseClient = WarehouseClient.create()) { SearchIndexEndpointRequest request = SearchIndexEndpointRequest.newBuilder() .setIndexEndpoint( IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString()) .addAllCriteria(new ArrayList<Criteria>()) .addAllExclusionCriteria(new ArrayList<Criteria>()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<SearchResultItem> future = warehouseClient.searchIndexEndpointPagedCallable().futureCall(request); // Do something. for (SearchResultItem element : future.get().iterateAll()) { // doThingsWith(element); } } -
searchIndexEndpointCallable
public final UnaryCallable<SearchIndexEndpointRequest,SearchIndexEndpointResponse> searchIndexEndpointCallable()Search a deployed index endpoint (IMAGE corpus type only).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 (WarehouseClient warehouseClient = WarehouseClient.create()) { SearchIndexEndpointRequest request = SearchIndexEndpointRequest.newBuilder() .setIndexEndpoint( IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString()) .addAllCriteria(new ArrayList<Criteria>()) .addAllExclusionCriteria(new ArrayList<Criteria>()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { SearchIndexEndpointResponse response = warehouseClient.searchIndexEndpointCallable().call(request); for (SearchResultItem element : response.getSearchResultItemsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
createIndexEndpointAsync
public final OperationFuture<IndexEndpoint,CreateIndexEndpointMetadata> createIndexEndpointAsync(LocationName parent, IndexEndpoint indexEndpoint, String indexEndpointId) Creates an IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); IndexEndpoint indexEndpoint = IndexEndpoint.newBuilder().build(); String indexEndpointId = "indexEndpointId-250889214"; IndexEndpoint response = warehouseClient.createIndexEndpointAsync(parent, indexEndpoint, indexEndpointId).get(); }- Parameters:
parent- Required. Format: `projects/{project}/locations/{location}`indexEndpoint- Required. The resource being created.indexEndpointId- Optional. The ID to use for the IndexEndpoint, which will become the final component of the IndexEndpoint's resource name if the user specifies it. Otherwise, IndexEndpoint id will be autogenerated.This value should be up to 63 characters, and valid characters are a-z, 0-9 and dash (-). The first character must be a letter, the last must be a letter or a number.
- Throws:
ApiException- if the remote call fails
-
createIndexEndpointAsync
public final OperationFuture<IndexEndpoint,CreateIndexEndpointMetadata> createIndexEndpointAsync(String parent, IndexEndpoint indexEndpoint, String indexEndpointId) Creates an IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); IndexEndpoint indexEndpoint = IndexEndpoint.newBuilder().build(); String indexEndpointId = "indexEndpointId-250889214"; IndexEndpoint response = warehouseClient.createIndexEndpointAsync(parent, indexEndpoint, indexEndpointId).get(); }- Parameters:
parent- Required. Format: `projects/{project}/locations/{location}`indexEndpoint- Required. The resource being created.indexEndpointId- Optional. The ID to use for the IndexEndpoint, which will become the final component of the IndexEndpoint's resource name if the user specifies it. Otherwise, IndexEndpoint id will be autogenerated.This value should be up to 63 characters, and valid characters are a-z, 0-9 and dash (-). The first character must be a letter, the last must be a letter or a number.
- Throws:
ApiException- if the remote call fails
-
createIndexEndpointAsync
public final OperationFuture<IndexEndpoint,CreateIndexEndpointMetadata> createIndexEndpointAsync(CreateIndexEndpointRequest request) Creates an IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CreateIndexEndpointRequest request = CreateIndexEndpointRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setIndexEndpointId("indexEndpointId-250889214") .setIndexEndpoint(IndexEndpoint.newBuilder().build()) .build(); IndexEndpoint response = warehouseClient.createIndexEndpointAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createIndexEndpointOperationCallable
public final OperationCallable<CreateIndexEndpointRequest,IndexEndpoint, createIndexEndpointOperationCallable()CreateIndexEndpointMetadata> Creates an IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CreateIndexEndpointRequest request = CreateIndexEndpointRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setIndexEndpointId("indexEndpointId-250889214") .setIndexEndpoint(IndexEndpoint.newBuilder().build()) .build(); OperationFuture<IndexEndpoint, CreateIndexEndpointMetadata> future = warehouseClient.createIndexEndpointOperationCallable().futureCall(request); // Do something. IndexEndpoint response = future.get(); } -
createIndexEndpointCallable
Creates an IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CreateIndexEndpointRequest request = CreateIndexEndpointRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setIndexEndpointId("indexEndpointId-250889214") .setIndexEndpoint(IndexEndpoint.newBuilder().build()) .build(); ApiFuture<Operation> future = warehouseClient.createIndexEndpointCallable().futureCall(request); // Do something. Operation response = future.get(); } -
getIndexEndpoint
Gets an IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { IndexEndpointName name = IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]"); IndexEndpoint response = warehouseClient.getIndexEndpoint(name); }- Parameters:
name- Required. Name of the IndexEndpoint resource.- Throws:
ApiException- if the remote call fails
-
getIndexEndpoint
Gets an IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String name = IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString(); IndexEndpoint response = warehouseClient.getIndexEndpoint(name); }- Parameters:
name- Required. Name of the IndexEndpoint resource.- Throws:
ApiException- if the remote call fails
-
getIndexEndpoint
Gets an IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GetIndexEndpointRequest request = GetIndexEndpointRequest.newBuilder() .setName( IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString()) .build(); IndexEndpoint response = warehouseClient.getIndexEndpoint(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getIndexEndpointCallable
Gets an IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GetIndexEndpointRequest request = GetIndexEndpointRequest.newBuilder() .setName( IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString()) .build(); ApiFuture<IndexEndpoint> future = warehouseClient.getIndexEndpointCallable().futureCall(request); // Do something. IndexEndpoint response = future.get(); } -
listIndexEndpoints
public final WarehouseClient.ListIndexEndpointsPagedResponse listIndexEndpoints(LocationName parent) Lists all IndexEndpoints in a project.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (IndexEndpoint element : warehouseClient.listIndexEndpoints(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Format: `projects/{project}/locations/{location}`- Throws:
ApiException- if the remote call fails
-
listIndexEndpoints
Lists all IndexEndpoints in a project.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (IndexEndpoint element : warehouseClient.listIndexEndpoints(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Format: `projects/{project}/locations/{location}`- Throws:
ApiException- if the remote call fails
-
listIndexEndpoints
public final WarehouseClient.ListIndexEndpointsPagedResponse listIndexEndpoints(ListIndexEndpointsRequest request) Lists all IndexEndpoints in a project.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListIndexEndpointsRequest request = ListIndexEndpointsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); for (IndexEndpoint element : warehouseClient.listIndexEndpoints(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listIndexEndpointsPagedCallable
public final UnaryCallable<ListIndexEndpointsRequest,WarehouseClient.ListIndexEndpointsPagedResponse> listIndexEndpointsPagedCallable()Lists all IndexEndpoints in a project.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListIndexEndpointsRequest request = ListIndexEndpointsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); ApiFuture<IndexEndpoint> future = warehouseClient.listIndexEndpointsPagedCallable().futureCall(request); // Do something. for (IndexEndpoint element : future.get().iterateAll()) { // doThingsWith(element); } } -
listIndexEndpointsCallable
public final UnaryCallable<ListIndexEndpointsRequest,ListIndexEndpointsResponse> listIndexEndpointsCallable()Lists all IndexEndpoints in a project.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListIndexEndpointsRequest request = ListIndexEndpointsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); while (true) { ListIndexEndpointsResponse response = warehouseClient.listIndexEndpointsCallable().call(request); for (IndexEndpoint element : response.getIndexEndpointsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
updateIndexEndpointAsync
public final OperationFuture<IndexEndpoint,UpdateIndexEndpointMetadata> updateIndexEndpointAsync(IndexEndpoint indexEndpoint, com.google.protobuf.FieldMask updateMask) Updates an IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { IndexEndpoint indexEndpoint = IndexEndpoint.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); IndexEndpoint response = warehouseClient.updateIndexEndpointAsync(indexEndpoint, updateMask).get(); }- Parameters:
indexEndpoint- Required. The resource being updated.updateMask- Required. Field mask is used to specify the fields to be overwritten in the IndexEndpoint resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field of the resource will be overwritten if it is in the mask. Empty field mask is not allowed. If the mask is "*", then this is a full replacement of the resource.- Throws:
ApiException- if the remote call fails
-
updateIndexEndpointAsync
public final OperationFuture<IndexEndpoint,UpdateIndexEndpointMetadata> updateIndexEndpointAsync(UpdateIndexEndpointRequest request) Updates an IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UpdateIndexEndpointRequest request = UpdateIndexEndpointRequest.newBuilder() .setIndexEndpoint(IndexEndpoint.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); IndexEndpoint response = warehouseClient.updateIndexEndpointAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateIndexEndpointOperationCallable
public final OperationCallable<UpdateIndexEndpointRequest,IndexEndpoint, updateIndexEndpointOperationCallable()UpdateIndexEndpointMetadata> Updates an IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UpdateIndexEndpointRequest request = UpdateIndexEndpointRequest.newBuilder() .setIndexEndpoint(IndexEndpoint.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); OperationFuture<IndexEndpoint, UpdateIndexEndpointMetadata> future = warehouseClient.updateIndexEndpointOperationCallable().futureCall(request); // Do something. IndexEndpoint response = future.get(); } -
updateIndexEndpointCallable
Updates an IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UpdateIndexEndpointRequest request = UpdateIndexEndpointRequest.newBuilder() .setIndexEndpoint(IndexEndpoint.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Operation> future = warehouseClient.updateIndexEndpointCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteIndexEndpointAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteIndexEndpointMetadata> deleteIndexEndpointAsync(IndexEndpointName name) Deletes an IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { IndexEndpointName name = IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]"); warehouseClient.deleteIndexEndpointAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
deleteIndexEndpointAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteIndexEndpointMetadata> deleteIndexEndpointAsync(String name) Deletes an IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String name = IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString(); warehouseClient.deleteIndexEndpointAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
deleteIndexEndpointAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteIndexEndpointMetadata> deleteIndexEndpointAsync(DeleteIndexEndpointRequest request) Deletes an IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeleteIndexEndpointRequest request = DeleteIndexEndpointRequest.newBuilder() .setName( IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString()) .build(); warehouseClient.deleteIndexEndpointAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteIndexEndpointOperationCallable
public final OperationCallable<DeleteIndexEndpointRequest,com.google.protobuf.Empty, deleteIndexEndpointOperationCallable()DeleteIndexEndpointMetadata> Deletes an IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeleteIndexEndpointRequest request = DeleteIndexEndpointRequest.newBuilder() .setName( IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString()) .build(); OperationFuture<Empty, DeleteIndexEndpointMetadata> future = warehouseClient.deleteIndexEndpointOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteIndexEndpointCallable
Deletes an IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeleteIndexEndpointRequest request = DeleteIndexEndpointRequest.newBuilder() .setName( IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString()) .build(); ApiFuture<Operation> future = warehouseClient.deleteIndexEndpointCallable().futureCall(request); // Do something. future.get(); } -
deployIndexAsync
public final OperationFuture<DeployIndexResponse,DeployIndexMetadata> deployIndexAsync(DeployIndexRequest request) Deploys an Index to IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeployIndexRequest request = DeployIndexRequest.newBuilder() .setIndexEndpoint( IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString()) .setDeployedIndex(DeployedIndex.newBuilder().build()) .build(); DeployIndexResponse response = warehouseClient.deployIndexAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deployIndexOperationCallable
public final OperationCallable<DeployIndexRequest,DeployIndexResponse, deployIndexOperationCallable()DeployIndexMetadata> Deploys an Index to IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeployIndexRequest request = DeployIndexRequest.newBuilder() .setIndexEndpoint( IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString()) .setDeployedIndex(DeployedIndex.newBuilder().build()) .build(); OperationFuture<DeployIndexResponse, DeployIndexMetadata> future = warehouseClient.deployIndexOperationCallable().futureCall(request); // Do something. DeployIndexResponse response = future.get(); } -
deployIndexCallable
Deploys an Index to IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeployIndexRequest request = DeployIndexRequest.newBuilder() .setIndexEndpoint( IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString()) .setDeployedIndex(DeployedIndex.newBuilder().build()) .build(); ApiFuture<Operation> future = warehouseClient.deployIndexCallable().futureCall(request); // Do something. Operation response = future.get(); } -
undeployIndexAsync
public final OperationFuture<UndeployIndexResponse,UndeployIndexMetadata> undeployIndexAsync(UndeployIndexRequest request) Undeploys an Index from IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UndeployIndexRequest request = UndeployIndexRequest.newBuilder() .setIndexEndpoint( IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString()) .build(); UndeployIndexResponse response = warehouseClient.undeployIndexAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
undeployIndexOperationCallable
public final OperationCallable<UndeployIndexRequest,UndeployIndexResponse, undeployIndexOperationCallable()UndeployIndexMetadata> Undeploys an Index from IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UndeployIndexRequest request = UndeployIndexRequest.newBuilder() .setIndexEndpoint( IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString()) .build(); OperationFuture<UndeployIndexResponse, UndeployIndexMetadata> future = warehouseClient.undeployIndexOperationCallable().futureCall(request); // Do something. UndeployIndexResponse response = future.get(); } -
undeployIndexCallable
Undeploys an Index from IndexEndpoint.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UndeployIndexRequest request = UndeployIndexRequest.newBuilder() .setIndexEndpoint( IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString()) .build(); ApiFuture<Operation> future = warehouseClient.undeployIndexCallable().futureCall(request); // Do something. Operation response = future.get(); } -
createCollectionAsync
public final OperationFuture<Collection,CreateCollectionMetadata> createCollectionAsync(CorpusName parent, Collection collection, String collectionId) Creates a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CorpusName parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]"); Collection collection = Collection.newBuilder().build(); String collectionId = "collectionId1636075609"; Collection response = warehouseClient.createCollectionAsync(parent, collection, collectionId).get(); }- Parameters:
parent- Required. The parent resource where this collection will be created. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}`collection- Required. The collection resource to be created.collectionId- Optional. The ID to use for the collection, which will become the final component of the resource name if user choose to specify. Otherwise, collection id will be generated by system.This value should be up to 55 characters, and valid characters are /[a-z][0-9]-/. The first character must be a letter, the last could be a letter or a number.
- Throws:
ApiException- if the remote call fails
-
createCollectionAsync
public final OperationFuture<Collection,CreateCollectionMetadata> createCollectionAsync(String parent, Collection collection, String collectionId) Creates a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString(); Collection collection = Collection.newBuilder().build(); String collectionId = "collectionId1636075609"; Collection response = warehouseClient.createCollectionAsync(parent, collection, collectionId).get(); }- Parameters:
parent- Required. The parent resource where this collection will be created. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}`collection- Required. The collection resource to be created.collectionId- Optional. The ID to use for the collection, which will become the final component of the resource name if user choose to specify. Otherwise, collection id will be generated by system.This value should be up to 55 characters, and valid characters are /[a-z][0-9]-/. The first character must be a letter, the last could be a letter or a number.
- Throws:
ApiException- if the remote call fails
-
createCollectionAsync
public final OperationFuture<Collection,CreateCollectionMetadata> createCollectionAsync(CreateCollectionRequest request) Creates a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CreateCollectionRequest request = CreateCollectionRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setCollection(Collection.newBuilder().build()) .setCollectionId("collectionId1636075609") .build(); Collection response = warehouseClient.createCollectionAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createCollectionOperationCallable
public final OperationCallable<CreateCollectionRequest,Collection, createCollectionOperationCallable()CreateCollectionMetadata> Creates a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CreateCollectionRequest request = CreateCollectionRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setCollection(Collection.newBuilder().build()) .setCollectionId("collectionId1636075609") .build(); OperationFuture<Collection, CreateCollectionMetadata> future = warehouseClient.createCollectionOperationCallable().futureCall(request); // Do something. Collection response = future.get(); } -
createCollectionCallable
Creates a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CreateCollectionRequest request = CreateCollectionRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setCollection(Collection.newBuilder().build()) .setCollectionId("collectionId1636075609") .build(); ApiFuture<Operation> future = warehouseClient.createCollectionCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteCollectionAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteCollectionMetadata> deleteCollectionAsync(CollectionName name) Deletes a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CollectionName name = CollectionName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[COLLECTION]"); warehouseClient.deleteCollectionAsync(name).get(); }- Parameters:
name- Required. The name of the collection to delete. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}`- Throws:
ApiException- if the remote call fails
-
deleteCollectionAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteCollectionMetadata> deleteCollectionAsync(String name) Deletes a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String name = CollectionName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[COLLECTION]") .toString(); warehouseClient.deleteCollectionAsync(name).get(); }- Parameters:
name- Required. The name of the collection to delete. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}`- Throws:
ApiException- if the remote call fails
-
deleteCollectionAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteCollectionMetadata> deleteCollectionAsync(DeleteCollectionRequest request) Deletes a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeleteCollectionRequest request = DeleteCollectionRequest.newBuilder() .setName( CollectionName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[COLLECTION]") .toString()) .build(); warehouseClient.deleteCollectionAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteCollectionOperationCallable
public final OperationCallable<DeleteCollectionRequest,com.google.protobuf.Empty, deleteCollectionOperationCallable()DeleteCollectionMetadata> Deletes a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeleteCollectionRequest request = DeleteCollectionRequest.newBuilder() .setName( CollectionName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[COLLECTION]") .toString()) .build(); OperationFuture<Empty, DeleteCollectionMetadata> future = warehouseClient.deleteCollectionOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteCollectionCallable
Deletes a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { DeleteCollectionRequest request = DeleteCollectionRequest.newBuilder() .setName( CollectionName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[COLLECTION]") .toString()) .build(); ApiFuture<Operation> future = warehouseClient.deleteCollectionCallable().futureCall(request); // Do something. future.get(); } -
getCollection
Gets a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CollectionName name = CollectionName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[COLLECTION]"); Collection response = warehouseClient.getCollection(name); }- Parameters:
name- Required. The name of the collection to retrieve. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}`- Throws:
ApiException- if the remote call fails
-
getCollection
Gets a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String name = CollectionName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[COLLECTION]") .toString(); Collection response = warehouseClient.getCollection(name); }- Parameters:
name- Required. The name of the collection to retrieve. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}`- Throws:
ApiException- if the remote call fails
-
getCollection
Gets a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GetCollectionRequest request = GetCollectionRequest.newBuilder() .setName( CollectionName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[COLLECTION]") .toString()) .build(); Collection response = warehouseClient.getCollection(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getCollectionCallable
Gets a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GetCollectionRequest request = GetCollectionRequest.newBuilder() .setName( CollectionName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[COLLECTION]") .toString()) .build(); ApiFuture<Collection> future = warehouseClient.getCollectionCallable().futureCall(request); // Do something. Collection response = future.get(); } -
updateCollection
public final Collection updateCollection(Collection collection, com.google.protobuf.FieldMask updateMask) Updates a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { Collection collection = Collection.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Collection response = warehouseClient.updateCollection(collection, updateMask); }- Parameters:
collection- Required. The collection to update.The collection's `name` field is used to identify the collection to be updated. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}`
updateMask- The list of fields to be updated. - Unset `update_mask` or set `update_mask` to be a single "*" only will update all updatable fields with the value provided in `collection`. - To update `display_name` value to empty string, set it in the `collection` to empty string, and set `update_mask` with "display_name". Same applies to other updatable string fields in the `collection`.- Throws:
ApiException- if the remote call fails
-
updateCollection
Updates a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UpdateCollectionRequest request = UpdateCollectionRequest.newBuilder() .setCollection(Collection.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Collection response = warehouseClient.updateCollection(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateCollectionCallable
Updates a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { UpdateCollectionRequest request = UpdateCollectionRequest.newBuilder() .setCollection(Collection.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Collection> future = warehouseClient.updateCollectionCallable().futureCall(request); // Do something. Collection response = future.get(); } -
listCollections
Lists collections inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CorpusName parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]"); for (Collection element : warehouseClient.listCollections(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent corpus. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}`- Throws:
ApiException- if the remote call fails
-
listCollections
Lists collections inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String parent = CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString(); for (Collection element : warehouseClient.listCollections(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent corpus. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}`- Throws:
ApiException- if the remote call fails
-
listCollections
public final WarehouseClient.ListCollectionsPagedResponse listCollections(ListCollectionsRequest request) Lists collections inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListCollectionsRequest request = ListCollectionsRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Collection element : warehouseClient.listCollections(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listCollectionsPagedCallable
public final UnaryCallable<ListCollectionsRequest,WarehouseClient.ListCollectionsPagedResponse> listCollectionsPagedCallable()Lists collections inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListCollectionsRequest request = ListCollectionsRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Collection> future = warehouseClient.listCollectionsPagedCallable().futureCall(request); // Do something. for (Collection element : future.get().iterateAll()) { // doThingsWith(element); } } -
listCollectionsCallable
public final UnaryCallable<ListCollectionsRequest,ListCollectionsResponse> listCollectionsCallable()Lists collections inside a corpus.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListCollectionsRequest request = ListCollectionsRequest.newBuilder() .setParent(CorpusName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListCollectionsResponse response = warehouseClient.listCollectionsCallable().call(request); for (Collection element : response.getCollectionsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
addCollectionItem
Adds an item into a Collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CollectionItem item = CollectionItem.newBuilder().build(); AddCollectionItemResponse response = warehouseClient.addCollectionItem(item); }- Parameters:
item- Required. The item to be added.- Throws:
ApiException- if the remote call fails
-
addCollectionItem
Adds an item into a Collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { AddCollectionItemRequest request = AddCollectionItemRequest.newBuilder() .setItem(CollectionItem.newBuilder().build()) .build(); AddCollectionItemResponse response = warehouseClient.addCollectionItem(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
addCollectionItemCallable
public final UnaryCallable<AddCollectionItemRequest,AddCollectionItemResponse> addCollectionItemCallable()Adds an item into a Collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { AddCollectionItemRequest request = AddCollectionItemRequest.newBuilder() .setItem(CollectionItem.newBuilder().build()) .build(); ApiFuture<AddCollectionItemResponse> future = warehouseClient.addCollectionItemCallable().futureCall(request); // Do something. AddCollectionItemResponse response = future.get(); } -
removeCollectionItem
Removes an item from a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CollectionItem item = CollectionItem.newBuilder().build(); RemoveCollectionItemResponse response = warehouseClient.removeCollectionItem(item); }- Parameters:
item- Required. The item to be removed.- Throws:
ApiException- if the remote call fails
-
removeCollectionItem
Removes an item from a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { RemoveCollectionItemRequest request = RemoveCollectionItemRequest.newBuilder() .setItem(CollectionItem.newBuilder().build()) .build(); RemoveCollectionItemResponse response = warehouseClient.removeCollectionItem(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
removeCollectionItemCallable
public final UnaryCallable<RemoveCollectionItemRequest,RemoveCollectionItemResponse> removeCollectionItemCallable()Removes an item from a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { RemoveCollectionItemRequest request = RemoveCollectionItemRequest.newBuilder() .setItem(CollectionItem.newBuilder().build()) .build(); ApiFuture<RemoveCollectionItemResponse> future = warehouseClient.removeCollectionItemCallable().futureCall(request); // Do something. RemoveCollectionItemResponse response = future.get(); } -
viewCollectionItems
public final WarehouseClient.ViewCollectionItemsPagedResponse viewCollectionItems(CollectionName collection) View items inside a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { CollectionName collection = CollectionName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[COLLECTION]"); for (CollectionItem element : warehouseClient.viewCollectionItems(collection).iterateAll()) { // doThingsWith(element); } }- Parameters:
collection- Required. The collection to view. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}`- Throws:
ApiException- if the remote call fails
-
viewCollectionItems
public final WarehouseClient.ViewCollectionItemsPagedResponse viewCollectionItems(String collection) View items inside a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { String collection = CollectionName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[COLLECTION]") .toString(); for (CollectionItem element : warehouseClient.viewCollectionItems(collection).iterateAll()) { // doThingsWith(element); } }- Parameters:
collection- Required. The collection to view. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}`- Throws:
ApiException- if the remote call fails
-
viewCollectionItems
public final WarehouseClient.ViewCollectionItemsPagedResponse viewCollectionItems(ViewCollectionItemsRequest request) View items inside a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ViewCollectionItemsRequest request = ViewCollectionItemsRequest.newBuilder() .setCollection( CollectionName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[COLLECTION]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (CollectionItem element : warehouseClient.viewCollectionItems(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
viewCollectionItemsPagedCallable
public final UnaryCallable<ViewCollectionItemsRequest,WarehouseClient.ViewCollectionItemsPagedResponse> viewCollectionItemsPagedCallable()View items inside a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ViewCollectionItemsRequest request = ViewCollectionItemsRequest.newBuilder() .setCollection( CollectionName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[COLLECTION]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<CollectionItem> future = warehouseClient.viewCollectionItemsPagedCallable().futureCall(request); // Do something. for (CollectionItem element : future.get().iterateAll()) { // doThingsWith(element); } } -
viewCollectionItemsCallable
public final UnaryCallable<ViewCollectionItemsRequest,ViewCollectionItemsResponse> viewCollectionItemsCallable()View items inside a collection.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ViewCollectionItemsRequest request = ViewCollectionItemsRequest.newBuilder() .setCollection( CollectionName.of("[PROJECT_NUMBER]", "[LOCATION]", "[CORPUS]", "[COLLECTION]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ViewCollectionItemsResponse response = warehouseClient.viewCollectionItemsCallable().call(request); for (CollectionItem element : response.getItemsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
listLocations
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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : warehouseClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listLocationsPagedCallable
public final UnaryCallable<ListLocationsRequest,WarehouseClient.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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = warehouseClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } } -
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 (WarehouseClient warehouseClient = WarehouseClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = warehouseClient.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; } } } -
getLocation
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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = warehouseClient.getLocation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
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 (WarehouseClient warehouseClient = WarehouseClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = warehouseClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-