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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * McpServerName name =
+ * McpServerName.ofProjectLocationMcpServerName("[PROJECT]", "[LOCATION]", "[MCP_SERVER]");
+ * McpServer response = cloudApiRegistryClient.getMcpServer(name);
+ * }
+ * }
+ *
+ * Note: close() needs to be called on the CloudApiRegistryClient 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 | + *
|---|---|---|
GetMcpServer |
+ * Gets a single McpServer. |
+ *
+ * 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. + *
|
+ *
ListMcpServers |
+ * Lists McpServers in a given Project. |
+ *
+ * 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. + *
|
+ *
GetMcpTool |
+ * Gets a single McpTool. |
+ *
+ * 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. + *
|
+ *
ListMcpTools |
+ * Lists McpTools in a given McpServer. |
+ *
+ * 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. + *
|
+ *
ListLocations |
+ * Lists information about the supported locations for this service. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetLocation |
+ * Gets information about a location. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
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 CloudApiRegistrySettings 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
+ * CloudApiRegistrySettings cloudApiRegistrySettings =
+ * CloudApiRegistrySettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * CloudApiRegistryClient cloudApiRegistryClient =
+ * CloudApiRegistryClient.create(cloudApiRegistrySettings);
+ * }
+ *
+ * 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
+ * CloudApiRegistrySettings cloudApiRegistrySettings =
+ * CloudApiRegistrySettings.newBuilder().setEndpoint(myEndpoint).build();
+ * CloudApiRegistryClient cloudApiRegistryClient =
+ * CloudApiRegistryClient.create(cloudApiRegistrySettings);
+ * }
+ *
+ * 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
+ * CloudApiRegistrySettings cloudApiRegistrySettings =
+ * CloudApiRegistrySettings.newHttpJsonBuilder().build();
+ * CloudApiRegistryClient cloudApiRegistryClient =
+ * CloudApiRegistryClient.create(cloudApiRegistrySettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class CloudApiRegistryClient implements BackgroundResource { + private final CloudApiRegistrySettings settings; + private final CloudApiRegistryStub stub; + + /** Constructs an instance of CloudApiRegistryClient with default settings. */ + public static final CloudApiRegistryClient create() throws IOException { + return create(CloudApiRegistrySettings.newBuilder().build()); + } + + /** + * Constructs an instance of CloudApiRegistryClient, 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 CloudApiRegistryClient create(CloudApiRegistrySettings settings) + throws IOException { + return new CloudApiRegistryClient(settings); + } + + /** + * Constructs an instance of CloudApiRegistryClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(CloudApiRegistrySettings). + */ + public static final CloudApiRegistryClient create(CloudApiRegistryStub stub) { + return new CloudApiRegistryClient(stub); + } + + /** + * Constructs an instance of CloudApiRegistryClient, 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 CloudApiRegistryClient(CloudApiRegistrySettings settings) throws IOException { + this.settings = settings; + this.stub = ((CloudApiRegistryStubSettings) settings.getStubSettings()).createStub(); + } + + protected CloudApiRegistryClient(CloudApiRegistryStub stub) { + this.settings = null; + this.stub = stub; + } + + public final CloudApiRegistrySettings getSettings() { + return settings; + } + + public CloudApiRegistryStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a single McpServer. + * + *
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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * McpServerName name =
+ * McpServerName.ofProjectLocationMcpServerName("[PROJECT]", "[LOCATION]", "[MCP_SERVER]");
+ * McpServer response = cloudApiRegistryClient.getMcpServer(name);
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final McpServer getMcpServer(McpServerName name) {
+ GetMcpServerRequest request =
+ GetMcpServerRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getMcpServer(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a single McpServer.
+ *
+ * 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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * String name =
+ * McpServerName.ofProjectLocationApiNamespaceMcpServerName(
+ * "[PROJECT]", "[LOCATION]", "[API_NAMESPACE]", "[MCP_SERVER]")
+ * .toString();
+ * McpServer response = cloudApiRegistryClient.getMcpServer(name);
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final McpServer getMcpServer(String name) {
+ GetMcpServerRequest request = GetMcpServerRequest.newBuilder().setName(name).build();
+ return getMcpServer(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a single McpServer.
+ *
+ * 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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * GetMcpServerRequest request =
+ * GetMcpServerRequest.newBuilder()
+ * .setName(
+ * McpServerName.ofProjectLocationMcpServerName(
+ * "[PROJECT]", "[LOCATION]", "[MCP_SERVER]")
+ * .toString())
+ * .build();
+ * McpServer response = cloudApiRegistryClient.getMcpServer(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 McpServer getMcpServer(GetMcpServerRequest request) {
+ return getMcpServerCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a single McpServer.
+ *
+ * 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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * GetMcpServerRequest request =
+ * GetMcpServerRequest.newBuilder()
+ * .setName(
+ * McpServerName.ofProjectLocationMcpServerName(
+ * "[PROJECT]", "[LOCATION]", "[MCP_SERVER]")
+ * .toString())
+ * .build();
+ * ApiFuture future =
+ * cloudApiRegistryClient.getMcpServerCallable().futureCall(request);
+ * // Do something.
+ * McpServer response = future.get();
+ * }
+ * }
+ */
+ 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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (McpServer element : cloudApiRegistryClient.listMcpServers(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Parent value for ListMcpServersRequest
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListMcpServersPagedResponse listMcpServers(LocationName parent) {
+ ListMcpServersRequest request =
+ ListMcpServersRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listMcpServers(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists McpServers in a given Project.
+ *
+ * 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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (McpServer element : cloudApiRegistryClient.listMcpServers(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Parent value for ListMcpServersRequest
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListMcpServersPagedResponse listMcpServers(String parent) {
+ ListMcpServersRequest request = ListMcpServersRequest.newBuilder().setParent(parent).build();
+ return listMcpServers(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists McpServers in a given Project.
+ *
+ * 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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * ListMcpServersRequest request =
+ * ListMcpServersRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * for (McpServer element : cloudApiRegistryClient.listMcpServers(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 ListMcpServersPagedResponse listMcpServers(ListMcpServersRequest request) {
+ return listMcpServersPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists McpServers in a given Project.
+ *
+ * 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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * ListMcpServersRequest request =
+ * ListMcpServersRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * ApiFuture future =
+ * cloudApiRegistryClient.listMcpServersPagedCallable().futureCall(request);
+ * // Do something.
+ * for (McpServer 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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * ListMcpServersRequest request =
+ * ListMcpServersRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * while (true) {
+ * ListMcpServersResponse response =
+ * cloudApiRegistryClient.listMcpServersCallable().call(request);
+ * for (McpServer element : response.getMcpServersList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ 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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * McpToolName name =
+ * McpToolName.ofProjectLocationMcpServerMcpToolName(
+ * "[PROJECT]", "[LOCATION]", "[MCP_SERVER]", "[MCP_TOOL]");
+ * McpTool response = cloudApiRegistryClient.getMcpTool(name);
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final McpTool getMcpTool(McpToolName name) {
+ GetMcpToolRequest request =
+ GetMcpToolRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getMcpTool(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a single McpTool.
+ *
+ * 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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * String name =
+ * McpToolName.ofProjectLocationApiNamespaceMcpServerMcpToolName(
+ * "[PROJECT]", "[LOCATION]", "[API_NAMESPACE]", "[MCP_SERVER]", "[MCP_TOOL]")
+ * .toString();
+ * McpTool response = cloudApiRegistryClient.getMcpTool(name);
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final McpTool getMcpTool(String name) {
+ GetMcpToolRequest request = GetMcpToolRequest.newBuilder().setName(name).build();
+ return getMcpTool(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a single McpTool.
+ *
+ * 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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * GetMcpToolRequest request =
+ * GetMcpToolRequest.newBuilder()
+ * .setName(
+ * McpToolName.ofProjectLocationMcpServerMcpToolName(
+ * "[PROJECT]", "[LOCATION]", "[MCP_SERVER]", "[MCP_TOOL]")
+ * .toString())
+ * .build();
+ * McpTool response = cloudApiRegistryClient.getMcpTool(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 McpTool getMcpTool(GetMcpToolRequest request) {
+ return getMcpToolCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a single McpTool.
+ *
+ * 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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * GetMcpToolRequest request =
+ * GetMcpToolRequest.newBuilder()
+ * .setName(
+ * McpToolName.ofProjectLocationMcpServerMcpToolName(
+ * "[PROJECT]", "[LOCATION]", "[MCP_SERVER]", "[MCP_TOOL]")
+ * .toString())
+ * .build();
+ * ApiFuture future = cloudApiRegistryClient.getMcpToolCallable().futureCall(request);
+ * // Do something.
+ * McpTool response = future.get();
+ * }
+ * }
+ */
+ 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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * McpServerName parent =
+ * McpServerName.ofProjectLocationMcpServerName("[PROJECT]", "[LOCATION]", "[MCP_SERVER]");
+ * for (McpTool element : cloudApiRegistryClient.listMcpTools(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Parent value for ListMcpToolsRequest
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListMcpToolsPagedResponse listMcpTools(McpServerName parent) {
+ ListMcpToolsRequest request =
+ ListMcpToolsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listMcpTools(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists McpTools in a given McpServer.
+ *
+ * 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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * String parent =
+ * McpServerName.ofProjectLocationApiNamespaceMcpServerName(
+ * "[PROJECT]", "[LOCATION]", "[API_NAMESPACE]", "[MCP_SERVER]")
+ * .toString();
+ * for (McpTool element : cloudApiRegistryClient.listMcpTools(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Parent value for ListMcpToolsRequest
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListMcpToolsPagedResponse listMcpTools(String parent) {
+ ListMcpToolsRequest request = ListMcpToolsRequest.newBuilder().setParent(parent).build();
+ return listMcpTools(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists McpTools in a given McpServer.
+ *
+ * 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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * ListMcpToolsRequest request =
+ * ListMcpToolsRequest.newBuilder()
+ * .setParent(
+ * McpServerName.ofProjectLocationMcpServerName(
+ * "[PROJECT]", "[LOCATION]", "[MCP_SERVER]")
+ * .toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * for (McpTool element : cloudApiRegistryClient.listMcpTools(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 ListMcpToolsPagedResponse listMcpTools(ListMcpToolsRequest request) {
+ return listMcpToolsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists McpTools in a given McpServer.
+ *
+ * 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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * ListMcpToolsRequest request =
+ * ListMcpToolsRequest.newBuilder()
+ * .setParent(
+ * McpServerName.ofProjectLocationMcpServerName(
+ * "[PROJECT]", "[LOCATION]", "[MCP_SERVER]")
+ * .toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * ApiFuture future =
+ * cloudApiRegistryClient.listMcpToolsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (McpTool 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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * ListMcpToolsRequest request =
+ * ListMcpToolsRequest.newBuilder()
+ * .setParent(
+ * McpServerName.ofProjectLocationMcpServerName(
+ * "[PROJECT]", "[LOCATION]", "[MCP_SERVER]")
+ * .toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * while (true) {
+ * ListMcpToolsResponse response = cloudApiRegistryClient.listMcpToolsCallable().call(request);
+ * for (McpTool element : response.getMcpToolsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ 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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (Location element : cloudApiRegistryClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) {
+ return listLocationsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * 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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * cloudApiRegistryClient.listLocationsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Location 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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListLocationsResponse response =
+ * cloudApiRegistryClient.listLocationsCallable().call(request);
+ * for (Location element : response.getLocationsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ 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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * Location response = cloudApiRegistryClient.getLocation(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 Location getLocation(GetLocationRequest request) {
+ return getLocationCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a location.
+ *
+ * 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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * ApiFuture future = cloudApiRegistryClient.getLocationCallable().futureCall(request);
+ * // Do something.
+ * Location response = future.get();
+ * }
+ * }
+ */
+ 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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getMcpServer: + * + *
{@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
+ * CloudApiRegistrySettings.Builder cloudApiRegistrySettingsBuilder =
+ * CloudApiRegistrySettings.newBuilder();
+ * cloudApiRegistrySettingsBuilder
+ * .getMcpServerSettings()
+ * .setRetrySettings(
+ * cloudApiRegistrySettingsBuilder
+ * .getMcpServerSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ * .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ * .setMaxAttempts(5)
+ * .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ * .setRetryDelayMultiplier(1.3)
+ * .setRpcTimeoutMultiplier(1.5)
+ * .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ * .build());
+ * CloudApiRegistrySettings cloudApiRegistrySettings = cloudApiRegistrySettingsBuilder.build();
+ * }
+ *
+ * Please refer to the [Client Side Retry
+ * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting
+ * retries.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class CloudApiRegistrySettings 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.
+ *
+ * ======================= CloudApiRegistryClient =======================
+ *
+ * Service Description: The Cloud API Registry service provides a central registry for managing
+ * API Data.
+ *
+ * Sample for CloudApiRegistryClient:
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public abstract class CloudApiRegistryStub 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
+ * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings)
+ * of getMcpServer:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class GrpcCloudApiRegistryCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class GrpcCloudApiRegistryStub extends CloudApiRegistryStub {
+ private static final MethodDescriptor This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonCloudApiRegistryCallableFactory
+ implements HttpJsonStubCallableFactory This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonCloudApiRegistryStub extends CloudApiRegistryStub {
+ private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build();
+
+ private static final ApiMethodDescriptor{@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 (CloudApiRegistryClient cloudApiRegistryClient = CloudApiRegistryClient.create()) {
+ * McpServerName name =
+ * McpServerName.ofProjectLocationMcpServerName("[PROJECT]", "[LOCATION]", "[MCP_SERVER]");
+ * McpServer response = cloudApiRegistryClient.getMcpServer(name);
+ * }
+ * }
+ */
+@Generated("by gapic-generator-java")
+package com.google.cloud.apiregistry.v1beta;
+
+import javax.annotation.Generated;
diff --git a/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/stub/CloudApiRegistryStub.java b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/stub/CloudApiRegistryStub.java
new file mode 100644
index 000000000000..3dcda0126d70
--- /dev/null
+++ b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/stub/CloudApiRegistryStub.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2026 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.apiregistry.v1beta.stub;
+
+import static com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient.ListLocationsPagedResponse;
+import static com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient.ListMcpServersPagedResponse;
+import static com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient.ListMcpToolsPagedResponse;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.apiregistry.v1beta.GetMcpServerRequest;
+import com.google.cloud.apiregistry.v1beta.GetMcpToolRequest;
+import com.google.cloud.apiregistry.v1beta.ListMcpServersRequest;
+import com.google.cloud.apiregistry.v1beta.ListMcpServersResponse;
+import com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest;
+import com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse;
+import com.google.cloud.apiregistry.v1beta.McpServer;
+import com.google.cloud.apiregistry.v1beta.McpTool;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Base stub class for the CloudApiRegistry 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
+ * CloudApiRegistryStubSettings.Builder cloudApiRegistrySettingsBuilder =
+ * CloudApiRegistryStubSettings.newBuilder();
+ * cloudApiRegistrySettingsBuilder
+ * .getMcpServerSettings()
+ * .setRetrySettings(
+ * cloudApiRegistrySettingsBuilder
+ * .getMcpServerSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ * .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ * .setMaxAttempts(5)
+ * .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ * .setRetryDelayMultiplier(1.3)
+ * .setRpcTimeoutMultiplier(1.5)
+ * .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ * .build());
+ * CloudApiRegistryStubSettings cloudApiRegistrySettings = cloudApiRegistrySettingsBuilder.build();
+ * }
+ *
+ * Please refer to the [Client Side Retry
+ * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting
+ * retries.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class CloudApiRegistryStubSettings extends StubSettings