Package com.google.cloud.retail.v2 (2.4.0)

A client to Retail API

The interfaces provided are listed below, along with usage samples.

CatalogServiceClient

Service Description: Service for managing catalog configuration.

Sample for CatalogServiceClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
   Catalog catalog = Catalog.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Catalog response = catalogServiceClient.updateCatalog(catalog, updateMask);
 }
 

CompletionServiceClient

Service Description: Auto-completion service for retail.

This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

Sample for CompletionServiceClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
   CompleteQueryRequest request =
       CompleteQueryRequest.newBuilder()
           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
           .setQuery("query107944136")
           .setVisitorId("visitorId1880545833")
           .addAllLanguageCodes(new ArrayList<String>())
           .setDeviceType("deviceType781190832")
           .setDataset("dataset1443214456")
           .setMaxSuggestions(618824852)
           .build();
   CompleteQueryResponse response = completionServiceClient.completeQuery(request);
 }
 

PredictionServiceClient

Service Description: Service for making recommendation prediction.

Sample for PredictionServiceClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
   PredictRequest request =
       PredictRequest.newBuilder()
           .setPlacement("placement1792938725")
           .setUserEvent(UserEvent.newBuilder().build())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setValidateOnly(true)
           .putAllParams(new HashMap<String, Value>())
           .putAllLabels(new HashMap<String, String>())
           .build();
   PredictResponse response = predictionServiceClient.predict(request);
 }
 

ProductServiceClient

Service Description: Service for ingesting Product information of the customer's website.

Sample for ProductServiceClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
   BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]");
   Product product = Product.newBuilder().build();
   String productId = "productId-1051830678";
   Product response = productServiceClient.createProduct(parent, product, productId);
 }
 

SearchServiceClient

Service Description: Service for search.

This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

Sample for SearchServiceClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) {
   SearchRequest request =
       SearchRequest.newBuilder()
           .setPlacement("placement1792938725")
           .setBranch(
               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
           .setQuery("query107944136")
           .setVisitorId("visitorId1880545833")
           .setUserInfo(UserInfo.newBuilder().build())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setOffset(-1019779949)
           .setFilter("filter-1274492040")
           .setCanonicalFilter("canonicalFilter-722283124")
           .setOrderBy("orderBy-1207110587")
           .addAllFacetSpecs(new ArrayList<SearchRequest.FacetSpec>())
           .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build())
           .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build())
           .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build())
           .addAllVariantRollupKeys(new ArrayList<String>())
           .addAllPageCategories(new ArrayList<String>())
           .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build())
           .putAllLabels(new HashMap<String, String>())
           .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build())
           .build();
   for (SearchResponse.SearchResult element : searchServiceClient.search(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 

UserEventServiceClient

Service Description: Service for ingesting end user actions on the customer website.

Sample for UserEventServiceClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
   WriteUserEventRequest request =
       WriteUserEventRequest.newBuilder()
           .setParent("parent-995424086")
           .setUserEvent(UserEvent.newBuilder().build())
           .build();
   UserEvent response = userEventServiceClient.writeUserEvent(request);
 }
 

Classes

AddFulfillmentPlacesMetadata

Metadata related to the progress of the AddFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddFulfillmentPlaces method.

Protobuf type google.cloud.retail.v2.AddFulfillmentPlacesMetadata

AddFulfillmentPlacesMetadata.Builder

Metadata related to the progress of the AddFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddFulfillmentPlaces method.

Protobuf type google.cloud.retail.v2.AddFulfillmentPlacesMetadata

AddFulfillmentPlacesRequest

Request message for ProductService.AddFulfillmentPlaces method.

Protobuf type google.cloud.retail.v2.AddFulfillmentPlacesRequest

AddFulfillmentPlacesRequest.Builder

Request message for ProductService.AddFulfillmentPlaces method.

Protobuf type google.cloud.retail.v2.AddFulfillmentPlacesRequest

AddFulfillmentPlacesResponse

Response of the AddFulfillmentPlacesRequest. Currently empty because there is no meaningful response populated from the ProductService.AddFulfillmentPlaces method.

Protobuf type google.cloud.retail.v2.AddFulfillmentPlacesResponse

AddFulfillmentPlacesResponse.Builder

Response of the AddFulfillmentPlacesRequest. Currently empty because there is no meaningful response populated from the ProductService.AddFulfillmentPlaces method.

Protobuf type google.cloud.retail.v2.AddFulfillmentPlacesResponse

AddLocalInventoriesMetadata

Metadata related to the progress of the AddLocalInventories operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddLocalInventories method.

Protobuf type google.cloud.retail.v2.AddLocalInventoriesMetadata

AddLocalInventoriesMetadata.Builder

Metadata related to the progress of the AddLocalInventories operation. Currently empty because there is no meaningful metadata populated from the ProductService.AddLocalInventories method.

Protobuf type google.cloud.retail.v2.AddLocalInventoriesMetadata

AddLocalInventoriesRequest

Request message for ProductService.AddLocalInventories method.

Protobuf type google.cloud.retail.v2.AddLocalInventoriesRequest

AddLocalInventoriesRequest.Builder

Request message for ProductService.AddLocalInventories method.

Protobuf type google.cloud.retail.v2.AddLocalInventoriesRequest

AddLocalInventoriesResponse

Response of the ProductService.AddLocalInventories API. Currently empty because there is no meaningful response populated from the ProductService.AddLocalInventories method.

Protobuf type google.cloud.retail.v2.AddLocalInventoriesResponse

AddLocalInventoriesResponse.Builder

Response of the ProductService.AddLocalInventories API. Currently empty because there is no meaningful response populated from the ProductService.AddLocalInventories method.

Protobuf type google.cloud.retail.v2.AddLocalInventoriesResponse

Audience

An intended audience of the Product for whom it's sold.

Protobuf type google.cloud.retail.v2.Audience

Audience.Builder

An intended audience of the Product for whom it's sold.

Protobuf type google.cloud.retail.v2.Audience

BigQuerySource

BigQuery source import data from.

Protobuf type google.cloud.retail.v2.BigQuerySource

BigQuerySource.Builder

BigQuery source import data from.

Protobuf type google.cloud.retail.v2.BigQuerySource

BranchName

BranchName.Builder

Builder for projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}.

Catalog

The catalog configuration.

Protobuf type google.cloud.retail.v2.Catalog

Catalog.Builder

The catalog configuration.

Protobuf type google.cloud.retail.v2.Catalog

CatalogName

CatalogName.Builder

Builder for projects/{project}/locations/{location}/catalogs/{catalog}.

CatalogProto

CatalogServiceClient

Service Description: Service for managing catalog configuration.

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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
   Catalog catalog = Catalog.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Catalog response = catalogServiceClient.updateCatalog(catalog, updateMask);
 }
 

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

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

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

See the individual methods for example code.

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

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

