createSubscriptionCallable() {
+ return stub.createSubscriptionCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a Google Workspace subscription. To learn how to use this method, see [Delete a Google
+ * Workspace
+ * subscription](https://developers.google.com/workspace/events/guides/delete-subscription).
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]");
+ * subscriptionsServiceClient.deleteSubscriptionAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. Resource name of the subscription to delete.
+ * Format: `subscriptions/{subscription}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture deleteSubscriptionAsync(
+ SubscriptionName name) {
+ DeleteSubscriptionRequest request =
+ DeleteSubscriptionRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return deleteSubscriptionAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a Google Workspace subscription. To learn how to use this method, see [Delete a Google
+ * Workspace
+ * subscription](https://developers.google.com/workspace/events/guides/delete-subscription).
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * String name = SubscriptionName.of("[SUBSCRIPTION]").toString();
+ * subscriptionsServiceClient.deleteSubscriptionAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. Resource name of the subscription to delete.
+ * Format: `subscriptions/{subscription}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture deleteSubscriptionAsync(
+ String name) {
+ DeleteSubscriptionRequest request =
+ DeleteSubscriptionRequest.newBuilder().setName(name).build();
+ return deleteSubscriptionAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a Google Workspace subscription. To learn how to use this method, see [Delete a Google
+ * Workspace
+ * subscription](https://developers.google.com/workspace/events/guides/delete-subscription).
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * DeleteSubscriptionRequest request =
+ * DeleteSubscriptionRequest.newBuilder()
+ * .setName(SubscriptionName.of("[SUBSCRIPTION]").toString())
+ * .setValidateOnly(true)
+ * .setAllowMissing(true)
+ * .setEtag("etag3123477")
+ * .build();
+ * subscriptionsServiceClient.deleteSubscriptionAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture deleteSubscriptionAsync(
+ DeleteSubscriptionRequest request) {
+ return deleteSubscriptionOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a Google Workspace subscription. To learn how to use this method, see [Delete a Google
+ * Workspace
+ * subscription](https://developers.google.com/workspace/events/guides/delete-subscription).
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * DeleteSubscriptionRequest request =
+ * DeleteSubscriptionRequest.newBuilder()
+ * .setName(SubscriptionName.of("[SUBSCRIPTION]").toString())
+ * .setValidateOnly(true)
+ * .setAllowMissing(true)
+ * .setEtag("etag3123477")
+ * .build();
+ * OperationFuture future =
+ * subscriptionsServiceClient.deleteSubscriptionOperationCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final OperationCallable
+ deleteSubscriptionOperationCallable() {
+ return stub.deleteSubscriptionOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a Google Workspace subscription. To learn how to use this method, see [Delete a Google
+ * Workspace
+ * subscription](https://developers.google.com/workspace/events/guides/delete-subscription).
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * DeleteSubscriptionRequest request =
+ * DeleteSubscriptionRequest.newBuilder()
+ * .setName(SubscriptionName.of("[SUBSCRIPTION]").toString())
+ * .setValidateOnly(true)
+ * .setAllowMissing(true)
+ * .setEtag("etag3123477")
+ * .build();
+ * ApiFuture future =
+ * subscriptionsServiceClient.deleteSubscriptionCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable deleteSubscriptionCallable() {
+ return stub.deleteSubscriptionCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details about a Google Workspace subscription. To learn how to use this method, see [Get
+ * details about a Google Workspace
+ * subscription](https://developers.google.com/workspace/events/guides/get-subscription).
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]");
+ * Subscription response = subscriptionsServiceClient.getSubscription(name);
+ * }
+ * }
+ *
+ * @param name Required. Resource name of the subscription.
+ * Format: `subscriptions/{subscription}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Subscription getSubscription(SubscriptionName name) {
+ GetSubscriptionRequest request =
+ GetSubscriptionRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getSubscription(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details about a Google Workspace subscription. To learn how to use this method, see [Get
+ * details about a Google Workspace
+ * subscription](https://developers.google.com/workspace/events/guides/get-subscription).
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * String name = SubscriptionName.of("[SUBSCRIPTION]").toString();
+ * Subscription response = subscriptionsServiceClient.getSubscription(name);
+ * }
+ * }
+ *
+ * @param name Required. Resource name of the subscription.
+ * Format: `subscriptions/{subscription}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Subscription getSubscription(String name) {
+ GetSubscriptionRequest request = GetSubscriptionRequest.newBuilder().setName(name).build();
+ return getSubscription(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details about a Google Workspace subscription. To learn how to use this method, see [Get
+ * details about a Google Workspace
+ * subscription](https://developers.google.com/workspace/events/guides/get-subscription).
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * GetSubscriptionRequest request =
+ * GetSubscriptionRequest.newBuilder()
+ * .setName(SubscriptionName.of("[SUBSCRIPTION]").toString())
+ * .build();
+ * Subscription response = subscriptionsServiceClient.getSubscription(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 Subscription getSubscription(GetSubscriptionRequest request) {
+ return getSubscriptionCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details about a Google Workspace subscription. To learn how to use this method, see [Get
+ * details about a Google Workspace
+ * subscription](https://developers.google.com/workspace/events/guides/get-subscription).
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * GetSubscriptionRequest request =
+ * GetSubscriptionRequest.newBuilder()
+ * .setName(SubscriptionName.of("[SUBSCRIPTION]").toString())
+ * .build();
+ * ApiFuture future =
+ * subscriptionsServiceClient.getSubscriptionCallable().futureCall(request);
+ * // Do something.
+ * Subscription response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable getSubscriptionCallable() {
+ return stub.getSubscriptionCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Google Workspace subscriptions. To learn how to use this method, see [List Google
+ * Workspace
+ * subscriptions](https://developers.google.com/workspace/events/guides/list-subscriptions).
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * int pageSize = 883849137;
+ * String pageToken = "pageToken873572522";
+ * String filter = "filter-1274492040";
+ * for (Subscription element :
+ * subscriptionsServiceClient.listSubscriptions(pageSize, pageToken, filter).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param pageSize Optional. The maximum number of subscriptions to return. The service might
+ * return fewer than this value.
+ * If unspecified or set to `0`, up to 50 subscriptions are returned.
+ *
The maximum value is 100. If you specify a value more than 100, the system only returns
+ * 100 subscriptions.
+ * @param pageToken Optional. A page token, received from a previous list subscriptions call.
+ * Provide this parameter to retrieve the subsequent page.
+ *
When paginating, the filter value should match the call that provided the page token.
+ * Passing a different value might lead to unexpected results.
+ * @param filter Required. A query filter.
+ *
You can filter subscriptions by event type (`event_types`) and target resource
+ * (`target_resource`).
+ *
You must specify at least one event type in your query. To filter for multiple event
+ * types, use the `OR` operator.
+ *
To filter by both event type and target resource, use the `AND` operator and specify the
+ * full resource name, such as `//chat.googleapis.com/spaces/{space}`.
+ *
For example, the following queries are valid:
+ *
``` event_types:"google.workspace.chat.membership.v1.updated" OR
+ * event_types:"google.workspace.chat.message.v1.created"
+ *
event_types:"google.workspace.chat.message.v1.created" AND
+ * target_resource="//chat.googleapis.com/spaces/{space}"
+ *
( event_types:"google.workspace.chat.membership.v1.updated" OR
+ * event_types:"google.workspace.chat.message.v1.created" ) AND
+ * target_resource="//chat.googleapis.com/spaces/{space}" ```
+ *
The server rejects invalid queries with an `INVALID_ARGUMENT` error.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListSubscriptionsPagedResponse listSubscriptions(
+ int pageSize, String pageToken, String filter) {
+ ListSubscriptionsRequest request =
+ ListSubscriptionsRequest.newBuilder()
+ .setPageSize(pageSize)
+ .setPageToken(pageToken)
+ .setFilter(filter)
+ .build();
+ return listSubscriptions(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Google Workspace subscriptions. To learn how to use this method, see [List Google
+ * Workspace
+ * subscriptions](https://developers.google.com/workspace/events/guides/list-subscriptions).
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * ListSubscriptionsRequest request =
+ * ListSubscriptionsRequest.newBuilder()
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .build();
+ * for (Subscription element :
+ * subscriptionsServiceClient.listSubscriptions(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 ListSubscriptionsPagedResponse listSubscriptions(ListSubscriptionsRequest request) {
+ return listSubscriptionsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Google Workspace subscriptions. To learn how to use this method, see [List Google
+ * Workspace
+ * subscriptions](https://developers.google.com/workspace/events/guides/list-subscriptions).
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * ListSubscriptionsRequest request =
+ * ListSubscriptionsRequest.newBuilder()
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .build();
+ * ApiFuture future =
+ * subscriptionsServiceClient.listSubscriptionsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Subscription element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable
+ listSubscriptionsPagedCallable() {
+ return stub.listSubscriptionsPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Google Workspace subscriptions. To learn how to use this method, see [List Google
+ * Workspace
+ * subscriptions](https://developers.google.com/workspace/events/guides/list-subscriptions).
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * ListSubscriptionsRequest request =
+ * ListSubscriptionsRequest.newBuilder()
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .build();
+ * while (true) {
+ * ListSubscriptionsResponse response =
+ * subscriptionsServiceClient.listSubscriptionsCallable().call(request);
+ * for (Subscription element : response.getSubscriptionsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable
+ listSubscriptionsCallable() {
+ return stub.listSubscriptionsCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates or renews a Google Workspace subscription. To learn how to use this method, see [Update
+ * or renew a Google Workspace
+ * subscription](https://developers.google.com/workspace/events/guides/update-subscription).
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * Subscription subscription = Subscription.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Subscription response =
+ * subscriptionsServiceClient.updateSubscriptionAsync(subscription, updateMask).get();
+ * }
+ * }
+ *
+ * @param subscription Required. The subscription to update.
+ * The subscription's `name` field is used to identify the subscription to update.
+ * @param updateMask Optional. Required. The field to update.
+ *
You can update one of the following fields in a subscription:
+ *
+ * - [`expire_time`][google.apps.events.subscriptions.v1.Subscription.expire_time]: The
+ * timestamp when the subscription expires.
+ *
- [`ttl`][google.apps.events.subscriptions.v1.Subscription.ttl]: The time-to-live (TTL)
+ * or duration of the subscription.
+ *
+ *
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture updateSubscriptionAsync(
+ Subscription subscription, FieldMask updateMask) {
+ UpdateSubscriptionRequest request =
+ UpdateSubscriptionRequest.newBuilder()
+ .setSubscription(subscription)
+ .setUpdateMask(updateMask)
+ .build();
+ return updateSubscriptionAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates or renews a Google Workspace subscription. To learn how to use this method, see [Update
+ * or renew a Google Workspace
+ * subscription](https://developers.google.com/workspace/events/guides/update-subscription).
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * UpdateSubscriptionRequest request =
+ * UpdateSubscriptionRequest.newBuilder()
+ * .setSubscription(Subscription.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setValidateOnly(true)
+ * .build();
+ * Subscription response = subscriptionsServiceClient.updateSubscriptionAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture updateSubscriptionAsync(
+ UpdateSubscriptionRequest request) {
+ return updateSubscriptionOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates or renews a Google Workspace subscription. To learn how to use this method, see [Update
+ * or renew a Google Workspace
+ * subscription](https://developers.google.com/workspace/events/guides/update-subscription).
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * UpdateSubscriptionRequest request =
+ * UpdateSubscriptionRequest.newBuilder()
+ * .setSubscription(Subscription.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setValidateOnly(true)
+ * .build();
+ * OperationFuture future =
+ * subscriptionsServiceClient.updateSubscriptionOperationCallable().futureCall(request);
+ * // Do something.
+ * Subscription response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallable<
+ UpdateSubscriptionRequest, Subscription, UpdateSubscriptionMetadata>
+ updateSubscriptionOperationCallable() {
+ return stub.updateSubscriptionOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates or renews a Google Workspace subscription. To learn how to use this method, see [Update
+ * or renew a Google Workspace
+ * subscription](https://developers.google.com/workspace/events/guides/update-subscription).
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * UpdateSubscriptionRequest request =
+ * UpdateSubscriptionRequest.newBuilder()
+ * .setSubscription(Subscription.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setValidateOnly(true)
+ * .build();
+ * ApiFuture future =
+ * subscriptionsServiceClient.updateSubscriptionCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable updateSubscriptionCallable() {
+ return stub.updateSubscriptionCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Reactivates a suspended Google Workspace subscription.
+ *
+ * This method resets your subscription's `State` field to `ACTIVE`. Before you use this
+ * method, you must fix the error that suspended the subscription. To learn how to use this
+ * method, see [Reactivate a Google Workspace
+ * subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription).
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]");
+ * Subscription response = subscriptionsServiceClient.reactivateSubscriptionAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. Resource name of the subscription.
+ * Format: `subscriptions/{subscription}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture
+ reactivateSubscriptionAsync(SubscriptionName name) {
+ ReactivateSubscriptionRequest request =
+ ReactivateSubscriptionRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return reactivateSubscriptionAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Reactivates a suspended Google Workspace subscription.
+ *
+ * This method resets your subscription's `State` field to `ACTIVE`. Before you use this
+ * method, you must fix the error that suspended the subscription. To learn how to use this
+ * method, see [Reactivate a Google Workspace
+ * subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription).
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * String name = SubscriptionName.of("[SUBSCRIPTION]").toString();
+ * Subscription response = subscriptionsServiceClient.reactivateSubscriptionAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. Resource name of the subscription.
+ * Format: `subscriptions/{subscription}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture
+ reactivateSubscriptionAsync(String name) {
+ ReactivateSubscriptionRequest request =
+ ReactivateSubscriptionRequest.newBuilder().setName(name).build();
+ return reactivateSubscriptionAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Reactivates a suspended Google Workspace subscription.
+ *
+ * This method resets your subscription's `State` field to `ACTIVE`. Before you use this
+ * method, you must fix the error that suspended the subscription. To learn how to use this
+ * method, see [Reactivate a Google Workspace
+ * subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription).
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * ReactivateSubscriptionRequest request =
+ * ReactivateSubscriptionRequest.newBuilder()
+ * .setName(SubscriptionName.of("[SUBSCRIPTION]").toString())
+ * .build();
+ * Subscription response = subscriptionsServiceClient.reactivateSubscriptionAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture
+ reactivateSubscriptionAsync(ReactivateSubscriptionRequest request) {
+ return reactivateSubscriptionOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Reactivates a suspended Google Workspace subscription.
+ *
+ * This method resets your subscription's `State` field to `ACTIVE`. Before you use this
+ * method, you must fix the error that suspended the subscription. To learn how to use this
+ * method, see [Reactivate a Google Workspace
+ * subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription).
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * ReactivateSubscriptionRequest request =
+ * ReactivateSubscriptionRequest.newBuilder()
+ * .setName(SubscriptionName.of("[SUBSCRIPTION]").toString())
+ * .build();
+ * OperationFuture future =
+ * subscriptionsServiceClient.reactivateSubscriptionOperationCallable().futureCall(request);
+ * // Do something.
+ * Subscription response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallable<
+ ReactivateSubscriptionRequest, Subscription, ReactivateSubscriptionMetadata>
+ reactivateSubscriptionOperationCallable() {
+ return stub.reactivateSubscriptionOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Reactivates a suspended Google Workspace subscription.
+ *
+ * This method resets your subscription's `State` field to `ACTIVE`. Before you use this
+ * method, you must fix the error that suspended the subscription. To learn how to use this
+ * method, see [Reactivate a Google Workspace
+ * subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription).
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * ReactivateSubscriptionRequest request =
+ * ReactivateSubscriptionRequest.newBuilder()
+ * .setName(SubscriptionName.of("[SUBSCRIPTION]").toString())
+ * .build();
+ * ApiFuture future =
+ * subscriptionsServiceClient.reactivateSubscriptionCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ reactivateSubscriptionCallable() {
+ return stub.reactivateSubscriptionCallable();
+ }
+
+ @Override
+ public final void close() {
+ stub.close();
+ }
+
+ @Override
+ public void shutdown() {
+ stub.shutdown();
+ }
+
+ @Override
+ public boolean isShutdown() {
+ return stub.isShutdown();
+ }
+
+ @Override
+ public boolean isTerminated() {
+ return stub.isTerminated();
+ }
+
+ @Override
+ public void shutdownNow() {
+ stub.shutdownNow();
+ }
+
+ @Override
+ public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
+ return stub.awaitTermination(duration, unit);
+ }
+
+ public static class ListSubscriptionsPagedResponse
+ extends AbstractPagedListResponse<
+ ListSubscriptionsRequest,
+ ListSubscriptionsResponse,
+ Subscription,
+ ListSubscriptionsPage,
+ ListSubscriptionsFixedSizeCollection> {
+
+ public static ApiFuture createAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ ApiFuture futurePage =
+ ListSubscriptionsPage.createEmptyPage().createPageAsync(context, futureResponse);
+ return ApiFutures.transform(
+ futurePage,
+ input -> new ListSubscriptionsPagedResponse(input),
+ MoreExecutors.directExecutor());
+ }
+
+ private ListSubscriptionsPagedResponse(ListSubscriptionsPage page) {
+ super(page, ListSubscriptionsFixedSizeCollection.createEmptyCollection());
+ }
+ }
+
+ public static class ListSubscriptionsPage
+ extends AbstractPage<
+ ListSubscriptionsRequest,
+ ListSubscriptionsResponse,
+ Subscription,
+ ListSubscriptionsPage> {
+
+ private ListSubscriptionsPage(
+ PageContext context,
+ ListSubscriptionsResponse response) {
+ super(context, response);
+ }
+
+ private static ListSubscriptionsPage createEmptyPage() {
+ return new ListSubscriptionsPage(null, null);
+ }
+
+ @Override
+ protected ListSubscriptionsPage createPage(
+ PageContext context,
+ ListSubscriptionsResponse response) {
+ return new ListSubscriptionsPage(context, response);
+ }
+
+ @Override
+ public ApiFuture createPageAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ return super.createPageAsync(context, futureResponse);
+ }
+ }
+
+ public static class ListSubscriptionsFixedSizeCollection
+ extends AbstractFixedSizeCollection<
+ ListSubscriptionsRequest,
+ ListSubscriptionsResponse,
+ Subscription,
+ ListSubscriptionsPage,
+ ListSubscriptionsFixedSizeCollection> {
+
+ private ListSubscriptionsFixedSizeCollection(
+ List pages, int collectionSize) {
+ super(pages, collectionSize);
+ }
+
+ private static ListSubscriptionsFixedSizeCollection createEmptyCollection() {
+ return new ListSubscriptionsFixedSizeCollection(null, 0);
+ }
+
+ @Override
+ protected ListSubscriptionsFixedSizeCollection createCollection(
+ List pages, int collectionSize) {
+ return new ListSubscriptionsFixedSizeCollection(pages, collectionSize);
+ }
+ }
+}
diff --git a/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionsServiceSettings.java b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionsServiceSettings.java
new file mode 100644
index 000000000000..8389eb6a22d5
--- /dev/null
+++ b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/SubscriptionsServiceSettings.java
@@ -0,0 +1,328 @@
+/*
+ * Copyright 2024 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.apps.events.subscriptions.v1;
+
+import static com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient.ListSubscriptionsPagedResponse;
+
+import com.google.api.core.ApiFunction;
+import com.google.api.core.BetaApi;
+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;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.TransportChannelProvider;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.apps.events.subscriptions.v1.stub.SubscriptionsServiceStubSettings;
+import com.google.longrunning.Operation;
+import com.google.protobuf.Empty;
+import java.io.IOException;
+import java.util.List;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Settings class to configure an instance of {@link SubscriptionsServiceClient}.
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ *
+ * - The default service address (workspaceevents.googleapis.com) and default port (443) are
+ * used.
+ *
- Credentials are acquired automatically through Application Default Credentials.
+ *
- Retries are configured for idempotent methods but not for non-idempotent methods.
+ *
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ *
For example, to set the total timeout of getSubscription to 30 seconds:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SubscriptionsServiceSettings.Builder subscriptionsServiceSettingsBuilder =
+ * SubscriptionsServiceSettings.newBuilder();
+ * subscriptionsServiceSettingsBuilder
+ * .getSubscriptionSettings()
+ * .setRetrySettings(
+ * subscriptionsServiceSettingsBuilder
+ * .getSubscriptionSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * SubscriptionsServiceSettings subscriptionsServiceSettings =
+ * subscriptionsServiceSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class SubscriptionsServiceSettings extends ClientSettings {
+
+ /** Returns the object with the settings used for calls to createSubscription. */
+ public UnaryCallSettings createSubscriptionSettings() {
+ return ((SubscriptionsServiceStubSettings) getStubSettings()).createSubscriptionSettings();
+ }
+
+ /** Returns the object with the settings used for calls to createSubscription. */
+ public OperationCallSettings
+ createSubscriptionOperationSettings() {
+ return ((SubscriptionsServiceStubSettings) getStubSettings())
+ .createSubscriptionOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to deleteSubscription. */
+ public UnaryCallSettings deleteSubscriptionSettings() {
+ return ((SubscriptionsServiceStubSettings) getStubSettings()).deleteSubscriptionSettings();
+ }
+
+ /** Returns the object with the settings used for calls to deleteSubscription. */
+ public OperationCallSettings
+ deleteSubscriptionOperationSettings() {
+ return ((SubscriptionsServiceStubSettings) getStubSettings())
+ .deleteSubscriptionOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to getSubscription. */
+ public UnaryCallSettings getSubscriptionSettings() {
+ return ((SubscriptionsServiceStubSettings) getStubSettings()).getSubscriptionSettings();
+ }
+
+ /** Returns the object with the settings used for calls to listSubscriptions. */
+ public PagedCallSettings<
+ ListSubscriptionsRequest, ListSubscriptionsResponse, ListSubscriptionsPagedResponse>
+ listSubscriptionsSettings() {
+ return ((SubscriptionsServiceStubSettings) getStubSettings()).listSubscriptionsSettings();
+ }
+
+ /** Returns the object with the settings used for calls to updateSubscription. */
+ public UnaryCallSettings updateSubscriptionSettings() {
+ return ((SubscriptionsServiceStubSettings) getStubSettings()).updateSubscriptionSettings();
+ }
+
+ /** Returns the object with the settings used for calls to updateSubscription. */
+ public OperationCallSettings
+ updateSubscriptionOperationSettings() {
+ return ((SubscriptionsServiceStubSettings) getStubSettings())
+ .updateSubscriptionOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to reactivateSubscription. */
+ public UnaryCallSettings
+ reactivateSubscriptionSettings() {
+ return ((SubscriptionsServiceStubSettings) getStubSettings()).reactivateSubscriptionSettings();
+ }
+
+ /** Returns the object with the settings used for calls to reactivateSubscription. */
+ public OperationCallSettings<
+ ReactivateSubscriptionRequest, Subscription, ReactivateSubscriptionMetadata>
+ reactivateSubscriptionOperationSettings() {
+ return ((SubscriptionsServiceStubSettings) getStubSettings())
+ .reactivateSubscriptionOperationSettings();
+ }
+
+ public static final SubscriptionsServiceSettings create(SubscriptionsServiceStubSettings stub)
+ throws IOException {
+ return new SubscriptionsServiceSettings.Builder(stub.toBuilder()).build();
+ }
+
+ /** Returns a builder for the default ExecutorProvider for this service. */
+ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
+ return SubscriptionsServiceStubSettings.defaultExecutorProviderBuilder();
+ }
+
+ /** Returns the default service endpoint. */
+ public static String getDefaultEndpoint() {
+ return SubscriptionsServiceStubSettings.getDefaultEndpoint();
+ }
+
+ /** Returns the default service scopes. */
+ public static List getDefaultServiceScopes() {
+ return SubscriptionsServiceStubSettings.getDefaultServiceScopes();
+ }
+
+ /** Returns a builder for the default credentials for this service. */
+ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
+ return SubscriptionsServiceStubSettings.defaultCredentialsProviderBuilder();
+ }
+
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
+ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
+ return SubscriptionsServiceStubSettings.defaultGrpcTransportProviderBuilder();
+ }
+
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return SubscriptionsServiceStubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
+ public static TransportChannelProvider defaultTransportChannelProvider() {
+ return SubscriptionsServiceStubSettings.defaultTransportChannelProvider();
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return SubscriptionsServiceStubSettings.defaultApiClientHeaderProviderBuilder();
+ }
+
+ /** 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);
+ }
+
+ /** Returns a builder containing all the values of this settings class. */
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ protected SubscriptionsServiceSettings(Builder settingsBuilder) throws IOException {
+ super(settingsBuilder);
+ }
+
+ /** Builder for SubscriptionsServiceSettings. */
+ public static class Builder
+ extends ClientSettings.Builder {
+
+ protected Builder() throws IOException {
+ this(((ClientContext) null));
+ }
+
+ protected Builder(ClientContext clientContext) {
+ super(SubscriptionsServiceStubSettings.newBuilder(clientContext));
+ }
+
+ protected Builder(SubscriptionsServiceSettings settings) {
+ super(settings.getStubSettings().toBuilder());
+ }
+
+ protected Builder(SubscriptionsServiceStubSettings.Builder stubSettings) {
+ super(stubSettings);
+ }
+
+ private static Builder createDefault() {
+ return new Builder(SubscriptionsServiceStubSettings.newBuilder());
+ }
+
+ private static Builder createHttpJsonDefault() {
+ return new Builder(SubscriptionsServiceStubSettings.newHttpJsonBuilder());
+ }
+
+ public SubscriptionsServiceStubSettings.Builder getStubSettingsBuilder() {
+ return ((SubscriptionsServiceStubSettings.Builder) getStubSettings());
+ }
+
+ /**
+ * Applies the given settings updater function to all of the unary API methods in this service.
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction, Void> settingsUpdater) {
+ super.applyToAllUnaryMethods(
+ getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
+ return this;
+ }
+
+ /** Returns the builder for the settings used for calls to createSubscription. */
+ public UnaryCallSettings.Builder
+ createSubscriptionSettings() {
+ return getStubSettingsBuilder().createSubscriptionSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to createSubscription. */
+ public OperationCallSettings.Builder<
+ CreateSubscriptionRequest, Subscription, CreateSubscriptionMetadata>
+ createSubscriptionOperationSettings() {
+ return getStubSettingsBuilder().createSubscriptionOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to deleteSubscription. */
+ public UnaryCallSettings.Builder
+ deleteSubscriptionSettings() {
+ return getStubSettingsBuilder().deleteSubscriptionSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to deleteSubscription. */
+ public OperationCallSettings.Builder<
+ DeleteSubscriptionRequest, Empty, DeleteSubscriptionMetadata>
+ deleteSubscriptionOperationSettings() {
+ return getStubSettingsBuilder().deleteSubscriptionOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to getSubscription. */
+ public UnaryCallSettings.Builder
+ getSubscriptionSettings() {
+ return getStubSettingsBuilder().getSubscriptionSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to listSubscriptions. */
+ public PagedCallSettings.Builder<
+ ListSubscriptionsRequest, ListSubscriptionsResponse, ListSubscriptionsPagedResponse>
+ listSubscriptionsSettings() {
+ return getStubSettingsBuilder().listSubscriptionsSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to updateSubscription. */
+ public UnaryCallSettings.Builder
+ updateSubscriptionSettings() {
+ return getStubSettingsBuilder().updateSubscriptionSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to updateSubscription. */
+ public OperationCallSettings.Builder<
+ UpdateSubscriptionRequest, Subscription, UpdateSubscriptionMetadata>
+ updateSubscriptionOperationSettings() {
+ return getStubSettingsBuilder().updateSubscriptionOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to reactivateSubscription. */
+ public UnaryCallSettings.Builder
+ reactivateSubscriptionSettings() {
+ return getStubSettingsBuilder().reactivateSubscriptionSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to reactivateSubscription. */
+ public OperationCallSettings.Builder<
+ ReactivateSubscriptionRequest, Subscription, ReactivateSubscriptionMetadata>
+ reactivateSubscriptionOperationSettings() {
+ return getStubSettingsBuilder().reactivateSubscriptionOperationSettings();
+ }
+
+ @Override
+ public SubscriptionsServiceSettings build() throws IOException {
+ return new SubscriptionsServiceSettings(this);
+ }
+ }
+}
diff --git a/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/gapic_metadata.json b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/gapic_metadata.json
new file mode 100644
index 000000000000..363f190e246e
--- /dev/null
+++ b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/gapic_metadata.json
@@ -0,0 +1,36 @@
+{
+ "schema": "1.0",
+ "comment": "This file maps proto services/RPCs to the corresponding library clients/methods",
+ "language": "java",
+ "protoPackage": "google.apps.events.subscriptions.v1",
+ "libraryPackage": "com.google.apps.events.subscriptions.v1",
+ "services": {
+ "SubscriptionsService": {
+ "clients": {
+ "grpc": {
+ "libraryClient": "SubscriptionsServiceClient",
+ "rpcs": {
+ "CreateSubscription": {
+ "methods": ["createSubscriptionAsync", "createSubscriptionAsync", "createSubscriptionOperationCallable", "createSubscriptionCallable"]
+ },
+ "DeleteSubscription": {
+ "methods": ["deleteSubscriptionAsync", "deleteSubscriptionAsync", "deleteSubscriptionAsync", "deleteSubscriptionOperationCallable", "deleteSubscriptionCallable"]
+ },
+ "GetSubscription": {
+ "methods": ["getSubscription", "getSubscription", "getSubscription", "getSubscriptionCallable"]
+ },
+ "ListSubscriptions": {
+ "methods": ["listSubscriptions", "listSubscriptions", "listSubscriptionsPagedCallable", "listSubscriptionsCallable"]
+ },
+ "ReactivateSubscription": {
+ "methods": ["reactivateSubscriptionAsync", "reactivateSubscriptionAsync", "reactivateSubscriptionAsync", "reactivateSubscriptionOperationCallable", "reactivateSubscriptionCallable"]
+ },
+ "UpdateSubscription": {
+ "methods": ["updateSubscriptionAsync", "updateSubscriptionAsync", "updateSubscriptionOperationCallable", "updateSubscriptionCallable"]
+ }
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/package-info.java b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/package-info.java
new file mode 100644
index 000000000000..c28ce0a05200
--- /dev/null
+++ b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/package-info.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2024 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.
+ */
+
+/**
+ * A client to Google Workspace Events API
+ *
+ * The interfaces provided are listed below, along with usage samples.
+ *
+ *
======================= SubscriptionsServiceClient =======================
+ *
+ *
Service Description: A service that manages subscriptions to Google Workspace events.
+ *
+ *
Sample for SubscriptionsServiceClient:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SubscriptionsServiceClient subscriptionsServiceClient =
+ * SubscriptionsServiceClient.create()) {
+ * SubscriptionName name = SubscriptionName.of("[SUBSCRIPTION]");
+ * Subscription response = subscriptionsServiceClient.getSubscription(name);
+ * }
+ * }
+ */
+@Generated("by gapic-generator-java")
+package com.google.apps.events.subscriptions.v1;
+
+import javax.annotation.Generated;
diff --git a/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/GrpcSubscriptionsServiceCallableFactory.java b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/GrpcSubscriptionsServiceCallableFactory.java
new file mode 100644
index 000000000000..81a5b160e91d
--- /dev/null
+++ b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/GrpcSubscriptionsServiceCallableFactory.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2024 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.apps.events.subscriptions.v1.stub;
+
+import com.google.api.gax.grpc.GrpcCallSettings;
+import com.google.api.gax.grpc.GrpcCallableFactory;
+import com.google.api.gax.grpc.GrpcStubCallableFactory;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.BidiStreamingCallable;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.ClientStreamingCallable;
+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.StreamingCallSettings;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
+import com.google.longrunning.stub.OperationsStub;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * gRPC callable factory implementation for the SubscriptionsService service API.
+ *
+ * This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcSubscriptionsServiceCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public UnaryCallable createUnaryCallable(
+ GrpcCallSettings grpcCallSettings,
+ UnaryCallSettings callSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ UnaryCallable createPagedCallable(
+ GrpcCallSettings grpcCallSettings,
+ PagedCallSettings callSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public UnaryCallable createBatchingCallable(
+ GrpcCallSettings grpcCallSettings,
+ BatchingCallSettings callSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createBatchingCallable(
+ grpcCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ OperationCallable createOperationCallable(
+ GrpcCallSettings grpcCallSettings,
+ OperationCallSettings callSettings,
+ ClientContext clientContext,
+ OperationsStub operationsStub) {
+ return GrpcCallableFactory.createOperationCallable(
+ grpcCallSettings, callSettings, clientContext, operationsStub);
+ }
+
+ @Override
+ public
+ BidiStreamingCallable createBidiStreamingCallable(
+ GrpcCallSettings grpcCallSettings,
+ StreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createBidiStreamingCallable(
+ grpcCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ ServerStreamingCallable createServerStreamingCallable(
+ GrpcCallSettings grpcCallSettings,
+ ServerStreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createServerStreamingCallable(
+ grpcCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ ClientStreamingCallable createClientStreamingCallable(
+ GrpcCallSettings grpcCallSettings,
+ StreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createClientStreamingCallable(
+ grpcCallSettings, callSettings, clientContext);
+ }
+}
diff --git a/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/GrpcSubscriptionsServiceStub.java b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/GrpcSubscriptionsServiceStub.java
new file mode 100644
index 000000000000..53c34b4bda32
--- /dev/null
+++ b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/GrpcSubscriptionsServiceStub.java
@@ -0,0 +1,406 @@
+/*
+ * Copyright 2024 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.apps.events.subscriptions.v1.stub;
+
+import static com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient.ListSubscriptionsPagedResponse;
+
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.core.BackgroundResourceAggregation;
+import com.google.api.gax.grpc.GrpcCallSettings;
+import com.google.api.gax.grpc.GrpcStubCallableFactory;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.RequestParamsBuilder;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata;
+import com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest;
+import com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata;
+import com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest;
+import com.google.apps.events.subscriptions.v1.GetSubscriptionRequest;
+import com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest;
+import com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse;
+import com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata;
+import com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest;
+import com.google.apps.events.subscriptions.v1.Subscription;
+import com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata;
+import com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest;
+import com.google.longrunning.Operation;
+import com.google.longrunning.stub.GrpcOperationsStub;
+import com.google.protobuf.Empty;
+import io.grpc.MethodDescriptor;
+import io.grpc.protobuf.ProtoUtils;
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * gRPC stub implementation for the SubscriptionsService service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcSubscriptionsServiceStub extends SubscriptionsServiceStub {
+ private static final MethodDescriptor
+ createSubscriptionMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName(
+ "google.apps.events.subscriptions.v1.SubscriptionsService/CreateSubscription")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(CreateSubscriptionRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor
+ deleteSubscriptionMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName(
+ "google.apps.events.subscriptions.v1.SubscriptionsService/DeleteSubscription")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(DeleteSubscriptionRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor
+ getSubscriptionMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName(
+ "google.apps.events.subscriptions.v1.SubscriptionsService/GetSubscription")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(GetSubscriptionRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Subscription.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor
+ listSubscriptionsMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName(
+ "google.apps.events.subscriptions.v1.SubscriptionsService/ListSubscriptions")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(ListSubscriptionsRequest.getDefaultInstance()))
+ .setResponseMarshaller(
+ ProtoUtils.marshaller(ListSubscriptionsResponse.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor
+ updateSubscriptionMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName(
+ "google.apps.events.subscriptions.v1.SubscriptionsService/UpdateSubscription")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(UpdateSubscriptionRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor
+ reactivateSubscriptionMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName(
+ "google.apps.events.subscriptions.v1.SubscriptionsService/ReactivateSubscription")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(ReactivateSubscriptionRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
+ .build();
+
+ private final UnaryCallable createSubscriptionCallable;
+ private final OperationCallable<
+ CreateSubscriptionRequest, Subscription, CreateSubscriptionMetadata>
+ createSubscriptionOperationCallable;
+ private final UnaryCallable deleteSubscriptionCallable;
+ private final OperationCallable
+ deleteSubscriptionOperationCallable;
+ private final UnaryCallable getSubscriptionCallable;
+ private final UnaryCallable
+ listSubscriptionsCallable;
+ private final UnaryCallable
+ listSubscriptionsPagedCallable;
+ private final UnaryCallable updateSubscriptionCallable;
+ private final OperationCallable<
+ UpdateSubscriptionRequest, Subscription, UpdateSubscriptionMetadata>
+ updateSubscriptionOperationCallable;
+ private final UnaryCallable
+ reactivateSubscriptionCallable;
+ private final OperationCallable<
+ ReactivateSubscriptionRequest, Subscription, ReactivateSubscriptionMetadata>
+ reactivateSubscriptionOperationCallable;
+
+ private final BackgroundResource backgroundResources;
+ private final GrpcOperationsStub operationsStub;
+ private final GrpcStubCallableFactory callableFactory;
+
+ public static final GrpcSubscriptionsServiceStub create(SubscriptionsServiceStubSettings settings)
+ throws IOException {
+ return new GrpcSubscriptionsServiceStub(settings, ClientContext.create(settings));
+ }
+
+ public static final GrpcSubscriptionsServiceStub create(ClientContext clientContext)
+ throws IOException {
+ return new GrpcSubscriptionsServiceStub(
+ SubscriptionsServiceStubSettings.newBuilder().build(), clientContext);
+ }
+
+ public static final GrpcSubscriptionsServiceStub create(
+ ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException {
+ return new GrpcSubscriptionsServiceStub(
+ SubscriptionsServiceStubSettings.newBuilder().build(), clientContext, callableFactory);
+ }
+
+ /**
+ * Constructs an instance of GrpcSubscriptionsServiceStub, 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 GrpcSubscriptionsServiceStub(
+ SubscriptionsServiceStubSettings settings, ClientContext clientContext) throws IOException {
+ this(settings, clientContext, new GrpcSubscriptionsServiceCallableFactory());
+ }
+
+ /**
+ * Constructs an instance of GrpcSubscriptionsServiceStub, 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 GrpcSubscriptionsServiceStub(
+ SubscriptionsServiceStubSettings settings,
+ ClientContext clientContext,
+ GrpcStubCallableFactory callableFactory)
+ throws IOException {
+ this.callableFactory = callableFactory;
+ this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory);
+
+ GrpcCallSettings createSubscriptionTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(createSubscriptionMethodDescriptor)
+ .build();
+ GrpcCallSettings deleteSubscriptionTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(deleteSubscriptionMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings getSubscriptionTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(getSubscriptionMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings
+ listSubscriptionsTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(listSubscriptionsMethodDescriptor)
+ .build();
+ GrpcCallSettings updateSubscriptionTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(updateSubscriptionMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add(
+ "subscription.name", String.valueOf(request.getSubscription().getName()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings
+ reactivateSubscriptionTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(reactivateSubscriptionMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .build();
+
+ this.createSubscriptionCallable =
+ callableFactory.createUnaryCallable(
+ createSubscriptionTransportSettings,
+ settings.createSubscriptionSettings(),
+ clientContext);
+ this.createSubscriptionOperationCallable =
+ callableFactory.createOperationCallable(
+ createSubscriptionTransportSettings,
+ settings.createSubscriptionOperationSettings(),
+ clientContext,
+ operationsStub);
+ this.deleteSubscriptionCallable =
+ callableFactory.createUnaryCallable(
+ deleteSubscriptionTransportSettings,
+ settings.deleteSubscriptionSettings(),
+ clientContext);
+ this.deleteSubscriptionOperationCallable =
+ callableFactory.createOperationCallable(
+ deleteSubscriptionTransportSettings,
+ settings.deleteSubscriptionOperationSettings(),
+ clientContext,
+ operationsStub);
+ this.getSubscriptionCallable =
+ callableFactory.createUnaryCallable(
+ getSubscriptionTransportSettings, settings.getSubscriptionSettings(), clientContext);
+ this.listSubscriptionsCallable =
+ callableFactory.createUnaryCallable(
+ listSubscriptionsTransportSettings,
+ settings.listSubscriptionsSettings(),
+ clientContext);
+ this.listSubscriptionsPagedCallable =
+ callableFactory.createPagedCallable(
+ listSubscriptionsTransportSettings,
+ settings.listSubscriptionsSettings(),
+ clientContext);
+ this.updateSubscriptionCallable =
+ callableFactory.createUnaryCallable(
+ updateSubscriptionTransportSettings,
+ settings.updateSubscriptionSettings(),
+ clientContext);
+ this.updateSubscriptionOperationCallable =
+ callableFactory.createOperationCallable(
+ updateSubscriptionTransportSettings,
+ settings.updateSubscriptionOperationSettings(),
+ clientContext,
+ operationsStub);
+ this.reactivateSubscriptionCallable =
+ callableFactory.createUnaryCallable(
+ reactivateSubscriptionTransportSettings,
+ settings.reactivateSubscriptionSettings(),
+ clientContext);
+ this.reactivateSubscriptionOperationCallable =
+ callableFactory.createOperationCallable(
+ reactivateSubscriptionTransportSettings,
+ settings.reactivateSubscriptionOperationSettings(),
+ clientContext,
+ operationsStub);
+
+ this.backgroundResources =
+ new BackgroundResourceAggregation(clientContext.getBackgroundResources());
+ }
+
+ public GrpcOperationsStub getOperationsStub() {
+ return operationsStub;
+ }
+
+ @Override
+ public UnaryCallable createSubscriptionCallable() {
+ return createSubscriptionCallable;
+ }
+
+ @Override
+ public OperationCallable
+ createSubscriptionOperationCallable() {
+ return createSubscriptionOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable deleteSubscriptionCallable() {
+ return deleteSubscriptionCallable;
+ }
+
+ @Override
+ public OperationCallable
+ deleteSubscriptionOperationCallable() {
+ return deleteSubscriptionOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable getSubscriptionCallable() {
+ return getSubscriptionCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ listSubscriptionsCallable() {
+ return listSubscriptionsCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ listSubscriptionsPagedCallable() {
+ return listSubscriptionsPagedCallable;
+ }
+
+ @Override
+ public UnaryCallable updateSubscriptionCallable() {
+ return updateSubscriptionCallable;
+ }
+
+ @Override
+ public OperationCallable
+ updateSubscriptionOperationCallable() {
+ return updateSubscriptionOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable reactivateSubscriptionCallable() {
+ return reactivateSubscriptionCallable;
+ }
+
+ @Override
+ public OperationCallable<
+ ReactivateSubscriptionRequest, Subscription, ReactivateSubscriptionMetadata>
+ reactivateSubscriptionOperationCallable() {
+ return reactivateSubscriptionOperationCallable;
+ }
+
+ @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/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/HttpJsonSubscriptionsServiceCallableFactory.java b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/HttpJsonSubscriptionsServiceCallableFactory.java
new file mode 100644
index 000000000000..2664d82c9eb8
--- /dev/null
+++ b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/HttpJsonSubscriptionsServiceCallableFactory.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2024 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.apps.events.subscriptions.v1.stub;
+
+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 SubscriptionsService service API.
+ *
+ * This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+public class HttpJsonSubscriptionsServiceCallableFactory
+ 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);
+ }
+
+ @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-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/HttpJsonSubscriptionsServiceStub.java b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/HttpJsonSubscriptionsServiceStub.java
new file mode 100644
index 000000000000..ee8b3476517c
--- /dev/null
+++ b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/HttpJsonSubscriptionsServiceStub.java
@@ -0,0 +1,632 @@
+/*
+ * Copyright 2024 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.apps.events.subscriptions.v1.stub;
+
+import static com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient.ListSubscriptionsPagedResponse;
+
+import com.google.api.HttpRule;
+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.RequestParamsBuilder;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata;
+import com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest;
+import com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata;
+import com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest;
+import com.google.apps.events.subscriptions.v1.GetSubscriptionRequest;
+import com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest;
+import com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse;
+import com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata;
+import com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest;
+import com.google.apps.events.subscriptions.v1.Subscription;
+import com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata;
+import com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest;
+import com.google.common.collect.ImmutableMap;
+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 SubscriptionsService service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public class HttpJsonSubscriptionsServiceStub extends SubscriptionsServiceStub {
+ private static final TypeRegistry typeRegistry =
+ TypeRegistry.newBuilder()
+ .add(Empty.getDescriptor())
+ .add(Subscription.getDescriptor())
+ .add(UpdateSubscriptionMetadata.getDescriptor())
+ .add(CreateSubscriptionMetadata.getDescriptor())
+ .add(DeleteSubscriptionMetadata.getDescriptor())
+ .add(ReactivateSubscriptionMetadata.getDescriptor())
+ .build();
+
+ private static final ApiMethodDescriptor
+ createSubscriptionMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.apps.events.subscriptions.v1.SubscriptionsService/CreateSubscription")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/subscriptions",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(
+ fields, "validateOnly", request.getValidateOnly());
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("subscription", request.getSubscription(), true))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (CreateSubscriptionRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteSubscriptionMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.apps.events.subscriptions.v1.SubscriptionsService/DeleteSubscription")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=subscriptions/*}",
+ 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());
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (DeleteSubscriptionRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ getSubscriptionMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.apps.events.subscriptions.v1.SubscriptionsService/GetSubscription")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=subscriptions/*}",
+ 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, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Subscription.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ listSubscriptionsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.apps.events.subscriptions.v1.SubscriptionsService/ListSubscriptions")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/subscriptions",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ 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());
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListSubscriptionsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ updateSubscriptionMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.apps.events.subscriptions.v1.SubscriptionsService/UpdateSubscription")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{subscription.name=subscriptions/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "subscription.name", request.getSubscription().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());
+ serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("subscription", request.getSubscription(), true))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (UpdateSubscriptionRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ reactivateSubscriptionMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.apps.events.subscriptions.v1.SubscriptionsService/ReactivateSubscription")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=subscriptions/*}:reactivate",
+ 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, "$alt", "json;enum-encoding=int");
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearName().build(), true))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (ReactivateSubscriptionRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private final UnaryCallable createSubscriptionCallable;
+ private final OperationCallable<
+ CreateSubscriptionRequest, Subscription, CreateSubscriptionMetadata>
+ createSubscriptionOperationCallable;
+ private final UnaryCallable deleteSubscriptionCallable;
+ private final OperationCallable
+ deleteSubscriptionOperationCallable;
+ private final UnaryCallable getSubscriptionCallable;
+ private final UnaryCallable
+ listSubscriptionsCallable;
+ private final UnaryCallable
+ listSubscriptionsPagedCallable;
+ private final UnaryCallable updateSubscriptionCallable;
+ private final OperationCallable<
+ UpdateSubscriptionRequest, Subscription, UpdateSubscriptionMetadata>
+ updateSubscriptionOperationCallable;
+ private final UnaryCallable
+ reactivateSubscriptionCallable;
+ private final OperationCallable<
+ ReactivateSubscriptionRequest, Subscription, ReactivateSubscriptionMetadata>
+ reactivateSubscriptionOperationCallable;
+
+ private final BackgroundResource backgroundResources;
+ private final HttpJsonOperationsStub httpJsonOperationsStub;
+ private final HttpJsonStubCallableFactory callableFactory;
+
+ public static final HttpJsonSubscriptionsServiceStub create(
+ SubscriptionsServiceStubSettings settings) throws IOException {
+ return new HttpJsonSubscriptionsServiceStub(settings, ClientContext.create(settings));
+ }
+
+ public static final HttpJsonSubscriptionsServiceStub create(ClientContext clientContext)
+ throws IOException {
+ return new HttpJsonSubscriptionsServiceStub(
+ SubscriptionsServiceStubSettings.newHttpJsonBuilder().build(), clientContext);
+ }
+
+ public static final HttpJsonSubscriptionsServiceStub create(
+ ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException {
+ return new HttpJsonSubscriptionsServiceStub(
+ SubscriptionsServiceStubSettings.newHttpJsonBuilder().build(),
+ clientContext,
+ callableFactory);
+ }
+
+ /**
+ * Constructs an instance of HttpJsonSubscriptionsServiceStub, 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 HttpJsonSubscriptionsServiceStub(
+ SubscriptionsServiceStubSettings settings, ClientContext clientContext) throws IOException {
+ this(settings, clientContext, new HttpJsonSubscriptionsServiceCallableFactory());
+ }
+
+ /**
+ * Constructs an instance of HttpJsonSubscriptionsServiceStub, 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 HttpJsonSubscriptionsServiceStub(
+ SubscriptionsServiceStubSettings settings,
+ ClientContext clientContext,
+ HttpJsonStubCallableFactory callableFactory)
+ throws IOException {
+ this.callableFactory = callableFactory;
+ this.httpJsonOperationsStub =
+ HttpJsonOperationsStub.create(
+ clientContext,
+ callableFactory,
+ typeRegistry,
+ ImmutableMap.builder()
+ .put(
+ "google.longrunning.Operations.GetOperation",
+ HttpRule.newBuilder().setGet("/v1/{name=operations/**}").build())
+ .build());
+
+ HttpJsonCallSettings createSubscriptionTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(createSubscriptionMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings deleteSubscriptionTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(deleteSubscriptionMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .build();
+ HttpJsonCallSettings getSubscriptionTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(getSubscriptionMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .build();
+ HttpJsonCallSettings
+ listSubscriptionsTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(listSubscriptionsMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .build();
+ HttpJsonCallSettings updateSubscriptionTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(updateSubscriptionMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add(
+ "subscription.name", String.valueOf(request.getSubscription().getName()));
+ return builder.build();
+ })
+ .build();
+ HttpJsonCallSettings
+ reactivateSubscriptionTransportSettings =
+ HttpJsonCallSettings.newBuilder()
+ .setMethodDescriptor(reactivateSubscriptionMethodDescriptor)
+ .setTypeRegistry(typeRegistry)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .build();
+
+ this.createSubscriptionCallable =
+ callableFactory.createUnaryCallable(
+ createSubscriptionTransportSettings,
+ settings.createSubscriptionSettings(),
+ clientContext);
+ this.createSubscriptionOperationCallable =
+ callableFactory.createOperationCallable(
+ createSubscriptionTransportSettings,
+ settings.createSubscriptionOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.deleteSubscriptionCallable =
+ callableFactory.createUnaryCallable(
+ deleteSubscriptionTransportSettings,
+ settings.deleteSubscriptionSettings(),
+ clientContext);
+ this.deleteSubscriptionOperationCallable =
+ callableFactory.createOperationCallable(
+ deleteSubscriptionTransportSettings,
+ settings.deleteSubscriptionOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.getSubscriptionCallable =
+ callableFactory.createUnaryCallable(
+ getSubscriptionTransportSettings, settings.getSubscriptionSettings(), clientContext);
+ this.listSubscriptionsCallable =
+ callableFactory.createUnaryCallable(
+ listSubscriptionsTransportSettings,
+ settings.listSubscriptionsSettings(),
+ clientContext);
+ this.listSubscriptionsPagedCallable =
+ callableFactory.createPagedCallable(
+ listSubscriptionsTransportSettings,
+ settings.listSubscriptionsSettings(),
+ clientContext);
+ this.updateSubscriptionCallable =
+ callableFactory.createUnaryCallable(
+ updateSubscriptionTransportSettings,
+ settings.updateSubscriptionSettings(),
+ clientContext);
+ this.updateSubscriptionOperationCallable =
+ callableFactory.createOperationCallable(
+ updateSubscriptionTransportSettings,
+ settings.updateSubscriptionOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+ this.reactivateSubscriptionCallable =
+ callableFactory.createUnaryCallable(
+ reactivateSubscriptionTransportSettings,
+ settings.reactivateSubscriptionSettings(),
+ clientContext);
+ this.reactivateSubscriptionOperationCallable =
+ callableFactory.createOperationCallable(
+ reactivateSubscriptionTransportSettings,
+ settings.reactivateSubscriptionOperationSettings(),
+ clientContext,
+ httpJsonOperationsStub);
+
+ this.backgroundResources =
+ new BackgroundResourceAggregation(clientContext.getBackgroundResources());
+ }
+
+ @InternalApi
+ public static List getMethodDescriptors() {
+ List methodDescriptors = new ArrayList<>();
+ methodDescriptors.add(createSubscriptionMethodDescriptor);
+ methodDescriptors.add(deleteSubscriptionMethodDescriptor);
+ methodDescriptors.add(getSubscriptionMethodDescriptor);
+ methodDescriptors.add(listSubscriptionsMethodDescriptor);
+ methodDescriptors.add(updateSubscriptionMethodDescriptor);
+ methodDescriptors.add(reactivateSubscriptionMethodDescriptor);
+ return methodDescriptors;
+ }
+
+ public HttpJsonOperationsStub getHttpJsonOperationsStub() {
+ return httpJsonOperationsStub;
+ }
+
+ @Override
+ public UnaryCallable createSubscriptionCallable() {
+ return createSubscriptionCallable;
+ }
+
+ @Override
+ public OperationCallable
+ createSubscriptionOperationCallable() {
+ return createSubscriptionOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable deleteSubscriptionCallable() {
+ return deleteSubscriptionCallable;
+ }
+
+ @Override
+ public OperationCallable
+ deleteSubscriptionOperationCallable() {
+ return deleteSubscriptionOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable getSubscriptionCallable() {
+ return getSubscriptionCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ listSubscriptionsCallable() {
+ return listSubscriptionsCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ listSubscriptionsPagedCallable() {
+ return listSubscriptionsPagedCallable;
+ }
+
+ @Override
+ public UnaryCallable updateSubscriptionCallable() {
+ return updateSubscriptionCallable;
+ }
+
+ @Override
+ public OperationCallable
+ updateSubscriptionOperationCallable() {
+ return updateSubscriptionOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable reactivateSubscriptionCallable() {
+ return reactivateSubscriptionCallable;
+ }
+
+ @Override
+ public OperationCallable<
+ ReactivateSubscriptionRequest, Subscription, ReactivateSubscriptionMetadata>
+ reactivateSubscriptionOperationCallable() {
+ return reactivateSubscriptionOperationCallable;
+ }
+
+ @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/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/SubscriptionsServiceStub.java b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/SubscriptionsServiceStub.java
new file mode 100644
index 000000000000..48041c4eb6ee
--- /dev/null
+++ b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/SubscriptionsServiceStub.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2024 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.apps.events.subscriptions.v1.stub;
+
+import static com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient.ListSubscriptionsPagedResponse;
+
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata;
+import com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest;
+import com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata;
+import com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest;
+import com.google.apps.events.subscriptions.v1.GetSubscriptionRequest;
+import com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest;
+import com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse;
+import com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata;
+import com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest;
+import com.google.apps.events.subscriptions.v1.Subscription;
+import com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata;
+import com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest;
+import com.google.longrunning.Operation;
+import com.google.longrunning.stub.OperationsStub;
+import com.google.protobuf.Empty;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Base stub class for the SubscriptionsService service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public abstract class SubscriptionsServiceStub implements BackgroundResource {
+
+ public OperationsStub getOperationsStub() {
+ return null;
+ }
+
+ public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
+ return null;
+ }
+
+ public OperationCallable
+ createSubscriptionOperationCallable() {
+ throw new UnsupportedOperationException(
+ "Not implemented: createSubscriptionOperationCallable()");
+ }
+
+ public UnaryCallable createSubscriptionCallable() {
+ throw new UnsupportedOperationException("Not implemented: createSubscriptionCallable()");
+ }
+
+ public OperationCallable
+ deleteSubscriptionOperationCallable() {
+ throw new UnsupportedOperationException(
+ "Not implemented: deleteSubscriptionOperationCallable()");
+ }
+
+ public UnaryCallable deleteSubscriptionCallable() {
+ throw new UnsupportedOperationException("Not implemented: deleteSubscriptionCallable()");
+ }
+
+ public UnaryCallable getSubscriptionCallable() {
+ throw new UnsupportedOperationException("Not implemented: getSubscriptionCallable()");
+ }
+
+ public UnaryCallable
+ listSubscriptionsPagedCallable() {
+ throw new UnsupportedOperationException("Not implemented: listSubscriptionsPagedCallable()");
+ }
+
+ public UnaryCallable
+ listSubscriptionsCallable() {
+ throw new UnsupportedOperationException("Not implemented: listSubscriptionsCallable()");
+ }
+
+ public OperationCallable
+ updateSubscriptionOperationCallable() {
+ throw new UnsupportedOperationException(
+ "Not implemented: updateSubscriptionOperationCallable()");
+ }
+
+ public UnaryCallable updateSubscriptionCallable() {
+ throw new UnsupportedOperationException("Not implemented: updateSubscriptionCallable()");
+ }
+
+ public OperationCallable<
+ ReactivateSubscriptionRequest, Subscription, ReactivateSubscriptionMetadata>
+ reactivateSubscriptionOperationCallable() {
+ throw new UnsupportedOperationException(
+ "Not implemented: reactivateSubscriptionOperationCallable()");
+ }
+
+ public UnaryCallable reactivateSubscriptionCallable() {
+ throw new UnsupportedOperationException("Not implemented: reactivateSubscriptionCallable()");
+ }
+
+ @Override
+ public abstract void close();
+}
diff --git a/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/SubscriptionsServiceStubSettings.java b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/SubscriptionsServiceStubSettings.java
new file mode 100644
index 000000000000..d96311afe755
--- /dev/null
+++ b/java-workspaceevents/google-cloud-workspaceevents/src/main/java/com/google/apps/events/subscriptions/v1/stub/SubscriptionsServiceStubSettings.java
@@ -0,0 +1,785 @@
+/*
+ * Copyright 2024 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.apps.events.subscriptions.v1.stub;
+
+import static com.google.apps.events.subscriptions.v1.SubscriptionsServiceClient.ListSubscriptionsPagedResponse;
+
+import com.google.api.core.ApiFunction;
+import com.google.api.core.ApiFuture;
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.GaxProperties;
+import com.google.api.gax.core.GoogleCredentialsProvider;
+import com.google.api.gax.core.InstantiatingExecutorProvider;
+import com.google.api.gax.grpc.GaxGrpcProperties;
+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;
+import com.google.api.gax.rpc.ApiCallContext;
+import com.google.api.gax.rpc.ApiClientHeaderProvider;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.PageContext;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.PagedListDescriptor;
+import com.google.api.gax.rpc.PagedListResponseFactory;
+import com.google.api.gax.rpc.StatusCode;
+import com.google.api.gax.rpc.StubSettings;
+import com.google.api.gax.rpc.TransportChannelProvider;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.apps.events.subscriptions.v1.CreateSubscriptionMetadata;
+import com.google.apps.events.subscriptions.v1.CreateSubscriptionRequest;
+import com.google.apps.events.subscriptions.v1.DeleteSubscriptionMetadata;
+import com.google.apps.events.subscriptions.v1.DeleteSubscriptionRequest;
+import com.google.apps.events.subscriptions.v1.GetSubscriptionRequest;
+import com.google.apps.events.subscriptions.v1.ListSubscriptionsRequest;
+import com.google.apps.events.subscriptions.v1.ListSubscriptionsResponse;
+import com.google.apps.events.subscriptions.v1.ReactivateSubscriptionMetadata;
+import com.google.apps.events.subscriptions.v1.ReactivateSubscriptionRequest;
+import com.google.apps.events.subscriptions.v1.Subscription;
+import com.google.apps.events.subscriptions.v1.UpdateSubscriptionMetadata;
+import com.google.apps.events.subscriptions.v1.UpdateSubscriptionRequest;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
+import com.google.longrunning.Operation;
+import com.google.protobuf.Empty;
+import java.io.IOException;
+import java.util.List;
+import javax.annotation.Generated;
+import org.threeten.bp.Duration;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Settings class to configure an instance of {@link SubscriptionsServiceStub}.
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ *
+ * - The default service address (workspaceevents.googleapis.com) and default port (443) are
+ * used.
+ *
- Credentials are acquired automatically through Application Default Credentials.
+ *
- Retries are configured for idempotent methods but not for non-idempotent methods.
+ *
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ *
For example, to set the total timeout of getSubscription to 30 seconds:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SubscriptionsServiceStubSettings.Builder subscriptionsServiceSettingsBuilder =
+ * SubscriptionsServiceStubSettings.newBuilder();
+ * subscriptionsServiceSettingsBuilder
+ * .getSubscriptionSettings()
+ * .setRetrySettings(
+ * subscriptionsServiceSettingsBuilder
+ * .getSubscriptionSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * SubscriptionsServiceStubSettings subscriptionsServiceSettings =
+ * subscriptionsServiceSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class SubscriptionsServiceStubSettings
+ extends StubSettings {
+ /** The default scopes of the service. */
+ private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+ ImmutableList.builder()
+ .add("https://www.googleapis.com/auth/chat.bot")
+ .add("https://www.googleapis.com/auth/chat.memberships")
+ .add("https://www.googleapis.com/auth/chat.memberships.readonly")
+ .add("https://www.googleapis.com/auth/chat.messages")
+ .add("https://www.googleapis.com/auth/chat.messages.reactions")
+ .add("https://www.googleapis.com/auth/chat.messages.reactions.readonly")
+ .add("https://www.googleapis.com/auth/chat.messages.readonly")
+ .add("https://www.googleapis.com/auth/chat.spaces")
+ .add("https://www.googleapis.com/auth/chat.spaces.readonly")
+ .add("https://www.googleapis.com/auth/meetings.space.created")
+ .add("https://www.googleapis.com/auth/meetings.space.readonly")
+ .build();
+
+ private final UnaryCallSettings createSubscriptionSettings;
+ private final OperationCallSettings<
+ CreateSubscriptionRequest, Subscription, CreateSubscriptionMetadata>
+ createSubscriptionOperationSettings;
+ private final UnaryCallSettings deleteSubscriptionSettings;
+ private final OperationCallSettings
+ deleteSubscriptionOperationSettings;
+ private final UnaryCallSettings getSubscriptionSettings;
+ private final PagedCallSettings<
+ ListSubscriptionsRequest, ListSubscriptionsResponse, ListSubscriptionsPagedResponse>
+ listSubscriptionsSettings;
+ private final UnaryCallSettings updateSubscriptionSettings;
+ private final OperationCallSettings<
+ UpdateSubscriptionRequest, Subscription, UpdateSubscriptionMetadata>
+ updateSubscriptionOperationSettings;
+ private final UnaryCallSettings
+ reactivateSubscriptionSettings;
+ private final OperationCallSettings<
+ ReactivateSubscriptionRequest, Subscription, ReactivateSubscriptionMetadata>
+ reactivateSubscriptionOperationSettings;
+
+ private static final PagedListDescriptor<
+ ListSubscriptionsRequest, ListSubscriptionsResponse, Subscription>
+ LIST_SUBSCRIPTIONS_PAGE_STR_DESC =
+ new PagedListDescriptor<
+ ListSubscriptionsRequest, ListSubscriptionsResponse, Subscription>() {
+ @Override
+ public String emptyToken() {
+ return "";
+ }
+
+ @Override
+ public ListSubscriptionsRequest injectToken(
+ ListSubscriptionsRequest payload, String token) {
+ return ListSubscriptionsRequest.newBuilder(payload).setPageToken(token).build();
+ }
+
+ @Override
+ public ListSubscriptionsRequest injectPageSize(
+ ListSubscriptionsRequest payload, int pageSize) {
+ return ListSubscriptionsRequest.newBuilder(payload).setPageSize(pageSize).build();
+ }
+
+ @Override
+ public Integer extractPageSize(ListSubscriptionsRequest payload) {
+ return payload.getPageSize();
+ }
+
+ @Override
+ public String extractNextToken(ListSubscriptionsResponse payload) {
+ return payload.getNextPageToken();
+ }
+
+ @Override
+ public Iterable extractResources(ListSubscriptionsResponse payload) {
+ return payload.getSubscriptionsList() == null
+ ? ImmutableList.of()
+ : payload.getSubscriptionsList();
+ }
+ };
+
+ private static final PagedListResponseFactory<
+ ListSubscriptionsRequest, ListSubscriptionsResponse, ListSubscriptionsPagedResponse>
+ LIST_SUBSCRIPTIONS_PAGE_STR_FACT =
+ new PagedListResponseFactory<
+ ListSubscriptionsRequest,
+ ListSubscriptionsResponse,
+ ListSubscriptionsPagedResponse>() {
+ @Override
+ public ApiFuture