diff --git a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcClient.java b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcClient.java
index 34a52c915e7c..30e91115c6e7 100644
--- a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcClient.java
+++ b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcClient.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.eventarc.v1.stub.EventarcStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.longrunning.Operation;
-import com.google.longrunning.OperationsClient;
import com.google.protobuf.FieldMask;
import java.io.IOException;
import java.util.List;
@@ -103,13 +103,28 @@
* EventarcClient eventarcClient = EventarcClient.create(eventarcSettings);
* }
*
+ * 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.
+ * EventarcSettings eventarcSettings =
+ * EventarcSettings.newBuilder()
+ * .setTransportChannelProvider(
+ * EventarcSettings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * EventarcClient eventarcClient = EventarcClient.create(eventarcSettings);
+ * }
+ *
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
public class EventarcClient implements BackgroundResource {
private final EventarcSettings settings;
private final EventarcStub stub;
- private final OperationsClient operationsClient;
+ private final OperationsClient httpJsonOperationsClient;
+ private final com.google.longrunning.OperationsClient operationsClient;
/** Constructs an instance of EventarcClient with default settings. */
public static final EventarcClient create() throws IOException {
@@ -128,7 +143,6 @@ public static final EventarcClient create(EventarcSettings settings) throws IOEx
* Constructs an instance of EventarcClient, using the given stub for making calls. This is for
* advanced usage - prefer using create(EventarcSettings).
*/
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final EventarcClient create(EventarcStub stub) {
return new EventarcClient(stub);
}
@@ -140,21 +154,23 @@ public static final EventarcClient create(EventarcStub stub) {
protected EventarcClient(EventarcSettings settings) throws IOException {
this.settings = settings;
this.stub = ((EventarcStubSettings) 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());
}
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
protected EventarcClient(EventarcStub 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 EventarcSettings getSettings() {
return settings;
}
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public EventarcStub getStub() {
return stub;
}
@@ -163,10 +179,19 @@ public EventarcStub 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.
+ */
+ @BetaApi
+ public final OperationsClient getHttpJsonOperationsClient() {
+ return httpJsonOperationsClient;
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Get a single trigger.
@@ -395,7 +420,7 @@ public final ListTriggersPagedResponse listTriggers(ListTriggersRequest request)
* .build();
* while (true) {
* ListTriggersResponse response = eventarcClient.listTriggersCallable().call(request);
- * for (Trigger element : response.getResponsesList()) {
+ * for (Trigger element : response.getTriggersList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -1056,7 +1081,7 @@ public final ListChannelsPagedResponse listChannels(ListChannelsRequest request)
* .build();
* while (true) {
* ListChannelsResponse response = eventarcClient.listChannelsCallable().call(request);
- * for (Channel element : response.getResponsesList()) {
+ * for (Channel element : response.getChannelsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -1461,6 +1486,254 @@ public final UnaryCallable deleteChannelCallabl
return stub.deleteChannelCallable();
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get a single Provider.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (EventarcClient eventarcClient = EventarcClient.create()) {
+ * ProviderName name = ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]");
+ * Provider response = eventarcClient.getProvider(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the provider to get.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Provider getProvider(ProviderName name) {
+ GetProviderRequest request =
+ GetProviderRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getProvider(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get a single Provider.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (EventarcClient eventarcClient = EventarcClient.create()) {
+ * String name = ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]").toString();
+ * Provider response = eventarcClient.getProvider(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the provider to get.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Provider getProvider(String name) {
+ GetProviderRequest request = GetProviderRequest.newBuilder().setName(name).build();
+ return getProvider(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get a single Provider.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (EventarcClient eventarcClient = EventarcClient.create()) {
+ * GetProviderRequest request =
+ * GetProviderRequest.newBuilder()
+ * .setName(ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]").toString())
+ * .build();
+ * Provider response = eventarcClient.getProvider(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Provider getProvider(GetProviderRequest request) {
+ return getProviderCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get a single Provider.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (EventarcClient eventarcClient = EventarcClient.create()) {
+ * GetProviderRequest request =
+ * GetProviderRequest.newBuilder()
+ * .setName(ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]").toString())
+ * .build();
+ * ApiFuture future = eventarcClient.getProviderCallable().futureCall(request);
+ * // Do something.
+ * Provider response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable getProviderCallable() {
+ return stub.getProviderCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List providers.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (EventarcClient eventarcClient = EventarcClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (Provider element : eventarcClient.listProviders(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent of the provider to get.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListProvidersPagedResponse listProviders(LocationName parent) {
+ ListProvidersRequest request =
+ ListProvidersRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listProviders(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List providers.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (EventarcClient eventarcClient = EventarcClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (Provider element : eventarcClient.listProviders(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent of the provider to get.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListProvidersPagedResponse listProviders(String parent) {
+ ListProvidersRequest request = ListProvidersRequest.newBuilder().setParent(parent).build();
+ return listProviders(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List providers.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (EventarcClient eventarcClient = EventarcClient.create()) {
+ * ListProvidersRequest request =
+ * ListProvidersRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setOrderBy("orderBy-1207110587")
+ * .setFilter("filter-1274492040")
+ * .build();
+ * for (Provider element : eventarcClient.listProviders(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListProvidersPagedResponse listProviders(ListProvidersRequest request) {
+ return listProvidersPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List providers.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (EventarcClient eventarcClient = EventarcClient.create()) {
+ * ListProvidersRequest request =
+ * ListProvidersRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setOrderBy("orderBy-1207110587")
+ * .setFilter("filter-1274492040")
+ * .build();
+ * ApiFuture future = eventarcClient.listProvidersPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Provider element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable
+ listProvidersPagedCallable() {
+ return stub.listProvidersPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List providers.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (EventarcClient eventarcClient = EventarcClient.create()) {
+ * ListProvidersRequest request =
+ * ListProvidersRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setOrderBy("orderBy-1207110587")
+ * .setFilter("filter-1274492040")
+ * .build();
+ * while (true) {
+ * ListProvidersResponse response = eventarcClient.listProvidersCallable().call(request);
+ * for (Provider element : response.getProvidersList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable listProvidersCallable() {
+ return stub.listProvidersCallable();
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Get a single ChannelConnection.
@@ -1702,7 +1975,7 @@ public final ListChannelConnectionsPagedResponse listChannelConnections(
* while (true) {
* ListChannelConnectionsResponse response =
* eventarcClient.listChannelConnectionsCallable().call(request);
- * for (ChannelConnection element : response.getResponsesList()) {
+ * for (ChannelConnection element : response.getChannelConnectionsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -2198,6 +2471,82 @@ protected ListChannelsFixedSizeCollection createCollection(
}
}
+ public static class ListProvidersPagedResponse
+ extends AbstractPagedListResponse<
+ ListProvidersRequest,
+ ListProvidersResponse,
+ Provider,
+ ListProvidersPage,
+ ListProvidersFixedSizeCollection> {
+
+ public static ApiFuture createAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ ApiFuture futurePage =
+ ListProvidersPage.createEmptyPage().createPageAsync(context, futureResponse);
+ return ApiFutures.transform(
+ futurePage,
+ input -> new ListProvidersPagedResponse(input),
+ MoreExecutors.directExecutor());
+ }
+
+ private ListProvidersPagedResponse(ListProvidersPage page) {
+ super(page, ListProvidersFixedSizeCollection.createEmptyCollection());
+ }
+ }
+
+ public static class ListProvidersPage
+ extends AbstractPage<
+ ListProvidersRequest, ListProvidersResponse, Provider, ListProvidersPage> {
+
+ private ListProvidersPage(
+ PageContext context,
+ ListProvidersResponse response) {
+ super(context, response);
+ }
+
+ private static ListProvidersPage createEmptyPage() {
+ return new ListProvidersPage(null, null);
+ }
+
+ @Override
+ protected ListProvidersPage createPage(
+ PageContext context,
+ ListProvidersResponse response) {
+ return new ListProvidersPage(context, response);
+ }
+
+ @Override
+ public ApiFuture createPageAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ return super.createPageAsync(context, futureResponse);
+ }
+ }
+
+ public static class ListProvidersFixedSizeCollection
+ extends AbstractFixedSizeCollection<
+ ListProvidersRequest,
+ ListProvidersResponse,
+ Provider,
+ ListProvidersPage,
+ ListProvidersFixedSizeCollection> {
+
+ private ListProvidersFixedSizeCollection(List pages, int collectionSize) {
+ super(pages, collectionSize);
+ }
+
+ private static ListProvidersFixedSizeCollection createEmptyCollection() {
+ return new ListProvidersFixedSizeCollection(null, 0);
+ }
+
+ @Override
+ protected ListProvidersFixedSizeCollection createCollection(
+ List pages, int collectionSize) {
+ return new ListProvidersFixedSizeCollection(pages, collectionSize);
+ }
+ }
+
public static class ListChannelConnectionsPagedResponse
extends AbstractPagedListResponse<
ListChannelConnectionsRequest,
diff --git a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcSettings.java b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcSettings.java
index 1d392bac2cc1..b1f3ecb2322f 100644
--- a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcSettings.java
+++ b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcSettings.java
@@ -18,6 +18,7 @@
import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelConnectionsPagedResponse;
import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelsPagedResponse;
+import static com.google.cloud.eventarc.v1.EventarcClient.ListProvidersPagedResponse;
import static com.google.cloud.eventarc.v1.EventarcClient.ListTriggersPagedResponse;
import com.google.api.core.ApiFunction;
@@ -25,6 +26,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;
@@ -162,6 +164,17 @@ public UnaryCallSettings deleteChannelSettings(
return ((EventarcStubSettings) getStubSettings()).deleteChannelOperationSettings();
}
+ /** Returns the object with the settings used for calls to getProvider. */
+ public UnaryCallSettings getProviderSettings() {
+ return ((EventarcStubSettings) getStubSettings()).getProviderSettings();
+ }
+
+ /** Returns the object with the settings used for calls to listProviders. */
+ public PagedCallSettings
+ listProvidersSettings() {
+ return ((EventarcStubSettings) getStubSettings()).listProvidersSettings();
+ }
+
/** Returns the object with the settings used for calls to getChannelConnection. */
public UnaryCallSettings
getChannelConnectionSettings() {
@@ -225,11 +238,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return EventarcStubSettings.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 EventarcStubSettings.defaultGrpcTransportProviderBuilder();
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return EventarcStubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return EventarcStubSettings.defaultTransportChannelProvider();
}
@@ -239,11 +259,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return EventarcStubSettings.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);
@@ -281,6 +307,11 @@ private static Builder createDefault() {
return new Builder(EventarcStubSettings.newBuilder());
}
+ @BetaApi
+ private static Builder createHttpJsonDefault() {
+ return new Builder(EventarcStubSettings.newHttpJsonBuilder());
+ }
+
public EventarcStubSettings.Builder getStubSettingsBuilder() {
return ((EventarcStubSettings.Builder) getStubSettings());
}
@@ -387,6 +418,18 @@ public UnaryCallSettings.Builder deleteChannelS
return getStubSettingsBuilder().deleteChannelOperationSettings();
}
+ /** Returns the builder for the settings used for calls to getProvider. */
+ public UnaryCallSettings.Builder getProviderSettings() {
+ return getStubSettingsBuilder().getProviderSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to listProviders. */
+ public PagedCallSettings.Builder<
+ ListProvidersRequest, ListProvidersResponse, ListProvidersPagedResponse>
+ listProvidersSettings() {
+ return getStubSettingsBuilder().listProvidersSettings();
+ }
+
/** Returns the builder for the settings used for calls to getChannelConnection. */
public UnaryCallSettings.Builder
getChannelConnectionSettings() {
diff --git a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/gapic_metadata.json b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/gapic_metadata.json
index 2205159266d0..31806784a1b9 100644
--- a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/gapic_metadata.json
+++ b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/gapic_metadata.json
@@ -34,6 +34,9 @@
"GetChannelConnection": {
"methods": ["getChannelConnection", "getChannelConnection", "getChannelConnection", "getChannelConnectionCallable"]
},
+ "GetProvider": {
+ "methods": ["getProvider", "getProvider", "getProvider", "getProviderCallable"]
+ },
"GetTrigger": {
"methods": ["getTrigger", "getTrigger", "getTrigger", "getTriggerCallable"]
},
@@ -43,6 +46,9 @@
"ListChannels": {
"methods": ["listChannels", "listChannels", "listChannels", "listChannelsPagedCallable", "listChannelsCallable"]
},
+ "ListProviders": {
+ "methods": ["listProviders", "listProviders", "listProviders", "listProvidersPagedCallable", "listProvidersCallable"]
+ },
"ListTriggers": {
"methods": ["listTriggers", "listTriggers", "listTriggers", "listTriggersPagedCallable", "listTriggersCallable"]
},
diff --git a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStub.java b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStub.java
index 3f8582cf123c..cae189fa9d4e 100644
--- a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStub.java
+++ b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStub.java
@@ -18,6 +18,7 @@
import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelConnectionsPagedResponse;
import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelsPagedResponse;
+import static com.google.cloud.eventarc.v1.EventarcClient.ListProvidersPagedResponse;
import static com.google.cloud.eventarc.v1.EventarcClient.ListTriggersPagedResponse;
import com.google.api.gax.core.BackgroundResource;
@@ -33,14 +34,18 @@
import com.google.cloud.eventarc.v1.DeleteTriggerRequest;
import com.google.cloud.eventarc.v1.GetChannelConnectionRequest;
import com.google.cloud.eventarc.v1.GetChannelRequest;
+import com.google.cloud.eventarc.v1.GetProviderRequest;
import com.google.cloud.eventarc.v1.GetTriggerRequest;
import com.google.cloud.eventarc.v1.ListChannelConnectionsRequest;
import com.google.cloud.eventarc.v1.ListChannelConnectionsResponse;
import com.google.cloud.eventarc.v1.ListChannelsRequest;
import com.google.cloud.eventarc.v1.ListChannelsResponse;
+import com.google.cloud.eventarc.v1.ListProvidersRequest;
+import com.google.cloud.eventarc.v1.ListProvidersResponse;
import com.google.cloud.eventarc.v1.ListTriggersRequest;
import com.google.cloud.eventarc.v1.ListTriggersResponse;
import com.google.cloud.eventarc.v1.OperationMetadata;
+import com.google.cloud.eventarc.v1.Provider;
import com.google.cloud.eventarc.v1.Trigger;
import com.google.cloud.eventarc.v1.UpdateChannelRequest;
import com.google.cloud.eventarc.v1.UpdateTriggerRequest;
@@ -58,7 +63,11 @@
public abstract class EventarcStub 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 getTriggerCallable() {
@@ -139,6 +148,19 @@ public UnaryCallable deleteChannelCallable() {
throw new UnsupportedOperationException("Not implemented: deleteChannelCallable()");
}
+ public UnaryCallable getProviderCallable() {
+ throw new UnsupportedOperationException("Not implemented: getProviderCallable()");
+ }
+
+ public UnaryCallable
+ listProvidersPagedCallable() {
+ throw new UnsupportedOperationException("Not implemented: listProvidersPagedCallable()");
+ }
+
+ public UnaryCallable listProvidersCallable() {
+ throw new UnsupportedOperationException("Not implemented: listProvidersCallable()");
+ }
+
public UnaryCallable
getChannelConnectionCallable() {
throw new UnsupportedOperationException("Not implemented: getChannelConnectionCallable()");
diff --git a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStubSettings.java b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStubSettings.java
index 4acf596f1ddc..ff07bde95a89 100644
--- a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStubSettings.java
+++ b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStubSettings.java
@@ -18,6 +18,7 @@
import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelConnectionsPagedResponse;
import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelsPagedResponse;
+import static com.google.cloud.eventarc.v1.EventarcClient.ListProvidersPagedResponse;
import static com.google.cloud.eventarc.v1.EventarcClient.ListTriggersPagedResponse;
import com.google.api.core.ApiFunction;
@@ -30,6 +31,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;
@@ -56,14 +60,18 @@
import com.google.cloud.eventarc.v1.DeleteTriggerRequest;
import com.google.cloud.eventarc.v1.GetChannelConnectionRequest;
import com.google.cloud.eventarc.v1.GetChannelRequest;
+import com.google.cloud.eventarc.v1.GetProviderRequest;
import com.google.cloud.eventarc.v1.GetTriggerRequest;
import com.google.cloud.eventarc.v1.ListChannelConnectionsRequest;
import com.google.cloud.eventarc.v1.ListChannelConnectionsResponse;
import com.google.cloud.eventarc.v1.ListChannelsRequest;
import com.google.cloud.eventarc.v1.ListChannelsResponse;
+import com.google.cloud.eventarc.v1.ListProvidersRequest;
+import com.google.cloud.eventarc.v1.ListProvidersResponse;
import com.google.cloud.eventarc.v1.ListTriggersRequest;
import com.google.cloud.eventarc.v1.ListTriggersResponse;
import com.google.cloud.eventarc.v1.OperationMetadata;
+import com.google.cloud.eventarc.v1.Provider;
import com.google.cloud.eventarc.v1.Trigger;
import com.google.cloud.eventarc.v1.UpdateChannelRequest;
import com.google.cloud.eventarc.v1.UpdateTriggerRequest;
@@ -142,6 +150,10 @@ public class EventarcStubSettings extends StubSettings {
private final UnaryCallSettings deleteChannelSettings;
private final OperationCallSettings
deleteChannelOperationSettings;
+ private final UnaryCallSettings getProviderSettings;
+ private final PagedCallSettings<
+ ListProvidersRequest, ListProvidersResponse, ListProvidersPagedResponse>
+ listProvidersSettings;
private final UnaryCallSettings
getChannelConnectionSettings;
private final PagedCallSettings<
@@ -232,6 +244,42 @@ public Iterable extractResources(ListChannelsResponse payload) {
}
};
+ private static final PagedListDescriptor
+ LIST_PROVIDERS_PAGE_STR_DESC =
+ new PagedListDescriptor() {
+ @Override
+ public String emptyToken() {
+ return "";
+ }
+
+ @Override
+ public ListProvidersRequest injectToken(ListProvidersRequest payload, String token) {
+ return ListProvidersRequest.newBuilder(payload).setPageToken(token).build();
+ }
+
+ @Override
+ public ListProvidersRequest injectPageSize(ListProvidersRequest payload, int pageSize) {
+ return ListProvidersRequest.newBuilder(payload).setPageSize(pageSize).build();
+ }
+
+ @Override
+ public Integer extractPageSize(ListProvidersRequest payload) {
+ return payload.getPageSize();
+ }
+
+ @Override
+ public String extractNextToken(ListProvidersResponse payload) {
+ return payload.getNextPageToken();
+ }
+
+ @Override
+ public Iterable extractResources(ListProvidersResponse payload) {
+ return payload.getProvidersList() == null
+ ? ImmutableList.of()
+ : payload.getProvidersList();
+ }
+ };
+
private static final PagedListDescriptor<
ListChannelConnectionsRequest, ListChannelConnectionsResponse, ChannelConnection>
LIST_CHANNEL_CONNECTIONS_PAGE_STR_DESC =
@@ -309,6 +357,23 @@ public ApiFuture getFuturePagedResponse(
}
};
+ private static final PagedListResponseFactory<
+ ListProvidersRequest, ListProvidersResponse, ListProvidersPagedResponse>
+ LIST_PROVIDERS_PAGE_STR_FACT =
+ new PagedListResponseFactory<
+ ListProvidersRequest, ListProvidersResponse, ListProvidersPagedResponse>() {
+ @Override
+ public ApiFuture getFuturePagedResponse(
+ UnaryCallable callable,
+ ListProvidersRequest request,
+ ApiCallContext context,
+ ApiFuture futureResponse) {
+ PageContext pageContext =
+ PageContext.create(callable, LIST_PROVIDERS_PAGE_STR_DESC, request, context);
+ return ListProvidersPagedResponse.createAsync(pageContext, futureResponse);
+ }
+ };
+
private static final PagedListResponseFactory<
ListChannelConnectionsRequest,
ListChannelConnectionsResponse,
@@ -424,6 +489,17 @@ public UnaryCallSettings deleteChannelSettings(
return deleteChannelOperationSettings;
}
+ /** Returns the object with the settings used for calls to getProvider. */
+ public UnaryCallSettings getProviderSettings() {
+ return getProviderSettings;
+ }
+
+ /** Returns the object with the settings used for calls to listProviders. */
+ public PagedCallSettings
+ listProvidersSettings() {
+ return listProvidersSettings;
+ }
+
/** Returns the object with the settings used for calls to getChannelConnection. */
public UnaryCallSettings
getChannelConnectionSettings() {
@@ -463,13 +539,17 @@ public UnaryCallSettings deleteChannelSettings(
return deleteChannelConnectionOperationSettings;
}
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public EventarcStub createStub() throws IOException {
if (getTransportChannelProvider()
.getTransportName()
.equals(GrpcTransportChannel.getGrpcTransportName())) {
return GrpcEventarcStub.create(this);
}
+ if (getTransportChannelProvider()
+ .getTransportName()
+ .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
+ return HttpJsonEventarcStub.create(this);
+ }
throw new UnsupportedOperationException(
String.format(
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
@@ -502,29 +582,54 @@ 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(EventarcStubSettings.class))
.setTransportToken(
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(EventarcStubSettings.class))
+ .setTransportToken(
+ GaxHttpJsonProperties.getHttpJsonTokenName(),
+ GaxHttpJsonProperties.getHttpJsonVersion());
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return EventarcStubSettings.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);
@@ -554,6 +659,8 @@ protected EventarcStubSettings(Builder settingsBuilder) throws IOException {
updateChannelOperationSettings = settingsBuilder.updateChannelOperationSettings().build();
deleteChannelSettings = settingsBuilder.deleteChannelSettings().build();
deleteChannelOperationSettings = settingsBuilder.deleteChannelOperationSettings().build();
+ getProviderSettings = settingsBuilder.getProviderSettings().build();
+ listProvidersSettings = settingsBuilder.listProvidersSettings().build();
getChannelConnectionSettings = settingsBuilder.getChannelConnectionSettings().build();
listChannelConnectionsSettings = settingsBuilder.listChannelConnectionsSettings().build();
createChannelConnectionSettings = settingsBuilder.createChannelConnectionSettings().build();
@@ -593,6 +700,10 @@ public static class Builder extends StubSettings.Builder deleteChannelSettings;
private final OperationCallSettings.Builder
deleteChannelOperationSettings;
+ private final UnaryCallSettings.Builder getProviderSettings;
+ private final PagedCallSettings.Builder<
+ ListProvidersRequest, ListProvidersResponse, ListProvidersPagedResponse>
+ listProvidersSettings;
private final UnaryCallSettings.Builder
getChannelConnectionSettings;
private final PagedCallSettings.Builder<
@@ -653,6 +764,8 @@ protected Builder(ClientContext clientContext) {
updateChannelOperationSettings = OperationCallSettings.newBuilder();
deleteChannelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
deleteChannelOperationSettings = OperationCallSettings.newBuilder();
+ getProviderSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ listProvidersSettings = PagedCallSettings.newBuilder(LIST_PROVIDERS_PAGE_STR_FACT);
getChannelConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
listChannelConnectionsSettings =
PagedCallSettings.newBuilder(LIST_CHANNEL_CONNECTIONS_PAGE_STR_FACT);
@@ -673,6 +786,8 @@ protected Builder(ClientContext clientContext) {
createChannelSettings,
updateChannelSettings,
deleteChannelSettings,
+ getProviderSettings,
+ listProvidersSettings,
getChannelConnectionSettings,
listChannelConnectionsSettings,
createChannelConnectionSettings,
@@ -699,6 +814,8 @@ protected Builder(EventarcStubSettings settings) {
updateChannelOperationSettings = settings.updateChannelOperationSettings.toBuilder();
deleteChannelSettings = settings.deleteChannelSettings.toBuilder();
deleteChannelOperationSettings = settings.deleteChannelOperationSettings.toBuilder();
+ getProviderSettings = settings.getProviderSettings.toBuilder();
+ listProvidersSettings = settings.listProvidersSettings.toBuilder();
getChannelConnectionSettings = settings.getChannelConnectionSettings.toBuilder();
listChannelConnectionsSettings = settings.listChannelConnectionsSettings.toBuilder();
createChannelConnectionSettings = settings.createChannelConnectionSettings.toBuilder();
@@ -720,6 +837,8 @@ protected Builder(EventarcStubSettings settings) {
createChannelSettings,
updateChannelSettings,
deleteChannelSettings,
+ getProviderSettings,
+ listProvidersSettings,
getChannelConnectionSettings,
listChannelConnectionsSettings,
createChannelConnectionSettings,
@@ -739,6 +858,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
.getTriggerSettings()
@@ -790,6 +922,16 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+ builder
+ .getProviderSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .listProvidersSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
builder
.getChannelConnectionSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
@@ -1122,6 +1264,18 @@ public UnaryCallSettings.Builder deleteChannelS
return deleteChannelOperationSettings;
}
+ /** Returns the builder for the settings used for calls to getProvider. */
+ public UnaryCallSettings.Builder getProviderSettings() {
+ return getProviderSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to listProviders. */
+ public PagedCallSettings.Builder<
+ ListProvidersRequest, ListProvidersResponse, ListProvidersPagedResponse>
+ listProvidersSettings() {
+ return listProvidersSettings;
+ }
+
/** Returns the builder for the settings used for calls to getChannelConnection. */
public UnaryCallSettings.Builder
getChannelConnectionSettings() {
diff --git a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/GrpcEventarcStub.java b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/GrpcEventarcStub.java
index 673d866ebc72..29a898aefd5d 100644
--- a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/GrpcEventarcStub.java
+++ b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/GrpcEventarcStub.java
@@ -18,6 +18,7 @@
import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelConnectionsPagedResponse;
import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelsPagedResponse;
+import static com.google.cloud.eventarc.v1.EventarcClient.ListProvidersPagedResponse;
import static com.google.cloud.eventarc.v1.EventarcClient.ListTriggersPagedResponse;
import com.google.api.gax.core.BackgroundResource;
@@ -37,14 +38,18 @@
import com.google.cloud.eventarc.v1.DeleteTriggerRequest;
import com.google.cloud.eventarc.v1.GetChannelConnectionRequest;
import com.google.cloud.eventarc.v1.GetChannelRequest;
+import com.google.cloud.eventarc.v1.GetProviderRequest;
import com.google.cloud.eventarc.v1.GetTriggerRequest;
import com.google.cloud.eventarc.v1.ListChannelConnectionsRequest;
import com.google.cloud.eventarc.v1.ListChannelConnectionsResponse;
import com.google.cloud.eventarc.v1.ListChannelsRequest;
import com.google.cloud.eventarc.v1.ListChannelsResponse;
+import com.google.cloud.eventarc.v1.ListProvidersRequest;
+import com.google.cloud.eventarc.v1.ListProvidersResponse;
import com.google.cloud.eventarc.v1.ListTriggersRequest;
import com.google.cloud.eventarc.v1.ListTriggersResponse;
import com.google.cloud.eventarc.v1.OperationMetadata;
+import com.google.cloud.eventarc.v1.Provider;
import com.google.cloud.eventarc.v1.Trigger;
import com.google.cloud.eventarc.v1.UpdateChannelRequest;
import com.google.cloud.eventarc.v1.UpdateTriggerRequest;
@@ -161,6 +166,25 @@ public class GrpcEventarcStub extends EventarcStub {
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
+ private static final MethodDescriptor getProviderMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.cloud.eventarc.v1.Eventarc/GetProvider")
+ .setRequestMarshaller(ProtoUtils.marshaller(GetProviderRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Provider.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor
+ listProvidersMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.cloud.eventarc.v1.Eventarc/ListProviders")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(ListProvidersRequest.getDefaultInstance()))
+ .setResponseMarshaller(
+ ProtoUtils.marshaller(ListProvidersResponse.getDefaultInstance()))
+ .build();
+
private static final MethodDescriptor
getChannelConnectionMethodDescriptor =
MethodDescriptor.newBuilder()
@@ -230,6 +254,10 @@ public class GrpcEventarcStub extends EventarcStub {
private final UnaryCallable deleteChannelCallable;
private final OperationCallable
deleteChannelOperationCallable;
+ private final UnaryCallable getProviderCallable;
+ private final UnaryCallable listProvidersCallable;
+ private final UnaryCallable
+ listProvidersPagedCallable;
private final UnaryCallable
getChannelConnectionCallable;
private final UnaryCallable
@@ -386,6 +414,26 @@ protected GrpcEventarcStub(
return params.build();
})
.build();
+ GrpcCallSettings getProviderTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(getProviderMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ ImmutableMap.Builder params = ImmutableMap.builder();
+ params.put("name", String.valueOf(request.getName()));
+ return params.build();
+ })
+ .build();
+ GrpcCallSettings listProvidersTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(listProvidersMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ ImmutableMap.Builder params = ImmutableMap.builder();
+ params.put("parent", String.valueOf(request.getParent()));
+ return params.build();
+ })
+ .build();
GrpcCallSettings
getChannelConnectionTransportSettings =
GrpcCallSettings.newBuilder()
@@ -504,6 +552,15 @@ protected GrpcEventarcStub(
settings.deleteChannelOperationSettings(),
clientContext,
operationsStub);
+ this.getProviderCallable =
+ callableFactory.createUnaryCallable(
+ getProviderTransportSettings, settings.getProviderSettings(), clientContext);
+ this.listProvidersCallable =
+ callableFactory.createUnaryCallable(
+ listProvidersTransportSettings, settings.listProvidersSettings(), clientContext);
+ this.listProvidersPagedCallable =
+ callableFactory.createPagedCallable(
+ listProvidersTransportSettings, settings.listProvidersSettings(), clientContext);
this.getChannelConnectionCallable =
callableFactory.createUnaryCallable(
getChannelConnectionTransportSettings,
@@ -646,6 +703,22 @@ public UnaryCallable deleteChannelCallable() {
return deleteChannelOperationCallable;
}
+ @Override
+ public UnaryCallable getProviderCallable() {
+ return getProviderCallable;
+ }
+
+ @Override
+ public UnaryCallable listProvidersCallable() {
+ return listProvidersCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ listProvidersPagedCallable() {
+ return listProvidersPagedCallable;
+ }
+
@Override
public UnaryCallable
getChannelConnectionCallable() {
diff --git a/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/HttpJsonEventarcCallableFactory.java b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/HttpJsonEventarcCallableFactory.java
new file mode 100644
index 000000000000..a3d7450d753f
--- /dev/null
+++ b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/HttpJsonEventarcCallableFactory.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.eventarc.v1.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 Eventarc service API.
+ *
+ * This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+@BetaApi
+public class HttpJsonEventarcCallableFactory
+ 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/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/HttpJsonEventarcStub.java b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/HttpJsonEventarcStub.java
new file mode 100644
index 000000000000..541654c8ac51
--- /dev/null
+++ b/java-eventarc/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/HttpJsonEventarcStub.java
@@ -0,0 +1,1207 @@
+/*
+ * 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.eventarc.v1.stub;
+
+import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelConnectionsPagedResponse;
+import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelsPagedResponse;
+import static com.google.cloud.eventarc.v1.EventarcClient.ListProvidersPagedResponse;
+import static com.google.cloud.eventarc.v1.EventarcClient.ListTriggersPagedResponse;
+
+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.eventarc.v1.Channel;
+import com.google.cloud.eventarc.v1.ChannelConnection;
+import com.google.cloud.eventarc.v1.CreateChannelConnectionRequest;
+import com.google.cloud.eventarc.v1.CreateChannelRequest;
+import com.google.cloud.eventarc.v1.CreateTriggerRequest;
+import com.google.cloud.eventarc.v1.DeleteChannelConnectionRequest;
+import com.google.cloud.eventarc.v1.DeleteChannelRequest;
+import com.google.cloud.eventarc.v1.DeleteTriggerRequest;
+import com.google.cloud.eventarc.v1.GetChannelConnectionRequest;
+import com.google.cloud.eventarc.v1.GetChannelRequest;
+import com.google.cloud.eventarc.v1.GetProviderRequest;
+import com.google.cloud.eventarc.v1.GetTriggerRequest;
+import com.google.cloud.eventarc.v1.ListChannelConnectionsRequest;
+import com.google.cloud.eventarc.v1.ListChannelConnectionsResponse;
+import com.google.cloud.eventarc.v1.ListChannelsRequest;
+import com.google.cloud.eventarc.v1.ListChannelsResponse;
+import com.google.cloud.eventarc.v1.ListProvidersRequest;
+import com.google.cloud.eventarc.v1.ListProvidersResponse;
+import com.google.cloud.eventarc.v1.ListTriggersRequest;
+import com.google.cloud.eventarc.v1.ListTriggersResponse;
+import com.google.cloud.eventarc.v1.OperationMetadata;
+import com.google.cloud.eventarc.v1.Provider;
+import com.google.cloud.eventarc.v1.Trigger;
+import com.google.cloud.eventarc.v1.UpdateChannelRequest;
+import com.google.cloud.eventarc.v1.UpdateTriggerRequest;
+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 Eventarc service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+@BetaApi
+public class HttpJsonEventarcStub extends EventarcStub {
+ private static final TypeRegistry typeRegistry =
+ TypeRegistry.newBuilder()
+ .add(Channel.getDescriptor())
+ .add(OperationMetadata.getDescriptor())
+ .add(Trigger.getDescriptor())
+ .add(ChannelConnection.getDescriptor())
+ .build();
+
+ private static final ApiMethodDescriptor getTriggerMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.eventarc.v1.Eventarc/GetTrigger")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/triggers/*}",
+ 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(Trigger.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ listTriggersMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.eventarc.v1.Eventarc/ListTriggers")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/triggers",
+ 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, "orderBy", request.getOrderBy());
+ serializer.putQueryParam(fields, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListTriggersResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ createTriggerMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.eventarc.v1.Eventarc/CreateTrigger")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/triggers",
+ 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, "triggerId", request.getTriggerId());
+ serializer.putQueryParam(
+ fields, "validateOnly", request.getValidateOnly());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create().toBody("trigger", request.getTrigger()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (CreateTriggerRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ updateTriggerMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.eventarc.v1.Eventarc/UpdateTrigger")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{trigger.name=projects/*/locations/*/triggers/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "trigger.name", request.getTrigger().getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(
+ fields, "allowMissing", request.getAllowMissing());
+ serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
+ serializer.putQueryParam(
+ fields, "validateOnly", request.getValidateOnly());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create().toBody("trigger", request.getTrigger()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (UpdateTriggerRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteTriggerMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.eventarc.v1.Eventarc/DeleteTrigger")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/triggers/*}",
+ 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, "allowMissing", request.getAllowMissing());
+ serializer.putQueryParam(fields, "etag", request.getEtag());
+ serializer.putQueryParam(
+ fields, "validateOnly", request.getValidateOnly());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (DeleteTriggerRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor getChannelMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.eventarc.v1.Eventarc/GetChannel")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/channels/*}",
+ 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(Channel.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ listChannelsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.eventarc.v1.Eventarc/ListChannels")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/channels",
+ 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, "orderBy", request.getOrderBy());
+ serializer.putQueryParam(fields, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListChannelsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ createChannelMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.eventarc.v1.Eventarc/CreateChannel")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/channels",
+ 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, "channelId", request.getChannelId());
+ serializer.putQueryParam(
+ fields, "validateOnly", request.getValidateOnly());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create().toBody("channel", request.getChannel()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (CreateChannelRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ updateChannelMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.eventarc.v1.Eventarc/UpdateChannel")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{channel.name=projects/*/locations/*/channels/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "channel.name", request.getChannel().getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
+ serializer.putQueryParam(
+ fields, "validateOnly", request.getValidateOnly());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create().toBody("channel", request.getChannel()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (UpdateChannelRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteChannelMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.eventarc.v1.Eventarc/DeleteChannel")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/channels/*}",
+ 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, "validateOnly", request.getValidateOnly());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (DeleteChannelRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ getProviderMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.eventarc.v1.Eventarc/GetProvider")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/providers/*}",
+ 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(Provider.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ listProvidersMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.eventarc.v1.Eventarc/ListProviders")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/providers",
+ 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, "orderBy", request.getOrderBy());
+ serializer.putQueryParam(fields, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListProvidersResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ getChannelConnectionMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.eventarc.v1.Eventarc/GetChannelConnection")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/channelConnections/*}",
+ 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(ChannelConnection.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor<
+ ListChannelConnectionsRequest, ListChannelConnectionsResponse>
+ listChannelConnectionsMethodDescriptor =
+ ApiMethodDescriptor
+ .newBuilder()
+ .setFullMethodName("google.cloud.eventarc.v1.Eventarc/ListChannelConnections")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/channelConnections",
+ 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(ListChannelConnectionsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ createChannelConnectionMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.eventarc.v1.Eventarc/CreateChannelConnection")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/channelConnections",
+ 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, "channelConnectionId", request.getChannelConnectionId());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("channelConnection", request.getChannelConnection()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (CreateChannelConnectionRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteChannelConnectionMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.cloud.eventarc.v1.Eventarc/DeleteChannelConnection")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/channelConnections/*}",
+ 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(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (DeleteChannelConnectionRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private final UnaryCallable getTriggerCallable;
+ private final UnaryCallable listTriggersCallable;
+ private final UnaryCallable
+ listTriggersPagedCallable;
+ private final UnaryCallable createTriggerCallable;
+ private final OperationCallable
+ createTriggerOperationCallable;
+ private final UnaryCallable updateTriggerCallable;
+ private final OperationCallable
+ updateTriggerOperationCallable;
+ private final UnaryCallable deleteTriggerCallable;
+ private final OperationCallable
+ deleteTriggerOperationCallable;
+ private final UnaryCallable getChannelCallable;
+ private final UnaryCallable listChannelsCallable;
+ private final UnaryCallable
+ listChannelsPagedCallable;
+ private final UnaryCallable createChannelCallable;
+ private final OperationCallable
+ createChannelOperationCallable;
+ private final UnaryCallable updateChannelCallable;
+ private final OperationCallable
+ updateChannelOperationCallable;
+ private final UnaryCallable deleteChannelCallable;
+ private final OperationCallable
+ deleteChannelOperationCallable;
+ private final UnaryCallable