This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *
{@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 (QuotaServiceClient quotaServiceClient = QuotaServiceClient.create()) {
+ * AccountName parent = AccountName.of("[ACCOUNT]");
+ * for (QuotaGroup element : quotaServiceClient.listQuotaGroups(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * Note: close() needs to be called on the QuotaServiceClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *
| Method | + *Description | + *Method Variants | + *
|---|---|---|
ListQuotaGroups |
+ * Lists the daily call quota and usage per group for your Merchant Center account. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
See the individual methods for example code. + * + *
Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *
This class can be customized by passing in a custom instance of QuotaServiceSettings to + * create(). For example: + * + *
To customize credentials: + * + *
{@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
+ * QuotaServiceSettings quotaServiceSettings =
+ * QuotaServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * QuotaServiceClient quotaServiceClient = QuotaServiceClient.create(quotaServiceSettings);
+ * }
+ *
+ * To customize the endpoint: + * + *
{@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
+ * QuotaServiceSettings quotaServiceSettings =
+ * QuotaServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * QuotaServiceClient quotaServiceClient = QuotaServiceClient.create(quotaServiceSettings);
+ * }
+ *
+ * To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *
{@code
+ * // This snippet has been automatically generated 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
+ * QuotaServiceSettings quotaServiceSettings = QuotaServiceSettings.newHttpJsonBuilder().build();
+ * QuotaServiceClient quotaServiceClient = QuotaServiceClient.create(quotaServiceSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class QuotaServiceClient implements BackgroundResource { + private final QuotaServiceSettings settings; + private final QuotaServiceStub stub; + + /** Constructs an instance of QuotaServiceClient with default settings. */ + public static final QuotaServiceClient create() throws IOException { + return create(QuotaServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of QuotaServiceClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final QuotaServiceClient create(QuotaServiceSettings settings) throws IOException { + return new QuotaServiceClient(settings); + } + + /** + * Constructs an instance of QuotaServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(QuotaServiceSettings). + */ + public static final QuotaServiceClient create(QuotaServiceStub stub) { + return new QuotaServiceClient(stub); + } + + /** + * Constructs an instance of QuotaServiceClient, 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 QuotaServiceClient(QuotaServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((QuotaServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected QuotaServiceClient(QuotaServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final QuotaServiceSettings getSettings() { + return settings; + } + + public QuotaServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the daily call quota and usage per group for your Merchant Center account. + * + *
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 (QuotaServiceClient quotaServiceClient = QuotaServiceClient.create()) {
+ * AccountName parent = AccountName.of("[ACCOUNT]");
+ * for (QuotaGroup element : quotaServiceClient.listQuotaGroups(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The merchant account who owns the collection of method quotas Format:
+ * accounts/{account}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListQuotaGroupsPagedResponse listQuotaGroups(AccountName parent) {
+ ListQuotaGroupsRequest request =
+ ListQuotaGroupsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listQuotaGroups(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists the daily call quota and usage per group for your Merchant Center account.
+ *
+ * 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 (QuotaServiceClient quotaServiceClient = QuotaServiceClient.create()) {
+ * String parent = AccountName.of("[ACCOUNT]").toString();
+ * for (QuotaGroup element : quotaServiceClient.listQuotaGroups(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The merchant account who owns the collection of method quotas Format:
+ * accounts/{account}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListQuotaGroupsPagedResponse listQuotaGroups(String parent) {
+ ListQuotaGroupsRequest request = ListQuotaGroupsRequest.newBuilder().setParent(parent).build();
+ return listQuotaGroups(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists the daily call quota and usage per group for your Merchant Center account.
+ *
+ * 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 (QuotaServiceClient quotaServiceClient = QuotaServiceClient.create()) {
+ * ListQuotaGroupsRequest request =
+ * ListQuotaGroupsRequest.newBuilder()
+ * .setParent(AccountName.of("[ACCOUNT]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (QuotaGroup element : quotaServiceClient.listQuotaGroups(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 ListQuotaGroupsPagedResponse listQuotaGroups(ListQuotaGroupsRequest request) {
+ return listQuotaGroupsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists the daily call quota and usage per group for your Merchant Center account.
+ *
+ * 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 (QuotaServiceClient quotaServiceClient = QuotaServiceClient.create()) {
+ * ListQuotaGroupsRequest request =
+ * ListQuotaGroupsRequest.newBuilder()
+ * .setParent(AccountName.of("[ACCOUNT]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * quotaServiceClient.listQuotaGroupsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (QuotaGroup element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (QuotaServiceClient quotaServiceClient = QuotaServiceClient.create()) {
+ * ListQuotaGroupsRequest request =
+ * ListQuotaGroupsRequest.newBuilder()
+ * .setParent(AccountName.of("[ACCOUNT]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListQuotaGroupsResponse response =
+ * quotaServiceClient.listQuotaGroupsCallable().call(request);
+ * for (QuotaGroup element : response.getQuotaGroupsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableThe default instance has everything set to sensible defaults: + * + *
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 listQuotaGroups 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
+ * QuotaServiceSettings.Builder quotaServiceSettingsBuilder = QuotaServiceSettings.newBuilder();
+ * quotaServiceSettingsBuilder
+ * .listQuotaGroupsSettings()
+ * .setRetrySettings(
+ * quotaServiceSettingsBuilder
+ * .listQuotaGroupsSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * QuotaServiceSettings quotaServiceSettings = quotaServiceSettingsBuilder.build();
+ * }
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class QuotaServiceSettings extends ClientSettingsNote: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction The interfaces provided are listed below, along with usage samples.
+ *
+ * ======================= QuotaServiceClient =======================
+ *
+ * Service Description: Service to get method call quota information per Merchant API method.
+ *
+ * Sample for QuotaServiceClient:
+ *
+ * This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class GrpcQuotaServiceCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class GrpcQuotaServiceStub extends QuotaServiceStub {
+ private static final MethodDescriptor This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonQuotaServiceCallableFactory
+ implements HttpJsonStubCallableFactory This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonQuotaServiceStub extends QuotaServiceStub {
+ private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build();
+
+ private static final ApiMethodDescriptor This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public abstract class QuotaServiceStub implements BackgroundResource {
+
+ public UnaryCallable The default instance has everything set to sensible defaults:
+ *
+ * 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 listQuotaGroups to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction{@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 (QuotaServiceClient quotaServiceClient = QuotaServiceClient.create()) {
+ * AccountName parent = AccountName.of("[ACCOUNT]");
+ * for (QuotaGroup element : quotaServiceClient.listQuotaGroups(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+@Generated("by gapic-generator-java")
+package com.google.shopping.merchant.quota.v1beta;
+
+import javax.annotation.Generated;
diff --git a/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/GrpcQuotaServiceCallableFactory.java b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/GrpcQuotaServiceCallableFactory.java
new file mode 100644
index 000000000000..e9f5d6726685
--- /dev/null
+++ b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/GrpcQuotaServiceCallableFactory.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.shopping.merchant.quota.v1beta.stub;
+
+import com.google.api.core.BetaApi;
+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 QuotaService service API.
+ *
+ *
+ *
+ *
+ * {@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
+ * QuotaServiceStubSettings.Builder quotaServiceSettingsBuilder =
+ * QuotaServiceStubSettings.newBuilder();
+ * quotaServiceSettingsBuilder
+ * .listQuotaGroupsSettings()
+ * .setRetrySettings(
+ * quotaServiceSettingsBuilder
+ * .listQuotaGroupsSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * QuotaServiceStubSettings quotaServiceSettings = quotaServiceSettingsBuilder.build();
+ * }
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class QuotaServiceStubSettings extends StubSettings