diff --git a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CatalogServiceClient.java b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CatalogServiceClient.java index 7f3a9e3e..343bcc15 100644 --- a/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CatalogServiceClient.java +++ b/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CatalogServiceClient.java @@ -42,6 +42,14 @@ *
This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code + * 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(). * @@ -145,6 +153,17 @@ public CatalogServiceStub getStub() { /** * Lists all the [Catalog][google.cloud.retail.v2.Catalog]s associated with the project. * + *
Sample code: + * + *
{@code + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (Catalog element : catalogServiceClient.listCatalogs(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The account resource name with an associated location. *
If the caller does not have permission to list * [Catalog][google.cloud.retail.v2.Catalog]s under this location, regardless of whether or @@ -163,6 +182,17 @@ public final ListCatalogsPagedResponse listCatalogs(LocationName parent) { /** * Lists all the [Catalog][google.cloud.retail.v2.Catalog]s associated with the project. * + *
Sample code: + * + *
{@code + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (Catalog element : catalogServiceClient.listCatalogs(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The account resource name with an associated location. *
If the caller does not have permission to list * [Catalog][google.cloud.retail.v2.Catalog]s under this location, regardless of whether or @@ -178,6 +208,22 @@ public final ListCatalogsPagedResponse listCatalogs(String parent) { /** * Lists all the [Catalog][google.cloud.retail.v2.Catalog]s associated with the project. * + *
Sample code: + * + *
{@code + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * ListCatalogsRequest request = + * ListCatalogsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Catalog element : catalogServiceClient.listCatalogs(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -190,6 +236,23 @@ public final ListCatalogsPagedResponse listCatalogs(ListCatalogsRequest request) * Lists all the [Catalog][google.cloud.retail.v2.Catalog]s associated with the project. * *
Sample code: + * + *
{@code + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * ListCatalogsRequest request = + * ListCatalogsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * catalogServiceClient.listCatalogsPagedCallable().futureCall(request); + * // Do something. + * for (Catalog element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * while (true) { + * ListCatalogsResponse response = catalogServiceClient.listCatalogsCallable().call(request); + * for (Catalog element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * Catalog catalog = Catalog.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Catalog response = catalogServiceClient.updateCatalog(catalog, updateMask); + * } + * }+ * * @param catalog Required. The [Catalog][google.cloud.retail.v2.Catalog] to update. *
If the caller does not have permission to update the * [Catalog][google.cloud.retail.v2.Catalog], regardless of whether or not it exists, a @@ -233,6 +323,19 @@ public final Catalog updateCatalog(Catalog catalog, FieldMask updateMask) { /** * Updates the [Catalog][google.cloud.retail.v2.Catalog]s. * + *
Sample code: + * + *
{@code + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * UpdateCatalogRequest request = + * UpdateCatalogRequest.newBuilder() + * .setCatalog(Catalog.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Catalog response = catalogServiceClient.updateCatalog(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -245,6 +348,19 @@ public final Catalog updateCatalog(UpdateCatalogRequest request) { * Updates the [Catalog][google.cloud.retail.v2.Catalog]s. * *
Sample code: + * + *
{@code + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * UpdateCatalogRequest request = + * UpdateCatalogRequest.newBuilder() + * .setCatalog(Catalog.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = catalogServiceClient.updateCatalogCallable().futureCall(request); + * // Do something. + * Catalog response = future.get(); + * } + * }
This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code + * 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+ * *()) + * .putAllLabels(new HashMap ()) + * .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(). @@ -138,6 +155,25 @@ public PredictionServiceStub getStub() { /** * Makes a recommendation prediction. * + *
Sample code: + * + *
{@code + * 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+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -150,6 +186,26 @@ public final PredictResponse predict(PredictRequest request) { * Makes a recommendation prediction. * *()) + * .putAllLabels(new HashMap ()) + * .build(); + * PredictResponse response = predictionServiceClient.predict(request); + * } + * }
Sample code: + * + *
{@code + * 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*/ public final UnaryCallable()) + * .putAllLabels(new HashMap ()) + * .build(); + * ApiFuture future = + * predictionServiceClient.predictCallable().futureCall(request); + * // Do something. + * PredictResponse response = future.get(); + * } + * }
This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code + * 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(). * @@ -153,6 +162,17 @@ public final OperationsClient getOperationsClient() { /** * Creates a [Product][google.cloud.retail.v2.Product]. * + *
Sample code: + * + *
{@code + * 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); + * } + * }+ * * @param parent Required. The parent catalog resource name, such as * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`. * @param product Required. The [Product][google.cloud.retail.v2.Product] to create. @@ -183,6 +203,17 @@ public final Product createProduct(BranchName parent, Product product, String pr /** * Creates a [Product][google.cloud.retail.v2.Product]. * + *
Sample code: + * + *
{@code + * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { + * String parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString(); + * Product product = Product.newBuilder().build(); + * String productId = "productId-1051830678"; + * Product response = productServiceClient.createProduct(parent, product, productId); + * } + * }+ * * @param parent Required. The parent catalog resource name, such as * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`. * @param product Required. The [Product][google.cloud.retail.v2.Product] to create. @@ -213,6 +244,21 @@ public final Product createProduct(String parent, Product product, String produc /** * Creates a [Product][google.cloud.retail.v2.Product]. * + *
Sample code: + * + *
{@code + * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { + * CreateProductRequest request = + * CreateProductRequest.newBuilder() + * .setParent( + * BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + * .setProduct(Product.newBuilder().build()) + * .setProductId("productId-1051830678") + * .build(); + * Product response = productServiceClient.createProduct(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -225,6 +271,21 @@ public final Product createProduct(CreateProductRequest request) { * Creates a [Product][google.cloud.retail.v2.Product]. * *
Sample code: + * + *
{@code + * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { + * CreateProductRequest request = + * CreateProductRequest.newBuilder() + * .setParent( + * BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) + * .setProduct(Product.newBuilder().build()) + * .setProductId("productId-1051830678") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = productServiceClient.createProductCallable().futureCall(request); + * // Do something. + * Product response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { + * ProductName name = + * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + * Product response = productServiceClient.getProduct(name); + * } + * }+ * * @param name Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. *
If the caller does not have permission to access the @@ -253,6 +324,17 @@ public final Product getProduct(ProductName name) { /** * Gets a [Product][google.cloud.retail.v2.Product]. * + *
Sample code: + * + *
{@code + * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { + * String name = + * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") + * .toString(); + * Product response = productServiceClient.getProduct(name); + * } + * }+ * * @param name Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. *
If the caller does not have permission to access the @@ -271,6 +353,20 @@ public final Product getProduct(String name) { /** * Gets a [Product][google.cloud.retail.v2.Product]. * + *
Sample code: + * + *
{@code + * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { + * GetProductRequest request = + * GetProductRequest.newBuilder() + * .setName( + * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") + * .toString()) + * .build(); + * Product response = productServiceClient.getProduct(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -283,6 +379,20 @@ public final Product getProduct(GetProductRequest request) { * Gets a [Product][google.cloud.retail.v2.Product]. * *
Sample code: + * + *
{@code + * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { + * GetProductRequest request = + * GetProductRequest.newBuilder() + * .setName( + * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") + * .toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = productServiceClient.getProductCallable().futureCall(request); + * // Do something. + * Product response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { + * Product product = Product.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Product response = productServiceClient.updateProduct(product, updateMask); + * } + * }+ * * @param product Required. The product to update/create. *
If the caller does not have permission to update the * [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a @@ -315,6 +435,19 @@ public final Product updateProduct(Product product, FieldMask updateMask) { /** * Updates a [Product][google.cloud.retail.v2.Product]. * + *
Sample code: + * + *
{@code + * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { + * UpdateProductRequest request = + * UpdateProductRequest.newBuilder() + * .setProduct(Product.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Product response = productServiceClient.updateProduct(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -327,6 +460,19 @@ public final Product updateProduct(UpdateProductRequest request) { * Updates a [Product][google.cloud.retail.v2.Product]. * *
Sample code: + * + *
{@code + * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { + * UpdateProductRequest request = + * UpdateProductRequest.newBuilder() + * .setProduct(Product.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = productServiceClient.updateProductCallable().futureCall(request); + * // Do something. + * Product response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { + * ProductName name = + * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); + * productServiceClient.deleteProduct(name); + * } + * }+ * * @param name Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. *
If the caller does not have permission to delete the @@ -355,6 +511,17 @@ public final void deleteProduct(ProductName name) { /** * Deletes a [Product][google.cloud.retail.v2.Product]. * + *
Sample code: + * + *
{@code + * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { + * String name = + * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") + * .toString(); + * productServiceClient.deleteProduct(name); + * } + * }+ * * @param name Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as * `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. *
If the caller does not have permission to delete the @@ -373,6 +540,20 @@ public final void deleteProduct(String name) { /** * Deletes a [Product][google.cloud.retail.v2.Product]. * + *
Sample code: + * + *
{@code + * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { + * DeleteProductRequest request = + * DeleteProductRequest.newBuilder() + * .setName( + * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") + * .toString()) + * .build(); + * productServiceClient.deleteProduct(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -385,6 +566,20 @@ public final void deleteProduct(DeleteProductRequest request) { * Deletes a [Product][google.cloud.retail.v2.Product]. * *
Sample code: + * + *
{@code + * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { + * DeleteProductRequest request = + * DeleteProductRequest.newBuilder() + * .setName( + * ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") + * .toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = productServiceClient.deleteProductCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Note that it is possible for a subset of the [Product][google.cloud.retail.v2.Product]s to * be successfully updated. * + *
Sample code: + * + *
{@code + * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { + * ImportProductsRequest request = + * ImportProductsRequest.newBuilder() + * .setParent("parent-995424086") + * .setInputConfig(ProductInputConfig.newBuilder().build()) + * .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ImportProductsResponse response = productServiceClient.importProductsAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -419,6 +629,22 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { + * ImportProductsRequest request = + * ImportProductsRequest.newBuilder() + * .setParent("parent-995424086") + * .setInputConfig(ProductInputConfig.newBuilder().build()) + * .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * productServiceClient.importProductsOperationCallable().futureCall(request); + * // Do something. + * ImportProductsResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { + * ImportProductsRequest request = + * ImportProductsRequest.newBuilder() + * .setParent("parent-995424086") + * .setInputConfig(ProductInputConfig.newBuilder().build()) + * .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * productServiceClient.importProductsCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code + * 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(). @@ -154,6 +165,19 @@ public final OperationsClient getOperationsClient() { /** * Writes a single user event. * + *
Sample code: + * + *
{@code + * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + * WriteUserEventRequest request = + * WriteUserEventRequest.newBuilder() + * .setParent("parent-995424086") + * .setUserEvent(UserEvent.newBuilder().build()) + * .build(); + * UserEvent response = userEventServiceClient.writeUserEvent(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -166,6 +190,20 @@ public final UserEvent writeUserEvent(WriteUserEventRequest request) { * Writes a single user event. * *
Sample code: + * + *
{@code + * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + * WriteUserEventRequest request = + * WriteUserEventRequest.newBuilder() + * .setParent("parent-995424086") + * .setUserEvent(UserEvent.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * userEventServiceClient.writeUserEventCallable().futureCall(request); + * // Do something. + * UserEvent response = future.get(); + * } + * }
This method is used only by the Retail API JavaScript pixel and Google Tag Manager. Users * should not call this method directly. * + *
Sample code: + * + *
{@code + * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + * CollectUserEventRequest request = + * CollectUserEventRequest.newBuilder() + * .setParent("parent-995424086") + * .setUserEvent("userEvent315571599") + * .setUri("uri116076") + * .setEts(100772) + * .build(); + * HttpBody response = userEventServiceClient.collectUserEvent(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -195,6 +248,22 @@ public final HttpBody collectUserEvent(CollectUserEventRequest request) { * should not call this method directly. * *
Sample code: + * + *
{@code + * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + * CollectUserEventRequest request = + * CollectUserEventRequest.newBuilder() + * .setParent("parent-995424086") + * .setUserEvent("userEvent315571599") + * .setUri("uri116076") + * .setEts(100772) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * userEventServiceClient.collectUserEventCallable().futureCall(request); + * // Do something. + * HttpBody response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + * PurgeUserEventsRequest request = + * PurgeUserEventsRequest.newBuilder() + * .setParent("parent-995424086") + * .setFilter("filter-1274492040") + * .setForce(true) + * .build(); + * PurgeUserEventsResponse response = userEventServiceClient.purgeUserEventsAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -221,6 +304,21 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + * PurgeUserEventsRequest request = + * PurgeUserEventsRequest.newBuilder() + * .setParent("parent-995424086") + * .setFilter("filter-1274492040") + * .setForce(true) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * userEventServiceClient.purgeUserEventsOperationCallable().futureCall(request); + * // Do something. + * PurgeUserEventsResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + * PurgeUserEventsRequest request = + * PurgeUserEventsRequest.newBuilder() + * .setParent("parent-995424086") + * .setFilter("filter-1274492040") + * .setForce(true) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * userEventServiceClient.purgeUserEventsCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Operation.response is of type ImportResponse. Note that it is possible for a subset of the * items to be successfully inserted. Operation.metadata is of type ImportMetadata. * + *
Sample code: + * + *
{@code + * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + * ImportUserEventsRequest request = + * ImportUserEventsRequest.newBuilder() + * .setParent("parent-995424086") + * .setInputConfig(UserEventInputConfig.newBuilder().build()) + * .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) + * .build(); + * ImportUserEventsResponse response = + * userEventServiceClient.importUserEventsAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -264,6 +392,21 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + * ImportUserEventsRequest request = + * ImportUserEventsRequest.newBuilder() + * .setParent("parent-995424086") + * .setInputConfig(UserEventInputConfig.newBuilder().build()) + * .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * userEventServiceClient.importUserEventsOperationCallable().futureCall(request); + * // Do something. + * ImportUserEventsResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + * ImportUserEventsRequest request = + * ImportUserEventsRequest.newBuilder() + * .setParent("parent-995424086") + * .setInputConfig(UserEventInputConfig.newBuilder().build()) + * .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * userEventServiceClient.importUserEventsCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + * RejoinUserEventsRequest request = + * RejoinUserEventsRequest.newBuilder().setParent("parent-995424086").build(); + * RejoinUserEventsResponse response = + * userEventServiceClient.rejoinUserEventsAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -311,6 +480,17 @@ public final UnaryCallable
Sample code: + * + *
{@code + * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + * RejoinUserEventsRequest request = + * RejoinUserEventsRequest.newBuilder().setParent("parent-995424086").build(); + * OperationFuture*/ public final OperationCallable< RejoinUserEventsRequest, RejoinUserEventsResponse, RejoinUserEventsMetadata> @@ -328,6 +508,17 @@ public final UnaryCallablefuture = + * userEventServiceClient.rejoinUserEventsOperationCallable().futureCall(request); + * // Do something. + * RejoinUserEventsResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + * RejoinUserEventsRequest request = + * RejoinUserEventsRequest.newBuilder().setParent("parent-995424086").build(); + * ApiFuture*/ public final UnaryCallablefuture = + * userEventServiceClient.rejoinUserEventsCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample for CatalogServiceClient: * + *
{@code + * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) { + * Catalog catalog = Catalog.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Catalog response = catalogServiceClient.updateCatalog(catalog, updateMask); + * } + * }+ * *
======================= PredictionServiceClient ======================= * *
Service Description: Service for making recommendation prediction. * *
Sample for PredictionServiceClient: * + *
{@code + * 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+ * *()) + * .putAllLabels(new HashMap ()) + * .build(); + * PredictResponse response = predictionServiceClient.predict(request); + * } + * }
======================= ProductServiceClient ======================= * *
Service Description: Service for ingesting [Product][google.cloud.retail.v2.Product] @@ -36,11 +61,31 @@ * *
Sample for ProductServiceClient: * + *
{@code + * 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); + * } + * }+ * *
======================= UserEventServiceClient ======================= * *
Service Description: Service for ingesting end user actions on the customer website. * *
Sample for UserEventServiceClient: + * + *
{@code + * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) { + * WriteUserEventRequest request = + * WriteUserEventRequest.newBuilder() + * .setParent("parent-995424086") + * .setUserEvent(UserEvent.newBuilder().build()) + * .build(); + * UserEvent response = userEventServiceClient.writeUserEvent(request); + * } + * }*/ @Generated("by gapic-generator-java") package com.google.cloud.retail.v2; diff --git a/synth.metadata b/synth.metadata index 68ed5a1b..0ea9db68 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-retail.git", - "sha": "d8f1274531a17dba245b64f39c30a9f0f2a600fa" + "sha": "e04c6da574a961af887ae282712f230e7bcf0ac4" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "dc9821e4005ff8fecc3bfccae1c61b5815cdf9d3", - "internalRef": "352807727" + "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", + "internalRef": "356341083" } }, {