Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

fix: migrate recommendationengine/v1beta1 to grpc_service_config #90

Merged
merged 2 commits into from Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -49,8 +49,9 @@
* <pre>
* <code>
* try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
* CatalogItemPathName name = CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
* catalogServiceClient.deleteCatalogItem(name);
* CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
* CatalogItem catalogItem = CatalogItem.newBuilder().build();
* CatalogItem response = catalogServiceClient.createCatalogItem(parent, catalogItem);
* }
* </code>
* </pre>
Expand Down Expand Up @@ -172,98 +173,6 @@ public final OperationsClient getOperationsClient() {
return operationsClient;
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes a catalog item.
*
* <p>Sample code:
*
* <pre><code>
* try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
* CatalogItemPathName name = CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
* catalogServiceClient.deleteCatalogItem(name);
* }
* </code></pre>
*
* @param name Required. Full resource name of catalog item, such as
* "projects/&#42;/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(CatalogItemPathName name) {
DeleteCatalogItemRequest request =
DeleteCatalogItemRequest.newBuilder()
.setName(name == null ? null : name.toString())
.build();
deleteCatalogItem(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes a catalog item.
*
* <p>Sample code:
*
* <pre><code>
* try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
* CatalogItemPathName name = CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
* catalogServiceClient.deleteCatalogItem(name.toString());
* }
* </code></pre>
*
* @param name Required. Full resource name of catalog item, such as
* "projects/&#42;/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) {
DeleteCatalogItemRequest request = DeleteCatalogItemRequest.newBuilder().setName(name).build();
deleteCatalogItem(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes a catalog item.
*
* <p>Sample code:
*
* <pre><code>
* 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);
* }
* </code></pre>
*
* @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.
*
* <p>Sample code:
*
* <pre><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&lt;Void&gt; future = catalogServiceClient.deleteCatalogItemCallable().futureCall(request);
* // Do something
* future.get();
* }
* </code></pre>
*/
public final UnaryCallable<DeleteCatalogItemRequest, Empty> deleteCatalogItemCallable() {
return stub.deleteCatalogItemCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Bulk import of multiple catalog items. Request processing may be synchronous. No partial
Expand Down Expand Up @@ -892,6 +801,98 @@ public final UnaryCallable<UpdateCatalogItemRequest, CatalogItem> updateCatalogI
return stub.updateCatalogItemCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes a catalog item.
*
* <p>Sample code:
*
* <pre><code>
* try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
* CatalogItemPathName name = CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
* catalogServiceClient.deleteCatalogItem(name);
* }
* </code></pre>
*
* @param name Required. Full resource name of catalog item, such as
* "projects/&#42;/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(CatalogItemPathName name) {
DeleteCatalogItemRequest request =
DeleteCatalogItemRequest.newBuilder()
.setName(name == null ? null : name.toString())
.build();
deleteCatalogItem(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes a catalog item.
*
* <p>Sample code:
*
* <pre><code>
* try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
* CatalogItemPathName name = CatalogItemPathName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CATALOG_ITEM_PATH]");
* catalogServiceClient.deleteCatalogItem(name.toString());
* }
* </code></pre>
*
* @param name Required. Full resource name of catalog item, such as
* "projects/&#42;/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) {
DeleteCatalogItemRequest request = DeleteCatalogItemRequest.newBuilder().setName(name).build();
deleteCatalogItem(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes a catalog item.
*
* <p>Sample code:
*
* <pre><code>
* 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);
* }
* </code></pre>
*
* @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.
*
* <p>Sample code:
*
* <pre><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&lt;Void&gt; future = catalogServiceClient.deleteCatalogItemCallable().futureCall(request);
* // Do something
* future.get();
* }
* </code></pre>
*/
public final UnaryCallable<DeleteCatalogItemRequest, Empty> deleteCatalogItemCallable() {
return stub.deleteCatalogItemCallable();
}

@Override
public final void close() {
stub.close();
Expand Down
Expand Up @@ -52,16 +52,16 @@
* <p>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.
*
* <p>For example, to set the total timeout of deleteCatalogItem to 30 seconds:
* <p>For example, to set the total timeout of createCatalogItem to 30 seconds:
*
* <pre>
* <code>
* CatalogServiceSettings.Builder catalogServiceSettingsBuilder =
* CatalogServiceSettings.newBuilder();
* catalogServiceSettingsBuilder
* .deleteCatalogItemSettings()
* .createCatalogItemSettings()
* .setRetrySettings(
* catalogServiceSettingsBuilder.deleteCatalogItemSettings().getRetrySettings().toBuilder()
* catalogServiceSettingsBuilder.createCatalogItemSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* CatalogServiceSettings catalogServiceSettings = catalogServiceSettingsBuilder.build();
Expand All @@ -71,11 +71,6 @@
@Generated("by gapic-generator")
@BetaApi
public class CatalogServiceSettings extends ClientSettings<CatalogServiceSettings> {
/** Returns the object with the settings used for calls to deleteCatalogItem. */
public UnaryCallSettings<DeleteCatalogItemRequest, Empty> deleteCatalogItemSettings() {
return ((CatalogServiceStubSettings) getStubSettings()).deleteCatalogItemSettings();
}

/** Returns the object with the settings used for calls to importCatalogItems. */
public UnaryCallSettings<ImportCatalogItemsRequest, Operation> importCatalogItemsSettings() {
return ((CatalogServiceStubSettings) getStubSettings()).importCatalogItemsSettings();
Expand Down Expand Up @@ -112,6 +107,11 @@ public UnaryCallSettings<UpdateCatalogItemRequest, CatalogItem> updateCatalogIte
return ((CatalogServiceStubSettings) getStubSettings()).updateCatalogItemSettings();
}

/** Returns the object with the settings used for calls to deleteCatalogItem. */
public UnaryCallSettings<DeleteCatalogItemRequest, Empty> deleteCatalogItemSettings() {
return ((CatalogServiceStubSettings) getStubSettings()).deleteCatalogItemSettings();
}

public static final CatalogServiceSettings create(CatalogServiceStubSettings stub)
throws IOException {
return new CatalogServiceSettings.Builder(stub.toBuilder()).build();
Expand Down Expand Up @@ -209,11 +209,6 @@ public Builder applyToAllUnaryMethods(
return this;
}

/** Returns the builder for the settings used for calls to deleteCatalogItem. */
public UnaryCallSettings.Builder<DeleteCatalogItemRequest, Empty> deleteCatalogItemSettings() {
return getStubSettingsBuilder().deleteCatalogItemSettings();
}

/** Returns the builder for the settings used for calls to importCatalogItems. */
public UnaryCallSettings.Builder<ImportCatalogItemsRequest, Operation>
importCatalogItemsSettings() {
Expand Down Expand Up @@ -253,6 +248,11 @@ public UnaryCallSettings.Builder<GetCatalogItemRequest, CatalogItem> getCatalogI
return getStubSettingsBuilder().updateCatalogItemSettings();
}

/** Returns the builder for the settings used for calls to deleteCatalogItem. */
public UnaryCallSettings.Builder<DeleteCatalogItemRequest, Empty> deleteCatalogItemSettings() {
return getStubSettingsBuilder().deleteCatalogItemSettings();
}

@Override
public CatalogServiceSettings build() throws IOException {
return new CatalogServiceSettings(this);
Expand Down