Skip to content
Permalink
Browse files
fix: migrate recommendationengine/v1beta1 to grpc_service_config (#90)
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/1a5efa2b-7082-489a-87a2-7d303da2cd98/targets

- [ ] To automatically regenerate this PR, check this box.

PiperOrigin-RevId: 316509011
Source-Link: googleapis/googleapis@864dfea
PiperOrigin-RevId: 316143794
Source-Link: googleapis/googleapis@1c722ce
  • Loading branch information
yoshi-automation committed Jun 16, 2020
1 parent c5b0453 commit 0f6d2ee976a4fc9f654738ed4866cc1ec8250c5f
Showing with 532 additions and 520 deletions.
  1. +95 −94 ...ndations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceClient.java
  2. +13 −13 ...ations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceSettings.java
  3. +98 −97 ...i/src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistryClient.java
  4. +18 −18 ...src/main/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistrySettings.java
  5. +6 −4 ...-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/package-info.java
  6. +4 −4 ...tions-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/CatalogServiceStub.java
  7. +49 −47 .../src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/CatalogServiceStubSettings.java
  8. +33 −33 ...s-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcCatalogServiceStub.java
  9. +38 −38 ...ain/java/com/google/cloud/recommendationengine/v1beta1/stub/GrpcPredictionApiKeyRegistryStub.java
  10. +6 −6 ...rc/main/java/com/google/cloud/recommendationengine/v1beta1/stub/PredictionApiKeyRegistryStub.java
  11. +48 −46 ...java/com/google/cloud/recommendationengine/v1beta1/stub/PredictionApiKeyRegistryStubSettings.java
  12. +10 −8 ...c/main/java/com/google/cloud/recommendationengine/v1beta1/stub/PredictionServiceStubSettings.java
  13. +22 −20 ...rc/main/java/com/google/cloud/recommendationengine/v1beta1/stub/UserEventServiceStubSettings.java
  14. +39 −39 ...ions-ai/src/test/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceClientTest.java
  15. +50 −50 ...c/test/java/com/google/cloud/recommendationengine/v1beta1/PredictionApiKeyRegistryClientTest.java
  16. +3 −3 synth.metadata
@@ -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>
@@ -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
@@ -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();
@@ -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();
@@ -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();
@@ -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();
@@ -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() {
@@ -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);

0 comments on commit 0f6d2ee

Please sign in to comment.