To customize credentials:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 CatalogServiceSettings catalogServiceSettings =
     CatalogServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 CatalogServiceClient catalogServiceClient = CatalogServiceClient.create(catalogServiceSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 CatalogServiceSettings catalogServiceSettings =
     CatalogServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 CatalogServiceClient catalogServiceClient = CatalogServiceClient.create(catalogServiceSettings);
 

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


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 CatalogServiceSettings catalogServiceSettings =
     CatalogServiceSettings.newBuilder()
         .setTransportChannelProvider(
             CatalogServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
         .build();
 CatalogServiceClient catalogServiceClient = CatalogServiceClient.create(catalogServiceSettings);
 

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

CatalogServiceClient.ListCatalogsFixedSizeCollection

CatalogServiceClient.ListCatalogsPage

CatalogServiceClient.ListCatalogsPagedResponse

CatalogServiceGrpc

Service for managing catalog configuration.

CatalogServiceGrpc.CatalogServiceBlockingStub

Service for managing catalog configuration.

CatalogServiceGrpc.CatalogServiceFutureStub

Service for managing catalog configuration.

CatalogServiceGrpc.CatalogServiceImplBase

Service for managing catalog configuration.

CatalogServiceGrpc.CatalogServiceStub

Service for managing catalog configuration.

CatalogServiceProto

CatalogServiceSettings

Settings class to configure an instance of CatalogServiceClient.

The default instance has everything set to sensible defaults:

  • The default service address (retail.googleapis.com) and default port (443) are used.
  • Credentials are acquired automatically through Application Default Credentials.
  • Retries are configured for idempotent methods but not for non-idempotent methods.

The builder of this class is recursive, so contained classes are themselves builders. When build() is called, the tree of builders is called to create the complete settings object.

For example, to set the total timeout of updateCatalog to 30 seconds:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 CatalogServiceSettings.Builder catalogServiceSettingsBuilder =
     CatalogServiceSettings.newBuilder();
 catalogServiceSettingsBuilder
     .updateCatalogSettings()
     .setRetrySettings(
         catalogServiceSettingsBuilder
             .updateCatalogSettings()
             .getRetrySettings()
             .toBuilder()
             .setTotalTimeout(Duration.ofSeconds(30))
             .build());
 CatalogServiceSettings catalogServiceSettings = catalogServiceSettingsBuilder.build();
 

CatalogServiceSettings.Builder

Builder for CatalogServiceSettings.

CollectUserEventRequest

Request message for CollectUserEvent method.

Protobuf type google.cloud.retail.v2.CollectUserEventRequest

CollectUserEventRequest.Builder

Request message for CollectUserEvent method.

Protobuf type google.cloud.retail.v2.CollectUserEventRequest

ColorInfo

The color information of a Product.

Protobuf type google.cloud.retail.v2.ColorInfo

ColorInfo.Builder

The color information of a Product.

Protobuf type google.cloud.retail.v2.ColorInfo

CommonProto

CompleteQueryRequest

Auto-complete parameters.

Protobuf type google.cloud.retail.v2.CompleteQueryRequest

CompleteQueryRequest.Builder

Auto-complete parameters.

Protobuf type google.cloud.retail.v2.CompleteQueryRequest

CompleteQueryResponse

Response of the auto-complete query.

Protobuf type google.cloud.retail.v2.CompleteQueryResponse

CompleteQueryResponse.Builder

Response of the auto-complete query.

Protobuf type google.cloud.retail.v2.CompleteQueryResponse

CompleteQueryResponse.CompletionResult

Resource that represents completion results.

Protobuf type google.cloud.retail.v2.CompleteQueryResponse.CompletionResult

CompleteQueryResponse.CompletionResult.Builder

Resource that represents completion results.

Protobuf type google.cloud.retail.v2.CompleteQueryResponse.CompletionResult

CompleteQueryResponse.RecentSearchResult

Recent search of this user.

Protobuf type google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult

CompleteQueryResponse.RecentSearchResult.Builder

Recent search of this user.

Protobuf type google.cloud.retail.v2.CompleteQueryResponse.RecentSearchResult

CompletionDataInputConfig

The input config source for completion data.

Protobuf type google.cloud.retail.v2.CompletionDataInputConfig

CompletionDataInputConfig.Builder

The input config source for completion data.

Protobuf type google.cloud.retail.v2.CompletionDataInputConfig

CompletionDetail

Detailed completion information including completion attribution token and clicked completion info.

Protobuf type google.cloud.retail.v2.CompletionDetail

CompletionDetail.Builder

Detailed completion information including completion attribution token and clicked completion info.

Protobuf type google.cloud.retail.v2.CompletionDetail

CompletionServiceClient

Service Description: Auto-completion service for retail.

This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
   CompleteQueryRequest request =
       CompleteQueryRequest.newBuilder()
           .setCatalog(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
           .setQuery("query107944136")
           .setVisitorId("visitorId1880545833")
           .addAllLanguageCodes(new ArrayList<String>())
           .setDeviceType("deviceType781190832")
           .setDataset("dataset1443214456")
           .setMaxSuggestions(618824852)
           .build();
   CompleteQueryResponse response = completionServiceClient.completeQuery(request);
 }
 

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

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

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

See the individual methods for example code.

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

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

To customize credentials:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 CompletionServiceSettings completionServiceSettings =
     CompletionServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 CompletionServiceClient completionServiceClient =
     CompletionServiceClient.create(completionServiceSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 CompletionServiceSettings completionServiceSettings =
     CompletionServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 CompletionServiceClient completionServiceClient =
     CompletionServiceClient.create(completionServiceSettings);
 

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


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 CompletionServiceSettings completionServiceSettings =
     CompletionServiceSettings.newBuilder()
         .setTransportChannelProvider(
             CompletionServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
         .build();
 CompletionServiceClient completionServiceClient =
     CompletionServiceClient.create(completionServiceSettings);
 

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

CompletionServiceGrpc

Auto-completion service for retail. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

CompletionServiceGrpc.CompletionServiceBlockingStub

Auto-completion service for retail. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

CompletionServiceGrpc.CompletionServiceFutureStub

Auto-completion service for retail. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

CompletionServiceGrpc.CompletionServiceImplBase

Auto-completion service for retail. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

CompletionServiceGrpc.CompletionServiceStub

Auto-completion service for retail. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

CompletionServiceProto

CompletionServiceSettings

Settings class to configure an instance of CompletionServiceClient.

The default instance has everything set to sensible defaults:

  • The default service address (retail.googleapis.com) and default port (443) are used.
  • Credentials are acquired automatically through Application Default Credentials.
  • Retries are configured for idempotent methods but not for non-idempotent methods.

The builder of this class is recursive, so contained classes are themselves builders. When build() is called, the tree of builders is called to create the complete settings object.

For example, to set the total timeout of completeQuery to 30 seconds:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 CompletionServiceSettings.Builder completionServiceSettingsBuilder =
     CompletionServiceSettings.newBuilder();
 completionServiceSettingsBuilder
     .completeQuerySettings()
     .setRetrySettings(
         completionServiceSettingsBuilder
             .completeQuerySettings()
             .getRetrySettings()
             .toBuilder()
             .setTotalTimeout(Duration.ofSeconds(30))
             .build());
 CompletionServiceSettings completionServiceSettings = completionServiceSettingsBuilder.build();
 

CompletionServiceSettings.Builder

Builder for CompletionServiceSettings.

CreateProductRequest

Request message for ProductService.CreateProduct method.

Protobuf type google.cloud.retail.v2.CreateProductRequest

CreateProductRequest.Builder

Request message for ProductService.CreateProduct method.

Protobuf type google.cloud.retail.v2.CreateProductRequest

CustomAttribute

A custom attribute that is not explicitly modeled in Product.

Protobuf type google.cloud.retail.v2.CustomAttribute

CustomAttribute.Builder

A custom attribute that is not explicitly modeled in Product.

Protobuf type google.cloud.retail.v2.CustomAttribute

DeleteProductRequest

Request message for ProductService.DeleteProduct method.

Protobuf type google.cloud.retail.v2.DeleteProductRequest

DeleteProductRequest.Builder

Request message for ProductService.DeleteProduct method.

Protobuf type google.cloud.retail.v2.DeleteProductRequest

FulfillmentInfo

Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods.

Protobuf type google.cloud.retail.v2.FulfillmentInfo

FulfillmentInfo.Builder

Fulfillment information, such as the store IDs for in-store pickup or region IDs for different shipping methods.

Protobuf type google.cloud.retail.v2.FulfillmentInfo

GcsSource

Google Cloud Storage location for input content. format.

Protobuf type google.cloud.retail.v2.GcsSource

GcsSource.Builder

Google Cloud Storage location for input content. format.

Protobuf type google.cloud.retail.v2.GcsSource

GetDefaultBranchRequest

Request message to show which branch is currently the default branch.

Protobuf type google.cloud.retail.v2.GetDefaultBranchRequest

GetDefaultBranchRequest.Builder

Request message to show which branch is currently the default branch.

Protobuf type google.cloud.retail.v2.GetDefaultBranchRequest

GetDefaultBranchResponse

Response message of CatalogService.GetDefaultBranch.

Protobuf type google.cloud.retail.v2.GetDefaultBranchResponse

GetDefaultBranchResponse.Builder

Response message of CatalogService.GetDefaultBranch.

Protobuf type google.cloud.retail.v2.GetDefaultBranchResponse

GetProductRequest

Request message for ProductService.GetProduct method.

Protobuf type google.cloud.retail.v2.GetProductRequest

GetProductRequest.Builder

Request message for ProductService.GetProduct method.

Protobuf type google.cloud.retail.v2.GetProductRequest

Image

Product image. Recommendations AI and Retail Search do not use product images to improve prediction and search results. However, product images can be returned in results, and are shown in prediction or search previews in the console.

Protobuf type google.cloud.retail.v2.Image

Image.Builder

Product image. Recommendations AI and Retail Search do not use product images to improve prediction and search results. However, product images can be returned in results, and are shown in prediction or search previews in the console.

Protobuf type google.cloud.retail.v2.Image

ImportCompletionDataRequest

Request message for ImportCompletionData methods.

Protobuf type google.cloud.retail.v2.ImportCompletionDataRequest

ImportCompletionDataRequest.Builder

Request message for ImportCompletionData methods.

Protobuf type google.cloud.retail.v2.ImportCompletionDataRequest

ImportCompletionDataResponse

Response of the ImportCompletionDataRequest. If the long running operation is done, this message is returned by the google.longrunning.Operations.response field if the operation is successful.

Protobuf type google.cloud.retail.v2.ImportCompletionDataResponse

ImportCompletionDataResponse.Builder

Response of the ImportCompletionDataRequest. If the long running operation is done, this message is returned by the google.longrunning.Operations.response field if the operation is successful.

Protobuf type google.cloud.retail.v2.ImportCompletionDataResponse

ImportConfigProto

ImportErrorsConfig

Configuration of destination for Import related errors.

Protobuf type google.cloud.retail.v2.ImportErrorsConfig

ImportErrorsConfig.Builder

Configuration of destination for Import related errors.

Protobuf type google.cloud.retail.v2.ImportErrorsConfig

ImportMetadata

Metadata related to the progress of the Import operation. This will be returned by the google.longrunning.Operation.metadata field.

Protobuf type google.cloud.retail.v2.ImportMetadata

ImportMetadata.Builder

Metadata related to the progress of the Import operation. This will be returned by the google.longrunning.Operation.metadata field.

Protobuf type google.cloud.retail.v2.ImportMetadata

ImportProductsRequest

Request message for Import methods.

Protobuf type google.cloud.retail.v2.ImportProductsRequest

ImportProductsRequest.Builder

Request message for Import methods.

Protobuf type google.cloud.retail.v2.ImportProductsRequest

ImportProductsResponse

Response of the ImportProductsRequest. If the long running operation is done, then this message is returned by the google.longrunning.Operations.response field if the operation was successful.

Protobuf type google.cloud.retail.v2.ImportProductsResponse

ImportProductsResponse.Builder

Response of the ImportProductsRequest. If the long running operation is done, then this message is returned by the google.longrunning.Operations.response field if the operation was successful.

Protobuf type google.cloud.retail.v2.ImportProductsResponse

ImportUserEventsRequest

Request message for the ImportUserEvents request.

Protobuf type google.cloud.retail.v2.ImportUserEventsRequest

ImportUserEventsRequest.Builder

Request message for the ImportUserEvents request.

Protobuf type google.cloud.retail.v2.ImportUserEventsRequest

ImportUserEventsResponse

Response of the ImportUserEventsRequest. If the long running operation was successful, then this message is returned by the google.longrunning.Operations.response field if the operation was successful.

Protobuf type google.cloud.retail.v2.ImportUserEventsResponse

ImportUserEventsResponse.Builder

Response of the ImportUserEventsRequest. If the long running operation was successful, then this message is returned by the google.longrunning.Operations.response field if the operation was successful.

Protobuf type google.cloud.retail.v2.ImportUserEventsResponse

Interval

A floating point interval.

Protobuf type google.cloud.retail.v2.Interval

Interval.Builder

A floating point interval.

Protobuf type google.cloud.retail.v2.Interval

ListCatalogsRequest

Request for CatalogService.ListCatalogs method.

Protobuf type google.cloud.retail.v2.ListCatalogsRequest

ListCatalogsRequest.Builder

Request for CatalogService.ListCatalogs method.

Protobuf type google.cloud.retail.v2.ListCatalogsRequest

ListCatalogsResponse

Response for CatalogService.ListCatalogs method.

Protobuf type google.cloud.retail.v2.ListCatalogsResponse

ListCatalogsResponse.Builder

Response for CatalogService.ListCatalogs method.

Protobuf type google.cloud.retail.v2.ListCatalogsResponse

ListProductsRequest

Request message for ProductService.ListProducts method.

Protobuf type google.cloud.retail.v2.ListProductsRequest

ListProductsRequest.Builder

Request message for ProductService.ListProducts method.

Protobuf type google.cloud.retail.v2.ListProductsRequest

ListProductsResponse

Response message for ProductService.ListProducts method.

Protobuf type google.cloud.retail.v2.ListProductsResponse

ListProductsResponse.Builder

Response message for ProductService.ListProducts method.

Protobuf type google.cloud.retail.v2.ListProductsResponse

LocalInventory

The inventory information at a place (e.g. a store) identified by a place ID.

Protobuf type google.cloud.retail.v2.LocalInventory

LocalInventory.Builder

The inventory information at a place (e.g. a store) identified by a place ID.

Protobuf type google.cloud.retail.v2.LocalInventory

LocationName

LocationName.Builder

Builder for projects/{project}/locations/{location}.

PredictRequest

Request message for Predict method.

Protobuf type google.cloud.retail.v2.PredictRequest

PredictRequest.Builder

Request message for Predict method.

Protobuf type google.cloud.retail.v2.PredictRequest

PredictResponse

Response message for predict method.

Protobuf type google.cloud.retail.v2.PredictResponse

PredictResponse.Builder

Response message for predict method.

Protobuf type google.cloud.retail.v2.PredictResponse

PredictResponse.PredictionResult

PredictionResult represents the recommendation prediction results.

Protobuf type google.cloud.retail.v2.PredictResponse.PredictionResult

PredictResponse.PredictionResult.Builder

PredictionResult represents the recommendation prediction results.

Protobuf type google.cloud.retail.v2.PredictResponse.PredictionResult

PredictionServiceClient

Service Description: Service for making recommendation prediction.

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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
   PredictRequest request =
       PredictRequest.newBuilder()
           .setPlacement("placement1792938725")
           .setUserEvent(UserEvent.newBuilder().build())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setValidateOnly(true)
           .putAllParams(new HashMap<String, Value>())
           .putAllLabels(new HashMap<String, String>())
           .build();
   PredictResponse response = predictionServiceClient.predict(request);
 }
 

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

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

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

See the individual methods for example code.

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

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

To customize credentials:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 PredictionServiceSettings predictionServiceSettings =
     PredictionServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 PredictionServiceClient predictionServiceClient =
     PredictionServiceClient.create(predictionServiceSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 PredictionServiceSettings predictionServiceSettings =
     PredictionServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 PredictionServiceClient predictionServiceClient =
     PredictionServiceClient.create(predictionServiceSettings);
 

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


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 PredictionServiceSettings predictionServiceSettings =
     PredictionServiceSettings.newBuilder()
         .setTransportChannelProvider(
             PredictionServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
         .build();
 PredictionServiceClient predictionServiceClient =
     PredictionServiceClient.create(predictionServiceSettings);
 

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

PredictionServiceGrpc

Service for making recommendation prediction.

PredictionServiceGrpc.PredictionServiceBlockingStub

Service for making recommendation prediction.

PredictionServiceGrpc.PredictionServiceFutureStub

Service for making recommendation prediction.

PredictionServiceGrpc.PredictionServiceImplBase

Service for making recommendation prediction.

PredictionServiceGrpc.PredictionServiceStub

Service for making recommendation prediction.

PredictionServiceProto

PredictionServiceSettings

Settings class to configure an instance of PredictionServiceClient.

The default instance has everything set to sensible defaults:

  • The default service address (retail.googleapis.com) and default port (443) are used.
  • Credentials are acquired automatically through Application Default Credentials.
  • Retries are configured for idempotent methods but not for non-idempotent methods.

The builder of this class is recursive, so contained classes are themselves builders. When build() is called, the tree of builders is called to create the complete settings object.

For example, to set the total timeout of predict to 30 seconds:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 PredictionServiceSettings.Builder predictionServiceSettingsBuilder =
     PredictionServiceSettings.newBuilder();
 predictionServiceSettingsBuilder
     .predictSettings()
     .setRetrySettings(
         predictionServiceSettingsBuilder
             .predictSettings()
             .getRetrySettings()
             .toBuilder()
             .setTotalTimeout(Duration.ofSeconds(30))
             .build());
 PredictionServiceSettings predictionServiceSettings = predictionServiceSettingsBuilder.build();
 

PredictionServiceSettings.Builder

Builder for PredictionServiceSettings.

PriceInfo

The price information of a Product.

Protobuf type google.cloud.retail.v2.PriceInfo

PriceInfo.Builder

The price information of a Product.

Protobuf type google.cloud.retail.v2.PriceInfo

PriceInfo.PriceRange

The price range of all variant Product having the same Product.primary_product_id.

Protobuf type google.cloud.retail.v2.PriceInfo.PriceRange

PriceInfo.PriceRange.Builder

The price range of all variant Product having the same Product.primary_product_id.

Protobuf type google.cloud.retail.v2.PriceInfo.PriceRange

Product

Product captures all metadata information of items to be recommended or searched.

Protobuf type google.cloud.retail.v2.Product

Product.Builder

Product captures all metadata information of items to be recommended or searched.

Protobuf type google.cloud.retail.v2.Product

ProductDetail

Detailed product information associated with a user event.

Protobuf type google.cloud.retail.v2.ProductDetail

ProductDetail.Builder

Detailed product information associated with a user event.

Protobuf type google.cloud.retail.v2.ProductDetail

ProductInlineSource

The inline source for the input config for ImportProducts method.

Protobuf type google.cloud.retail.v2.ProductInlineSource

ProductInlineSource.Builder

The inline source for the input config for ImportProducts method.

Protobuf type google.cloud.retail.v2.ProductInlineSource

ProductInputConfig

The input config source for products.

Protobuf type google.cloud.retail.v2.ProductInputConfig

ProductInputConfig.Builder

The input config source for products.

Protobuf type google.cloud.retail.v2.ProductInputConfig

ProductLevelConfig

Configures what level the product should be uploaded with regards to how users will be send events and how predictions will be made.

Protobuf type google.cloud.retail.v2.ProductLevelConfig

ProductLevelConfig.Builder

Configures what level the product should be uploaded with regards to how users will be send events and how predictions will be made.

Protobuf type google.cloud.retail.v2.ProductLevelConfig

ProductName

ProductName.Builder

Builder for projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}.

ProductProto

ProductServiceClient

Service Description: Service for ingesting Product information of the customer's website.

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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
   BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]");
   Product product = Product.newBuilder().build();
   String productId = "productId-1051830678";
   Product response = productServiceClient.createProduct(parent, product, productId);
 }
 

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

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

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

See the individual methods for example code.

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

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

To customize credentials:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 ProductServiceSettings productServiceSettings =
     ProductServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 ProductServiceClient productServiceClient = ProductServiceClient.create(productServiceSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 ProductServiceSettings productServiceSettings =
     ProductServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 ProductServiceClient productServiceClient = ProductServiceClient.create(productServiceSettings);
 

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


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 ProductServiceSettings productServiceSettings =
     ProductServiceSettings.newBuilder()
         .setTransportChannelProvider(
             ProductServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
         .build();
 ProductServiceClient productServiceClient = ProductServiceClient.create(productServiceSettings);
 

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

ProductServiceClient.ListProductsFixedSizeCollection

ProductServiceClient.ListProductsPage

ProductServiceClient.ListProductsPagedResponse

ProductServiceGrpc

Service for ingesting Product information of the customer's website.

ProductServiceGrpc.ProductServiceBlockingStub

Service for ingesting Product information of the customer's website.

ProductServiceGrpc.ProductServiceFutureStub

Service for ingesting Product information of the customer's website.

ProductServiceGrpc.ProductServiceImplBase

Service for ingesting Product information of the customer's website.

ProductServiceGrpc.ProductServiceStub

Service for ingesting Product information of the customer's website.

ProductServiceProto

ProductServiceSettings

Settings class to configure an instance of ProductServiceClient.

The default instance has everything set to sensible defaults:

  • The default service address (retail.googleapis.com) and default port (443) are used.
  • Credentials are acquired automatically through Application Default Credentials.
  • Retries are configured for idempotent methods but not for non-idempotent methods.

The builder of this class is recursive, so contained classes are themselves builders. When build() is called, the tree of builders is called to create the complete settings object.

For example, to set the total timeout of createProduct to 30 seconds:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 ProductServiceSettings.Builder productServiceSettingsBuilder =
     ProductServiceSettings.newBuilder();
 productServiceSettingsBuilder
     .createProductSettings()
     .setRetrySettings(
         productServiceSettingsBuilder
             .createProductSettings()
             .getRetrySettings()
             .toBuilder()
             .setTotalTimeout(Duration.ofSeconds(30))
             .build());
 ProductServiceSettings productServiceSettings = productServiceSettingsBuilder.build();
 

ProductServiceSettings.Builder

Builder for ProductServiceSettings.

Promotion

Promotion information.

Protobuf type google.cloud.retail.v2.Promotion

Promotion.Builder

Promotion information.

Protobuf type google.cloud.retail.v2.Promotion

PromotionProto

PurchaseTransaction

A transaction represents the entire purchase transaction.

Protobuf type google.cloud.retail.v2.PurchaseTransaction

PurchaseTransaction.Builder

A transaction represents the entire purchase transaction.

Protobuf type google.cloud.retail.v2.PurchaseTransaction

PurgeConfigProto

PurgeMetadata

Metadata related to the progress of the Purge operation. This will be returned by the google.longrunning.Operation.metadata field.

Protobuf type google.cloud.retail.v2.PurgeMetadata

PurgeMetadata.Builder

Metadata related to the progress of the Purge operation. This will be returned by the google.longrunning.Operation.metadata field.

Protobuf type google.cloud.retail.v2.PurgeMetadata

PurgeUserEventsRequest

Request message for PurgeUserEvents method.

Protobuf type google.cloud.retail.v2.PurgeUserEventsRequest

PurgeUserEventsRequest.Builder

Request message for PurgeUserEvents method.

Protobuf type google.cloud.retail.v2.PurgeUserEventsRequest

PurgeUserEventsResponse

Response of the PurgeUserEventsRequest. If the long running operation is successfully done, then this message is returned by the google.longrunning.Operations.response field.

Protobuf type google.cloud.retail.v2.PurgeUserEventsResponse

PurgeUserEventsResponse.Builder

Response of the PurgeUserEventsRequest. If the long running operation is successfully done, then this message is returned by the google.longrunning.Operations.response field.

Protobuf type google.cloud.retail.v2.PurgeUserEventsResponse

Rating

The rating of a Product.

Protobuf type google.cloud.retail.v2.Rating

Rating.Builder

The rating of a Product.

Protobuf type google.cloud.retail.v2.Rating

RejoinUserEventsMetadata

Metadata for RejoinUserEvents method.

Protobuf type google.cloud.retail.v2.RejoinUserEventsMetadata

RejoinUserEventsMetadata.Builder

Metadata for RejoinUserEvents method.

Protobuf type google.cloud.retail.v2.RejoinUserEventsMetadata

RejoinUserEventsRequest

Request message for RejoinUserEvents method.

Protobuf type google.cloud.retail.v2.RejoinUserEventsRequest

RejoinUserEventsRequest.Builder

Request message for RejoinUserEvents method.

Protobuf type google.cloud.retail.v2.RejoinUserEventsRequest

RejoinUserEventsResponse

Response message for RejoinUserEvents method.

Protobuf type google.cloud.retail.v2.RejoinUserEventsResponse

RejoinUserEventsResponse.Builder

Response message for RejoinUserEvents method.

Protobuf type google.cloud.retail.v2.RejoinUserEventsResponse

RemoveFulfillmentPlacesMetadata

Metadata related to the progress of the RemoveFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the ProductService.RemoveFulfillmentPlaces method.

Protobuf type google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata

RemoveFulfillmentPlacesMetadata.Builder

Metadata related to the progress of the RemoveFulfillmentPlaces operation. Currently empty because there is no meaningful metadata populated from the ProductService.RemoveFulfillmentPlaces method.

Protobuf type google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata

RemoveFulfillmentPlacesRequest

Request message for ProductService.RemoveFulfillmentPlaces method.

Protobuf type google.cloud.retail.v2.RemoveFulfillmentPlacesRequest

RemoveFulfillmentPlacesRequest.Builder

Request message for ProductService.RemoveFulfillmentPlaces method.

Protobuf type google.cloud.retail.v2.RemoveFulfillmentPlacesRequest

RemoveFulfillmentPlacesResponse

Response of the RemoveFulfillmentPlacesRequest. Currently empty because there is no meaningful response populated from the ProductService.RemoveFulfillmentPlaces method.

Protobuf type google.cloud.retail.v2.RemoveFulfillmentPlacesResponse

RemoveFulfillmentPlacesResponse.Builder

Response of the RemoveFulfillmentPlacesRequest. Currently empty because there is no meaningful response populated from the ProductService.RemoveFulfillmentPlaces method.

Protobuf type google.cloud.retail.v2.RemoveFulfillmentPlacesResponse

RemoveLocalInventoriesMetadata

Metadata related to the progress of the RemoveLocalInventories operation. Currently empty because there is no meaningful metadata populated from the ProductService.RemoveLocalInventories method.

Protobuf type google.cloud.retail.v2.RemoveLocalInventoriesMetadata

RemoveLocalInventoriesMetadata.Builder

Metadata related to the progress of the RemoveLocalInventories operation. Currently empty because there is no meaningful metadata populated from the ProductService.RemoveLocalInventories method.

Protobuf type google.cloud.retail.v2.RemoveLocalInventoriesMetadata

RemoveLocalInventoriesRequest

Request message for ProductService.RemoveLocalInventories method.

Protobuf type google.cloud.retail.v2.RemoveLocalInventoriesRequest

RemoveLocalInventoriesRequest.Builder

Request message for ProductService.RemoveLocalInventories method.

Protobuf type google.cloud.retail.v2.RemoveLocalInventoriesRequest

RemoveLocalInventoriesResponse

Response of the ProductService.RemoveLocalInventories API. Currently empty because there is no meaningful response populated from the ProductService.RemoveLocalInventories method.

Protobuf type google.cloud.retail.v2.RemoveLocalInventoriesResponse

RemoveLocalInventoriesResponse.Builder

Response of the ProductService.RemoveLocalInventories API. Currently empty because there is no meaningful response populated from the ProductService.RemoveLocalInventories method.

Protobuf type google.cloud.retail.v2.RemoveLocalInventoriesResponse

SearchRequest

Request message for SearchService.Search method.

Protobuf type google.cloud.retail.v2.SearchRequest

SearchRequest.BoostSpec

Boost specification to boost certain items.

Protobuf type google.cloud.retail.v2.SearchRequest.BoostSpec

SearchRequest.BoostSpec.Builder

Boost specification to boost certain items.

Protobuf type google.cloud.retail.v2.SearchRequest.BoostSpec

SearchRequest.BoostSpec.ConditionBoostSpec

Boost applies to products which match a condition.

Protobuf type google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec

SearchRequest.BoostSpec.ConditionBoostSpec.Builder

Boost applies to products which match a condition.

Protobuf type google.cloud.retail.v2.SearchRequest.BoostSpec.ConditionBoostSpec

SearchRequest.Builder

Request message for SearchService.Search method.

Protobuf type google.cloud.retail.v2.SearchRequest

SearchRequest.DynamicFacetSpec

The specifications of dynamically generated facets.

Protobuf type google.cloud.retail.v2.SearchRequest.DynamicFacetSpec

SearchRequest.DynamicFacetSpec.Builder

The specifications of dynamically generated facets.

Protobuf type google.cloud.retail.v2.SearchRequest.DynamicFacetSpec

SearchRequest.FacetSpec

A facet specification to perform faceted search.

Protobuf type google.cloud.retail.v2.SearchRequest.FacetSpec

SearchRequest.FacetSpec.Builder

A facet specification to perform faceted search.

Protobuf type google.cloud.retail.v2.SearchRequest.FacetSpec

SearchRequest.FacetSpec.FacetKey

Specifies how a facet is computed.

Protobuf type google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey

SearchRequest.FacetSpec.FacetKey.Builder

Specifies how a facet is computed.

Protobuf type google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey

SearchRequest.PersonalizationSpec

The specification for personalization.

Protobuf type google.cloud.retail.v2.SearchRequest.PersonalizationSpec

SearchRequest.PersonalizationSpec.Builder

The specification for personalization.

Protobuf type google.cloud.retail.v2.SearchRequest.PersonalizationSpec

SearchRequest.QueryExpansionSpec

Specification to determine under which conditions query expansion should occur.

Protobuf type google.cloud.retail.v2.SearchRequest.QueryExpansionSpec

SearchRequest.QueryExpansionSpec.Builder

Specification to determine under which conditions query expansion should occur.

Protobuf type google.cloud.retail.v2.SearchRequest.QueryExpansionSpec

SearchRequest.SpellCorrectionSpec

The specification for query spell correction.

Protobuf type google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec

SearchRequest.SpellCorrectionSpec.Builder

The specification for query spell correction.

Protobuf type google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec

SearchResponse

Response message for SearchService.Search method.

Protobuf type google.cloud.retail.v2.SearchResponse

SearchResponse.Builder

Response message for SearchService.Search method.

Protobuf type google.cloud.retail.v2.SearchResponse

SearchResponse.Facet

A facet result.

Protobuf type google.cloud.retail.v2.SearchResponse.Facet

SearchResponse.Facet.Builder

A facet result.

Protobuf type google.cloud.retail.v2.SearchResponse.Facet

SearchResponse.Facet.FacetValue

A facet value which contains value names and their count.

Protobuf type google.cloud.retail.v2.SearchResponse.Facet.FacetValue

SearchResponse.Facet.FacetValue.Builder

A facet value which contains value names and their count.

Protobuf type google.cloud.retail.v2.SearchResponse.Facet.FacetValue

SearchResponse.QueryExpansionInfo

Information describing query expansion including whether expansion has occurred.

Protobuf type google.cloud.retail.v2.SearchResponse.QueryExpansionInfo

SearchResponse.QueryExpansionInfo.Builder

Information describing query expansion including whether expansion has occurred.

Protobuf type google.cloud.retail.v2.SearchResponse.QueryExpansionInfo

SearchResponse.SearchResult

Represents the search results.

Protobuf type google.cloud.retail.v2.SearchResponse.SearchResult

SearchResponse.SearchResult.Builder

Represents the search results.

Protobuf type google.cloud.retail.v2.SearchResponse.SearchResult

SearchServiceClient

Service Description: Service for search.

This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (SearchServiceClient searchServiceClient = SearchServiceClient.create()) {
   SearchRequest request =
       SearchRequest.newBuilder()
           .setPlacement("placement1792938725")
           .setBranch(
               BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString())
           .setQuery("query107944136")
           .setVisitorId("visitorId1880545833")
           .setUserInfo(UserInfo.newBuilder().build())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setOffset(-1019779949)
           .setFilter("filter-1274492040")
           .setCanonicalFilter("canonicalFilter-722283124")
           .setOrderBy("orderBy-1207110587")
           .addAllFacetSpecs(new ArrayList<SearchRequest.FacetSpec>())
           .setDynamicFacetSpec(SearchRequest.DynamicFacetSpec.newBuilder().build())
           .setBoostSpec(SearchRequest.BoostSpec.newBuilder().build())
           .setQueryExpansionSpec(SearchRequest.QueryExpansionSpec.newBuilder().build())
           .addAllVariantRollupKeys(new ArrayList<String>())
           .addAllPageCategories(new ArrayList<String>())
           .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build())
           .putAllLabels(new HashMap<String, String>())
           .setSpellCorrectionSpec(SearchRequest.SpellCorrectionSpec.newBuilder().build())
           .build();
   for (SearchResponse.SearchResult element : searchServiceClient.search(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 

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

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

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

See the individual methods for example code.

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

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

To customize credentials:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 SearchServiceSettings searchServiceSettings =
     SearchServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 SearchServiceClient searchServiceClient = SearchServiceClient.create(searchServiceSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 SearchServiceSettings searchServiceSettings =
     SearchServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 SearchServiceClient searchServiceClient = SearchServiceClient.create(searchServiceSettings);
 

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


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 SearchServiceSettings searchServiceSettings =
     SearchServiceSettings.newBuilder()
         .setTransportChannelProvider(
             SearchServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
         .build();
 SearchServiceClient searchServiceClient = SearchServiceClient.create(searchServiceSettings);
 

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

SearchServiceClient.SearchFixedSizeCollection

SearchServiceClient.SearchPage

SearchServiceClient.SearchPagedResponse

SearchServiceGrpc

Service for search. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

SearchServiceGrpc.SearchServiceBlockingStub

Service for search. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

SearchServiceGrpc.SearchServiceFutureStub

Service for search. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

SearchServiceGrpc.SearchServiceImplBase

Service for search. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

SearchServiceGrpc.SearchServiceStub

Service for search. This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

SearchServiceProto

SearchServiceSettings

Settings class to configure an instance of SearchServiceClient.

The default instance has everything set to sensible defaults:

  • The default service address (retail.googleapis.com) and default port (443) are used.
  • Credentials are acquired automatically through Application Default Credentials.
  • Retries are configured for idempotent methods but not for non-idempotent methods.

The builder of this class is recursive, so contained classes are themselves builders. When build() is called, the tree of builders is called to create the complete settings object.

For example, to set the total timeout of search to 30 seconds:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 SearchServiceSettings.Builder searchServiceSettingsBuilder = SearchServiceSettings.newBuilder();
 searchServiceSettingsBuilder
     .searchSettings()
     .setRetrySettings(
         searchServiceSettingsBuilder
             .searchSettings()
             .getRetrySettings()
             .toBuilder()
             .setTotalTimeout(Duration.ofSeconds(30))
             .build());
 SearchServiceSettings searchServiceSettings = searchServiceSettingsBuilder.build();
 

SearchServiceSettings.Builder

Builder for SearchServiceSettings.

SetDefaultBranchRequest

Request message to set a specified branch as new default_branch.

Protobuf type google.cloud.retail.v2.SetDefaultBranchRequest

SetDefaultBranchRequest.Builder

Request message to set a specified branch as new default_branch.

Protobuf type google.cloud.retail.v2.SetDefaultBranchRequest

SetInventoryMetadata

Metadata related to the progress of the SetInventory operation. Currently empty because there is no meaningful metadata populated from the ProductService.SetInventory method.

Protobuf type google.cloud.retail.v2.SetInventoryMetadata

SetInventoryMetadata.Builder

Metadata related to the progress of the SetInventory operation. Currently empty because there is no meaningful metadata populated from the ProductService.SetInventory method.

Protobuf type google.cloud.retail.v2.SetInventoryMetadata

SetInventoryRequest

Request message for ProductService.SetInventory method.

Protobuf type google.cloud.retail.v2.SetInventoryRequest

SetInventoryRequest.Builder

Request message for ProductService.SetInventory method.

Protobuf type google.cloud.retail.v2.SetInventoryRequest

SetInventoryResponse

Response of the SetInventoryRequest. Currently empty because there is no meaningful response populated from the ProductService.SetInventory method.

Protobuf type google.cloud.retail.v2.SetInventoryResponse

SetInventoryResponse.Builder

Response of the SetInventoryRequest. Currently empty because there is no meaningful response populated from the ProductService.SetInventory method.

Protobuf type google.cloud.retail.v2.SetInventoryResponse

UpdateCatalogRequest

Request for CatalogService.UpdateCatalog method.

Protobuf type google.cloud.retail.v2.UpdateCatalogRequest

UpdateCatalogRequest.Builder

Request for CatalogService.UpdateCatalog method.

Protobuf type google.cloud.retail.v2.UpdateCatalogRequest

UpdateProductRequest

Request message for ProductService.UpdateProduct method.

Protobuf type google.cloud.retail.v2.UpdateProductRequest

UpdateProductRequest.Builder

Request message for ProductService.UpdateProduct method.

Protobuf type google.cloud.retail.v2.UpdateProductRequest

UserEvent

UserEvent captures all metadata information Retail API needs to know about how end users interact with customers' website.

Protobuf type google.cloud.retail.v2.UserEvent

UserEvent.Builder

UserEvent captures all metadata information Retail API needs to know about how end users interact with customers' website.

Protobuf type google.cloud.retail.v2.UserEvent

UserEventImportSummary

A summary of import result. The UserEventImportSummary summarizes the import status for user events.

Protobuf type google.cloud.retail.v2.UserEventImportSummary

UserEventImportSummary.Builder

A summary of import result. The UserEventImportSummary summarizes the import status for user events.

Protobuf type google.cloud.retail.v2.UserEventImportSummary

UserEventInlineSource

The inline source for the input config for ImportUserEvents method.

Protobuf type google.cloud.retail.v2.UserEventInlineSource

UserEventInlineSource.Builder

The inline source for the input config for ImportUserEvents method.

Protobuf type google.cloud.retail.v2.UserEventInlineSource

UserEventInputConfig

The input config source for user events.

Protobuf type google.cloud.retail.v2.UserEventInputConfig

UserEventInputConfig.Builder

The input config source for user events.

Protobuf type google.cloud.retail.v2.UserEventInputConfig

UserEventProto

UserEventServiceClient

Service Description: Service for ingesting end user actions on the customer website.

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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
   WriteUserEventRequest request =
       WriteUserEventRequest.newBuilder()
           .setParent("parent-995424086")
           .setUserEvent(UserEvent.newBuilder().build())
           .build();
   UserEvent response = userEventServiceClient.writeUserEvent(request);
 }
 

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

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

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

See the individual methods for example code.

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

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

To customize credentials:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 UserEventServiceSettings userEventServiceSettings =
     UserEventServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 UserEventServiceClient userEventServiceClient =
     UserEventServiceClient.create(userEventServiceSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 UserEventServiceSettings userEventServiceSettings =
     UserEventServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 UserEventServiceClient userEventServiceClient =
     UserEventServiceClient.create(userEventServiceSettings);
 

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


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 UserEventServiceSettings userEventServiceSettings =
     UserEventServiceSettings.newBuilder()
         .setTransportChannelProvider(
             UserEventServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
         .build();
 UserEventServiceClient userEventServiceClient =
     UserEventServiceClient.create(userEventServiceSettings);
 

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

UserEventServiceGrpc

Service for ingesting end user actions on the customer website.

UserEventServiceGrpc.UserEventServiceBlockingStub

Service for ingesting end user actions on the customer website.

UserEventServiceGrpc.UserEventServiceFutureStub

Service for ingesting end user actions on the customer website.

UserEventServiceGrpc.UserEventServiceImplBase

Service for ingesting end user actions on the customer website.

UserEventServiceGrpc.UserEventServiceStub

Service for ingesting end user actions on the customer website.

UserEventServiceProto

UserEventServiceSettings

Settings class to configure an instance of UserEventServiceClient.

The default instance has everything set to sensible defaults:

  • The default service address (retail.googleapis.com) and default port (443) are used.
  • Credentials are acquired automatically through Application Default Credentials.
  • Retries are configured for idempotent methods but not for non-idempotent methods.

The builder of this class is recursive, so contained classes are themselves builders. When build() is called, the tree of builders is called to create the complete settings object.

For example, to set the total timeout of writeUserEvent to 30 seconds:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 UserEventServiceSettings.Builder userEventServiceSettingsBuilder =
     UserEventServiceSettings.newBuilder();
 userEventServiceSettingsBuilder
     .writeUserEventSettings()
     .setRetrySettings(
         userEventServiceSettingsBuilder
             .writeUserEventSettings()
             .getRetrySettings()
             .toBuilder()
             .setTotalTimeout(Duration.ofSeconds(30))
             .build());
 UserEventServiceSettings userEventServiceSettings = userEventServiceSettingsBuilder.build();
 

UserEventServiceSettings.Builder

Builder for UserEventServiceSettings.

UserInfo

Information of an end user.

Protobuf type google.cloud.retail.v2.UserInfo

UserInfo.Builder

Information of an end user.

Protobuf type google.cloud.retail.v2.UserInfo

WriteUserEventRequest

Request message for WriteUserEvent method.

Protobuf type google.cloud.retail.v2.WriteUserEventRequest

WriteUserEventRequest.Builder

Request message for WriteUserEvent method.

Protobuf type google.cloud.retail.v2.WriteUserEventRequest

Interfaces

AddFulfillmentPlacesMetadataOrBuilder

AddFulfillmentPlacesRequestOrBuilder

AddFulfillmentPlacesResponseOrBuilder

AddLocalInventoriesMetadataOrBuilder

AddLocalInventoriesRequestOrBuilder

AddLocalInventoriesResponseOrBuilder

AudienceOrBuilder

BigQuerySourceOrBuilder

CatalogOrBuilder

CollectUserEventRequestOrBuilder

ColorInfoOrBuilder

CompleteQueryRequestOrBuilder

CompleteQueryResponse.CompletionResultOrBuilder

CompleteQueryResponse.RecentSearchResultOrBuilder

CompleteQueryResponseOrBuilder

CompletionDataInputConfigOrBuilder

CompletionDetailOrBuilder

CreateProductRequestOrBuilder

CustomAttributeOrBuilder

DeleteProductRequestOrBuilder

FulfillmentInfoOrBuilder

GcsSourceOrBuilder

GetDefaultBranchRequestOrBuilder

GetDefaultBranchResponseOrBuilder

GetProductRequestOrBuilder

ImageOrBuilder

ImportCompletionDataRequestOrBuilder

ImportCompletionDataResponseOrBuilder

ImportErrorsConfigOrBuilder

ImportMetadataOrBuilder

ImportProductsRequestOrBuilder

ImportProductsResponseOrBuilder

ImportUserEventsRequestOrBuilder

ImportUserEventsResponseOrBuilder

IntervalOrBuilder

ListCatalogsRequestOrBuilder

ListCatalogsResponseOrBuilder

ListProductsRequestOrBuilder

ListProductsResponseOrBuilder

LocalInventoryOrBuilder

PredictRequestOrBuilder

PredictResponse.PredictionResultOrBuilder

PredictResponseOrBuilder

PriceInfo.PriceRangeOrBuilder

PriceInfoOrBuilder

ProductDetailOrBuilder

ProductInlineSourceOrBuilder

ProductInputConfigOrBuilder

ProductLevelConfigOrBuilder

ProductOrBuilder

PromotionOrBuilder

PurchaseTransactionOrBuilder

PurgeMetadataOrBuilder

PurgeUserEventsRequestOrBuilder

PurgeUserEventsResponseOrBuilder

RatingOrBuilder

RejoinUserEventsMetadataOrBuilder

RejoinUserEventsRequestOrBuilder

RejoinUserEventsResponseOrBuilder

RemoveFulfillmentPlacesMetadataOrBuilder

RemoveFulfillmentPlacesRequestOrBuilder

RemoveFulfillmentPlacesResponseOrBuilder

RemoveLocalInventoriesMetadataOrBuilder

RemoveLocalInventoriesRequestOrBuilder

RemoveLocalInventoriesResponseOrBuilder

SearchRequest.BoostSpec.ConditionBoostSpecOrBuilder

SearchRequest.BoostSpecOrBuilder

SearchRequest.DynamicFacetSpecOrBuilder

SearchRequest.FacetSpec.FacetKeyOrBuilder

SearchRequest.FacetSpecOrBuilder

SearchRequest.PersonalizationSpecOrBuilder

SearchRequest.QueryExpansionSpecOrBuilder

SearchRequest.SpellCorrectionSpecOrBuilder

SearchRequestOrBuilder

SearchResponse.Facet.FacetValueOrBuilder

SearchResponse.FacetOrBuilder

SearchResponse.QueryExpansionInfoOrBuilder

SearchResponse.SearchResultOrBuilder

SearchResponseOrBuilder

SetDefaultBranchRequestOrBuilder

SetInventoryMetadataOrBuilder

SetInventoryRequestOrBuilder

SetInventoryResponseOrBuilder

UpdateCatalogRequestOrBuilder

UpdateProductRequestOrBuilder

UserEventImportSummaryOrBuilder

UserEventInlineSourceOrBuilder

UserEventInputConfigOrBuilder

UserEventOrBuilder

UserInfoOrBuilder

WriteUserEventRequestOrBuilder

Enums

BigQuerySource.PartitionCase

CompletionDataInputConfig.SourceCase

ImportErrorsConfig.DestinationCase

ImportProductsRequest.ReconciliationMode

Indicates how imported products are reconciled with the existing products created or imported before.

Protobuf enum google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode

Interval.MaxCase

Interval.MinCase

Product.Availability

Product availability. If this field is unspecified, the product is assumed to be in stock.

Protobuf enum google.cloud.retail.v2.Product.Availability

Product.ExpirationCase

Product.Type

The type of this product.

Protobuf enum google.cloud.retail.v2.Product.Type

ProductInputConfig.SourceCase

RejoinUserEventsRequest.UserEventRejoinScope

The scope of user events to be rejoined with the latest product catalog. If the rejoining aims at reducing number of unjoined events, set UserEventRejoinScope to UNJOINED_EVENTS. If the rejoining aims at correcting product catalog information in joined events, set UserEventRejoinScope to JOINED_EVENTS. If all events needs to be rejoined, set UserEventRejoinScope to USER_EVENT_REJOIN_SCOPE_UNSPECIFIED.

Protobuf enum google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope

SearchRequest.DynamicFacetSpec.Mode

Enum to control DynamicFacet mode

Protobuf enum google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode

SearchRequest.PersonalizationSpec.Mode

The personalization mode of each search request.

Protobuf enum google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode

SearchRequest.QueryExpansionSpec.Condition

Enum describing under which condition query expansion should occur.

Protobuf enum google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition

SearchRequest.SearchMode

The search mode of each search request.

Protobuf enum google.cloud.retail.v2.SearchRequest.SearchMode

SearchRequest.SpellCorrectionSpec.Mode

Enum describing under which mode spell correction should occur.

Protobuf enum google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode

SearchResponse.Facet.FacetValue.FacetValueCase

UserEventInputConfig.SourceCase