diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceClient.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceClient.java
index 4eaf88a7..5ca96977 100644
--- a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceClient.java
+++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/CatalogServiceClient.java
@@ -20,6 +20,7 @@
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.httpjson.longrunning.OperationsClient;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.api.gax.paging.AbstractFixedSizeCollection;
import com.google.api.gax.paging.AbstractPage;
@@ -31,7 +32,6 @@
import com.google.cloud.recommendationengine.v1beta1.stub.CatalogServiceStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.longrunning.Operation;
-import com.google.longrunning.OperationsClient;
import com.google.protobuf.Empty;
import com.google.protobuf.FieldMask;
import java.io.IOException;
@@ -104,6 +104,20 @@
* CatalogServiceClient catalogServiceClient = CatalogServiceClient.create(catalogServiceSettings);
* }
*
+ * To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
+ * the wire:
+ *
+ *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * CatalogServiceSettings catalogServiceSettings =
+ * CatalogServiceSettings.newBuilder()
+ * .setTransportChannelProvider(
+ * CatalogServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * CatalogServiceClient catalogServiceClient = CatalogServiceClient.create(catalogServiceSettings);
+ * }
+ *
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@BetaApi
@@ -111,7 +125,8 @@
public class CatalogServiceClient implements BackgroundResource {
private final CatalogServiceSettings settings;
private final CatalogServiceStub stub;
- private final OperationsClient operationsClient;
+ private final OperationsClient httpJsonOperationsClient;
+ private final com.google.longrunning.OperationsClient operationsClient;
/** Constructs an instance of CatalogServiceClient with default settings. */
public static final CatalogServiceClient create() throws IOException {
@@ -143,13 +158,17 @@ public static final CatalogServiceClient create(CatalogServiceStub stub) {
protected CatalogServiceClient(CatalogServiceSettings settings) throws IOException {
this.settings = settings;
this.stub = ((CatalogServiceStubSettings) settings.getStubSettings()).createStub();
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ this.operationsClient =
+ com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
+ this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}
protected CatalogServiceClient(CatalogServiceStub stub) {
this.settings = null;
this.stub = stub;
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ this.operationsClient =
+ com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
+ this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}
public final CatalogServiceSettings getSettings() {
@@ -164,10 +183,18 @@ public CatalogServiceStub getStub() {
* Returns the OperationsClient that can be used to query the status of a long-running operation
* returned by another API method call.
*/
- public final OperationsClient getOperationsClient() {
+ public final com.google.longrunning.OperationsClient getOperationsClient() {
return operationsClient;
}
+ /**
+ * Returns the OperationsClient that can be used to query the status of a long-running operation
+ * returned by another API method call.
+ */
+ public final OperationsClient getHttpJsonOperationsClient() {
+ return httpJsonOperationsClient;
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a catalog item.
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 899c591f..22f31b84 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
@@ -23,6 +23,7 @@
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
@@ -140,11 +141,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return CatalogServiceStubSettings.defaultCredentialsProviderBuilder();
}
- /** Returns a builder for the default ChannelProvider for this service. */
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return CatalogServiceStubSettings.defaultGrpcTransportProviderBuilder();
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return CatalogServiceStubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return CatalogServiceStubSettings.defaultTransportChannelProvider();
}
@@ -154,11 +162,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return CatalogServiceStubSettings.defaultApiClientHeaderProviderBuilder();
}
- /** Returns a new builder for this class. */
+ /** Returns a new gRPC builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}
+ /** Returns a new REST builder for this class. */
+ @BetaApi
+ public static Builder newHttpJsonBuilder() {
+ return Builder.createHttpJsonDefault();
+ }
+
/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
@@ -196,6 +210,11 @@ private static Builder createDefault() {
return new Builder(CatalogServiceStubSettings.newBuilder());
}
+ @BetaApi
+ private static Builder createHttpJsonDefault() {
+ return new Builder(CatalogServiceStubSettings.newHttpJsonBuilder());
+ }
+
public CatalogServiceStubSettings.Builder getStubSettingsBuilder() {
return ((CatalogServiceStubSettings.Builder) getStubSettings());
}
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 faad7422..ce1a01b1 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
@@ -110,6 +110,21 @@
* PredictionApiKeyRegistryClient.create(predictionApiKeyRegistrySettings);
* }
*
+ *
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
+ * the wire:
+ *
+ *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * PredictionApiKeyRegistrySettings predictionApiKeyRegistrySettings =
+ * PredictionApiKeyRegistrySettings.newBuilder()
+ * .setTransportChannelProvider(
+ * PredictionApiKeyRegistrySettings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * PredictionApiKeyRegistryClient predictionApiKeyRegistryClient =
+ * PredictionApiKeyRegistryClient.create(predictionApiKeyRegistrySettings);
+ * }
+ *
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@BetaApi
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 a0fd2fd5..568cb6fa 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
@@ -23,6 +23,7 @@
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
@@ -125,11 +126,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return PredictionApiKeyRegistryStubSettings.defaultCredentialsProviderBuilder();
}
- /** Returns a builder for the default ChannelProvider for this service. */
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return PredictionApiKeyRegistryStubSettings.defaultGrpcTransportProviderBuilder();
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return PredictionApiKeyRegistryStubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return PredictionApiKeyRegistryStubSettings.defaultTransportChannelProvider();
}
@@ -139,11 +147,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return PredictionApiKeyRegistryStubSettings.defaultApiClientHeaderProviderBuilder();
}
- /** Returns a new builder for this class. */
+ /** Returns a new gRPC builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}
+ /** Returns a new REST builder for this class. */
+ @BetaApi
+ public static Builder newHttpJsonBuilder() {
+ return Builder.createHttpJsonDefault();
+ }
+
/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
@@ -182,6 +196,11 @@ private static Builder createDefault() {
return new Builder(PredictionApiKeyRegistryStubSettings.newBuilder());
}
+ @BetaApi
+ private static Builder createHttpJsonDefault() {
+ return new Builder(PredictionApiKeyRegistryStubSettings.newHttpJsonBuilder());
+ }
+
public PredictionApiKeyRegistryStubSettings.Builder getStubSettingsBuilder() {
return ((PredictionApiKeyRegistryStubSettings.Builder) getStubSettings());
}
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 1c965227..b171c8e2 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
@@ -107,6 +107,21 @@
* PredictionServiceClient.create(predictionServiceSettings);
* }
*
+ *
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
+ * the wire:
+ *
+ *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * PredictionServiceSettings predictionServiceSettings =
+ * PredictionServiceSettings.newBuilder()
+ * .setTransportChannelProvider(
+ * PredictionServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * PredictionServiceClient predictionServiceClient =
+ * PredictionServiceClient.create(predictionServiceSettings);
+ * }
+ *
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@BetaApi
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 b4463873..069b74af 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
@@ -23,6 +23,7 @@
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
@@ -104,11 +105,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return PredictionServiceStubSettings.defaultCredentialsProviderBuilder();
}
- /** Returns a builder for the default ChannelProvider for this service. */
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return PredictionServiceStubSettings.defaultGrpcTransportProviderBuilder();
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return PredictionServiceStubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return PredictionServiceStubSettings.defaultTransportChannelProvider();
}
@@ -118,11 +126,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return PredictionServiceStubSettings.defaultApiClientHeaderProviderBuilder();
}
- /** Returns a new builder for this class. */
+ /** Returns a new gRPC builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}
+ /** Returns a new REST builder for this class. */
+ @BetaApi
+ public static Builder newHttpJsonBuilder() {
+ return Builder.createHttpJsonDefault();
+ }
+
/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
@@ -160,6 +174,11 @@ private static Builder createDefault() {
return new Builder(PredictionServiceStubSettings.newBuilder());
}
+ @BetaApi
+ private static Builder createHttpJsonDefault() {
+ return new Builder(PredictionServiceStubSettings.newHttpJsonBuilder());
+ }
+
public PredictionServiceStubSettings.Builder getStubSettingsBuilder() {
return ((PredictionServiceStubSettings.Builder) getStubSettings());
}
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 f642ed32..525a2f58 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
@@ -21,6 +21,7 @@
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.httpjson.longrunning.OperationsClient;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.api.gax.paging.AbstractFixedSizeCollection;
import com.google.api.gax.paging.AbstractPage;
@@ -32,7 +33,6 @@
import com.google.cloud.recommendationengine.v1beta1.stub.UserEventServiceStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.longrunning.Operation;
-import com.google.longrunning.OperationsClient;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
@@ -107,6 +107,21 @@
* UserEventServiceClient.create(userEventServiceSettings);
* }
*
+ *
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
+ * the wire:
+ *
+ *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * UserEventServiceSettings userEventServiceSettings =
+ * UserEventServiceSettings.newBuilder()
+ * .setTransportChannelProvider(
+ * UserEventServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * UserEventServiceClient userEventServiceClient =
+ * UserEventServiceClient.create(userEventServiceSettings);
+ * }
+ *
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@BetaApi
@@ -114,7 +129,8 @@
public class UserEventServiceClient implements BackgroundResource {
private final UserEventServiceSettings settings;
private final UserEventServiceStub stub;
- private final OperationsClient operationsClient;
+ private final OperationsClient httpJsonOperationsClient;
+ private final com.google.longrunning.OperationsClient operationsClient;
/** Constructs an instance of UserEventServiceClient with default settings. */
public static final UserEventServiceClient create() throws IOException {
@@ -146,13 +162,17 @@ public static final UserEventServiceClient create(UserEventServiceStub stub) {
protected UserEventServiceClient(UserEventServiceSettings settings) throws IOException {
this.settings = settings;
this.stub = ((UserEventServiceStubSettings) settings.getStubSettings()).createStub();
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ this.operationsClient =
+ com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
+ this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}
protected UserEventServiceClient(UserEventServiceStub stub) {
this.settings = null;
this.stub = stub;
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ this.operationsClient =
+ com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
+ this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}
public final UserEventServiceSettings getSettings() {
@@ -167,10 +187,18 @@ public UserEventServiceStub getStub() {
* Returns the OperationsClient that can be used to query the status of a long-running operation
* returned by another API method call.
*/
- public final OperationsClient getOperationsClient() {
+ public final com.google.longrunning.OperationsClient getOperationsClient() {
return operationsClient;
}
+ /**
+ * Returns the OperationsClient that can be used to query the status of a long-running operation
+ * returned by another API method call.
+ */
+ public final OperationsClient getHttpJsonOperationsClient() {
+ return httpJsonOperationsClient;
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Writes a single user event.
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 3c727fe0..7a7787fd 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
@@ -24,6 +24,7 @@
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
@@ -141,11 +142,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return UserEventServiceStubSettings.defaultCredentialsProviderBuilder();
}
- /** Returns a builder for the default ChannelProvider for this service. */
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return UserEventServiceStubSettings.defaultGrpcTransportProviderBuilder();
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return UserEventServiceStubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return UserEventServiceStubSettings.defaultTransportChannelProvider();
}
@@ -155,11 +163,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return UserEventServiceStubSettings.defaultApiClientHeaderProviderBuilder();
}
- /** Returns a new builder for this class. */
+ /** Returns a new gRPC builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}
+ /** Returns a new REST builder for this class. */
+ @BetaApi
+ public static Builder newHttpJsonBuilder() {
+ return Builder.createHttpJsonDefault();
+ }
+
/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
@@ -197,6 +211,11 @@ private static Builder createDefault() {
return new Builder(UserEventServiceStubSettings.newBuilder());
}
+ @BetaApi
+ private static Builder createHttpJsonDefault() {
+ return new Builder(UserEventServiceStubSettings.newHttpJsonBuilder());
+ }
+
public UserEventServiceStubSettings.Builder getStubSettingsBuilder() {
return ((UserEventServiceStubSettings.Builder) getStubSettings());
}
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 97ab5aff..8fdd08d7 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
@@ -48,7 +48,11 @@
public abstract class CatalogServiceStub implements BackgroundResource {
public OperationsStub getOperationsStub() {
- throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
+ return null;
+ }
+
+ public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
+ return null;
}
public UnaryCallable createCatalogItemCallable() {
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 2e81eb72..460ed0a3 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
@@ -28,6 +28,9 @@
import com.google.api.gax.grpc.GrpcTransportChannel;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
import com.google.api.gax.grpc.ProtoOperationTransformers;
+import com.google.api.gax.httpjson.GaxHttpJsonProperties;
+import com.google.api.gax.httpjson.HttpJsonTransportChannel;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.longrunning.OperationSnapshot;
import com.google.api.gax.longrunning.OperationTimedPollAlgorithm;
import com.google.api.gax.retrying.RetrySettings;
@@ -223,6 +226,11 @@ public CatalogServiceStub createStub() throws IOException {
.equals(GrpcTransportChannel.getGrpcTransportName())) {
return GrpcCatalogServiceStub.create(this);
}
+ if (getTransportChannelProvider()
+ .getTransportName()
+ .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
+ return HttpJsonCatalogServiceStub.create(this);
+ }
throw new UnsupportedOperationException(
String.format(
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
@@ -255,18 +263,25 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
.setUseJwtAccessWithScope(true);
}
- /** Returns a builder for the default ChannelProvider for this service. */
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return InstantiatingGrpcChannelProvider.newBuilder()
.setMaxInboundMessageSize(Integer.MAX_VALUE);
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return InstantiatingHttpJsonChannelProvider.newBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return defaultGrpcTransportProviderBuilder().build();
}
@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
- public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() {
return ApiClientHeaderProvider.newBuilder()
.setGeneratedLibToken(
"gapic", GaxProperties.getLibraryVersion(CatalogServiceStubSettings.class))
@@ -274,11 +289,30 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion());
}
- /** Returns a new builder for this class. */
+ @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
+ public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() {
+ return ApiClientHeaderProvider.newBuilder()
+ .setGeneratedLibToken(
+ "gapic", GaxProperties.getLibraryVersion(CatalogServiceStubSettings.class))
+ .setTransportToken(
+ GaxHttpJsonProperties.getHttpJsonTokenName(),
+ GaxHttpJsonProperties.getHttpJsonVersion());
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return CatalogServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder();
+ }
+
+ /** Returns a new gRPC builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}
+ /** Returns a new REST builder for this class. */
+ public static Builder newHttpJsonBuilder() {
+ return Builder.createHttpJsonDefault();
+ }
+
/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
@@ -415,6 +449,19 @@ private static Builder createDefault() {
return initDefaults(builder);
}
+ private static Builder createHttpJsonDefault() {
+ Builder builder = new Builder(((ClientContext) null));
+
+ builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build());
+ builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
+ builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build());
+ builder.setEndpoint(getDefaultEndpoint());
+ builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
+ builder.setSwitchToMtlsEndpointAllowed(true);
+
+ return initDefaults(builder);
+ }
+
private static Builder initDefaults(Builder builder) {
builder
.createCatalogItemSettings()
diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonCatalogServiceCallableFactory.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonCatalogServiceCallableFactory.java
new file mode 100644
index 00000000..2e9ef461
--- /dev/null
+++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonCatalogServiceCallableFactory.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.recommendationengine.v1beta1.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonCallableFactory;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.longrunning.stub.OperationsStub;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallable;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST callable factory implementation for the CatalogService service API.
+ *
+ * This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonCatalogServiceCallableFactory
+ implements HttpJsonStubCallableFactory {
+
+ @Override
+ public UnaryCallable createUnaryCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ UnaryCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createUnaryCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ UnaryCallable createPagedCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ PagedCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createPagedCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public UnaryCallable createBatchingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ BatchingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createBatchingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ @Override
+ public
+ OperationCallable createOperationCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ OperationCallSettings callSettings,
+ ClientContext clientContext,
+ OperationsStub operationsStub) {
+ UnaryCallable innerCallable =
+ HttpJsonCallableFactory.createBaseUnaryCallable(
+ httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext);
+ HttpJsonOperationSnapshotCallable initialCallable =
+ new HttpJsonOperationSnapshotCallable(
+ innerCallable,
+ httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory());
+ return HttpJsonCallableFactory.createOperationCallable(
+ callSettings, clientContext, operationsStub.longRunningClient(), initialCallable);
+ }
+
+ @Override
+ public
+ ServerStreamingCallable createServerStreamingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ ServerStreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createServerStreamingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+}
diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonCatalogServiceStub.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonCatalogServiceStub.java
new file mode 100644
index 00000000..2062005d
--- /dev/null
+++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonCatalogServiceStub.java
@@ -0,0 +1,516 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.recommendationengine.v1beta1.stub;
+
+import static com.google.cloud.recommendationengine.v1beta1.CatalogServiceClient.ListCatalogItemsPagedResponse;
+
+import com.google.api.core.BetaApi;
+import com.google.api.core.InternalApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.core.BackgroundResourceAggregation;
+import com.google.api.gax.httpjson.ApiMethodDescriptor;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshot;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.ProtoMessageRequestFormatter;
+import com.google.api.gax.httpjson.ProtoMessageResponseParser;
+import com.google.api.gax.httpjson.ProtoRestSerializer;
+import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.recommendationengine.v1beta1.CatalogItem;
+import com.google.cloud.recommendationengine.v1beta1.CreateCatalogItemRequest;
+import com.google.cloud.recommendationengine.v1beta1.DeleteCatalogItemRequest;
+import com.google.cloud.recommendationengine.v1beta1.GetCatalogItemRequest;
+import com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsRequest;
+import com.google.cloud.recommendationengine.v1beta1.ImportCatalogItemsResponse;
+import com.google.cloud.recommendationengine.v1beta1.ImportMetadata;
+import com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsRequest;
+import com.google.cloud.recommendationengine.v1beta1.ListCatalogItemsResponse;
+import com.google.cloud.recommendationengine.v1beta1.UpdateCatalogItemRequest;
+import com.google.longrunning.Operation;
+import com.google.protobuf.Empty;
+import com.google.protobuf.TypeRegistry;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST stub implementation for the CatalogService service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonCatalogServiceStub extends CatalogServiceStub {
+ private static final TypeRegistry typeRegistry =
+ TypeRegistry.newBuilder()
+ .add(ImportCatalogItemsResponse.getDescriptor())
+ .add(ImportMetadata.getDescriptor())
+ .build();
+
+ private static final ApiMethodDescriptor
+ createCatalogItemMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.recommendationengine.v1beta1.CatalogService/CreateCatalogItem")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("catalogItem", request.getCatalogItem()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(CatalogItem.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ getCatalogItemMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.recommendationengine.v1beta1.CatalogService/GetCatalogItem")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(CatalogItem.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ listCatalogItemsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.recommendationengine.v1beta1.CatalogService/ListCatalogItems")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "filter", request.getFilter());
+ serializer.putQueryParam(fields, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListCatalogItemsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ updateCatalogItemMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.recommendationengine.v1beta1.CatalogService/UpdateCatalogItem")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("catalogItem", request.getCatalogItem()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(CatalogItem.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteCatalogItemMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.recommendationengine.v1beta1.CatalogService/DeleteCatalogItem")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{name=projects/*/locations/*/catalogs/*/catalogItems/**}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Empty.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ importCatalogItemsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.recommendationengine.v1beta1.CatalogService/ImportCatalogItems")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{parent=projects/*/locations/*/catalogs/*}/catalogItems:import",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearParent().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (ImportCatalogItemsRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private final UnaryCallable createCatalogItemCallable;
+ private final UnaryCallable getCatalogItemCallable;
+ private final UnaryCallable
+ listCatalogItemsCallable;
+ 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 BackgroundResource backgroundResources;
+ private final HttpJsonOperationsStub httpJsonOperationsStub;
+ private final HttpJsonStubCallableFactory callableFactory;
+
+ public static final HttpJsonCatalogServiceStub create(CatalogServiceStubSettings settings)
+ throws IOException {
+ return new HttpJsonCatalogServiceStub(settings, ClientContext.create(settings));
+ }
+
+ public static final HttpJsonCatalogServiceStub create(ClientContext clientContext)
+ throws IOException {
+ return new HttpJsonCatalogServiceStub(
+ CatalogServiceStubSettings.newHttpJsonBuilder().build(), clientContext);
+ }
+
+ public static final HttpJsonCatalogServiceStub create(
+ ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException {
+ return new HttpJsonCatalogServiceStub(
+ CatalogServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory);
+ }
+
+ /**
+ * Constructs an instance of HttpJsonCatalogServiceStub, 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.
+ */
+ protected HttpJsonCatalogServiceStub(
+ CatalogServiceStubSettings settings, ClientContext clientContext) throws IOException {
+ this(settings, clientContext, new HttpJsonCatalogServiceCallableFactory());
+ }
+
+ /**
+ * Constructs an instance of HttpJsonCatalogServiceStub, 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.
+ */
+ protected HttpJsonCatalogServiceStub(
+ CatalogServiceStubSettings settings,
+ ClientContext clientContext,
+ HttpJsonStubCallableFactory callableFactory)
+ throws IOException {
+ this.callableFactory = callableFactory;
+ this.httpJsonOperationsStub =
+ HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry);
+
+ HttpJsonCallSettings createCatalogItemTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(createCatalogItemMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings getCatalogItemTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(getCatalogItemMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ listCatalogItemsTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(listCatalogItemsMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings updateCatalogItemTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(updateCatalogItemMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings deleteCatalogItemTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(deleteCatalogItemMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings importCatalogItemsTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(importCatalogItemsMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+
+ this.createCatalogItemCallable =
+ callableFactory.createUnaryCallable(
+ createCatalogItemTransportSettings,
+ settings.createCatalogItemSettings(),
+ clientContext);
+ this.getCatalogItemCallable =
+ callableFactory.createUnaryCallable(
+ getCatalogItemTransportSettings, settings.getCatalogItemSettings(), clientContext);
+ this.listCatalogItemsCallable =
+ callableFactory.createUnaryCallable(
+ listCatalogItemsTransportSettings, settings.listCatalogItemsSettings(), clientContext);
+ this.listCatalogItemsPagedCallable =
+ callableFactory.createPagedCallable(
+ listCatalogItemsTransportSettings, settings.listCatalogItemsSettings(), clientContext);
+ this.updateCatalogItemCallable =
+ callableFactory.createUnaryCallable(
+ 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,
+ httpJsonOperationsStub);
+
+ this.backgroundResources =
+ new BackgroundResourceAggregation(clientContext.getBackgroundResources());
+ }
+
+ @InternalApi
+ public static List getMethodDescriptors() {
+ List methodDescriptors = new ArrayList<>();
+ methodDescriptors.add(createCatalogItemMethodDescriptor);
+ methodDescriptors.add(getCatalogItemMethodDescriptor);
+ methodDescriptors.add(listCatalogItemsMethodDescriptor);
+ methodDescriptors.add(updateCatalogItemMethodDescriptor);
+ methodDescriptors.add(deleteCatalogItemMethodDescriptor);
+ methodDescriptors.add(importCatalogItemsMethodDescriptor);
+ return methodDescriptors;
+ }
+
+ public HttpJsonOperationsStub getHttpJsonOperationsStub() {
+ return httpJsonOperationsStub;
+ }
+
+ @Override
+ public UnaryCallable createCatalogItemCallable() {
+ return createCatalogItemCallable;
+ }
+
+ @Override
+ public UnaryCallable getCatalogItemCallable() {
+ return getCatalogItemCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ listCatalogItemsCallable() {
+ return listCatalogItemsCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ listCatalogItemsPagedCallable() {
+ return listCatalogItemsPagedCallable;
+ }
+
+ @Override
+ public UnaryCallable updateCatalogItemCallable() {
+ return updateCatalogItemCallable;
+ }
+
+ @Override
+ public UnaryCallable deleteCatalogItemCallable() {
+ return deleteCatalogItemCallable;
+ }
+
+ @Override
+ public UnaryCallable importCatalogItemsCallable() {
+ return importCatalogItemsCallable;
+ }
+
+ @Override
+ public OperationCallable
+ importCatalogItemsOperationCallable() {
+ return importCatalogItemsOperationCallable;
+ }
+
+ @Override
+ public final void close() {
+ try {
+ backgroundResources.close();
+ } catch (RuntimeException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new IllegalStateException("Failed to close resource", e);
+ }
+ }
+
+ @Override
+ public void shutdown() {
+ backgroundResources.shutdown();
+ }
+
+ @Override
+ public boolean isShutdown() {
+ return backgroundResources.isShutdown();
+ }
+
+ @Override
+ public boolean isTerminated() {
+ return backgroundResources.isTerminated();
+ }
+
+ @Override
+ public void shutdownNow() {
+ backgroundResources.shutdownNow();
+ }
+
+ @Override
+ public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
+ return backgroundResources.awaitTermination(duration, unit);
+ }
+}
diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonPredictionApiKeyRegistryCallableFactory.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonPredictionApiKeyRegistryCallableFactory.java
new file mode 100644
index 00000000..0517effb
--- /dev/null
+++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonPredictionApiKeyRegistryCallableFactory.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.recommendationengine.v1beta1.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonCallableFactory;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.longrunning.stub.OperationsStub;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallable;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST callable factory implementation for the PredictionApiKeyRegistry service API.
+ *
+ * This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonPredictionApiKeyRegistryCallableFactory
+ implements HttpJsonStubCallableFactory {
+
+ @Override
+ public UnaryCallable createUnaryCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ UnaryCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createUnaryCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ UnaryCallable createPagedCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ PagedCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createPagedCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public UnaryCallable createBatchingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ BatchingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createBatchingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ @Override
+ public
+ OperationCallable createOperationCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ OperationCallSettings callSettings,
+ ClientContext clientContext,
+ OperationsStub operationsStub) {
+ UnaryCallable innerCallable =
+ HttpJsonCallableFactory.createBaseUnaryCallable(
+ httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext);
+ HttpJsonOperationSnapshotCallable initialCallable =
+ new HttpJsonOperationSnapshotCallable(
+ innerCallable,
+ httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory());
+ return HttpJsonCallableFactory.createOperationCallable(
+ callSettings, clientContext, operationsStub.longRunningClient(), initialCallable);
+ }
+
+ @Override
+ public
+ ServerStreamingCallable createServerStreamingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ ServerStreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createServerStreamingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+}
diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonPredictionApiKeyRegistryStub.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonPredictionApiKeyRegistryStub.java
new file mode 100644
index 00000000..f412c6c4
--- /dev/null
+++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonPredictionApiKeyRegistryStub.java
@@ -0,0 +1,352 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.recommendationengine.v1beta1.stub;
+
+import static com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistryClient.ListPredictionApiKeyRegistrationsPagedResponse;
+
+import com.google.api.core.BetaApi;
+import com.google.api.core.InternalApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.core.BackgroundResourceAggregation;
+import com.google.api.gax.httpjson.ApiMethodDescriptor;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.ProtoMessageRequestFormatter;
+import com.google.api.gax.httpjson.ProtoMessageResponseParser;
+import com.google.api.gax.httpjson.ProtoRestSerializer;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.recommendationengine.v1beta1.CreatePredictionApiKeyRegistrationRequest;
+import com.google.cloud.recommendationengine.v1beta1.DeletePredictionApiKeyRegistrationRequest;
+import com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsRequest;
+import com.google.cloud.recommendationengine.v1beta1.ListPredictionApiKeyRegistrationsResponse;
+import com.google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistration;
+import com.google.protobuf.Empty;
+import com.google.protobuf.TypeRegistry;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST stub implementation for the PredictionApiKeyRegistry service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonPredictionApiKeyRegistryStub extends PredictionApiKeyRegistryStub {
+ private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build();
+
+ private static final ApiMethodDescriptor<
+ CreatePredictionApiKeyRegistrationRequest, PredictionApiKeyRegistration>
+ createPredictionApiKeyRegistrationMethodDescriptor =
+ ApiMethodDescriptor
+ .newBuilder()
+ .setFullMethodName(
+ "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry/CreatePredictionApiKeyRegistration")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter
+ .newBuilder()
+ .setPath(
+ "/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/predictionApiKeyRegistrations",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer
+ serializer = ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer
+ serializer = ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearParent().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(PredictionApiKeyRegistration.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor<
+ ListPredictionApiKeyRegistrationsRequest, ListPredictionApiKeyRegistrationsResponse>
+ listPredictionApiKeyRegistrationsMethodDescriptor =
+ ApiMethodDescriptor
+ .
+ newBuilder()
+ .setFullMethodName(
+ "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry/ListPredictionApiKeyRegistrations")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter
+ .newBuilder()
+ .setPath(
+ "/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/predictionApiKeyRegistrations",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer
+ serializer = ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer
+ serializer = ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(
+ ListPredictionApiKeyRegistrationsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ deletePredictionApiKeyRegistrationMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.recommendationengine.v1beta1.PredictionApiKeyRegistry/DeletePredictionApiKeyRegistration")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter
+ .newBuilder()
+ .setPath(
+ "/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/predictionApiKeyRegistrations/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer
+ serializer = ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer
+ serializer = ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Empty.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private final UnaryCallable<
+ CreatePredictionApiKeyRegistrationRequest, PredictionApiKeyRegistration>
+ createPredictionApiKeyRegistrationCallable;
+ private final UnaryCallable<
+ ListPredictionApiKeyRegistrationsRequest, ListPredictionApiKeyRegistrationsResponse>
+ listPredictionApiKeyRegistrationsCallable;
+ private final UnaryCallable<
+ ListPredictionApiKeyRegistrationsRequest, ListPredictionApiKeyRegistrationsPagedResponse>
+ listPredictionApiKeyRegistrationsPagedCallable;
+ private final UnaryCallable
+ deletePredictionApiKeyRegistrationCallable;
+
+ private final BackgroundResource backgroundResources;
+ private final HttpJsonStubCallableFactory callableFactory;
+
+ public static final HttpJsonPredictionApiKeyRegistryStub create(
+ PredictionApiKeyRegistryStubSettings settings) throws IOException {
+ return new HttpJsonPredictionApiKeyRegistryStub(settings, ClientContext.create(settings));
+ }
+
+ public static final HttpJsonPredictionApiKeyRegistryStub create(ClientContext clientContext)
+ throws IOException {
+ return new HttpJsonPredictionApiKeyRegistryStub(
+ PredictionApiKeyRegistryStubSettings.newHttpJsonBuilder().build(), clientContext);
+ }
+
+ public static final HttpJsonPredictionApiKeyRegistryStub create(
+ ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException {
+ return new HttpJsonPredictionApiKeyRegistryStub(
+ PredictionApiKeyRegistryStubSettings.newHttpJsonBuilder().build(),
+ clientContext,
+ callableFactory);
+ }
+
+ /**
+ * Constructs an instance of HttpJsonPredictionApiKeyRegistryStub, 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.
+ */
+ protected HttpJsonPredictionApiKeyRegistryStub(
+ PredictionApiKeyRegistryStubSettings settings, ClientContext clientContext)
+ throws IOException {
+ this(settings, clientContext, new HttpJsonPredictionApiKeyRegistryCallableFactory());
+ }
+
+ /**
+ * Constructs an instance of HttpJsonPredictionApiKeyRegistryStub, 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.
+ */
+ protected HttpJsonPredictionApiKeyRegistryStub(
+ PredictionApiKeyRegistryStubSettings settings,
+ ClientContext clientContext,
+ HttpJsonStubCallableFactory callableFactory)
+ throws IOException {
+ this.callableFactory = callableFactory;
+
+ HttpJsonCallSettings
+ createPredictionApiKeyRegistrationTransportSettings =
+ HttpJsonCallSettings
+ .
+ newBuilder()
+ .setMethodDescriptor(createPredictionApiKeyRegistrationMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings<
+ ListPredictionApiKeyRegistrationsRequest, ListPredictionApiKeyRegistrationsResponse>
+ listPredictionApiKeyRegistrationsTransportSettings =
+ HttpJsonCallSettings
+ .
+ newBuilder()
+ .setMethodDescriptor(listPredictionApiKeyRegistrationsMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings
+ deletePredictionApiKeyRegistrationTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(deletePredictionApiKeyRegistrationMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+
+ this.createPredictionApiKeyRegistrationCallable =
+ callableFactory.createUnaryCallable(
+ createPredictionApiKeyRegistrationTransportSettings,
+ settings.createPredictionApiKeyRegistrationSettings(),
+ clientContext);
+ this.listPredictionApiKeyRegistrationsCallable =
+ callableFactory.createUnaryCallable(
+ listPredictionApiKeyRegistrationsTransportSettings,
+ settings.listPredictionApiKeyRegistrationsSettings(),
+ clientContext);
+ this.listPredictionApiKeyRegistrationsPagedCallable =
+ callableFactory.createPagedCallable(
+ listPredictionApiKeyRegistrationsTransportSettings,
+ settings.listPredictionApiKeyRegistrationsSettings(),
+ clientContext);
+ this.deletePredictionApiKeyRegistrationCallable =
+ callableFactory.createUnaryCallable(
+ deletePredictionApiKeyRegistrationTransportSettings,
+ settings.deletePredictionApiKeyRegistrationSettings(),
+ clientContext);
+
+ this.backgroundResources =
+ new BackgroundResourceAggregation(clientContext.getBackgroundResources());
+ }
+
+ @InternalApi
+ public static List getMethodDescriptors() {
+ List methodDescriptors = new ArrayList<>();
+ methodDescriptors.add(createPredictionApiKeyRegistrationMethodDescriptor);
+ methodDescriptors.add(listPredictionApiKeyRegistrationsMethodDescriptor);
+ methodDescriptors.add(deletePredictionApiKeyRegistrationMethodDescriptor);
+ return methodDescriptors;
+ }
+
+ @Override
+ public UnaryCallable
+ createPredictionApiKeyRegistrationCallable() {
+ return createPredictionApiKeyRegistrationCallable;
+ }
+
+ @Override
+ public UnaryCallable<
+ ListPredictionApiKeyRegistrationsRequest, ListPredictionApiKeyRegistrationsResponse>
+ listPredictionApiKeyRegistrationsCallable() {
+ return listPredictionApiKeyRegistrationsCallable;
+ }
+
+ @Override
+ public UnaryCallable<
+ ListPredictionApiKeyRegistrationsRequest, ListPredictionApiKeyRegistrationsPagedResponse>
+ listPredictionApiKeyRegistrationsPagedCallable() {
+ return listPredictionApiKeyRegistrationsPagedCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ deletePredictionApiKeyRegistrationCallable() {
+ return deletePredictionApiKeyRegistrationCallable;
+ }
+
+ @Override
+ public final void close() {
+ try {
+ backgroundResources.close();
+ } catch (RuntimeException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new IllegalStateException("Failed to close resource", e);
+ }
+ }
+
+ @Override
+ public void shutdown() {
+ backgroundResources.shutdown();
+ }
+
+ @Override
+ public boolean isShutdown() {
+ return backgroundResources.isShutdown();
+ }
+
+ @Override
+ public boolean isTerminated() {
+ return backgroundResources.isTerminated();
+ }
+
+ @Override
+ public void shutdownNow() {
+ backgroundResources.shutdownNow();
+ }
+
+ @Override
+ public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
+ return backgroundResources.awaitTermination(duration, unit);
+ }
+}
diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonPredictionServiceCallableFactory.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonPredictionServiceCallableFactory.java
new file mode 100644
index 00000000..fd7da10d
--- /dev/null
+++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonPredictionServiceCallableFactory.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.recommendationengine.v1beta1.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonCallableFactory;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.longrunning.stub.OperationsStub;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallable;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST callable factory implementation for the PredictionService service API.
+ *
+ * This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonPredictionServiceCallableFactory
+ implements HttpJsonStubCallableFactory {
+
+ @Override
+ public UnaryCallable createUnaryCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ UnaryCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createUnaryCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ UnaryCallable createPagedCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ PagedCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createPagedCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public UnaryCallable createBatchingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ BatchingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createBatchingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ @Override
+ public
+ OperationCallable createOperationCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ OperationCallSettings callSettings,
+ ClientContext clientContext,
+ OperationsStub operationsStub) {
+ UnaryCallable innerCallable =
+ HttpJsonCallableFactory.createBaseUnaryCallable(
+ httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext);
+ HttpJsonOperationSnapshotCallable initialCallable =
+ new HttpJsonOperationSnapshotCallable(
+ innerCallable,
+ httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory());
+ return HttpJsonCallableFactory.createOperationCallable(
+ callSettings, clientContext, operationsStub.longRunningClient(), initialCallable);
+ }
+
+ @Override
+ public
+ ServerStreamingCallable createServerStreamingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ ServerStreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createServerStreamingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+}
diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonPredictionServiceStub.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonPredictionServiceStub.java
new file mode 100644
index 00000000..503f4b51
--- /dev/null
+++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonPredictionServiceStub.java
@@ -0,0 +1,206 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.recommendationengine.v1beta1.stub;
+
+import static com.google.cloud.recommendationengine.v1beta1.PredictionServiceClient.PredictPagedResponse;
+
+import com.google.api.core.BetaApi;
+import com.google.api.core.InternalApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.core.BackgroundResourceAggregation;
+import com.google.api.gax.httpjson.ApiMethodDescriptor;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.ProtoMessageRequestFormatter;
+import com.google.api.gax.httpjson.ProtoMessageResponseParser;
+import com.google.api.gax.httpjson.ProtoRestSerializer;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.recommendationengine.v1beta1.PredictRequest;
+import com.google.cloud.recommendationengine.v1beta1.PredictResponse;
+import com.google.protobuf.TypeRegistry;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST stub implementation for the PredictionService service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonPredictionServiceStub extends PredictionServiceStub {
+ private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build();
+
+ private static final ApiMethodDescriptor
+ predictMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.recommendationengine.v1beta1.PredictionService/Predict")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{name=projects/*/locations/*/catalogs/*/eventStores/*/placements/*}:predict",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearName().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(PredictResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private final UnaryCallable predictCallable;
+ private final UnaryCallable predictPagedCallable;
+
+ private final BackgroundResource backgroundResources;
+ private final HttpJsonStubCallableFactory callableFactory;
+
+ public static final HttpJsonPredictionServiceStub create(PredictionServiceStubSettings settings)
+ throws IOException {
+ return new HttpJsonPredictionServiceStub(settings, ClientContext.create(settings));
+ }
+
+ public static final HttpJsonPredictionServiceStub create(ClientContext clientContext)
+ throws IOException {
+ return new HttpJsonPredictionServiceStub(
+ PredictionServiceStubSettings.newHttpJsonBuilder().build(), clientContext);
+ }
+
+ public static final HttpJsonPredictionServiceStub create(
+ ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException {
+ return new HttpJsonPredictionServiceStub(
+ PredictionServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory);
+ }
+
+ /**
+ * Constructs an instance of HttpJsonPredictionServiceStub, 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.
+ */
+ protected HttpJsonPredictionServiceStub(
+ PredictionServiceStubSettings settings, ClientContext clientContext) throws IOException {
+ this(settings, clientContext, new HttpJsonPredictionServiceCallableFactory());
+ }
+
+ /**
+ * Constructs an instance of HttpJsonPredictionServiceStub, 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.
+ */
+ protected HttpJsonPredictionServiceStub(
+ PredictionServiceStubSettings settings,
+ ClientContext clientContext,
+ HttpJsonStubCallableFactory callableFactory)
+ throws IOException {
+ this.callableFactory = callableFactory;
+
+ HttpJsonCallSettings predictTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(predictMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+
+ this.predictCallable =
+ callableFactory.createUnaryCallable(
+ predictTransportSettings, settings.predictSettings(), clientContext);
+ this.predictPagedCallable =
+ callableFactory.createPagedCallable(
+ predictTransportSettings, settings.predictSettings(), clientContext);
+
+ this.backgroundResources =
+ new BackgroundResourceAggregation(clientContext.getBackgroundResources());
+ }
+
+ @InternalApi
+ public static List getMethodDescriptors() {
+ List methodDescriptors = new ArrayList<>();
+ methodDescriptors.add(predictMethodDescriptor);
+ return methodDescriptors;
+ }
+
+ @Override
+ public UnaryCallable predictCallable() {
+ return predictCallable;
+ }
+
+ @Override
+ public UnaryCallable predictPagedCallable() {
+ return predictPagedCallable;
+ }
+
+ @Override
+ public final void close() {
+ try {
+ backgroundResources.close();
+ } catch (RuntimeException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new IllegalStateException("Failed to close resource", e);
+ }
+ }
+
+ @Override
+ public void shutdown() {
+ backgroundResources.shutdown();
+ }
+
+ @Override
+ public boolean isShutdown() {
+ return backgroundResources.isShutdown();
+ }
+
+ @Override
+ public boolean isTerminated() {
+ return backgroundResources.isTerminated();
+ }
+
+ @Override
+ public void shutdownNow() {
+ backgroundResources.shutdownNow();
+ }
+
+ @Override
+ public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
+ return backgroundResources.awaitTermination(duration, unit);
+ }
+}
diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonUserEventServiceCallableFactory.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonUserEventServiceCallableFactory.java
new file mode 100644
index 00000000..310e107b
--- /dev/null
+++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonUserEventServiceCallableFactory.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.recommendationengine.v1beta1.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonCallableFactory;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.longrunning.stub.OperationsStub;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallable;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST callable factory implementation for the UserEventService service API.
+ *
+ * This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonUserEventServiceCallableFactory
+ implements HttpJsonStubCallableFactory {
+
+ @Override
+ public UnaryCallable createUnaryCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ UnaryCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createUnaryCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ UnaryCallable createPagedCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ PagedCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createPagedCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public UnaryCallable createBatchingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ BatchingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createBatchingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ @Override
+ public
+ OperationCallable createOperationCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ OperationCallSettings callSettings,
+ ClientContext clientContext,
+ OperationsStub operationsStub) {
+ UnaryCallable innerCallable =
+ HttpJsonCallableFactory.createBaseUnaryCallable(
+ httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext);
+ HttpJsonOperationSnapshotCallable initialCallable =
+ new HttpJsonOperationSnapshotCallable(
+ innerCallable,
+ httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory());
+ return HttpJsonCallableFactory.createOperationCallable(
+ callSettings, clientContext, operationsStub.longRunningClient(), initialCallable);
+ }
+
+ @Override
+ public
+ ServerStreamingCallable createServerStreamingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ ServerStreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createServerStreamingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+}
diff --git a/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonUserEventServiceStub.java b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonUserEventServiceStub.java
new file mode 100644
index 00000000..e29d2030
--- /dev/null
+++ b/google-cloud-recommendations-ai/src/main/java/com/google/cloud/recommendationengine/v1beta1/stub/HttpJsonUserEventServiceStub.java
@@ -0,0 +1,479 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.recommendationengine.v1beta1.stub;
+
+import static com.google.cloud.recommendationengine.v1beta1.UserEventServiceClient.ListUserEventsPagedResponse;
+
+import com.google.api.HttpBody;
+import com.google.api.core.BetaApi;
+import com.google.api.core.InternalApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.core.BackgroundResourceAggregation;
+import com.google.api.gax.httpjson.ApiMethodDescriptor;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshot;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.ProtoMessageRequestFormatter;
+import com.google.api.gax.httpjson.ProtoMessageResponseParser;
+import com.google.api.gax.httpjson.ProtoRestSerializer;
+import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.recommendationengine.v1beta1.CollectUserEventRequest;
+import com.google.cloud.recommendationengine.v1beta1.ImportMetadata;
+import com.google.cloud.recommendationengine.v1beta1.ImportUserEventsRequest;
+import com.google.cloud.recommendationengine.v1beta1.ImportUserEventsResponse;
+import com.google.cloud.recommendationengine.v1beta1.ListUserEventsRequest;
+import com.google.cloud.recommendationengine.v1beta1.ListUserEventsResponse;
+import com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsMetadata;
+import com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsRequest;
+import com.google.cloud.recommendationengine.v1beta1.PurgeUserEventsResponse;
+import com.google.cloud.recommendationengine.v1beta1.UserEvent;
+import com.google.cloud.recommendationengine.v1beta1.WriteUserEventRequest;
+import com.google.longrunning.Operation;
+import com.google.protobuf.TypeRegistry;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST stub implementation for the UserEventService service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonUserEventServiceStub extends UserEventServiceStub {
+ private static final TypeRegistry typeRegistry =
+ TypeRegistry.newBuilder()
+ .add(PurgeUserEventsMetadata.getDescriptor())
+ .add(PurgeUserEventsResponse.getDescriptor())
+ .add(ImportUserEventsResponse.getDescriptor())
+ .add(ImportMetadata.getDescriptor())
+ .build();
+
+ private static final ApiMethodDescriptor
+ writeUserEventMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.recommendationengine.v1beta1.UserEventService/WriteUserEvent")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:write",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("userEvent", request.getUserEvent()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(UserEvent.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ collectUserEventMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.recommendationengine.v1beta1.UserEventService/CollectUserEvent")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents:collect",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "ets", request.getEts());
+ serializer.putQueryParam(fields, "uri", request.getUri());
+ serializer.putQueryParam(fields, "userEvent", request.getUserEvent());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(HttpBody.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ listUserEventsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.cloud.recommendationengine.v1beta1.UserEventService/ListUserEvents")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1beta1/{parent=projects/*/locations/*/catalogs/*/eventStores/*}/userEvents",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer