diff --git a/google-cloud-recommendations-ai/clirr-ignored-differences.xml b/google-cloud-recommendations-ai/clirr-ignored-differences.xml
new file mode 100644
index 00000000..3cc91795
--- /dev/null
+++ b/google-cloud-recommendations-ai/clirr-ignored-differences.xml
@@ -0,0 +1,50 @@
+
+
+
*
* try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
- * String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
- * CatalogItem catalogItem = CatalogItem.newBuilder().build();
- * CatalogItem response = catalogServiceClient.createCatalogItem(formattedParent, catalogItem);
+ * CatalogItemPathName name = CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+ * catalogServiceClient.deleteCatalogItem(name);
* }
*
*
@@ -113,175 +112,364 @@ public class CatalogServiceClient implements BackgroundResource {
private final CatalogServiceStub stub;
private final OperationsClient operationsClient;
- private static final PathTemplate CATALOG_PATH_TEMPLATE =
- PathTemplate.createWithoutUrlEncoding(
- "projects/{project}/locations/{location}/catalogs/{catalog}");
-
- private static final PathTemplate CATALOG_ITEM_PATH_PATH_TEMPLATE =
- PathTemplate.createWithoutUrlEncoding(
- "projects/{project}/locations/{location}/catalogs/{catalog}/catalogItems/{catalog_item_path=**}");
+ /** Constructs an instance of CatalogServiceClient with default settings. */
+ public static final CatalogServiceClient create() throws IOException {
+ return create(CatalogServiceSettings.newBuilder().build());
+ }
/**
- * Formats a string containing the fully-qualified path to represent a catalog resource.
- *
- * @deprecated Use the {@link CatalogName} class instead.
+ * Constructs an instance of CatalogServiceClient, using the given settings. The channels are
+ * created based on the settings passed in, or defaults for any settings that are not set.
*/
- @Deprecated
- public static final String formatCatalogName(String project, String location, String catalog) {
- return CATALOG_PATH_TEMPLATE.instantiate(
- "project", project,
- "location", location,
- "catalog", catalog);
+ public static final CatalogServiceClient create(CatalogServiceSettings settings)
+ throws IOException {
+ return new CatalogServiceClient(settings);
}
/**
- * Formats a string containing the fully-qualified path to represent a catalog_item_path resource.
- *
- * @deprecated Use the {@link CatalogItemPathName} class instead.
+ * Constructs an instance of CatalogServiceClient, using the given stub for making calls. This is
+ * for advanced usage - prefer to use CatalogServiceSettings}.
*/
- @Deprecated
- public static final String formatCatalogItemPathName(
- String project, String location, String catalog, String catalogItemPath) {
- return CATALOG_ITEM_PATH_PATH_TEMPLATE.instantiate(
- "project", project,
- "location", location,
- "catalog", catalog,
- "catalog_item_path", catalogItemPath);
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public static final CatalogServiceClient create(CatalogServiceStub stub) {
+ return new CatalogServiceClient(stub);
}
/**
- * Parses the project from the given fully-qualified path which represents a catalog resource.
- *
- * @deprecated Use the {@link CatalogName} class instead.
+ * Constructs an instance of CatalogServiceClient, using the given settings. This is protected so
+ * that it is easy to make a subclass, but otherwise, the static factory methods should be
+ * preferred.
*/
- @Deprecated
- public static final String parseProjectFromCatalogName(String catalogName) {
- return CATALOG_PATH_TEMPLATE.parse(catalogName).get("project");
+ protected CatalogServiceClient(CatalogServiceSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((CatalogServiceStubSettings) settings.getStubSettings()).createStub();
+ this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ protected CatalogServiceClient(CatalogServiceStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ }
+
+ public final CatalogServiceSettings getSettings() {
+ return settings;
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public CatalogServiceStub getStub() {
+ return stub;
}
/**
- * Parses the location from the given fully-qualified path which represents a catalog resource.
- *
- * @deprecated Use the {@link CatalogName} class instead.
+ * Returns the OperationsClient that can be used to query the status of a long-running operation
+ * returned by another API method call.
*/
- @Deprecated
- public static final String parseLocationFromCatalogName(String catalogName) {
- return CATALOG_PATH_TEMPLATE.parse(catalogName).get("location");
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationsClient getOperationsClient() {
+ return operationsClient;
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Parses the catalog from the given fully-qualified path which represents a catalog resource.
+ * Deletes a catalog item.
+ *
+ * Sample code: + * + *
+ * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+ * CatalogItemPathName name = CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+ * catalogServiceClient.deleteCatalogItem(name);
+ * }
+ *
*
- * @deprecated Use the {@link CatalogName} class instead.
+ * @param name Required. Full resource name of catalog item, such as
+ * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @Deprecated
- public static final String parseCatalogFromCatalogName(String catalogName) {
- return CATALOG_PATH_TEMPLATE.parse(catalogName).get("catalog");
+ public final void deleteCatalogItem(CatalogItemPathName name) {
+ DeleteCatalogItemRequest request =
+ DeleteCatalogItemRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ deleteCatalogItem(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Parses the project from the given fully-qualified path which represents a catalog_item_path
- * resource.
+ * Deletes a catalog item.
*
- * @deprecated Use the {@link CatalogItemPathName} class instead.
+ * Sample code: + * + *
+ * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+ * CatalogItemPathName name = CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+ * catalogServiceClient.deleteCatalogItem(name.toString());
+ * }
+ *
+ *
+ * @param name Required. Full resource name of catalog item, such as
+ * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @Deprecated
- public static final String parseProjectFromCatalogItemPathName(String catalogItemPathName) {
- return CATALOG_ITEM_PATH_PATH_TEMPLATE.parse(catalogItemPathName).get("project");
+ public final void deleteCatalogItem(String name) {
+ DeleteCatalogItemRequest request = DeleteCatalogItemRequest.newBuilder().setName(name).build();
+ deleteCatalogItem(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Parses the location from the given fully-qualified path which represents a catalog_item_path
- * resource.
+ * Deletes a catalog item.
+ *
+ * Sample code: * - * @deprecated Use the {@link CatalogItemPathName} class instead. + *
+ * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+ * CatalogItemPathName name = CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+ * DeleteCatalogItemRequest request = DeleteCatalogItemRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * catalogServiceClient.deleteCatalogItem(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
*/
- @Deprecated
- public static final String parseLocationFromCatalogItemPathName(String catalogItemPathName) {
- return CATALOG_ITEM_PATH_PATH_TEMPLATE.parse(catalogItemPathName).get("location");
+ public final void deleteCatalogItem(DeleteCatalogItemRequest request) {
+ deleteCatalogItemCallable().call(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Parses the catalog from the given fully-qualified path which represents a catalog_item_path
- * resource.
+ * Deletes a catalog item.
*
- * @deprecated Use the {@link CatalogItemPathName} class instead.
+ * Sample code: + * + *
+ * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+ * CatalogItemPathName name = CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+ * DeleteCatalogItemRequest request = DeleteCatalogItemRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<Void> future = catalogServiceClient.deleteCatalogItemCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
*/
- @Deprecated
- public static final String parseCatalogFromCatalogItemPathName(String catalogItemPathName) {
- return CATALOG_ITEM_PATH_PATH_TEMPLATE.parse(catalogItemPathName).get("catalog");
+ public final UnaryCallableOperation.response is of type ImportResponse. Note that it is possible for a subset of the + * items to be successfully updated. * - * @deprecated Use the {@link CatalogItemPathName} class instead. + *
Sample code: + * + *
+ * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+ * CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ * String requestId = "";
+ * InputConfig inputConfig = InputConfig.newBuilder().build();
+ * ImportErrorsConfig errorsConfig = ImportErrorsConfig.newBuilder().build();
+ * ImportCatalogItemsResponse response = catalogServiceClient.importCatalogItemsAsync(parent, requestId, inputConfig, errorsConfig).get();
+ * }
+ *
+ *
+ * @param parent Required. "projects/1234/locations/global/catalogs/default_catalog"
+ * @param requestId Optional. Unique identifier provided by client, within the ancestor dataset
+ * scope. Ensures idempotency and used for request deduplication. Server-generated if
+ * unspecified. Up to 128 characters long. This is returned as
+ * google.longrunning.Operation.name in the response.
+ * @param inputConfig Required. The desired input location of the data.
+ * @param errorsConfig Optional. The desired location of errors incurred during the Import.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @Deprecated
- public static final String parseCatalogItemPathFromCatalogItemPathName(
- String catalogItemPathName) {
- return CATALOG_ITEM_PATH_PATH_TEMPLATE.parse(catalogItemPathName).get("catalog_item_path");
- }
-
- /** Constructs an instance of CatalogServiceClient with default settings. */
- public static final CatalogServiceClient create() throws IOException {
- return create(CatalogServiceSettings.newBuilder().build());
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFutureOperation.response is of type ImportResponse. Note that it is possible for a subset of the + * items to be successfully updated. + * + *
Sample code: + * + *
+ * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+ * CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ * String requestId = "";
+ * InputConfig inputConfig = InputConfig.newBuilder().build();
+ * ImportErrorsConfig errorsConfig = ImportErrorsConfig.newBuilder().build();
+ * ImportCatalogItemsResponse response = catalogServiceClient.importCatalogItemsAsync(parent.toString(), requestId, inputConfig, errorsConfig).get();
+ * }
+ *
+ *
+ * @param parent Required. "projects/1234/locations/global/catalogs/default_catalog"
+ * @param requestId Optional. Unique identifier provided by client, within the ancestor dataset
+ * scope. Ensures idempotency and used for request deduplication. Server-generated if
+ * unspecified. Up to 128 characters long. This is returned as
+ * google.longrunning.Operation.name in the response.
+ * @param inputConfig Required. The desired input location of the data.
+ * @param errorsConfig Optional. The desired location of errors incurred during the Import.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public static final CatalogServiceClient create(CatalogServiceSettings settings)
- throws IOException {
- return new CatalogServiceClient(settings);
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFutureOperation.response is of type ImportResponse. Note that it is possible for a subset of the + * items to be successfully updated. + * + *
Sample code: + * + *
+ * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+ * CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ * InputConfig inputConfig = InputConfig.newBuilder().build();
+ * ImportCatalogItemsRequest request = ImportCatalogItemsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setInputConfig(inputConfig)
+ * .build();
+ * ImportCatalogItemsResponse response = catalogServiceClient.importCatalogItemsAsync(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
*/
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- public static final CatalogServiceClient create(CatalogServiceStub stub) {
- return new CatalogServiceClient(stub);
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFutureOperation.response is of type ImportResponse. Note that it is possible for a subset of the + * items to be successfully updated. + * + *
Sample code: + * + *
+ * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+ * CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ * InputConfig inputConfig = InputConfig.newBuilder().build();
+ * ImportCatalogItemsRequest request = ImportCatalogItemsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setInputConfig(inputConfig)
+ * .build();
+ * OperationFuture<ImportCatalogItemsResponse, ImportMetadata> future = catalogServiceClient.importCatalogItemsOperationCallable().futureCall(request);
+ * // Do something
+ * ImportCatalogItemsResponse response = future.get();
+ * }
+ *
*/
- protected CatalogServiceClient(CatalogServiceSettings settings) throws IOException {
- this.settings = settings;
- this.stub = ((CatalogServiceStubSettings) settings.getStubSettings()).createStub();
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
- }
-
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- protected CatalogServiceClient(CatalogServiceStub stub) {
- this.settings = null;
- this.stub = stub;
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
- }
-
- public final CatalogServiceSettings getSettings() {
- return settings;
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public final OperationCallable<
+ ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata>
+ importCatalogItemsOperationCallable() {
+ return stub.importCatalogItemsOperationCallable();
}
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- public CatalogServiceStub getStub() {
- return stub;
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Bulk import of multiple catalog items. Request processing may be synchronous. No partial
+ * updating supported. Non-existing items will be created.
+ *
+ * Operation.response is of type ImportResponse. Note that it is possible for a subset of the + * items to be successfully updated. + * + *
Sample code: + * + *
+ * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+ * CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ * InputConfig inputConfig = InputConfig.newBuilder().build();
+ * ImportCatalogItemsRequest request = ImportCatalogItemsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setInputConfig(inputConfig)
+ * .build();
+ * ApiFuture<Operation> future = catalogServiceClient.importCatalogItemsCallable().futureCall(request);
+ * // Do something
+ * Operation response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+ * CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ * CatalogItem catalogItem = CatalogItem.newBuilder().build();
+ * CatalogItem response = catalogServiceClient.createCatalogItem(parent, catalogItem);
+ * }
+ *
+ *
+ * @param parent Required. The parent catalog resource name, such as
+ * "projects/*/locations/global/catalogs/default_catalog".
+ * @param catalogItem Required. The catalog item to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationsClient getOperationsClient() {
- return operationsClient;
+ public final CatalogItem createCatalogItem(CatalogName parent, CatalogItem catalogItem) {
+ CreateCatalogItemRequest request =
+ CreateCatalogItemRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setCatalogItem(catalogItem)
+ .build();
+ return createCatalogItem(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
@@ -292,9 +480,9 @@ public final OperationsClient getOperationsClient() {
*
*
* try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
- * String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ * CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
* CatalogItem catalogItem = CatalogItem.newBuilder().build();
- * CatalogItem response = catalogServiceClient.createCatalogItem(formattedParent, catalogItem);
+ * CatalogItem response = catalogServiceClient.createCatalogItem(parent.toString(), catalogItem);
* }
*
*
@@ -304,7 +492,6 @@ public final OperationsClient getOperationsClient() {
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final CatalogItem createCatalogItem(String parent, CatalogItem catalogItem) {
- CATALOG_PATH_TEMPLATE.validate(parent, "createCatalogItem");
CreateCatalogItemRequest request =
CreateCatalogItemRequest.newBuilder().setParent(parent).setCatalogItem(catalogItem).build();
return createCatalogItem(request);
@@ -318,10 +505,10 @@ public final CatalogItem createCatalogItem(String parent, CatalogItem catalogIte
*
*
* try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
- * String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ * CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
* CatalogItem catalogItem = CatalogItem.newBuilder().build();
* CreateCatalogItemRequest request = CreateCatalogItemRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .setCatalogItem(catalogItem)
* .build();
* CatalogItem response = catalogServiceClient.createCatalogItem(request);
@@ -343,10 +530,10 @@ public final CatalogItem createCatalogItem(CreateCatalogItemRequest request) {
*
*
* try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
- * String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ * CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
* CatalogItem catalogItem = CatalogItem.newBuilder().build();
* CreateCatalogItemRequest request = CreateCatalogItemRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .setCatalogItem(catalogItem)
* .build();
* ApiFuture<CatalogItem> future = catalogServiceClient.createCatalogItemCallable().futureCall(request);
@@ -367,8 +554,31 @@ public final UnaryCallable createCatalogI
*
*
* try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
- * String formattedName = CatalogServiceClient.formatCatalogItemPathName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
- * CatalogItem response = catalogServiceClient.getCatalogItem(formattedName);
+ * CatalogItemPathName name = CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+ * CatalogItem response = catalogServiceClient.getCatalogItem(name);
+ * }
+ *
+ *
+ * @param name Required. Full resource name of catalog item, such as
+ * "projects/*/locations/global/catalogs/default_catalog/catalogitems/some_catalog_item_id".
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CatalogItem getCatalogItem(CatalogItemPathName name) {
+ GetCatalogItemRequest request =
+ GetCatalogItemRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getCatalogItem(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a specific catalog item.
+ *
+ * Sample code:
+ *
+ *
+ * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+ * CatalogItemPathName name = CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+ * CatalogItem response = catalogServiceClient.getCatalogItem(name.toString());
* }
*
*
@@ -377,7 +587,6 @@ public final UnaryCallable createCatalogI
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final CatalogItem getCatalogItem(String name) {
- CATALOG_ITEM_PATH_PATH_TEMPLATE.validate(name, "getCatalogItem");
GetCatalogItemRequest request = GetCatalogItemRequest.newBuilder().setName(name).build();
return getCatalogItem(request);
}
@@ -390,9 +599,9 @@ public final CatalogItem getCatalogItem(String name) {
*
*
* try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
- * String formattedName = CatalogServiceClient.formatCatalogItemPathName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+ * CatalogItemPathName name = CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
* GetCatalogItemRequest request = GetCatalogItemRequest.newBuilder()
- * .setName(formattedName)
+ * .setName(name.toString())
* .build();
* CatalogItem response = catalogServiceClient.getCatalogItem(request);
* }
@@ -413,9 +622,9 @@ public final CatalogItem getCatalogItem(GetCatalogItemRequest request) {
*
*
* try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
- * String formattedName = CatalogServiceClient.formatCatalogItemPathName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+ * CatalogItemPathName name = CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
* GetCatalogItemRequest request = GetCatalogItemRequest.newBuilder()
- * .setName(formattedName)
+ * .setName(name.toString())
* .build();
* ApiFuture<CatalogItem> future = catalogServiceClient.getCatalogItemCallable().futureCall(request);
* // Do something
@@ -435,9 +644,39 @@ public final UnaryCallable getCatalogItemCal
*
*
* try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
- * String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ * CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ * String filter = "";
+ * for (CatalogItem element : catalogServiceClient.listCatalogItems(parent, filter).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. The parent catalog resource name, such as
+ * "projects/*/locations/global/catalogs/default_catalog".
+ * @param filter Optional. A filter to apply on the list results.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListCatalogItemsPagedResponse listCatalogItems(CatalogName parent, String filter) {
+ ListCatalogItemsRequest request =
+ ListCatalogItemsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setFilter(filter)
+ .build();
+ return listCatalogItems(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a list of catalog items.
+ *
+ * Sample code:
+ *
+ *
+ * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+ * CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
* String filter = "";
- * for (CatalogItem element : catalogServiceClient.listCatalogItems(formattedParent, filter).iterateAll()) {
+ * for (CatalogItem element : catalogServiceClient.listCatalogItems(parent.toString(), filter).iterateAll()) {
* // doThingsWith(element);
* }
* }
@@ -449,7 +688,6 @@ public final UnaryCallable getCatalogItemCal
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListCatalogItemsPagedResponse listCatalogItems(String parent, String filter) {
- CATALOG_PATH_TEMPLATE.validate(parent, "listCatalogItems");
ListCatalogItemsRequest request =
ListCatalogItemsRequest.newBuilder().setParent(parent).setFilter(filter).build();
return listCatalogItems(request);
@@ -463,9 +701,9 @@ public final ListCatalogItemsPagedResponse listCatalogItems(String parent, Strin
*
*
* try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
- * String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ * CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
* ListCatalogItemsRequest request = ListCatalogItemsRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .build();
* for (CatalogItem element : catalogServiceClient.listCatalogItems(request).iterateAll()) {
* // doThingsWith(element);
@@ -488,9 +726,9 @@ public final ListCatalogItemsPagedResponse listCatalogItems(ListCatalogItemsRequ
*
*
* try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
- * String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ * CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
* ListCatalogItemsRequest request = ListCatalogItemsRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .build();
* ApiFuture<ListCatalogItemsPagedResponse> future = catalogServiceClient.listCatalogItemsPagedCallable().futureCall(request);
* // Do something
@@ -513,9 +751,9 @@ public final ListCatalogItemsPagedResponse listCatalogItems(ListCatalogItemsRequ
*
*
* try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
- * String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
+ * CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
* ListCatalogItemsRequest request = ListCatalogItemsRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .build();
* while (true) {
* ListCatalogItemsResponse response = catalogServiceClient.listCatalogItemsCallable().call(request);
@@ -545,9 +783,10 @@ public final ListCatalogItemsPagedResponse listCatalogItems(ListCatalogItemsRequ
*
*
* try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
- * String formattedName = CatalogServiceClient.formatCatalogItemPathName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+ * CatalogItemPathName name = CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
* CatalogItem catalogItem = CatalogItem.newBuilder().build();
- * CatalogItem response = catalogServiceClient.updateCatalogItem(formattedName, catalogItem);
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * CatalogItem response = catalogServiceClient.updateCatalogItem(name, catalogItem, updateMask);
* }
*
*
@@ -555,12 +794,18 @@ public final ListCatalogItemsPagedResponse listCatalogItems(ListCatalogItemsRequ
* "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
* @param catalogItem Required. The catalog item to update/create. The 'catalog_item_id' field has
* to match that in the 'name'.
+ * @param updateMask Optional. Indicates which fields in the provided 'item' to update. If not
+ * set, will by default update all fields.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final CatalogItem updateCatalogItem(String name, CatalogItem catalogItem) {
- CATALOG_ITEM_PATH_PATH_TEMPLATE.validate(name, "updateCatalogItem");
+ public final CatalogItem updateCatalogItem(
+ CatalogItemPathName name, CatalogItem catalogItem, FieldMask updateMask) {
UpdateCatalogItemRequest request =
- UpdateCatalogItemRequest.newBuilder().setName(name).setCatalogItem(catalogItem).build();
+ UpdateCatalogItemRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setCatalogItem(catalogItem)
+ .setUpdateMask(updateMask)
+ .build();
return updateCatalogItem(request);
}
@@ -572,21 +817,30 @@ public final CatalogItem updateCatalogItem(String name, CatalogItem catalogItem)
*
*
* try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
- * String formattedName = CatalogServiceClient.formatCatalogItemPathName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+ * CatalogItemPathName name = CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
* CatalogItem catalogItem = CatalogItem.newBuilder().build();
- * UpdateCatalogItemRequest request = UpdateCatalogItemRequest.newBuilder()
- * .setName(formattedName)
- * .setCatalogItem(catalogItem)
- * .build();
- * CatalogItem response = catalogServiceClient.updateCatalogItem(request);
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * CatalogItem response = catalogServiceClient.updateCatalogItem(name.toString(), catalogItem, updateMask);
* }
*
*
- * @param request The request object containing all of the parameters for the API call.
+ * @param name Required. Full resource name of catalog item, such as
+ * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
+ * @param catalogItem Required. The catalog item to update/create. The 'catalog_item_id' field has
+ * to match that in the 'name'.
+ * @param updateMask Optional. Indicates which fields in the provided 'item' to update. If not
+ * set, will by default update all fields.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final CatalogItem updateCatalogItem(UpdateCatalogItemRequest request) {
- return updateCatalogItemCallable().call(request);
+ public final CatalogItem updateCatalogItem(
+ String name, CatalogItem catalogItem, FieldMask updateMask) {
+ UpdateCatalogItemRequest request =
+ UpdateCatalogItemRequest.newBuilder()
+ .setName(name)
+ .setCatalogItem(catalogItem)
+ .setUpdateMask(updateMask)
+ .build();
+ return updateCatalogItem(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
@@ -597,223 +851,45 @@ public final CatalogItem updateCatalogItem(UpdateCatalogItemRequest request) {
*
*
* try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
- * String formattedName = CatalogServiceClient.formatCatalogItemPathName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+ * CatalogItemPathName name = CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
* CatalogItem catalogItem = CatalogItem.newBuilder().build();
* UpdateCatalogItemRequest request = UpdateCatalogItemRequest.newBuilder()
- * .setName(formattedName)
+ * .setName(name.toString())
* .setCatalogItem(catalogItem)
* .build();
- * ApiFuture<CatalogItem> future = catalogServiceClient.updateCatalogItemCallable().futureCall(request);
- * // Do something
- * CatalogItem response = future.get();
- * }
- *
- */
- public final UnaryCallable updateCatalogItemCallable() {
- return stub.updateCatalogItemCallable();
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes a catalog item.
- *
- * Sample code:
- *
- *
- * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
- * String formattedName = CatalogServiceClient.formatCatalogItemPathName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
- * catalogServiceClient.deleteCatalogItem(formattedName);
- * }
- *
- *
- * @param name Required. Full resource name of catalog item, such as
- * "projects/*/locations/global/catalogs/default_catalog/catalogItems/some_catalog_item_id".
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteCatalogItem(String name) {
- CATALOG_ITEM_PATH_PATH_TEMPLATE.validate(name, "deleteCatalogItem");
- DeleteCatalogItemRequest request = DeleteCatalogItemRequest.newBuilder().setName(name).build();
- deleteCatalogItem(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes a catalog item.
- *
- * Sample code:
- *
- *
- * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
- * String formattedName = CatalogServiceClient.formatCatalogItemPathName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
- * DeleteCatalogItemRequest request = DeleteCatalogItemRequest.newBuilder()
- * .setName(formattedName)
- * .build();
- * catalogServiceClient.deleteCatalogItem(request);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteCatalogItem(DeleteCatalogItemRequest request) {
- deleteCatalogItemCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes a catalog item.
- *
- * Sample code:
- *
- *
- * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
- * String formattedName = CatalogServiceClient.formatCatalogItemPathName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
- * DeleteCatalogItemRequest request = DeleteCatalogItemRequest.newBuilder()
- * .setName(formattedName)
- * .build();
- * ApiFuture<Void> future = catalogServiceClient.deleteCatalogItemCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallable deleteCatalogItemCallable() {
- return stub.deleteCatalogItemCallable();
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Bulk import of multiple catalog items. Request processing may be synchronous. No partial
- * updating supported. Non-existing items will be created.
- *
- * Operation.response is of type ImportResponse. Note that it is possible for a subset of the
- * items to be successfully updated.
- *
- *
Sample code:
- *
- *
- * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
- * String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
- * String requestId = "";
- * InputConfig inputConfig = InputConfig.newBuilder().build();
- * ImportErrorsConfig errorsConfig = ImportErrorsConfig.newBuilder().build();
- * ImportCatalogItemsResponse response = catalogServiceClient.importCatalogItemsAsync(formattedParent, requestId, inputConfig, errorsConfig).get();
- * }
- *
- *
- * @param parent Required. "projects/1234/locations/global/catalogs/default_catalog"
- * @param requestId Optional. Unique identifier provided by client, within the ancestor dataset
- * scope. Ensures idempotency and used for request deduplication. Server-generated if
- * unspecified. Up to 128 characters long. This is returned as
- * google.longrunning.Operation.name in the response.
- * @param inputConfig Required. The desired input location of the data.
- * @param errorsConfig Optional. The desired location of errors incurred during the Import.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture importCatalogItemsAsync(
- String parent, String requestId, InputConfig inputConfig, ImportErrorsConfig errorsConfig) {
- CATALOG_PATH_TEMPLATE.validate(parent, "importCatalogItems");
- ImportCatalogItemsRequest request =
- ImportCatalogItemsRequest.newBuilder()
- .setParent(parent)
- .setRequestId(requestId)
- .setInputConfig(inputConfig)
- .setErrorsConfig(errorsConfig)
- .build();
- return importCatalogItemsAsync(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Bulk import of multiple catalog items. Request processing may be synchronous. No partial
- * updating supported. Non-existing items will be created.
- *
- * Operation.response is of type ImportResponse. Note that it is possible for a subset of the
- * items to be successfully updated.
- *
- *
Sample code:
- *
- *
- * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
- * String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
- * InputConfig inputConfig = InputConfig.newBuilder().build();
- * ImportCatalogItemsRequest request = ImportCatalogItemsRequest.newBuilder()
- * .setParent(formattedParent)
- * .setInputConfig(inputConfig)
- * .build();
- * ImportCatalogItemsResponse response = catalogServiceClient.importCatalogItemsAsync(request).get();
+ * CatalogItem response = catalogServiceClient.updateCatalogItem(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
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture importCatalogItemsAsync(
- ImportCatalogItemsRequest request) {
- return importCatalogItemsOperationCallable().futureCall(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Bulk import of multiple catalog items. Request processing may be synchronous. No partial
- * updating supported. Non-existing items will be created.
- *
- * Operation.response is of type ImportResponse. Note that it is possible for a subset of the
- * items to be successfully updated.
- *
- *
Sample code:
- *
- *
- * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
- * String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
- * InputConfig inputConfig = InputConfig.newBuilder().build();
- * ImportCatalogItemsRequest request = ImportCatalogItemsRequest.newBuilder()
- * .setParent(formattedParent)
- * .setInputConfig(inputConfig)
- * .build();
- * OperationFuture<ImportCatalogItemsResponse, ImportMetadata> future = catalogServiceClient.importCatalogItemsOperationCallable().futureCall(request);
- * // Do something
- * ImportCatalogItemsResponse response = future.get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable<
- ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata>
- importCatalogItemsOperationCallable() {
- return stub.importCatalogItemsOperationCallable();
+ public final CatalogItem updateCatalogItem(UpdateCatalogItemRequest request) {
+ return updateCatalogItemCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Bulk import of multiple catalog items. Request processing may be synchronous. No partial
- * updating supported. Non-existing items will be created.
- *
- * Operation.response is of type ImportResponse. Note that it is possible for a subset of the
- * items to be successfully updated.
+ * Updates a catalog item. Partial updating is supported. Non-existing items will be created.
*
*
Sample code:
*
*
* try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
- * String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
- * InputConfig inputConfig = InputConfig.newBuilder().build();
- * ImportCatalogItemsRequest request = ImportCatalogItemsRequest.newBuilder()
- * .setParent(formattedParent)
- * .setInputConfig(inputConfig)
+ * CatalogItemPathName name = CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+ * CatalogItem catalogItem = CatalogItem.newBuilder().build();
+ * UpdateCatalogItemRequest request = UpdateCatalogItemRequest.newBuilder()
+ * .setName(name.toString())
+ * .setCatalogItem(catalogItem)
* .build();
- * ApiFuture<Operation> future = catalogServiceClient.importCatalogItemsCallable().futureCall(request);
+ * ApiFuture<CatalogItem> future = catalogServiceClient.updateCatalogItemCallable().futureCall(request);
* // Do something
- * Operation response = future.get();
+ * CatalogItem response = future.get();
* }
*
*/
- public final UnaryCallable importCatalogItemsCallable() {
- return stub.importCatalogItemsCallable();
+ public final UnaryCallable updateCatalogItemCallable() {
+ return stub.updateCatalogItemCallable();
}
@Override
diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceSettings.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceSettings.java
index fb44de2a..f061de3d 100644
--- a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceSettings.java
+++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceSettings.java
@@ -52,16 +52,16 @@
* 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 createCatalogItem to 30 seconds:
+ *
For example, to set the total timeout of deleteCatalogItem to 30 seconds:
*
*
*
* CatalogServiceSettings.Builder catalogServiceSettingsBuilder =
* CatalogServiceSettings.newBuilder();
* catalogServiceSettingsBuilder
- * .createCatalogItemSettings()
+ * .deleteCatalogItemSettings()
* .setRetrySettings(
- * catalogServiceSettingsBuilder.createCatalogItemSettings().getRetrySettings().toBuilder()
+ * catalogServiceSettingsBuilder.deleteCatalogItemSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* CatalogServiceSettings catalogServiceSettings = catalogServiceSettingsBuilder.build();
@@ -71,6 +71,25 @@
@Generated("by gapic-generator")
@BetaApi
public class CatalogServiceSettings extends ClientSettings {
+ /** Returns the object with the settings used for calls to deleteCatalogItem. */
+ public UnaryCallSettings deleteCatalogItemSettings() {
+ return ((CatalogServiceStubSettings) getStubSettings()).deleteCatalogItemSettings();
+ }
+
+ /** Returns the object with the settings used for calls to importCatalogItems. */
+ public UnaryCallSettings importCatalogItemsSettings() {
+ return ((CatalogServiceStubSettings) getStubSettings()).importCatalogItemsSettings();
+ }
+
+ /** Returns the object with the settings used for calls to importCatalogItems. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings<
+ ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata>
+ importCatalogItemsOperationSettings() {
+ return ((CatalogServiceStubSettings) getStubSettings()).importCatalogItemsOperationSettings();
+ }
+
/** Returns the object with the settings used for calls to createCatalogItem. */
public UnaryCallSettings createCatalogItemSettings() {
return ((CatalogServiceStubSettings) getStubSettings()).createCatalogItemSettings();
@@ -93,25 +112,6 @@ public UnaryCallSettings updateCatalogIte
return ((CatalogServiceStubSettings) getStubSettings()).updateCatalogItemSettings();
}
- /** Returns the object with the settings used for calls to deleteCatalogItem. */
- public UnaryCallSettings deleteCatalogItemSettings() {
- return ((CatalogServiceStubSettings) getStubSettings()).deleteCatalogItemSettings();
- }
-
- /** Returns the object with the settings used for calls to importCatalogItems. */
- public UnaryCallSettings importCatalogItemsSettings() {
- return ((CatalogServiceStubSettings) getStubSettings()).importCatalogItemsSettings();
- }
-
- /** Returns the object with the settings used for calls to importCatalogItems. */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public OperationCallSettings<
- ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata>
- importCatalogItemsOperationSettings() {
- return ((CatalogServiceStubSettings) getStubSettings()).importCatalogItemsOperationSettings();
- }
-
public static final CatalogServiceSettings create(CatalogServiceStubSettings stub)
throws IOException {
return new CatalogServiceSettings.Builder(stub.toBuilder()).build();
@@ -209,6 +209,26 @@ public Builder applyToAllUnaryMethods(
return this;
}
+ /** Returns the builder for the settings used for calls to deleteCatalogItem. */
+ public UnaryCallSettings.Builder deleteCatalogItemSettings() {
+ return getStubSettingsBuilder().deleteCatalogItemSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to importCatalogItems. */
+ public UnaryCallSettings.Builder
+ importCatalogItemsSettings() {
+ return getStubSettingsBuilder().importCatalogItemsSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to importCatalogItems. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings.Builder<
+ ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata>
+ importCatalogItemsOperationSettings() {
+ return getStubSettingsBuilder().importCatalogItemsOperationSettings();
+ }
+
/** Returns the builder for the settings used for calls to createCatalogItem. */
public UnaryCallSettings.Builder
createCatalogItemSettings() {
@@ -233,26 +253,6 @@ public UnaryCallSettings.Builder getCatalogI
return getStubSettingsBuilder().updateCatalogItemSettings();
}
- /** Returns the builder for the settings used for calls to deleteCatalogItem. */
- public UnaryCallSettings.Builder deleteCatalogItemSettings() {
- return getStubSettingsBuilder().deleteCatalogItemSettings();
- }
-
- /** Returns the builder for the settings used for calls to importCatalogItems. */
- public UnaryCallSettings.Builder
- importCatalogItemsSettings() {
- return getStubSettingsBuilder().importCatalogItemsSettings();
- }
-
- /** Returns the builder for the settings used for calls to importCatalogItems. */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public OperationCallSettings.Builder<
- ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata>
- importCatalogItemsOperationSettings() {
- return getStubSettingsBuilder().importCatalogItemsOperationSettings();
- }
-
@Override
public CatalogServiceSettings build() throws IOException {
return new CatalogServiceSettings(this);
diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistryClient.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistryClient.java
index 89fd576b..2e1a01d0 100644
--- a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistryClient.java
+++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistryClient.java
@@ -25,7 +25,6 @@
import com.google.api.gax.paging.AbstractPagedListResponse;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.UnaryCallable;
-import com.google.api.pathtemplate.PathTemplate;
import com.google.cloud.recommendationengine.v1beta1.stub.PredictionApiKeyRegistryStub;
import com.google.cloud.recommendationengine.v1beta1.stub.PredictionApiKeyRegistryStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
@@ -48,9 +47,8 @@
*
*
* try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
- * String formattedParent = PredictionApiKeyRegistryClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
- * PredictionApiKeyRegistration predictionApiKeyRegistration = PredictionApiKeyRegistration.newBuilder().build();
- * PredictionApiKeyRegistration response = predictionApiKeyRegistryClient.createPredictionApiKeyRegistration(formattedParent, predictionApiKeyRegistration);
+ * PredictionApiKeyRegistrationName name = PredictionApiKeyRegistrationName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PREDICTION_API_KEY_REGISTRATION]");
+ * predictionApiKeyRegistryClient.deletePredictionApiKeyRegistration(name);
* }
*
*
@@ -112,162 +110,6 @@ public class PredictionApiKeyRegistryClient implements BackgroundResource {
private final PredictionApiKeyRegistrySettings settings;
private final PredictionApiKeyRegistryStub stub;
- private static final PathTemplate EVENT_STORE_PATH_TEMPLATE =
- PathTemplate.createWithoutUrlEncoding(
- "projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}");
-
- private static final PathTemplate PREDICTION_API_KEY_REGISTRATION_PATH_TEMPLATE =
- PathTemplate.createWithoutUrlEncoding(
- "projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/predictionApiKeyRegistrations/{prediction_api_key_registration}");
-
- /**
- * Formats a string containing the fully-qualified path to represent a event_store resource.
- *
- * @deprecated Use the {@link EventStoreName} class instead.
- */
- @Deprecated
- public static final String formatEventStoreName(
- String project, String location, String catalog, String eventStore) {
- return EVENT_STORE_PATH_TEMPLATE.instantiate(
- "project", project,
- "location", location,
- "catalog", catalog,
- "event_store", eventStore);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a
- * prediction_api_key_registration resource.
- *
- * @deprecated Use the {@link PredictionApiKeyRegistrationName} class instead.
- */
- @Deprecated
- public static final String formatPredictionApiKeyRegistrationName(
- String project,
- String location,
- String catalog,
- String eventStore,
- String predictionApiKeyRegistration) {
- return PREDICTION_API_KEY_REGISTRATION_PATH_TEMPLATE.instantiate(
- "project", project,
- "location", location,
- "catalog", catalog,
- "event_store", eventStore,
- "prediction_api_key_registration", predictionApiKeyRegistration);
- }
-
- /**
- * Parses the project from the given fully-qualified path which represents a event_store resource.
- *
- * @deprecated Use the {@link EventStoreName} class instead.
- */
- @Deprecated
- public static final String parseProjectFromEventStoreName(String eventStoreName) {
- return EVENT_STORE_PATH_TEMPLATE.parse(eventStoreName).get("project");
- }
-
- /**
- * Parses the location from the given fully-qualified path which represents a event_store
- * resource.
- *
- * @deprecated Use the {@link EventStoreName} class instead.
- */
- @Deprecated
- public static final String parseLocationFromEventStoreName(String eventStoreName) {
- return EVENT_STORE_PATH_TEMPLATE.parse(eventStoreName).get("location");
- }
-
- /**
- * Parses the catalog from the given fully-qualified path which represents a event_store resource.
- *
- * @deprecated Use the {@link EventStoreName} class instead.
- */
- @Deprecated
- public static final String parseCatalogFromEventStoreName(String eventStoreName) {
- return EVENT_STORE_PATH_TEMPLATE.parse(eventStoreName).get("catalog");
- }
-
- /**
- * Parses the event_store from the given fully-qualified path which represents a event_store
- * resource.
- *
- * @deprecated Use the {@link EventStoreName} class instead.
- */
- @Deprecated
- public static final String parseEventStoreFromEventStoreName(String eventStoreName) {
- return EVENT_STORE_PATH_TEMPLATE.parse(eventStoreName).get("event_store");
- }
-
- /**
- * Parses the project from the given fully-qualified path which represents a
- * prediction_api_key_registration resource.
- *
- * @deprecated Use the {@link PredictionApiKeyRegistrationName} class instead.
- */
- @Deprecated
- public static final String parseProjectFromPredictionApiKeyRegistrationName(
- String predictionApiKeyRegistrationName) {
- return PREDICTION_API_KEY_REGISTRATION_PATH_TEMPLATE
- .parse(predictionApiKeyRegistrationName)
- .get("project");
- }
-
- /**
- * Parses the location from the given fully-qualified path which represents a
- * prediction_api_key_registration resource.
- *
- * @deprecated Use the {@link PredictionApiKeyRegistrationName} class instead.
- */
- @Deprecated
- public static final String parseLocationFromPredictionApiKeyRegistrationName(
- String predictionApiKeyRegistrationName) {
- return PREDICTION_API_KEY_REGISTRATION_PATH_TEMPLATE
- .parse(predictionApiKeyRegistrationName)
- .get("location");
- }
-
- /**
- * Parses the catalog from the given fully-qualified path which represents a
- * prediction_api_key_registration resource.
- *
- * @deprecated Use the {@link PredictionApiKeyRegistrationName} class instead.
- */
- @Deprecated
- public static final String parseCatalogFromPredictionApiKeyRegistrationName(
- String predictionApiKeyRegistrationName) {
- return PREDICTION_API_KEY_REGISTRATION_PATH_TEMPLATE
- .parse(predictionApiKeyRegistrationName)
- .get("catalog");
- }
-
- /**
- * Parses the event_store from the given fully-qualified path which represents a
- * prediction_api_key_registration resource.
- *
- * @deprecated Use the {@link PredictionApiKeyRegistrationName} class instead.
- */
- @Deprecated
- public static final String parseEventStoreFromPredictionApiKeyRegistrationName(
- String predictionApiKeyRegistrationName) {
- return PREDICTION_API_KEY_REGISTRATION_PATH_TEMPLATE
- .parse(predictionApiKeyRegistrationName)
- .get("event_store");
- }
-
- /**
- * Parses the prediction_api_key_registration from the given fully-qualified path which represents
- * a prediction_api_key_registration resource.
- *
- * @deprecated Use the {@link PredictionApiKeyRegistrationName} class instead.
- */
- @Deprecated
- public static final String parsePredictionApiKeyRegistrationFromPredictionApiKeyRegistrationName(
- String predictionApiKeyRegistrationName) {
- return PREDICTION_API_KEY_REGISTRATION_PATH_TEMPLATE
- .parse(predictionApiKeyRegistrationName)
- .get("prediction_api_key_registration");
- }
-
/** Constructs an instance of PredictionApiKeyRegistryClient with default settings. */
public static final PredictionApiKeyRegistryClient create() throws IOException {
return create(PredictionApiKeyRegistrySettings.newBuilder().build());
@@ -318,6 +160,101 @@ public PredictionApiKeyRegistryStub getStub() {
return stub;
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Unregister an apiKey from using for predict method.
+ *
+ * Sample code:
+ *
+ *
+ * try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
+ * PredictionApiKeyRegistrationName name = PredictionApiKeyRegistrationName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PREDICTION_API_KEY_REGISTRATION]");
+ * predictionApiKeyRegistryClient.deletePredictionApiKeyRegistration(name);
+ * }
+ *
+ *
+ * @param name Required. The API key to unregister including full resource path.
+ * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/<YOUR_API_KEY>"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deletePredictionApiKeyRegistration(PredictionApiKeyRegistrationName name) {
+ DeletePredictionApiKeyRegistrationRequest request =
+ DeletePredictionApiKeyRegistrationRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ deletePredictionApiKeyRegistration(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Unregister an apiKey from using for predict method.
+ *
+ * Sample code:
+ *
+ *
+ * try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
+ * PredictionApiKeyRegistrationName name = PredictionApiKeyRegistrationName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PREDICTION_API_KEY_REGISTRATION]");
+ * predictionApiKeyRegistryClient.deletePredictionApiKeyRegistration(name.toString());
+ * }
+ *
+ *
+ * @param name Required. The API key to unregister including full resource path.
+ * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/<YOUR_API_KEY>"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deletePredictionApiKeyRegistration(String name) {
+ DeletePredictionApiKeyRegistrationRequest request =
+ DeletePredictionApiKeyRegistrationRequest.newBuilder().setName(name).build();
+ deletePredictionApiKeyRegistration(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Unregister an apiKey from using for predict method.
+ *
+ * Sample code:
+ *
+ *
+ * try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
+ * PredictionApiKeyRegistrationName name = PredictionApiKeyRegistrationName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PREDICTION_API_KEY_REGISTRATION]");
+ * DeletePredictionApiKeyRegistrationRequest request = DeletePredictionApiKeyRegistrationRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * predictionApiKeyRegistryClient.deletePredictionApiKeyRegistration(request);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deletePredictionApiKeyRegistration(
+ DeletePredictionApiKeyRegistrationRequest request) {
+ deletePredictionApiKeyRegistrationCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Unregister an apiKey from using for predict method.
+ *
+ * Sample code:
+ *
+ *
+ * try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
+ * PredictionApiKeyRegistrationName name = PredictionApiKeyRegistrationName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PREDICTION_API_KEY_REGISTRATION]");
+ * DeletePredictionApiKeyRegistrationRequest request = DeletePredictionApiKeyRegistrationRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<Void> future = predictionApiKeyRegistryClient.deletePredictionApiKeyRegistrationCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ public final UnaryCallable
+ deletePredictionApiKeyRegistrationCallable() {
+ return stub.deletePredictionApiKeyRegistrationCallable();
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Register an API key for use with predict method.
@@ -326,9 +263,38 @@ public PredictionApiKeyRegistryStub getStub() {
*
*
* try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
- * String formattedParent = PredictionApiKeyRegistryClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
* PredictionApiKeyRegistration predictionApiKeyRegistration = PredictionApiKeyRegistration.newBuilder().build();
- * PredictionApiKeyRegistration response = predictionApiKeyRegistryClient.createPredictionApiKeyRegistration(formattedParent, predictionApiKeyRegistration);
+ * PredictionApiKeyRegistration response = predictionApiKeyRegistryClient.createPredictionApiKeyRegistration(parent, predictionApiKeyRegistration);
+ * }
+ *
+ *
+ * @param parent Required. The parent resource path.
+ * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+ * @param predictionApiKeyRegistration Required. The prediction API key registration.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PredictionApiKeyRegistration createPredictionApiKeyRegistration(
+ EventStoreName parent, PredictionApiKeyRegistration predictionApiKeyRegistration) {
+ CreatePredictionApiKeyRegistrationRequest request =
+ CreatePredictionApiKeyRegistrationRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setPredictionApiKeyRegistration(predictionApiKeyRegistration)
+ .build();
+ return createPredictionApiKeyRegistration(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Register an API key for use with predict method.
+ *
+ * Sample code:
+ *
+ *
+ * try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * PredictionApiKeyRegistration predictionApiKeyRegistration = PredictionApiKeyRegistration.newBuilder().build();
+ * PredictionApiKeyRegistration response = predictionApiKeyRegistryClient.createPredictionApiKeyRegistration(parent.toString(), predictionApiKeyRegistration);
* }
*
*
@@ -339,7 +305,6 @@ public PredictionApiKeyRegistryStub getStub() {
*/
public final PredictionApiKeyRegistration createPredictionApiKeyRegistration(
String parent, PredictionApiKeyRegistration predictionApiKeyRegistration) {
- EVENT_STORE_PATH_TEMPLATE.validate(parent, "createPredictionApiKeyRegistration");
CreatePredictionApiKeyRegistrationRequest request =
CreatePredictionApiKeyRegistrationRequest.newBuilder()
.setParent(parent)
@@ -356,10 +321,10 @@ public final PredictionApiKeyRegistration createPredictionApiKeyRegistration(
*
*
* try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
- * String formattedParent = PredictionApiKeyRegistryClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
* PredictionApiKeyRegistration predictionApiKeyRegistration = PredictionApiKeyRegistration.newBuilder().build();
* CreatePredictionApiKeyRegistrationRequest request = CreatePredictionApiKeyRegistrationRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .setPredictionApiKeyRegistration(predictionApiKeyRegistration)
* .build();
* PredictionApiKeyRegistration response = predictionApiKeyRegistryClient.createPredictionApiKeyRegistration(request);
@@ -382,10 +347,10 @@ public final PredictionApiKeyRegistration createPredictionApiKeyRegistration(
*
*
* try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
- * String formattedParent = PredictionApiKeyRegistryClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
* PredictionApiKeyRegistration predictionApiKeyRegistration = PredictionApiKeyRegistration.newBuilder().build();
* CreatePredictionApiKeyRegistrationRequest request = CreatePredictionApiKeyRegistrationRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .setPredictionApiKeyRegistration(predictionApiKeyRegistration)
* .build();
* ApiFuture<PredictionApiKeyRegistration> future = predictionApiKeyRegistryClient.createPredictionApiKeyRegistrationCallable().futureCall(request);
@@ -408,8 +373,36 @@ public final PredictionApiKeyRegistration createPredictionApiKeyRegistration(
*
*
* try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
- * String formattedParent = PredictionApiKeyRegistryClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
- * for (PredictionApiKeyRegistration element : predictionApiKeyRegistryClient.listPredictionApiKeyRegistrations(formattedParent).iterateAll()) {
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * for (PredictionApiKeyRegistration element : predictionApiKeyRegistryClient.listPredictionApiKeyRegistrations(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. The parent placement resource name such as
+ * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListPredictionApiKeyRegistrationsPagedResponse listPredictionApiKeyRegistrations(
+ EventStoreName parent) {
+ ListPredictionApiKeyRegistrationsRequest request =
+ ListPredictionApiKeyRegistrationsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listPredictionApiKeyRegistrations(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * List the registered apiKeys for use with predict method.
+ *
+ * Sample code:
+ *
+ *
+ * try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * for (PredictionApiKeyRegistration element : predictionApiKeyRegistryClient.listPredictionApiKeyRegistrations(parent.toString()).iterateAll()) {
* // doThingsWith(element);
* }
* }
@@ -421,7 +414,6 @@ public final PredictionApiKeyRegistration createPredictionApiKeyRegistration(
*/
public final ListPredictionApiKeyRegistrationsPagedResponse listPredictionApiKeyRegistrations(
String parent) {
- EVENT_STORE_PATH_TEMPLATE.validate(parent, "listPredictionApiKeyRegistrations");
ListPredictionApiKeyRegistrationsRequest request =
ListPredictionApiKeyRegistrationsRequest.newBuilder().setParent(parent).build();
return listPredictionApiKeyRegistrations(request);
@@ -435,9 +427,9 @@ public final ListPredictionApiKeyRegistrationsPagedResponse listPredictionApiKey
*
*
* try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
- * String formattedParent = PredictionApiKeyRegistryClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
* ListPredictionApiKeyRegistrationsRequest request = ListPredictionApiKeyRegistrationsRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .build();
* for (PredictionApiKeyRegistration element : predictionApiKeyRegistryClient.listPredictionApiKeyRegistrations(request).iterateAll()) {
* // doThingsWith(element);
@@ -461,9 +453,9 @@ public final ListPredictionApiKeyRegistrationsPagedResponse listPredictionApiKey
*
*
* try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
- * String formattedParent = PredictionApiKeyRegistryClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
* ListPredictionApiKeyRegistrationsRequest request = ListPredictionApiKeyRegistrationsRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .build();
* ApiFuture<ListPredictionApiKeyRegistrationsPagedResponse> future = predictionApiKeyRegistryClient.listPredictionApiKeyRegistrationsPagedCallable().futureCall(request);
* // Do something
@@ -487,9 +479,9 @@ public final ListPredictionApiKeyRegistrationsPagedResponse listPredictionApiKey
*
*
* try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
- * String formattedParent = PredictionApiKeyRegistryClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
* ListPredictionApiKeyRegistrationsRequest request = ListPredictionApiKeyRegistrationsRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .build();
* while (true) {
* ListPredictionApiKeyRegistrationsResponse response = predictionApiKeyRegistryClient.listPredictionApiKeyRegistrationsCallable().call(request);
@@ -512,78 +504,6 @@ public final ListPredictionApiKeyRegistrationsPagedResponse listPredictionApiKey
return stub.listPredictionApiKeyRegistrationsCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Unregister an apiKey from using for predict method.
- *
- * Sample code:
- *
- *
- * try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
- * String formattedName = PredictionApiKeyRegistryClient.formatPredictionApiKeyRegistrationName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PREDICTION_API_KEY_REGISTRATION]");
- * predictionApiKeyRegistryClient.deletePredictionApiKeyRegistration(formattedName);
- * }
- *
- *
- * @param name Required. The API key to unregister including full resource path.
- * "projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/predictionApiKeyRegistrations/<YOUR_API_KEY>"
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deletePredictionApiKeyRegistration(String name) {
- PREDICTION_API_KEY_REGISTRATION_PATH_TEMPLATE.validate(
- name, "deletePredictionApiKeyRegistration");
- DeletePredictionApiKeyRegistrationRequest request =
- DeletePredictionApiKeyRegistrationRequest.newBuilder().setName(name).build();
- deletePredictionApiKeyRegistration(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Unregister an apiKey from using for predict method.
- *
- * Sample code:
- *
- *
- * try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
- * String formattedName = PredictionApiKeyRegistryClient.formatPredictionApiKeyRegistrationName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PREDICTION_API_KEY_REGISTRATION]");
- * DeletePredictionApiKeyRegistrationRequest request = DeletePredictionApiKeyRegistrationRequest.newBuilder()
- * .setName(formattedName)
- * .build();
- * predictionApiKeyRegistryClient.deletePredictionApiKeyRegistration(request);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deletePredictionApiKeyRegistration(
- DeletePredictionApiKeyRegistrationRequest request) {
- deletePredictionApiKeyRegistrationCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Unregister an apiKey from using for predict method.
- *
- * Sample code:
- *
- *
- * try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
- * String formattedName = PredictionApiKeyRegistryClient.formatPredictionApiKeyRegistrationName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PREDICTION_API_KEY_REGISTRATION]");
- * DeletePredictionApiKeyRegistrationRequest request = DeletePredictionApiKeyRegistrationRequest.newBuilder()
- * .setName(formattedName)
- * .build();
- * ApiFuture<Void> future = predictionApiKeyRegistryClient.deletePredictionApiKeyRegistrationCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallable
- deletePredictionApiKeyRegistrationCallable() {
- return stub.deletePredictionApiKeyRegistrationCallable();
- }
-
@Override
public final void close() {
stub.close();
diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistrySettings.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistrySettings.java
index e1669db9..795e9e26 100644
--- a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistrySettings.java
+++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistrySettings.java
@@ -50,16 +50,16 @@
* 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 createPredictionApiKeyRegistration to 30 seconds:
+ *
For example, to set the total timeout of deletePredictionApiKeyRegistration to 30 seconds:
*
*
*
* PredictionApiKeyRegistrySettings.Builder predictionApiKeyRegistrySettingsBuilder =
* PredictionApiKeyRegistrySettings.newBuilder();
* predictionApiKeyRegistrySettingsBuilder
- * .createPredictionApiKeyRegistrationSettings()
+ * .deletePredictionApiKeyRegistrationSettings()
* .setRetrySettings(
- * predictionApiKeyRegistrySettingsBuilder.createPredictionApiKeyRegistrationSettings().getRetrySettings().toBuilder()
+ * predictionApiKeyRegistrySettingsBuilder.deletePredictionApiKeyRegistrationSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* PredictionApiKeyRegistrySettings predictionApiKeyRegistrySettings = predictionApiKeyRegistrySettingsBuilder.build();
@@ -70,6 +70,13 @@
@BetaApi
public class PredictionApiKeyRegistrySettings
extends ClientSettings {
+ /** Returns the object with the settings used for calls to deletePredictionApiKeyRegistration. */
+ public UnaryCallSettings
+ deletePredictionApiKeyRegistrationSettings() {
+ return ((PredictionApiKeyRegistryStubSettings) getStubSettings())
+ .deletePredictionApiKeyRegistrationSettings();
+ }
+
/** Returns the object with the settings used for calls to createPredictionApiKeyRegistration. */
public UnaryCallSettings
createPredictionApiKeyRegistrationSettings() {
@@ -87,13 +94,6 @@ public class PredictionApiKeyRegistrySettings
.listPredictionApiKeyRegistrationsSettings();
}
- /** Returns the object with the settings used for calls to deletePredictionApiKeyRegistration. */
- public UnaryCallSettings
- deletePredictionApiKeyRegistrationSettings() {
- return ((PredictionApiKeyRegistryStubSettings) getStubSettings())
- .deletePredictionApiKeyRegistrationSettings();
- }
-
public static final PredictionApiKeyRegistrySettings create(
PredictionApiKeyRegistryStubSettings stub) throws IOException {
return new PredictionApiKeyRegistrySettings.Builder(stub.toBuilder()).build();
@@ -192,6 +192,14 @@ public Builder applyToAllUnaryMethods(
return this;
}
+ /**
+ * Returns the builder for the settings used for calls to deletePredictionApiKeyRegistration.
+ */
+ public UnaryCallSettings.Builder
+ deletePredictionApiKeyRegistrationSettings() {
+ return getStubSettingsBuilder().deletePredictionApiKeyRegistrationSettings();
+ }
+
/**
* Returns the builder for the settings used for calls to createPredictionApiKeyRegistration.
*/
@@ -210,14 +218,6 @@ public Builder applyToAllUnaryMethods(
return getStubSettingsBuilder().listPredictionApiKeyRegistrationsSettings();
}
- /**
- * Returns the builder for the settings used for calls to deletePredictionApiKeyRegistration.
- */
- public UnaryCallSettings.Builder
- deletePredictionApiKeyRegistrationSettings() {
- return getStubSettingsBuilder().deletePredictionApiKeyRegistrationSettings();
- }
-
@Override
public PredictionApiKeyRegistrySettings build() throws IOException {
return new PredictionApiKeyRegistrySettings(this);
diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceClient.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceClient.java
index 67c71b95..e99b24c9 100644
--- a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceClient.java
+++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceClient.java
@@ -25,7 +25,6 @@
import com.google.api.gax.paging.AbstractPagedListResponse;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.UnaryCallable;
-import com.google.api.pathtemplate.PathTemplate;
import com.google.cloud.recommendationengine.v1beta1.stub.PredictionServiceStub;
import com.google.cloud.recommendationengine.v1beta1.stub.PredictionServiceStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
@@ -44,15 +43,9 @@
*
*
* try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * String formattedName = PredictionServiceClient.formatPlacementName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PLACEMENT]");
+ * PlacementName name = PlacementName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PLACEMENT]");
* UserEvent userEvent = UserEvent.newBuilder().build();
- * PredictRequest request = PredictRequest.newBuilder()
- * .setName(formattedName)
- * .setUserEvent(userEvent)
- * .build();
- * ApiFuture<PredictPagedResponse> future = predictionServiceClient.predictPagedCallable().futureCall(request);
- * // Do something
- * for (PredictResponse.PredictionResult element : future.get().iterateAll()) {
+ * for (PredictResponse.PredictionResult element : predictionServiceClient.predict(name, userEvent).iterateAll()) {
* // doThingsWith(element);
* }
* }
@@ -116,77 +109,6 @@ public class PredictionServiceClient implements BackgroundResource {
private final PredictionServiceSettings settings;
private final PredictionServiceStub stub;
- private static final PathTemplate PLACEMENT_PATH_TEMPLATE =
- PathTemplate.createWithoutUrlEncoding(
- "projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}/placements/{placement}");
-
- /**
- * Formats a string containing the fully-qualified path to represent a placement resource.
- *
- * @deprecated Use the {@link PlacementName} class instead.
- */
- @Deprecated
- public static final String formatPlacementName(
- String project, String location, String catalog, String eventStore, String placement) {
- return PLACEMENT_PATH_TEMPLATE.instantiate(
- "project", project,
- "location", location,
- "catalog", catalog,
- "event_store", eventStore,
- "placement", placement);
- }
-
- /**
- * Parses the project from the given fully-qualified path which represents a placement resource.
- *
- * @deprecated Use the {@link PlacementName} class instead.
- */
- @Deprecated
- public static final String parseProjectFromPlacementName(String placementName) {
- return PLACEMENT_PATH_TEMPLATE.parse(placementName).get("project");
- }
-
- /**
- * Parses the location from the given fully-qualified path which represents a placement resource.
- *
- * @deprecated Use the {@link PlacementName} class instead.
- */
- @Deprecated
- public static final String parseLocationFromPlacementName(String placementName) {
- return PLACEMENT_PATH_TEMPLATE.parse(placementName).get("location");
- }
-
- /**
- * Parses the catalog from the given fully-qualified path which represents a placement resource.
- *
- * @deprecated Use the {@link PlacementName} class instead.
- */
- @Deprecated
- public static final String parseCatalogFromPlacementName(String placementName) {
- return PLACEMENT_PATH_TEMPLATE.parse(placementName).get("catalog");
- }
-
- /**
- * Parses the event_store from the given fully-qualified path which represents a placement
- * resource.
- *
- * @deprecated Use the {@link PlacementName} class instead.
- */
- @Deprecated
- public static final String parseEventStoreFromPlacementName(String placementName) {
- return PLACEMENT_PATH_TEMPLATE.parse(placementName).get("event_store");
- }
-
- /**
- * Parses the placement from the given fully-qualified path which represents a placement resource.
- *
- * @deprecated Use the {@link PlacementName} class instead.
- */
- @Deprecated
- public static final String parsePlacementFromPlacementName(String placementName) {
- return PLACEMENT_PATH_TEMPLATE.parse(placementName).get("placement");
- }
-
/** Constructs an instance of PredictionServiceClient with default settings. */
public static final PredictionServiceClient create() throws IOException {
return create(PredictionServiceSettings.newBuilder().build());
@@ -246,10 +168,115 @@ public PredictionServiceStub getStub() {
*
*
* try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * String formattedName = PredictionServiceClient.formatPlacementName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PLACEMENT]");
+ * PlacementName name = PlacementName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PLACEMENT]");
+ * UserEvent userEvent = UserEvent.newBuilder().build();
+ * for (PredictResponse.PredictionResult element : predictionServiceClient.predict(name, userEvent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param name Required. Full resource name of the format:
+ * {name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}
+ * The id of the recommendation engine placement. This id is used to identify the set of
+ * models that will be used to make the prediction.
+ * We currently support three placements with the following IDs by default:
+ *
* `shopping_cart`: Predicts items frequently bought together with one or more
+ * catalog items in the same shopping session. Commonly displayed after `add-to-cart` events,
+ * on product detail pages, or on the shopping cart page.
+ *
* `home_page`: Predicts the next product that a user will most likely engage with or
+ * purchase based on the shopping or viewing history of the specified `userId` or `visitorId`.
+ * For example - Recommendations for you.
+ *
* `product_detail`: Predicts the next product that a user will most likely engage
+ * with or purchase. The prediction is based on the shopping or viewing history of the
+ * specified `userId` or `visitorId` and its relevance to a specified `CatalogItem`. Typically
+ * used on product detail pages. For example - More items like this.
+ *
* `recently_viewed_default`: Returns up to 75 items recently viewed by the specified
+ * `userId` or `visitorId`, most recent ones first. Returns nothing if neither of them has
+ * viewed any items yet. For example - Recently viewed.
+ *
The full list of available placements can be seen at
+ * https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard
+ * @param userEvent Required. Context about the user, what they are looking at and what action
+ * they took to trigger the predict request. Note that this user event detail won't be
+ * ingested to userEvent logs. Thus, a separate userEvent write request is required for event
+ * logging.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PredictPagedResponse predict(PlacementName name, UserEvent userEvent) {
+ PredictRequest request =
+ PredictRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setUserEvent(userEvent)
+ .build();
+ return predict(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Makes a recommendation prediction. If using API Key based authentication, the API Key must be
+ * registered using the
+ * [PredictionApiKeyRegistry][google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry]
+ * service. [Learn more](/recommendations-ai/docs/setting-up#register-key).
+ *
+ *
Sample code:
+ *
+ *
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * PlacementName name = PlacementName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PLACEMENT]");
+ * UserEvent userEvent = UserEvent.newBuilder().build();
+ * for (PredictResponse.PredictionResult element : predictionServiceClient.predict(name.toString(), userEvent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param name Required. Full resource name of the format:
+ * {name=projects/*/locations/global/catalogs/default_catalog/eventStores/default_event_store/placements/*}
+ * The id of the recommendation engine placement. This id is used to identify the set of
+ * models that will be used to make the prediction.
+ * We currently support three placements with the following IDs by default:
+ *
* `shopping_cart`: Predicts items frequently bought together with one or more
+ * catalog items in the same shopping session. Commonly displayed after `add-to-cart` events,
+ * on product detail pages, or on the shopping cart page.
+ *
* `home_page`: Predicts the next product that a user will most likely engage with or
+ * purchase based on the shopping or viewing history of the specified `userId` or `visitorId`.
+ * For example - Recommendations for you.
+ *
* `product_detail`: Predicts the next product that a user will most likely engage
+ * with or purchase. The prediction is based on the shopping or viewing history of the
+ * specified `userId` or `visitorId` and its relevance to a specified `CatalogItem`. Typically
+ * used on product detail pages. For example - More items like this.
+ *
* `recently_viewed_default`: Returns up to 75 items recently viewed by the specified
+ * `userId` or `visitorId`, most recent ones first. Returns nothing if neither of them has
+ * viewed any items yet. For example - Recently viewed.
+ *
The full list of available placements can be seen at
+ * https://console.cloud.google.com/recommendation/datafeeds/default_catalog/dashboard
+ * @param userEvent Required. Context about the user, what they are looking at and what action
+ * they took to trigger the predict request. Note that this user event detail won't be
+ * ingested to userEvent logs. Thus, a separate userEvent write request is required for event
+ * logging.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PredictPagedResponse predict(String name, UserEvent userEvent) {
+ PredictRequest request =
+ PredictRequest.newBuilder().setName(name).setUserEvent(userEvent).build();
+ return predict(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Makes a recommendation prediction. If using API Key based authentication, the API Key must be
+ * registered using the
+ * [PredictionApiKeyRegistry][google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry]
+ * service. [Learn more](/recommendations-ai/docs/setting-up#register-key).
+ *
+ *
Sample code:
+ *
+ *
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * PlacementName name = PlacementName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PLACEMENT]");
* UserEvent userEvent = UserEvent.newBuilder().build();
* PredictRequest request = PredictRequest.newBuilder()
- * .setName(formattedName)
+ * .setName(name.toString())
* .setUserEvent(userEvent)
* .build();
* for (PredictResponse.PredictionResult element : predictionServiceClient.predict(request).iterateAll()) {
@@ -276,10 +303,10 @@ public final PredictPagedResponse predict(PredictRequest request) {
*
*
* try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * String formattedName = PredictionServiceClient.formatPlacementName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PLACEMENT]");
+ * PlacementName name = PlacementName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PLACEMENT]");
* UserEvent userEvent = UserEvent.newBuilder().build();
* PredictRequest request = PredictRequest.newBuilder()
- * .setName(formattedName)
+ * .setName(name.toString())
* .setUserEvent(userEvent)
* .build();
* ApiFuture<PredictPagedResponse> future = predictionServiceClient.predictPagedCallable().futureCall(request);
@@ -305,10 +332,10 @@ public final UnaryCallable predictPagedCal
*
*
* try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * String formattedName = PredictionServiceClient.formatPlacementName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PLACEMENT]");
+ * PlacementName name = PlacementName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PLACEMENT]");
* UserEvent userEvent = UserEvent.newBuilder().build();
* PredictRequest request = PredictRequest.newBuilder()
- * .setName(formattedName)
+ * .setName(name.toString())
* .setUserEvent(userEvent)
* .build();
* while (true) {
diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceSettings.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceSettings.java
index cecd5685..b5818f05 100644
--- a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceSettings.java
+++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionServiceSettings.java
@@ -49,7 +49,7 @@
* 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 predictPagedCallable to 30 seconds:
+ *
For example, to set the total timeout of predict to 30 seconds:
*
*
*
diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceClient.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceClient.java
index 99f0d1cc..63205274 100644
--- a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceClient.java
+++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceClient.java
@@ -28,7 +28,6 @@
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.UnaryCallable;
-import com.google.api.pathtemplate.PathTemplate;
import com.google.cloud.recommendationengine.v1beta1.stub.UserEventServiceStub;
import com.google.cloud.recommendationengine.v1beta1.stub.UserEventServiceStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
@@ -49,9 +48,9 @@
*
*
* try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
- * String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
* UserEvent userEvent = UserEvent.newBuilder().build();
- * UserEvent response = userEventServiceClient.writeUserEvent(formattedParent, userEvent);
+ * UserEvent response = userEventServiceClient.writeUserEvent(parent, userEvent);
* }
*
*
@@ -114,67 +113,6 @@ public class UserEventServiceClient implements BackgroundResource {
private final UserEventServiceStub stub;
private final OperationsClient operationsClient;
- private static final PathTemplate EVENT_STORE_PATH_TEMPLATE =
- PathTemplate.createWithoutUrlEncoding(
- "projects/{project}/locations/{location}/catalogs/{catalog}/eventStores/{event_store}");
-
- /**
- * Formats a string containing the fully-qualified path to represent a event_store resource.
- *
- * @deprecated Use the {@link EventStoreName} class instead.
- */
- @Deprecated
- public static final String formatEventStoreName(
- String project, String location, String catalog, String eventStore) {
- return EVENT_STORE_PATH_TEMPLATE.instantiate(
- "project", project,
- "location", location,
- "catalog", catalog,
- "event_store", eventStore);
- }
-
- /**
- * Parses the project from the given fully-qualified path which represents a event_store resource.
- *
- * @deprecated Use the {@link EventStoreName} class instead.
- */
- @Deprecated
- public static final String parseProjectFromEventStoreName(String eventStoreName) {
- return EVENT_STORE_PATH_TEMPLATE.parse(eventStoreName).get("project");
- }
-
- /**
- * Parses the location from the given fully-qualified path which represents a event_store
- * resource.
- *
- * @deprecated Use the {@link EventStoreName} class instead.
- */
- @Deprecated
- public static final String parseLocationFromEventStoreName(String eventStoreName) {
- return EVENT_STORE_PATH_TEMPLATE.parse(eventStoreName).get("location");
- }
-
- /**
- * Parses the catalog from the given fully-qualified path which represents a event_store resource.
- *
- * @deprecated Use the {@link EventStoreName} class instead.
- */
- @Deprecated
- public static final String parseCatalogFromEventStoreName(String eventStoreName) {
- return EVENT_STORE_PATH_TEMPLATE.parse(eventStoreName).get("catalog");
- }
-
- /**
- * Parses the event_store from the given fully-qualified path which represents a event_store
- * resource.
- *
- * @deprecated Use the {@link EventStoreName} class instead.
- */
- @Deprecated
- public static final String parseEventStoreFromEventStoreName(String eventStoreName) {
- return EVENT_STORE_PATH_TEMPLATE.parse(eventStoreName).get("event_store");
- }
-
/** Constructs an instance of UserEventServiceClient with default settings. */
public static final UserEventServiceClient create() throws IOException {
return create(UserEventServiceSettings.newBuilder().build());
@@ -237,577 +175,789 @@ public final OperationsClient getOperationsClient() {
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Writes a single user event.
+ * Deletes permanently all user events specified by the filter provided. Depending on the number
+ * of events specified by the filter, this operation could take hours or days to complete. To test
+ * a filter, use the list command first.
*
* Sample code:
*
*
* try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
- * String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
- * UserEvent userEvent = UserEvent.newBuilder().build();
- * UserEvent response = userEventServiceClient.writeUserEvent(formattedParent, userEvent);
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * String filter = "";
+ * boolean force = false;
+ * PurgeUserEventsResponse response = userEventServiceClient.purgeUserEventsAsync(parent, filter, force).get();
* }
*
*
- * @param parent Required. The parent eventStore resource name, such as
- * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
- * @param userEvent Required. User event to write.
+ * @param parent Required. The resource name of the event_store under which the events are
+ * created. The format is
+ * "projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}"
+ * @param filter Required. The filter string to specify the events to be deleted. Empty string
+ * filter is not allowed. This filter can also be used with ListUserEvents API to list events
+ * that will be deleted. The eligible fields for filtering are: * eventType -
+ * UserEvent.eventType field of type string. * eventTime - in ISO 8601 "zulu" format.
+ * * visitorId - field of type string. Specifying this will delete all events associated
+ * with a visitor. * userId - field of type string. Specifying this will delete all events
+ * associated with a user. Example 1: Deleting all events in a time range. `eventTime >
+ * "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z"` Example 2: Deleting
+ * specific eventType in time range. `eventTime > "2012-04-23T18:25:43.511Z" eventType =
+ * "detail-page-view"` Example 3: Deleting all events for a specific visitor `visitorId =
+ * visitor1024` The filtering fields are assumed to have an implicit AND.
+ * @param force Optional. The default value is false. Override this flag to true to actually
+ * perform the purge. If the field is not set to true, a sampling of events to be deleted will
+ * be returned.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final UserEvent writeUserEvent(String parent, UserEvent userEvent) {
- EVENT_STORE_PATH_TEMPLATE.validate(parent, "writeUserEvent");
- WriteUserEventRequest request =
- WriteUserEventRequest.newBuilder().setParent(parent).setUserEvent(userEvent).build();
- return writeUserEvent(request);
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture
+ purgeUserEventsAsync(EventStoreName parent, String filter, boolean force) {
+ PurgeUserEventsRequest request =
+ PurgeUserEventsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setFilter(filter)
+ .setForce(force)
+ .build();
+ return purgeUserEventsAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Writes a single user event.
+ * Deletes permanently all user events specified by the filter provided. Depending on the number
+ * of events specified by the filter, this operation could take hours or days to complete. To test
+ * a filter, use the list command first.
*
* Sample code:
*
*
* try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
- * String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
- * UserEvent userEvent = UserEvent.newBuilder().build();
- * WriteUserEventRequest request = WriteUserEventRequest.newBuilder()
- * .setParent(formattedParent)
- * .setUserEvent(userEvent)
- * .build();
- * UserEvent response = userEventServiceClient.writeUserEvent(request);
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * String filter = "";
+ * boolean force = false;
+ * PurgeUserEventsResponse response = userEventServiceClient.purgeUserEventsAsync(parent.toString(), filter, force).get();
* }
*
*
- * @param request The request object containing all of the parameters for the API call.
+ * @param parent Required. The resource name of the event_store under which the events are
+ * created. The format is
+ * "projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}"
+ * @param filter Required. The filter string to specify the events to be deleted. Empty string
+ * filter is not allowed. This filter can also be used with ListUserEvents API to list events
+ * that will be deleted. The eligible fields for filtering are: * eventType -
+ * UserEvent.eventType field of type string. * eventTime - in ISO 8601 "zulu" format.
+ * * visitorId - field of type string. Specifying this will delete all events associated
+ * with a visitor. * userId - field of type string. Specifying this will delete all events
+ * associated with a user. Example 1: Deleting all events in a time range. `eventTime >
+ * "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z"` Example 2: Deleting
+ * specific eventType in time range. `eventTime > "2012-04-23T18:25:43.511Z" eventType =
+ * "detail-page-view"` Example 3: Deleting all events for a specific visitor `visitorId =
+ * visitor1024` The filtering fields are assumed to have an implicit AND.
+ * @param force Optional. The default value is false. Override this flag to true to actually
+ * perform the purge. If the field is not set to true, a sampling of events to be deleted will
+ * be returned.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final UserEvent writeUserEvent(WriteUserEventRequest request) {
- return writeUserEventCallable().call(request);
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture
+ purgeUserEventsAsync(String parent, String filter, boolean force) {
+ PurgeUserEventsRequest request =
+ PurgeUserEventsRequest.newBuilder()
+ .setParent(parent)
+ .setFilter(filter)
+ .setForce(force)
+ .build();
+ return purgeUserEventsAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Writes a single user event.
+ * Deletes permanently all user events specified by the filter provided. Depending on the number
+ * of events specified by the filter, this operation could take hours or days to complete. To test
+ * a filter, use the list command first.
*
* Sample code:
*
*
* try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
- * String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
- * UserEvent userEvent = UserEvent.newBuilder().build();
- * WriteUserEventRequest request = WriteUserEventRequest.newBuilder()
- * .setParent(formattedParent)
- * .setUserEvent(userEvent)
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * String filter = "";
+ * PurgeUserEventsRequest request = PurgeUserEventsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setFilter(filter)
* .build();
- * ApiFuture<UserEvent> future = userEventServiceClient.writeUserEventCallable().futureCall(request);
- * // Do something
- * UserEvent response = future.get();
+ * 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
*/
- public final UnaryCallable writeUserEventCallable() {
- return stub.writeUserEventCallable();
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture
+ purgeUserEventsAsync(PurgeUserEventsRequest request) {
+ return purgeUserEventsOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Writes a single user event from the browser. This uses a GET request to due to browser
- * restriction of POST-ing to a 3rd party domain.
- *
- * This method is used only by the Recommendations AI JavaScript pixel. Users should not call
- * this method directly.
+ * Deletes permanently all user events specified by the filter provided. Depending on the number
+ * of events specified by the filter, this operation could take hours or days to complete. To test
+ * a filter, use the list command first.
*
*
Sample code:
*
*
* try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
- * String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
- * String userEvent = "";
- * String uri = "";
- * long ets = 0L;
- * HttpBody response = userEventServiceClient.collectUserEvent(formattedParent, userEvent, uri, ets);
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * String filter = "";
+ * PurgeUserEventsRequest request = PurgeUserEventsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setFilter(filter)
+ * .build();
+ * OperationFuture<PurgeUserEventsResponse, PurgeUserEventsMetadata> future = userEventServiceClient.purgeUserEventsOperationCallable().futureCall(request);
+ * // Do something
+ * PurgeUserEventsResponse response = future.get();
* }
*
- *
- * @param parent Required. The parent eventStore name, such as
- * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
- * @param userEvent Required. URL encoded UserEvent proto.
- * @param uri Optional. The url including cgi-parameters but excluding the hash fragment. The URL
- * must be truncated to 1.5K bytes to conservatively be under the 2K bytes. This is often more
- * useful than the referer url, because many browsers only send the domain for 3rd party
- * requests.
- * @param ets Optional. The event timestamp in milliseconds. This prevents browser caching of
- * otherwise identical get requests. The name is abbreviated to reduce the payload bytes.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final HttpBody collectUserEvent(String parent, String userEvent, String uri, long ets) {
- EVENT_STORE_PATH_TEMPLATE.validate(parent, "collectUserEvent");
- CollectUserEventRequest request =
- CollectUserEventRequest.newBuilder()
- .setParent(parent)
- .setUserEvent(userEvent)
- .setUri(uri)
- .setEts(ets)
- .build();
- return collectUserEvent(request);
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public final OperationCallable<
+ PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeUserEventsMetadata>
+ purgeUserEventsOperationCallable() {
+ return stub.purgeUserEventsOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Writes a single user event from the browser. This uses a GET request to due to browser
- * restriction of POST-ing to a 3rd party domain.
- *
- * This method is used only by the Recommendations AI JavaScript pixel. Users should not call
- * this method directly.
+ * Deletes permanently all user events specified by the filter provided. Depending on the number
+ * of events specified by the filter, this operation could take hours or days to complete. To test
+ * a filter, use the list command first.
*
*
Sample code:
*
*
* try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
- * String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
- * String userEvent = "";
- * CollectUserEventRequest request = CollectUserEventRequest.newBuilder()
- * .setParent(formattedParent)
- * .setUserEvent(userEvent)
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * String filter = "";
+ * PurgeUserEventsRequest request = PurgeUserEventsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setFilter(filter)
* .build();
- * HttpBody response = userEventServiceClient.collectUserEvent(request);
+ * ApiFuture<Operation> future = userEventServiceClient.purgeUserEventsCallable().futureCall(request);
+ * // Do something
+ * Operation response = future.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
*/
- public final HttpBody collectUserEvent(CollectUserEventRequest request) {
- return collectUserEventCallable().call(request);
+ public final UnaryCallable purgeUserEventsCallable() {
+ return stub.purgeUserEventsCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Writes a single user event from the browser. This uses a GET request to due to browser
- * restriction of POST-ing to a 3rd party domain.
+ * Bulk import of User events. Request processing might be synchronous. Events that already exist
+ * are skipped. Use this method for backfilling historical user events.
*
- * This method is used only by the Recommendations AI JavaScript pixel. Users should not call
- * this method directly.
+ *
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:
*
*
* try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
- * String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
- * String userEvent = "";
- * CollectUserEventRequest request = CollectUserEventRequest.newBuilder()
- * .setParent(formattedParent)
- * .setUserEvent(userEvent)
- * .build();
- * ApiFuture<HttpBody> future = userEventServiceClient.collectUserEventCallable().futureCall(request);
- * // Do something
- * HttpBody response = future.get();
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * String requestId = "";
+ * InputConfig inputConfig = InputConfig.newBuilder().build();
+ * ImportErrorsConfig errorsConfig = ImportErrorsConfig.newBuilder().build();
+ * ImportUserEventsResponse response = userEventServiceClient.importUserEventsAsync(parent, requestId, inputConfig, errorsConfig).get();
* }
*
+ *
+ * @param parent Required.
+ * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store"
+ * @param requestId Optional. Unique identifier provided by client, within the ancestor dataset
+ * scope. Ensures idempotency for expensive long running operations. Server-generated if
+ * unspecified. Up to 128 characters long. This is returned as
+ * google.longrunning.Operation.name in the response. Note that this field must not be set if
+ * the desired input config is catalog_inline_source.
+ * @param inputConfig Required. The desired input location of the data.
+ * @param errorsConfig Optional. The desired location of errors incurred during the Import.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final UnaryCallable collectUserEventCallable() {
- return stub.collectUserEventCallable();
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture importUserEventsAsync(
+ EventStoreName parent,
+ String requestId,
+ InputConfig inputConfig,
+ ImportErrorsConfig errorsConfig) {
+ ImportUserEventsRequest request =
+ ImportUserEventsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setRequestId(requestId)
+ .setInputConfig(inputConfig)
+ .setErrorsConfig(errorsConfig)
+ .build();
+ return importUserEventsAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets a list of user events within a time range, with potential filtering.
+ * Bulk import of User events. Request processing might be synchronous. Events that already exist
+ * are skipped. Use this method for backfilling historical user events.
+ *
+ * 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:
*
*
* try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
- * String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
- * String filter = "";
- * for (UserEvent element : userEventServiceClient.listUserEvents(formattedParent, filter).iterateAll()) {
- * // doThingsWith(element);
- * }
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * String requestId = "";
+ * InputConfig inputConfig = InputConfig.newBuilder().build();
+ * ImportErrorsConfig errorsConfig = ImportErrorsConfig.newBuilder().build();
+ * ImportUserEventsResponse response = userEventServiceClient.importUserEventsAsync(parent.toString(), requestId, inputConfig, errorsConfig).get();
* }
*
*
- * @param parent Required. The parent eventStore resource name, such as
- * "projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store".
- * @param filter Optional. Filtering expression to specify restrictions over returned events. This
- * is a sequence of terms, where each term applies some kind of a restriction to the returned
- * user events. Use this expression to restrict results to a specific time range, or filter
- * events by eventType. eg: eventTime > "2012-04-23T18:25:43.511Z"
- * eventsMissingCatalogItems eventTime<"2012-04-23T18:25:43.511Z" eventType=search
- * We expect only 3 types of fields:
- *
* eventTime: this can be specified a maximum of 2 times, once with a less than
- * operator and once with a greater than operator. The eventTime restrict should result in one
- * contiguous valid eventTime range.
- *
* eventType: only 1 eventType restriction can be specified.
- *
* eventsMissingCatalogItems: specififying this will restrict results to events for
- * which catalog items were not found in the catalog. The default behavior is to return only
- * those events for which catalog items were found.
- *
Some examples of valid filters expressions:
- *
* Example 1: eventTime > "2012-04-23T18:25:43.511Z" eventTime <
- * "2012-04-23T18:30:43.511Z" * Example 2: eventTime > "2012-04-23T18:25:43.511Z"
- * eventType = detail-page-view * Example 3: eventsMissingCatalogItems eventType = search
- * eventTime < "2018-04-23T18:30:43.511Z" * Example 4: eventTime >
- * "2012-04-23T18:25:43.511Z" * Example 5: eventType = search * Example 6:
- * eventsMissingCatalogItems
+ * @param parent Required.
+ * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store"
+ * @param requestId Optional. Unique identifier provided by client, within the ancestor dataset
+ * scope. Ensures idempotency for expensive long running operations. Server-generated if
+ * unspecified. Up to 128 characters long. This is returned as
+ * google.longrunning.Operation.name in the response. Note that this field must not be set if
+ * the desired input config is catalog_inline_source.
+ * @param inputConfig Required. The desired input location of the data.
+ * @param errorsConfig Optional. The desired location of errors incurred during the Import.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListUserEventsPagedResponse listUserEvents(String parent, String filter) {
- EVENT_STORE_PATH_TEMPLATE.validate(parent, "listUserEvents");
- ListUserEventsRequest request =
- ListUserEventsRequest.newBuilder().setParent(parent).setFilter(filter).build();
- return listUserEvents(request);
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture importUserEventsAsync(
+ String parent, String requestId, InputConfig inputConfig, ImportErrorsConfig errorsConfig) {
+ ImportUserEventsRequest request =
+ ImportUserEventsRequest.newBuilder()
+ .setParent(parent)
+ .setRequestId(requestId)
+ .setInputConfig(inputConfig)
+ .setErrorsConfig(errorsConfig)
+ .build();
+ return importUserEventsAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets a list of user events within a time range, with potential filtering.
+ * Bulk import of User events. Request processing might be synchronous. Events that already exist
+ * are skipped. Use this method for backfilling historical user events.
+ *
+ * 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:
*
*
* try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
- * String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
- * ListUserEventsRequest request = ListUserEventsRequest.newBuilder()
- * .setParent(formattedParent)
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * InputConfig inputConfig = InputConfig.newBuilder().build();
+ * ImportUserEventsRequest request = ImportUserEventsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setInputConfig(inputConfig)
* .build();
- * for (UserEvent element : userEventServiceClient.listUserEvents(request).iterateAll()) {
- * // doThingsWith(element);
- * }
+ * 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
*/
- public final ListUserEventsPagedResponse listUserEvents(ListUserEventsRequest request) {
- return listUserEventsPagedCallable().call(request);
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture importUserEventsAsync(
+ ImportUserEventsRequest request) {
+ return importUserEventsOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets a list of user events within a time range, with potential filtering.
+ * Bulk import of User events. Request processing might be synchronous. Events that already exist
+ * are skipped. Use this method for backfilling historical user events.
+ *
+ * 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:
*
*
* try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
- * String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
- * ListUserEventsRequest request = ListUserEventsRequest.newBuilder()
- * .setParent(formattedParent)
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * InputConfig inputConfig = InputConfig.newBuilder().build();
+ * ImportUserEventsRequest request = ImportUserEventsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setInputConfig(inputConfig)
* .build();
- * ApiFuture<ListUserEventsPagedResponse> future = userEventServiceClient.listUserEventsPagedCallable().futureCall(request);
+ * OperationFuture<ImportUserEventsResponse, ImportMetadata> future = userEventServiceClient.importUserEventsOperationCallable().futureCall(request);
* // Do something
- * for (UserEvent element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
+ * ImportUserEventsResponse response = future.get();
* }
*
*/
- public final UnaryCallable
- listUserEventsPagedCallable() {
- return stub.listUserEventsPagedCallable();
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public final OperationCallable
+ importUserEventsOperationCallable() {
+ return stub.importUserEventsOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets a list of user events within a time range, with potential filtering.
+ * Bulk import of User events. Request processing might be synchronous. Events that already exist
+ * are skipped. Use this method for backfilling historical user events.
+ *
+ * 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:
*
*
* try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
- * String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
- * ListUserEventsRequest request = ListUserEventsRequest.newBuilder()
- * .setParent(formattedParent)
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * InputConfig inputConfig = InputConfig.newBuilder().build();
+ * ImportUserEventsRequest request = ImportUserEventsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setInputConfig(inputConfig)
* .build();
- * while (true) {
- * ListUserEventsResponse response = userEventServiceClient.listUserEventsCallable().call(request);
- * for (UserEvent element : response.getUserEventsList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
+ * ApiFuture<Operation> future = userEventServiceClient.importUserEventsCallable().futureCall(request);
+ * // Do something
+ * Operation response = future.get();
* }
*
*/
- public final UnaryCallable
- listUserEventsCallable() {
- return stub.listUserEventsCallable();
+ public final UnaryCallable importUserEventsCallable() {
+ return stub.importUserEventsCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes permanently all user events specified by the filter provided. Depending on the number
- * of events specified by the filter, this operation could take hours or days to complete. To test
- * a filter, use the list command first.
+ * Writes a single user event.
*
* Sample code:
*
*
* try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
- * String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
- * String filter = "";
- * boolean force = false;
- * PurgeUserEventsResponse response = userEventServiceClient.purgeUserEventsAsync(formattedParent, filter, force).get();
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * UserEvent userEvent = UserEvent.newBuilder().build();
+ * UserEvent response = userEventServiceClient.writeUserEvent(parent, userEvent);
* }
*
*
- * @param parent Required. The resource name of the event_store under which the events are
- * created. The format is
- * "projects/${projectId}/locations/global/catalogs/${catalogId}/eventStores/${eventStoreId}"
- * @param filter Required. The filter string to specify the events to be deleted. Empty string
- * filter is not allowed. This filter can also be used with ListUserEvents API to list events
- * that will be deleted. The eligible fields for filtering are: * eventType -
- * UserEvent.eventType field of type string. * eventTime - in ISO 8601 "zulu" format.
- * * visitorId - field of type string. Specifying this will delete all events associated
- * with a visitor. * userId - field of type string. Specifying this will delete all events
- * associated with a user. Example 1: Deleting all events in a time range. `eventTime >
- * "2012-04-23T18:25:43.511Z" eventTime < "2012-04-23T18:30:43.511Z"` Example 2: Deleting
- * specific eventType in time range. `eventTime > "2012-04-23T18:25:43.511Z" eventType =
- * "detail-page-view"` Example 3: Deleting all events for a specific visitor `visitorId =
- * visitor1024` The filtering fields are assumed to have an implicit AND.
- * @param force Optional. The default value is false. Override this flag to true to actually
- * perform the purge. If the field is not set to true, a sampling of events to be deleted will
- * be returned.
+ * @param parent Required. The parent eventStore resource name, such as
+ * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+ * @param userEvent Required. User event to write.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture
- purgeUserEventsAsync(String parent, String filter, boolean force) {
- EVENT_STORE_PATH_TEMPLATE.validate(parent, "purgeUserEvents");
- PurgeUserEventsRequest request =
- PurgeUserEventsRequest.newBuilder()
- .setParent(parent)
- .setFilter(filter)
- .setForce(force)
+ public final UserEvent writeUserEvent(EventStoreName parent, UserEvent userEvent) {
+ WriteUserEventRequest request =
+ WriteUserEventRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setUserEvent(userEvent)
.build();
- return purgeUserEventsAsync(request);
+ return writeUserEvent(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes permanently all user events specified by the filter provided. Depending on the number
- * of events specified by the filter, this operation could take hours or days to complete. To test
- * a filter, use the list command first.
+ * Writes a single user event.
*
* Sample code:
*
*
* try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
- * String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
- * String filter = "";
- * PurgeUserEventsRequest request = PurgeUserEventsRequest.newBuilder()
- * .setParent(formattedParent)
- * .setFilter(filter)
- * .build();
- * PurgeUserEventsResponse response = userEventServiceClient.purgeUserEventsAsync(request).get();
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * UserEvent userEvent = UserEvent.newBuilder().build();
+ * UserEvent response = userEventServiceClient.writeUserEvent(parent.toString(), userEvent);
* }
*
*
- * @param request The request object containing all of the parameters for the API call.
+ * @param parent Required. The parent eventStore resource name, such as
+ * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+ * @param userEvent Required. User event to write.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture
- purgeUserEventsAsync(PurgeUserEventsRequest request) {
- return purgeUserEventsOperationCallable().futureCall(request);
+ public final UserEvent writeUserEvent(String parent, UserEvent userEvent) {
+ WriteUserEventRequest request =
+ WriteUserEventRequest.newBuilder().setParent(parent).setUserEvent(userEvent).build();
+ return writeUserEvent(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes permanently all user events specified by the filter provided. Depending on the number
- * of events specified by the filter, this operation could take hours or days to complete. To test
- * a filter, use the list command first.
+ * Writes a single user event.
*
* Sample code:
*
*
* try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
- * String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
- * String filter = "";
- * PurgeUserEventsRequest request = PurgeUserEventsRequest.newBuilder()
- * .setParent(formattedParent)
- * .setFilter(filter)
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * UserEvent userEvent = UserEvent.newBuilder().build();
+ * WriteUserEventRequest request = WriteUserEventRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setUserEvent(userEvent)
* .build();
- * OperationFuture<PurgeUserEventsResponse, PurgeUserEventsMetadata> future = userEventServiceClient.purgeUserEventsOperationCallable().futureCall(request);
- * // Do something
- * PurgeUserEventsResponse response = future.get();
+ * 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
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable<
- PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeUserEventsMetadata>
- purgeUserEventsOperationCallable() {
- return stub.purgeUserEventsOperationCallable();
+ public final UserEvent writeUserEvent(WriteUserEventRequest request) {
+ return writeUserEventCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes permanently all user events specified by the filter provided. Depending on the number
- * of events specified by the filter, this operation could take hours or days to complete. To test
- * a filter, use the list command first.
+ * Writes a single user event.
*
* Sample code:
*
*
* try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
- * String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
- * String filter = "";
- * PurgeUserEventsRequest request = PurgeUserEventsRequest.newBuilder()
- * .setParent(formattedParent)
- * .setFilter(filter)
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * UserEvent userEvent = UserEvent.newBuilder().build();
+ * WriteUserEventRequest request = WriteUserEventRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setUserEvent(userEvent)
* .build();
- * ApiFuture<Operation> future = userEventServiceClient.purgeUserEventsCallable().futureCall(request);
+ * ApiFuture<UserEvent> future = userEventServiceClient.writeUserEventCallable().futureCall(request);
* // Do something
- * Operation response = future.get();
+ * UserEvent response = future.get();
* }
*
*/
- public final UnaryCallable purgeUserEventsCallable() {
- return stub.purgeUserEventsCallable();
+ public final UnaryCallable writeUserEventCallable() {
+ return stub.writeUserEventCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Bulk import of User events. Request processing might be synchronous. Events that already exist
- * are skipped. Use this method for backfilling historical user events.
+ * Writes a single user event from the browser. This uses a GET request to due to browser
+ * restriction of POST-ing to a 3rd party domain.
*
- * 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.
+ *
This method is used only by the Recommendations AI JavaScript pixel. Users should not call
+ * this method directly.
*
*
Sample code:
*
*
* try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
- * String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
- * String requestId = "";
- * InputConfig inputConfig = InputConfig.newBuilder().build();
- * ImportErrorsConfig errorsConfig = ImportErrorsConfig.newBuilder().build();
- * ImportUserEventsResponse response = userEventServiceClient.importUserEventsAsync(formattedParent, requestId, inputConfig, errorsConfig).get();
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * String userEvent = "";
+ * String uri = "";
+ * long ets = 0L;
+ * HttpBody response = userEventServiceClient.collectUserEvent(parent, userEvent, uri, ets);
* }
*
*
- * @param parent Required.
- * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store"
- * @param requestId Optional. Unique identifier provided by client, within the ancestor dataset
- * scope. Ensures idempotency for expensive long running operations. Server-generated if
- * unspecified. Up to 128 characters long. This is returned as
- * google.longrunning.Operation.name in the response. Note that this field must not be set if
- * the desired input config is catalog_inline_source.
- * @param inputConfig Required. The desired input location of the data.
- * @param errorsConfig Optional. The desired location of errors incurred during the Import.
+ * @param parent Required. The parent eventStore name, such as
+ * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+ * @param userEvent Required. URL encoded UserEvent proto.
+ * @param uri Optional. The url including cgi-parameters but excluding the hash fragment. The URL
+ * must be truncated to 1.5K bytes to conservatively be under the 2K bytes. This is often more
+ * useful than the referer url, because many browsers only send the domain for 3rd party
+ * requests.
+ * @param ets Optional. The event timestamp in milliseconds. This prevents browser caching of
+ * otherwise identical get requests. The name is abbreviated to reduce the payload bytes.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture importUserEventsAsync(
- String parent, String requestId, InputConfig inputConfig, ImportErrorsConfig errorsConfig) {
- EVENT_STORE_PATH_TEMPLATE.validate(parent, "importUserEvents");
- ImportUserEventsRequest request =
- ImportUserEventsRequest.newBuilder()
+ public final HttpBody collectUserEvent(
+ EventStoreName parent, String userEvent, String uri, long ets) {
+ CollectUserEventRequest request =
+ CollectUserEventRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setUserEvent(userEvent)
+ .setUri(uri)
+ .setEts(ets)
+ .build();
+ return collectUserEvent(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Writes a single user event from the browser. This uses a GET request to due to browser
+ * restriction of POST-ing to a 3rd party domain.
+ *
+ * This method is used only by the Recommendations AI JavaScript pixel. Users should not call
+ * this method directly.
+ *
+ *
Sample code:
+ *
+ *
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * String userEvent = "";
+ * String uri = "";
+ * long ets = 0L;
+ * HttpBody response = userEventServiceClient.collectUserEvent(parent.toString(), userEvent, uri, ets);
+ * }
+ *
+ *
+ * @param parent Required. The parent eventStore name, such as
+ * "projects/1234/locations/global/catalogs/default_catalog/eventStores/default_event_store".
+ * @param userEvent Required. URL encoded UserEvent proto.
+ * @param uri Optional. The url including cgi-parameters but excluding the hash fragment. The URL
+ * must be truncated to 1.5K bytes to conservatively be under the 2K bytes. This is often more
+ * useful than the referer url, because many browsers only send the domain for 3rd party
+ * requests.
+ * @param ets Optional. The event timestamp in milliseconds. This prevents browser caching of
+ * otherwise identical get requests. The name is abbreviated to reduce the payload bytes.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final HttpBody collectUserEvent(String parent, String userEvent, String uri, long ets) {
+ CollectUserEventRequest request =
+ CollectUserEventRequest.newBuilder()
.setParent(parent)
- .setRequestId(requestId)
- .setInputConfig(inputConfig)
- .setErrorsConfig(errorsConfig)
+ .setUserEvent(userEvent)
+ .setUri(uri)
+ .setEts(ets)
.build();
- return importUserEventsAsync(request);
+ return collectUserEvent(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Bulk import of User events. Request processing might be synchronous. Events that already exist
- * are skipped. Use this method for backfilling historical user events.
+ * Writes a single user event from the browser. This uses a GET request to due to browser
+ * restriction of POST-ing to a 3rd party domain.
*
- * 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.
+ *
This method is used only by the Recommendations AI JavaScript pixel. Users should not call
+ * this method directly.
*
*
Sample code:
*
*
* try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
- * String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
- * InputConfig inputConfig = InputConfig.newBuilder().build();
- * ImportUserEventsRequest request = ImportUserEventsRequest.newBuilder()
- * .setParent(formattedParent)
- * .setInputConfig(inputConfig)
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * String userEvent = "";
+ * CollectUserEventRequest request = CollectUserEventRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setUserEvent(userEvent)
* .build();
- * ImportUserEventsResponse response = userEventServiceClient.importUserEventsAsync(request).get();
+ * 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
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture importUserEventsAsync(
- ImportUserEventsRequest request) {
- return importUserEventsOperationCallable().futureCall(request);
+ public final HttpBody collectUserEvent(CollectUserEventRequest request) {
+ return collectUserEventCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Bulk import of User events. Request processing might be synchronous. Events that already exist
- * are skipped. Use this method for backfilling historical user events.
+ * Writes a single user event from the browser. This uses a GET request to due to browser
+ * restriction of POST-ing to a 3rd party domain.
*
- * 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.
+ *
This method is used only by the Recommendations AI JavaScript pixel. Users should not call
+ * this method directly.
*
*
Sample code:
*
*
* try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
- * String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
- * InputConfig inputConfig = InputConfig.newBuilder().build();
- * ImportUserEventsRequest request = ImportUserEventsRequest.newBuilder()
- * .setParent(formattedParent)
- * .setInputConfig(inputConfig)
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * String userEvent = "";
+ * CollectUserEventRequest request = CollectUserEventRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setUserEvent(userEvent)
* .build();
- * OperationFuture<ImportUserEventsResponse, ImportMetadata> future = userEventServiceClient.importUserEventsOperationCallable().futureCall(request);
+ * ApiFuture<HttpBody> future = userEventServiceClient.collectUserEventCallable().futureCall(request);
* // Do something
- * ImportUserEventsResponse response = future.get();
+ * HttpBody response = future.get();
* }
*
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
- importUserEventsOperationCallable() {
- return stub.importUserEventsOperationCallable();
+ public final UnaryCallable collectUserEventCallable() {
+ return stub.collectUserEventCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Bulk import of User events. Request processing might be synchronous. Events that already exist
- * are skipped. Use this method for backfilling historical user events.
+ * Gets a list of user events within a time range, with potential filtering.
*
- * 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:
+ *
+ *
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * String filter = "";
+ * for (UserEvent element : userEventServiceClient.listUserEvents(parent, filter).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. The parent eventStore resource name, such as
+ * "projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store".
+ * @param filter Optional. Filtering expression to specify restrictions over returned events. This
+ * is a sequence of terms, where each term applies some kind of a restriction to the returned
+ * user events. Use this expression to restrict results to a specific time range, or filter
+ * events by eventType. eg: eventTime > "2012-04-23T18:25:43.511Z"
+ * eventsMissingCatalogItems eventTime<"2012-04-23T18:25:43.511Z" eventType=search
+ * We expect only 3 types of fields:
+ *
* eventTime: this can be specified a maximum of 2 times, once with a less than
+ * operator and once with a greater than operator. The eventTime restrict should result in one
+ * contiguous valid eventTime range.
+ *
* eventType: only 1 eventType restriction can be specified.
+ *
* eventsMissingCatalogItems: specififying this will restrict results to events for
+ * which catalog items were not found in the catalog. The default behavior is to return only
+ * those events for which catalog items were found.
+ *
Some examples of valid filters expressions:
+ *
* Example 1: eventTime > "2012-04-23T18:25:43.511Z" eventTime <
+ * "2012-04-23T18:30:43.511Z" * Example 2: eventTime > "2012-04-23T18:25:43.511Z"
+ * eventType = detail-page-view * Example 3: eventsMissingCatalogItems eventType = search
+ * eventTime < "2018-04-23T18:30:43.511Z" * Example 4: eventTime >
+ * "2012-04-23T18:25:43.511Z" * Example 5: eventType = search * Example 6:
+ * eventsMissingCatalogItems
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListUserEventsPagedResponse listUserEvents(EventStoreName parent, String filter) {
+ ListUserEventsRequest request =
+ ListUserEventsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setFilter(filter)
+ .build();
+ return listUserEvents(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a list of user events within a time range, with potential filtering.
*
*
Sample code:
*
*
* try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
- * String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
- * InputConfig inputConfig = InputConfig.newBuilder().build();
- * ImportUserEventsRequest request = ImportUserEventsRequest.newBuilder()
- * .setParent(formattedParent)
- * .setInputConfig(inputConfig)
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * String filter = "";
+ * for (UserEvent element : userEventServiceClient.listUserEvents(parent.toString(), filter).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. The parent eventStore resource name, such as
+ * "projects/*/locations/*/catalogs/default_catalog/eventStores/default_event_store".
+ * @param filter Optional. Filtering expression to specify restrictions over returned events. This
+ * is a sequence of terms, where each term applies some kind of a restriction to the returned
+ * user events. Use this expression to restrict results to a specific time range, or filter
+ * events by eventType. eg: eventTime > "2012-04-23T18:25:43.511Z"
+ * eventsMissingCatalogItems eventTime<"2012-04-23T18:25:43.511Z" eventType=search
+ * We expect only 3 types of fields:
+ *
* eventTime: this can be specified a maximum of 2 times, once with a less than
+ * operator and once with a greater than operator. The eventTime restrict should result in one
+ * contiguous valid eventTime range.
+ *
* eventType: only 1 eventType restriction can be specified.
+ *
* eventsMissingCatalogItems: specififying this will restrict results to events for
+ * which catalog items were not found in the catalog. The default behavior is to return only
+ * those events for which catalog items were found.
+ *
Some examples of valid filters expressions:
+ *
* Example 1: eventTime > "2012-04-23T18:25:43.511Z" eventTime <
+ * "2012-04-23T18:30:43.511Z" * Example 2: eventTime > "2012-04-23T18:25:43.511Z"
+ * eventType = detail-page-view * Example 3: eventsMissingCatalogItems eventType = search
+ * eventTime < "2018-04-23T18:30:43.511Z" * Example 4: eventTime >
+ * "2012-04-23T18:25:43.511Z" * Example 5: eventType = search * Example 6:
+ * eventsMissingCatalogItems
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListUserEventsPagedResponse listUserEvents(String parent, String filter) {
+ ListUserEventsRequest request =
+ ListUserEventsRequest.newBuilder().setParent(parent).setFilter(filter).build();
+ return listUserEvents(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a list of user events within a time range, with potential filtering.
+ *
+ *
Sample code:
+ *
+ *
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * ListUserEventsRequest request = ListUserEventsRequest.newBuilder()
+ * .setParent(parent.toString())
* .build();
- * ApiFuture<Operation> future = userEventServiceClient.importUserEventsCallable().futureCall(request);
+ * for (UserEvent element : userEventServiceClient.listUserEvents(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
+ */
+ public final ListUserEventsPagedResponse listUserEvents(ListUserEventsRequest request) {
+ return listUserEventsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a list of user events within a time range, with potential filtering.
+ *
+ * Sample code:
+ *
+ *
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * ListUserEventsRequest request = ListUserEventsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * ApiFuture<ListUserEventsPagedResponse> future = userEventServiceClient.listUserEventsPagedCallable().futureCall(request);
* // Do something
- * Operation response = future.get();
+ * for (UserEvent element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
* }
*
*/
- public final UnaryCallable importUserEventsCallable() {
- return stub.importUserEventsCallable();
+ public final UnaryCallable
+ listUserEventsPagedCallable() {
+ return stub.listUserEventsPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a list of user events within a time range, with potential filtering.
+ *
+ * Sample code:
+ *
+ *
+ * try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * ListUserEventsRequest request = ListUserEventsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * while (true) {
+ * ListUserEventsResponse response = userEventServiceClient.listUserEventsCallable().call(request);
+ * for (UserEvent element : response.getUserEventsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ *
+ */
+ public final UnaryCallable
+ listUserEventsCallable() {
+ return stub.listUserEventsCallable();
}
@Override
diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceSettings.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceSettings.java
index 8d861f9e..51405015 100644
--- a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceSettings.java
+++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/UserEventServiceSettings.java
@@ -71,23 +71,6 @@
@Generated("by gapic-generator")
@BetaApi
public class UserEventServiceSettings extends ClientSettings {
- /** Returns the object with the settings used for calls to writeUserEvent. */
- public UnaryCallSettings writeUserEventSettings() {
- return ((UserEventServiceStubSettings) getStubSettings()).writeUserEventSettings();
- }
-
- /** Returns the object with the settings used for calls to collectUserEvent. */
- public UnaryCallSettings collectUserEventSettings() {
- return ((UserEventServiceStubSettings) getStubSettings()).collectUserEventSettings();
- }
-
- /** Returns the object with the settings used for calls to listUserEvents. */
- public PagedCallSettings<
- ListUserEventsRequest, ListUserEventsResponse, ListUserEventsPagedResponse>
- listUserEventsSettings() {
- return ((UserEventServiceStubSettings) getStubSettings()).listUserEventsSettings();
- }
-
/** Returns the object with the settings used for calls to purgeUserEvents. */
public UnaryCallSettings purgeUserEventsSettings() {
return ((UserEventServiceStubSettings) getStubSettings()).purgeUserEventsSettings();
@@ -115,6 +98,23 @@ public UnaryCallSettings importUserEventsSet
return ((UserEventServiceStubSettings) getStubSettings()).importUserEventsOperationSettings();
}
+ /** Returns the object with the settings used for calls to writeUserEvent. */
+ public UnaryCallSettings writeUserEventSettings() {
+ return ((UserEventServiceStubSettings) getStubSettings()).writeUserEventSettings();
+ }
+
+ /** Returns the object with the settings used for calls to collectUserEvent. */
+ public UnaryCallSettings collectUserEventSettings() {
+ return ((UserEventServiceStubSettings) getStubSettings()).collectUserEventSettings();
+ }
+
+ /** Returns the object with the settings used for calls to listUserEvents. */
+ public PagedCallSettings<
+ ListUserEventsRequest, ListUserEventsResponse, ListUserEventsPagedResponse>
+ listUserEventsSettings() {
+ return ((UserEventServiceStubSettings) getStubSettings()).listUserEventsSettings();
+ }
+
public static final UserEventServiceSettings create(UserEventServiceStubSettings stub)
throws IOException {
return new UserEventServiceSettings.Builder(stub.toBuilder()).build();
@@ -212,23 +212,6 @@ public Builder applyToAllUnaryMethods(
return this;
}
- /** Returns the builder for the settings used for calls to writeUserEvent. */
- public UnaryCallSettings.Builder writeUserEventSettings() {
- return getStubSettingsBuilder().writeUserEventSettings();
- }
-
- /** Returns the builder for the settings used for calls to collectUserEvent. */
- public UnaryCallSettings.Builder collectUserEventSettings() {
- return getStubSettingsBuilder().collectUserEventSettings();
- }
-
- /** Returns the builder for the settings used for calls to listUserEvents. */
- public PagedCallSettings.Builder<
- ListUserEventsRequest, ListUserEventsResponse, ListUserEventsPagedResponse>
- listUserEventsSettings() {
- return getStubSettingsBuilder().listUserEventsSettings();
- }
-
/** Returns the builder for the settings used for calls to purgeUserEvents. */
public UnaryCallSettings.Builder purgeUserEventsSettings() {
return getStubSettingsBuilder().purgeUserEventsSettings();
@@ -258,6 +241,23 @@ public UnaryCallSettings.Builder purgeUserEve
return getStubSettingsBuilder().importUserEventsOperationSettings();
}
+ /** Returns the builder for the settings used for calls to writeUserEvent. */
+ public UnaryCallSettings.Builder writeUserEventSettings() {
+ return getStubSettingsBuilder().writeUserEventSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to collectUserEvent. */
+ public UnaryCallSettings.Builder collectUserEventSettings() {
+ return getStubSettingsBuilder().collectUserEventSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to listUserEvents. */
+ public PagedCallSettings.Builder<
+ ListUserEventsRequest, ListUserEventsResponse, ListUserEventsPagedResponse>
+ listUserEventsSettings() {
+ return getStubSettingsBuilder().listUserEventsSettings();
+ }
+
@Override
public UserEventServiceSettings build() throws IOException {
return new UserEventServiceSettings(this);
diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/package-info.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/package-info.java
index 86fcfdb8..31d43fad 100644
--- a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/package-info.java
+++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/package-info.java
@@ -28,9 +28,8 @@
*
*
* try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
- * String formattedParent = CatalogServiceClient.formatCatalogName("[PROJECT]", "[LOCATION]", "[CATALOG]");
- * CatalogItem catalogItem = CatalogItem.newBuilder().build();
- * CatalogItem response = catalogServiceClient.createCatalogItem(formattedParent, catalogItem);
+ * CatalogItemPathName name = CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
+ * catalogServiceClient.deleteCatalogItem(name);
* }
*
*
@@ -47,9 +46,8 @@
*
*
* try (PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.create()) {
- * String formattedParent = PredictionApiKeyRegistryClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
- * PredictionApiKeyRegistration predictionApiKeyRegistration = PredictionApiKeyRegistration.newBuilder().build();
- * PredictionApiKeyRegistration response = predictionApiKeyRegistryClient.createPredictionApiKeyRegistration(formattedParent, predictionApiKeyRegistration);
+ * PredictionApiKeyRegistrationName name = PredictionApiKeyRegistrationName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PREDICTION_API_KEY_REGISTRATION]");
+ * predictionApiKeyRegistryClient.deletePredictionApiKeyRegistration(name);
* }
*
*
@@ -63,13 +61,9 @@
*
*
* try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
- * String formattedName = PredictionServiceClient.formatPlacementName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PLACEMENT]");
+ * PlacementName name = PlacementName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PLACEMENT]");
* UserEvent userEvent = UserEvent.newBuilder().build();
- * PredictRequest request = PredictRequest.newBuilder()
- * .setName(formattedName)
- * .setUserEvent(userEvent)
- * .build();
- * PredictPagedResponse response = predictionServiceClient.predictPagedCallable(request);
+ * PredictPagedResponse response = predictionServiceClient.predict(name, userEvent);
* }
*
*
@@ -83,9 +77,9 @@
*
*
* try (UserEventServiceClient userEventServiceClient = UserEventServiceClient.create()) {
- * String formattedParent = UserEventServiceClient.formatEventStoreName("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
+ * EventStoreName parent = EventStoreName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]");
* UserEvent userEvent = UserEvent.newBuilder().build();
- * UserEvent response = userEventServiceClient.writeUserEvent(formattedParent, userEvent);
+ * UserEvent response = userEventServiceClient.writeUserEvent(parent, userEvent);
* }
*
*
diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/CatalogServiceStub.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/CatalogServiceStub.java
index 944c833b..d921aac3 100644
--- a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/CatalogServiceStub.java
+++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/CatalogServiceStub.java
@@ -51,6 +51,21 @@ public OperationsStub getOperationsStub() {
throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
}
+ public UnaryCallable deleteCatalogItemCallable() {
+ throw new UnsupportedOperationException("Not implemented: deleteCatalogItemCallable()");
+ }
+
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public OperationCallable
+ importCatalogItemsOperationCallable() {
+ throw new UnsupportedOperationException(
+ "Not implemented: importCatalogItemsOperationCallable()");
+ }
+
+ public UnaryCallable importCatalogItemsCallable() {
+ throw new UnsupportedOperationException("Not implemented: importCatalogItemsCallable()");
+ }
+
public UnaryCallable createCatalogItemCallable() {
throw new UnsupportedOperationException("Not implemented: createCatalogItemCallable()");
}
@@ -73,21 +88,6 @@ public UnaryCallable updateCatalogItemCal
throw new UnsupportedOperationException("Not implemented: updateCatalogItemCallable()");
}
- public UnaryCallable deleteCatalogItemCallable() {
- throw new UnsupportedOperationException("Not implemented: deleteCatalogItemCallable()");
- }
-
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public OperationCallable
- importCatalogItemsOperationCallable() {
- throw new UnsupportedOperationException(
- "Not implemented: importCatalogItemsOperationCallable()");
- }
-
- public UnaryCallable importCatalogItemsCallable() {
- throw new UnsupportedOperationException("Not implemented: importCatalogItemsCallable()");
- }
-
@Override
public abstract void close();
}
diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/CatalogServiceStubSettings.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/CatalogServiceStubSettings.java
index 5745275c..b61b4520 100644
--- a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/CatalogServiceStubSettings.java
+++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/CatalogServiceStubSettings.java
@@ -80,16 +80,16 @@
* 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 createCatalogItem to 30 seconds:
+ *
For example, to set the total timeout of deleteCatalogItem to 30 seconds:
*
*
*
* CatalogServiceStubSettings.Builder catalogServiceSettingsBuilder =
* CatalogServiceStubSettings.newBuilder();
* catalogServiceSettingsBuilder
- * .createCatalogItemSettings()
+ * .deleteCatalogItemSettings()
* .setRetrySettings(
- * catalogServiceSettingsBuilder.createCatalogItemSettings().getRetrySettings().toBuilder()
+ * catalogServiceSettingsBuilder.deleteCatalogItemSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* CatalogServiceStubSettings catalogServiceSettings = catalogServiceSettingsBuilder.build();
@@ -103,17 +103,35 @@ public class CatalogServiceStubSettings extends StubSettings DEFAULT_SERVICE_SCOPES =
ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build();
+ private final UnaryCallSettings deleteCatalogItemSettings;
+ private final UnaryCallSettings importCatalogItemsSettings;
+ private final OperationCallSettings<
+ ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata>
+ importCatalogItemsOperationSettings;
private final UnaryCallSettings createCatalogItemSettings;
private final UnaryCallSettings getCatalogItemSettings;
private final PagedCallSettings<
ListCatalogItemsRequest, ListCatalogItemsResponse, ListCatalogItemsPagedResponse>
listCatalogItemsSettings;
private final UnaryCallSettings updateCatalogItemSettings;
- private final UnaryCallSettings deleteCatalogItemSettings;
- private final UnaryCallSettings importCatalogItemsSettings;
- private final OperationCallSettings<
+
+ /** Returns the object with the settings used for calls to deleteCatalogItem. */
+ public UnaryCallSettings deleteCatalogItemSettings() {
+ return deleteCatalogItemSettings;
+ }
+
+ /** Returns the object with the settings used for calls to importCatalogItems. */
+ public UnaryCallSettings importCatalogItemsSettings() {
+ return importCatalogItemsSettings;
+ }
+
+ /** Returns the object with the settings used for calls to importCatalogItems. */
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public OperationCallSettings<
ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata>
- importCatalogItemsOperationSettings;
+ importCatalogItemsOperationSettings() {
+ return importCatalogItemsOperationSettings;
+ }
/** Returns the object with the settings used for calls to createCatalogItem. */
public UnaryCallSettings createCatalogItemSettings() {
@@ -137,24 +155,6 @@ public UnaryCallSettings updateCatalogIte
return updateCatalogItemSettings;
}
- /** Returns the object with the settings used for calls to deleteCatalogItem. */
- public UnaryCallSettings deleteCatalogItemSettings() {
- return deleteCatalogItemSettings;
- }
-
- /** Returns the object with the settings used for calls to importCatalogItems. */
- public UnaryCallSettings importCatalogItemsSettings() {
- return importCatalogItemsSettings;
- }
-
- /** Returns the object with the settings used for calls to importCatalogItems. */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public OperationCallSettings<
- ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata>
- importCatalogItemsOperationSettings() {
- return importCatalogItemsOperationSettings;
- }
-
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public CatalogServiceStub createStub() throws IOException {
if (getTransportChannelProvider()
@@ -224,14 +224,14 @@ public Builder toBuilder() {
protected CatalogServiceStubSettings(Builder settingsBuilder) throws IOException {
super(settingsBuilder);
- createCatalogItemSettings = settingsBuilder.createCatalogItemSettings().build();
- getCatalogItemSettings = settingsBuilder.getCatalogItemSettings().build();
- listCatalogItemsSettings = settingsBuilder.listCatalogItemsSettings().build();
- updateCatalogItemSettings = settingsBuilder.updateCatalogItemSettings().build();
deleteCatalogItemSettings = settingsBuilder.deleteCatalogItemSettings().build();
importCatalogItemsSettings = settingsBuilder.importCatalogItemsSettings().build();
importCatalogItemsOperationSettings =
settingsBuilder.importCatalogItemsOperationSettings().build();
+ createCatalogItemSettings = settingsBuilder.createCatalogItemSettings().build();
+ getCatalogItemSettings = settingsBuilder.getCatalogItemSettings().build();
+ listCatalogItemsSettings = settingsBuilder.listCatalogItemsSettings().build();
+ updateCatalogItemSettings = settingsBuilder.updateCatalogItemSettings().build();
}
private static final PagedListDescriptor<
@@ -297,6 +297,13 @@ public ApiFuture getFuturePagedResponse(
public static class Builder extends StubSettings.Builder {
private final ImmutableList> unaryMethodSettingsBuilders;
+ private final UnaryCallSettings.Builder
+ deleteCatalogItemSettings;
+ private final UnaryCallSettings.Builder
+ importCatalogItemsSettings;
+ private final OperationCallSettings.Builder<
+ ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata>
+ importCatalogItemsOperationSettings;
private final UnaryCallSettings.Builder
createCatalogItemSettings;
private final UnaryCallSettings.Builder
@@ -306,13 +313,6 @@ public static class Builder extends StubSettings.Builder
updateCatalogItemSettings;
- private final UnaryCallSettings.Builder
- deleteCatalogItemSettings;
- private final UnaryCallSettings.Builder
- importCatalogItemsSettings;
- private final OperationCallSettings.Builder<
- ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata>
- importCatalogItemsOperationSettings;
private static final ImmutableMap>
RETRYABLE_CODE_DEFINITIONS;
@@ -355,6 +355,12 @@ protected Builder() {
protected Builder(ClientContext clientContext) {
super(clientContext);
+ deleteCatalogItemSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
+ importCatalogItemsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
+ importCatalogItemsOperationSettings = OperationCallSettings.newBuilder();
+
createCatalogItemSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
getCatalogItemSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
@@ -363,20 +369,14 @@ protected Builder(ClientContext clientContext) {
updateCatalogItemSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
- deleteCatalogItemSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
-
- importCatalogItemsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
-
- importCatalogItemsOperationSettings = OperationCallSettings.newBuilder();
-
unaryMethodSettingsBuilders =
ImmutableList.>of(
+ deleteCatalogItemSettings,
+ importCatalogItemsSettings,
createCatalogItemSettings,
getCatalogItemSettings,
listCatalogItemsSettings,
- updateCatalogItemSettings,
- deleteCatalogItemSettings,
- importCatalogItemsSettings);
+ updateCatalogItemSettings);
initDefaults(this);
}
@@ -393,32 +393,32 @@ private static Builder createDefault() {
private static Builder initDefaults(Builder builder) {
builder
- .createCatalogItemSettings()
- .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+ .deleteCatalogItemSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
builder
- .getCatalogItemSettings()
- .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+ .importCatalogItemsSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
builder
- .listCatalogItemsSettings()
- .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+ .createCatalogItemSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
builder
- .updateCatalogItemSettings()
- .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+ .getCatalogItemSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
builder
- .deleteCatalogItemSettings()
+ .listCatalogItemsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
builder
- .importCatalogItemsSettings()
+ .updateCatalogItemSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
builder
@@ -452,23 +452,23 @@ private static Builder initDefaults(Builder builder) {
protected Builder(CatalogServiceStubSettings settings) {
super(settings);
- createCatalogItemSettings = settings.createCatalogItemSettings.toBuilder();
- getCatalogItemSettings = settings.getCatalogItemSettings.toBuilder();
- listCatalogItemsSettings = settings.listCatalogItemsSettings.toBuilder();
- updateCatalogItemSettings = settings.updateCatalogItemSettings.toBuilder();
deleteCatalogItemSettings = settings.deleteCatalogItemSettings.toBuilder();
importCatalogItemsSettings = settings.importCatalogItemsSettings.toBuilder();
importCatalogItemsOperationSettings =
settings.importCatalogItemsOperationSettings.toBuilder();
+ createCatalogItemSettings = settings.createCatalogItemSettings.toBuilder();
+ getCatalogItemSettings = settings.getCatalogItemSettings.toBuilder();
+ listCatalogItemsSettings = settings.listCatalogItemsSettings.toBuilder();
+ updateCatalogItemSettings = settings.updateCatalogItemSettings.toBuilder();
unaryMethodSettingsBuilders =
ImmutableList.>of(
+ deleteCatalogItemSettings,
+ importCatalogItemsSettings,
createCatalogItemSettings,
getCatalogItemSettings,
listCatalogItemsSettings,
- updateCatalogItemSettings,
- deleteCatalogItemSettings,
- importCatalogItemsSettings);
+ updateCatalogItemSettings);
}
// NEXT_MAJOR_VER: remove 'throws Exception'
@@ -487,6 +487,26 @@ public Builder applyToAllUnaryMethods(
return unaryMethodSettingsBuilders;
}
+ /** Returns the builder for the settings used for calls to deleteCatalogItem. */
+ public UnaryCallSettings.Builder deleteCatalogItemSettings() {
+ return deleteCatalogItemSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to importCatalogItems. */
+ public UnaryCallSettings.Builder
+ importCatalogItemsSettings() {
+ return importCatalogItemsSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to importCatalogItems. */
+ @BetaApi(
+ "The surface for use by generated code is not stable yet and may change in the future.")
+ public OperationCallSettings.Builder<
+ ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata>
+ importCatalogItemsOperationSettings() {
+ return importCatalogItemsOperationSettings;
+ }
+
/** Returns the builder for the settings used for calls to createCatalogItem. */
public UnaryCallSettings.Builder
createCatalogItemSettings() {
@@ -511,26 +531,6 @@ public UnaryCallSettings.Builder getCatalogI
return updateCatalogItemSettings;
}
- /** Returns the builder for the settings used for calls to deleteCatalogItem. */
- public UnaryCallSettings.Builder deleteCatalogItemSettings() {
- return deleteCatalogItemSettings;
- }
-
- /** Returns the builder for the settings used for calls to importCatalogItems. */
- public UnaryCallSettings.Builder
- importCatalogItemsSettings() {
- return importCatalogItemsSettings;
- }
-
- /** Returns the builder for the settings used for calls to importCatalogItems. */
- @BetaApi(
- "The surface for use by generated code is not stable yet and may change in the future.")
- public OperationCallSettings.Builder<
- ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata>
- importCatalogItemsOperationSettings() {
- return importCatalogItemsOperationSettings;
- }
-
@Override
public CatalogServiceStubSettings build() throws IOException {
return new CatalogServiceStubSettings(this);
diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcCatalogServiceStub.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcCatalogServiceStub.java
index 2902dd74..6e75f27d 100644
--- a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcCatalogServiceStub.java
+++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcCatalogServiceStub.java
@@ -57,6 +57,26 @@
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public class GrpcCatalogServiceStub extends CatalogServiceStub {
+ private static final MethodDescriptor
+ deleteCatalogItemMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName(
+ "google.cloud.recommendationengine.v1beta1.CatalogService/DeleteCatalogItem")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(DeleteCatalogItemRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
+ .build();
+ private static final MethodDescriptor
+ importCatalogItemsMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName(
+ "google.cloud.recommendationengine.v1beta1.CatalogService/ImportCatalogItems")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(ImportCatalogItemsRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
+ .build();
private static final MethodDescriptor
createCatalogItemMethodDescriptor =
MethodDescriptor.newBuilder()
@@ -98,30 +118,15 @@ public class GrpcCatalogServiceStub extends CatalogServiceStub {
ProtoUtils.marshaller(UpdateCatalogItemRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(CatalogItem.getDefaultInstance()))
.build();
- private static final MethodDescriptor
- deleteCatalogItemMethodDescriptor =
- MethodDescriptor.newBuilder()
- .setType(MethodDescriptor.MethodType.UNARY)
- .setFullMethodName(
- "google.cloud.recommendationengine.v1beta1.CatalogService/DeleteCatalogItem")
- .setRequestMarshaller(
- ProtoUtils.marshaller(DeleteCatalogItemRequest.getDefaultInstance()))
- .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
- .build();
- private static final MethodDescriptor
- importCatalogItemsMethodDescriptor =
- MethodDescriptor.newBuilder()
- .setType(MethodDescriptor.MethodType.UNARY)
- .setFullMethodName(
- "google.cloud.recommendationengine.v1beta1.CatalogService/ImportCatalogItems")
- .setRequestMarshaller(
- ProtoUtils.marshaller(ImportCatalogItemsRequest.getDefaultInstance()))
- .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
- .build();
private final BackgroundResource backgroundResources;
private final GrpcOperationsStub operationsStub;
+ private final UnaryCallable deleteCatalogItemCallable;
+ private final UnaryCallable importCatalogItemsCallable;
+ private final OperationCallable<
+ ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata>
+ importCatalogItemsOperationCallable;
private final UnaryCallable createCatalogItemCallable;
private final UnaryCallable getCatalogItemCallable;
private final UnaryCallable
@@ -129,11 +134,6 @@ public class GrpcCatalogServiceStub extends CatalogServiceStub {
private final UnaryCallable
listCatalogItemsPagedCallable;
private final UnaryCallable updateCatalogItemCallable;
- private final UnaryCallable deleteCatalogItemCallable;
- private final UnaryCallable importCatalogItemsCallable;
- private final OperationCallable<
- ImportCatalogItemsRequest, ImportCatalogItemsResponse, ImportMetadata>
- importCatalogItemsOperationCallable;
private final GrpcStubCallableFactory callableFactory;
@@ -177,6 +177,32 @@ protected GrpcCatalogServiceStub(
this.callableFactory = callableFactory;
this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory);
+ GrpcCallSettings deleteCatalogItemTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(deleteCatalogItemMethodDescriptor)
+ .setParamsExtractor(
+ new RequestParamsExtractor() {
+ @Override
+ public Map extract(DeleteCatalogItemRequest request) {
+ ImmutableMap.Builder params = ImmutableMap.builder();
+ params.put("name", String.valueOf(request.getName()));
+ return params.build();
+ }
+ })
+ .build();
+ GrpcCallSettings importCatalogItemsTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(importCatalogItemsMethodDescriptor)
+ .setParamsExtractor(
+ new RequestParamsExtractor() {
+ @Override
+ public Map extract(ImportCatalogItemsRequest request) {
+ ImmutableMap.Builder params = ImmutableMap.builder();
+ params.put("parent", String.valueOf(request.getParent()));
+ return params.build();
+ }
+ })
+ .build();
GrpcCallSettings createCatalogItemTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createCatalogItemMethodDescriptor)
@@ -230,33 +256,23 @@ public Map extract(UpdateCatalogItemRequest request) {
}
})
.build();
- GrpcCallSettings deleteCatalogItemTransportSettings =
- GrpcCallSettings.newBuilder()
- .setMethodDescriptor(deleteCatalogItemMethodDescriptor)
- .setParamsExtractor(
- new RequestParamsExtractor() {
- @Override
- public Map extract(DeleteCatalogItemRequest request) {
- ImmutableMap.Builder params = ImmutableMap.builder();
- params.put("name", String.valueOf(request.getName()));
- return params.build();
- }
- })
- .build();
- GrpcCallSettings importCatalogItemsTransportSettings =
- GrpcCallSettings.newBuilder()
- .setMethodDescriptor(importCatalogItemsMethodDescriptor)
- .setParamsExtractor(
- new RequestParamsExtractor() {
- @Override
- public Map extract(ImportCatalogItemsRequest request) {
- ImmutableMap.Builder params = ImmutableMap.builder();
- params.put("parent", String.valueOf(request.getParent()));
- return params.build();
- }
- })
- .build();
+ this.deleteCatalogItemCallable =
+ callableFactory.createUnaryCallable(
+ deleteCatalogItemTransportSettings,
+ settings.deleteCatalogItemSettings(),
+ clientContext);
+ this.importCatalogItemsCallable =
+ callableFactory.createUnaryCallable(
+ importCatalogItemsTransportSettings,
+ settings.importCatalogItemsSettings(),
+ clientContext);
+ this.importCatalogItemsOperationCallable =
+ callableFactory.createOperationCallable(
+ importCatalogItemsTransportSettings,
+ settings.importCatalogItemsOperationSettings(),
+ clientContext,
+ this.operationsStub);
this.createCatalogItemCallable =
callableFactory.createUnaryCallable(
createCatalogItemTransportSettings,
@@ -276,22 +292,6 @@ public Map extract(ImportCatalogItemsRequest request) {
updateCatalogItemTransportSettings,
settings.updateCatalogItemSettings(),
clientContext);
- this.deleteCatalogItemCallable =
- callableFactory.createUnaryCallable(
- deleteCatalogItemTransportSettings,
- settings.deleteCatalogItemSettings(),
- clientContext);
- this.importCatalogItemsCallable =
- callableFactory.createUnaryCallable(
- importCatalogItemsTransportSettings,
- settings.importCatalogItemsSettings(),
- clientContext);
- this.importCatalogItemsOperationCallable =
- callableFactory.createOperationCallable(
- importCatalogItemsTransportSettings,
- settings.importCatalogItemsOperationSettings(),
- clientContext,
- this.operationsStub);
backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources());
}
@@ -301,6 +301,20 @@ public GrpcOperationsStub getOperationsStub() {
return operationsStub;
}
+ public UnaryCallable deleteCatalogItemCallable() {
+ return deleteCatalogItemCallable;
+ }
+
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public OperationCallable
+ importCatalogItemsOperationCallable() {
+ return importCatalogItemsOperationCallable;
+ }
+
+ public UnaryCallable importCatalogItemsCallable() {
+ return importCatalogItemsCallable;
+ }
+
public UnaryCallable createCatalogItemCallable() {
return createCatalogItemCallable;
}
@@ -323,20 +337,6 @@ public UnaryCallable updateCatalogItemCal
return updateCatalogItemCallable;
}
- public UnaryCallable deleteCatalogItemCallable() {
- return deleteCatalogItemCallable;
- }
-
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public OperationCallable
- importCatalogItemsOperationCallable() {
- return importCatalogItemsOperationCallable;
- }
-
- public UnaryCallable importCatalogItemsCallable() {
- return importCatalogItemsCallable;
- }
-
@Override
public final void close() {
shutdown();
diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcPredictionApiKeyRegistryStub.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcPredictionApiKeyRegistryStub.java
index fd549a8d..30805cd3 100644
--- a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcPredictionApiKeyRegistryStub.java
+++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcPredictionApiKeyRegistryStub.java
@@ -49,6 +49,17 @@
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public class GrpcPredictionApiKeyRegistryStub extends PredictionApiKeyRegistryStub {
+ private static final MethodDescriptor
+ deletePredictionApiKeyRegistrationMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName(
+ "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry/DeletePredictionApiKeyRegistration")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(
+ DeletePredictionApiKeyRegistrationRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
+ .build();
private static final MethodDescriptor<
CreatePredictionApiKeyRegistrationRequest, PredictionApiKeyRegistration>
createPredictionApiKeyRegistrationMethodDescriptor =
@@ -79,20 +90,11 @@ public class GrpcPredictionApiKeyRegistryStub extends PredictionApiKeyRegistrySt
ProtoUtils.marshaller(
ListPredictionApiKeyRegistrationsResponse.getDefaultInstance()))
.build();
- private static final MethodDescriptor
- deletePredictionApiKeyRegistrationMethodDescriptor =
- MethodDescriptor.newBuilder()
- .setType(MethodDescriptor.MethodType.UNARY)
- .setFullMethodName(
- "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry/DeletePredictionApiKeyRegistration")
- .setRequestMarshaller(
- ProtoUtils.marshaller(
- DeletePredictionApiKeyRegistrationRequest.getDefaultInstance()))
- .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
- .build();
private final BackgroundResource backgroundResources;
+ private final UnaryCallable
+ deletePredictionApiKeyRegistrationCallable;
private final UnaryCallable<
CreatePredictionApiKeyRegistrationRequest, PredictionApiKeyRegistration>
createPredictionApiKeyRegistrationCallable;
@@ -102,8 +104,6 @@ public class GrpcPredictionApiKeyRegistryStub extends PredictionApiKeyRegistrySt
private final UnaryCallable<
ListPredictionApiKeyRegistrationsRequest, ListPredictionApiKeyRegistrationsPagedResponse>
listPredictionApiKeyRegistrationsPagedCallable;
- private final UnaryCallable
- deletePredictionApiKeyRegistrationCallable;
private final GrpcStubCallableFactory callableFactory;
@@ -147,6 +147,21 @@ protected GrpcPredictionApiKeyRegistryStub(
throws IOException {
this.callableFactory = callableFactory;
+ GrpcCallSettings
+ deletePredictionApiKeyRegistrationTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(deletePredictionApiKeyRegistrationMethodDescriptor)
+ .setParamsExtractor(
+ new RequestParamsExtractor() {
+ @Override
+ public Map extract(
+ DeletePredictionApiKeyRegistrationRequest request) {
+ ImmutableMap.Builder params = ImmutableMap.builder();
+ params.put("name", String.valueOf(request.getName()));
+ return params.build();
+ }
+ })
+ .build();
GrpcCallSettings
createPredictionApiKeyRegistrationTransportSettings =
GrpcCallSettings
@@ -183,22 +198,12 @@ public Map extract(
}
})
.build();
- GrpcCallSettings
- deletePredictionApiKeyRegistrationTransportSettings =
- GrpcCallSettings.newBuilder()
- .setMethodDescriptor(deletePredictionApiKeyRegistrationMethodDescriptor)
- .setParamsExtractor(
- new RequestParamsExtractor() {
- @Override
- public Map extract(
- DeletePredictionApiKeyRegistrationRequest request) {
- ImmutableMap.Builder params = ImmutableMap.builder();
- params.put("name", String.valueOf(request.getName()));
- return params.build();
- }
- })
- .build();
+ this.deletePredictionApiKeyRegistrationCallable =
+ callableFactory.createUnaryCallable(
+ deletePredictionApiKeyRegistrationTransportSettings,
+ settings.deletePredictionApiKeyRegistrationSettings(),
+ clientContext);
this.createPredictionApiKeyRegistrationCallable =
callableFactory.createUnaryCallable(
createPredictionApiKeyRegistrationTransportSettings,
@@ -214,15 +219,15 @@ public Map extract(
listPredictionApiKeyRegistrationsTransportSettings,
settings.listPredictionApiKeyRegistrationsSettings(),
clientContext);
- this.deletePredictionApiKeyRegistrationCallable =
- callableFactory.createUnaryCallable(
- deletePredictionApiKeyRegistrationTransportSettings,
- settings.deletePredictionApiKeyRegistrationSettings(),
- clientContext);
backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources());
}
+ public UnaryCallable
+ deletePredictionApiKeyRegistrationCallable() {
+ return deletePredictionApiKeyRegistrationCallable;
+ }
+
public UnaryCallable
createPredictionApiKeyRegistrationCallable() {
return createPredictionApiKeyRegistrationCallable;
@@ -240,11 +245,6 @@ public Map extract(
return listPredictionApiKeyRegistrationsCallable;
}
- public UnaryCallable
- deletePredictionApiKeyRegistrationCallable() {
- return deletePredictionApiKeyRegistrationCallable;
- }
-
@Override
public final void close() {
shutdown();
diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcUserEventServiceStub.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcUserEventServiceStub.java
index 44e28ed0..079808e5 100644
--- a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcUserEventServiceStub.java
+++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcUserEventServiceStub.java
@@ -58,6 +58,26 @@
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public class GrpcUserEventServiceStub extends UserEventServiceStub {
+ private static final MethodDescriptor
+ purgeUserEventsMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName(
+ "google.cloud.recommendationengine.v1beta1.UserEventService/PurgeUserEvents")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(PurgeUserEventsRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
+ .build();
+ private static final MethodDescriptor
+ importUserEventsMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName(
+ "google.cloud.recommendationengine.v1beta1.UserEventService/ImportUserEvents")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(ImportUserEventsRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
+ .build();
private static final MethodDescriptor
writeUserEventMethodDescriptor =
MethodDescriptor.newBuilder()
@@ -89,35 +109,10 @@ public class GrpcUserEventServiceStub extends UserEventServiceStub {
.setResponseMarshaller(
ProtoUtils.marshaller(ListUserEventsResponse.getDefaultInstance()))
.build();
- private static final MethodDescriptor
- purgeUserEventsMethodDescriptor =
- MethodDescriptor.newBuilder()
- .setType(MethodDescriptor.MethodType.UNARY)
- .setFullMethodName(
- "google.cloud.recommendationengine.v1beta1.UserEventService/PurgeUserEvents")
- .setRequestMarshaller(
- ProtoUtils.marshaller(PurgeUserEventsRequest.getDefaultInstance()))
- .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
- .build();
- private static final MethodDescriptor
- importUserEventsMethodDescriptor =
- MethodDescriptor.newBuilder()
- .setType(MethodDescriptor.MethodType.UNARY)
- .setFullMethodName(
- "google.cloud.recommendationengine.v1beta1.UserEventService/ImportUserEvents")
- .setRequestMarshaller(
- ProtoUtils.marshaller(ImportUserEventsRequest.getDefaultInstance()))
- .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
- .build();
private final BackgroundResource backgroundResources;
private final GrpcOperationsStub operationsStub;
- private final UnaryCallable writeUserEventCallable;
- private final UnaryCallable collectUserEventCallable;
- private final UnaryCallable listUserEventsCallable;
- private final UnaryCallable
- listUserEventsPagedCallable;
private final UnaryCallable purgeUserEventsCallable;
private final OperationCallable<
PurgeUserEventsRequest, PurgeUserEventsResponse, PurgeUserEventsMetadata>
@@ -125,6 +120,11 @@ public class GrpcUserEventServiceStub extends UserEventServiceStub {
private final UnaryCallable importUserEventsCallable;
private final OperationCallable
importUserEventsOperationCallable;
+ private final UnaryCallable writeUserEventCallable;
+ private final UnaryCallable collectUserEventCallable;
+ private final UnaryCallable listUserEventsCallable;
+ private final UnaryCallable