diff --git a/gapic-libraries-bom/pom.xml b/gapic-libraries-bom/pom.xml index e7937e306406..fffffb0c1204 100644 --- a/gapic-libraries-bom/pom.xml +++ b/gapic-libraries-bom/pom.xml @@ -329,6 +329,13 @@ pom import + + com.google.cloud + google-cloud-cloudapiregistry-bom + 0.0.1-SNAPSHOT + pom + import + com.google.cloud google-cloud-cloudcommerceconsumerprocurement-bom diff --git a/generation_config.yaml b/generation_config.yaml index 42692c856581..b3366de7f359 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -532,6 +532,23 @@ libraries: GAPICs: - proto_path: google/cloud/chronicle/v1 requires_billing: true +- api_shortname: cloudapiregistry + name_pretty: Cloud API Registry API + product_documentation: https://docs.cloud.google.com/api-registry/docs/overview + api_description: Cloud API Registry lets you discover, govern, use, and monitor + Model Context Protocol (MCP) servers and tools provided by Google, or by your + organization through Apigee API hub. + client_documentation: + https://cloud.google.com/java/docs/reference/google-cloud-cloudapiregistry/latest/overview + release_level: preview + distribution_name: com.google.cloud:google-cloud-cloudapiregistry + api_id: cloudapiregistry.googleapis.com + library_type: GAPIC_AUTO + group_id: com.google.cloud + cloud_api: true + GAPICs: + - proto_path: google/cloud/apiregistry/v1beta + requires_billing: true - api_shortname: cloudbuild name_pretty: Cloud Build product_documentation: https://cloud.google.com/cloud-build/ diff --git a/java-cloudapiregistry/.OwlBot-hermetic.yaml b/java-cloudapiregistry/.OwlBot-hermetic.yaml new file mode 100644 index 000000000000..601dc3f6704f --- /dev/null +++ b/java-cloudapiregistry/.OwlBot-hermetic.yaml @@ -0,0 +1,35 @@ +# 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 +# +# http://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. + + +deep-remove-regex: +- "/java-cloudapiregistry/grpc-google-.*/src" +- "/java-cloudapiregistry/proto-google-.*/src" +- "/java-cloudapiregistry/google-.*/src" +- "/java-cloudapiregistry/samples/snippets/generated" + +deep-preserve-regex: +- "/java-cloudapiregistry/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/cloud/apiregistry/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-cloudapiregistry/$1/proto-google-cloud-cloudapiregistry-$1/src" +- source: "/google/cloud/apiregistry/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-cloudapiregistry/$1/grpc-google-cloud-cloudapiregistry-$1/src" +- source: "/google/cloud/apiregistry/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-cloudapiregistry/$1/google-cloud-cloudapiregistry/src" +- source: "/google/cloud/apiregistry/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-cloudapiregistry/$1/samples/snippets/generated" + +api-name: cloudapiregistry \ No newline at end of file diff --git a/java-cloudapiregistry/.repo-metadata.json b/java-cloudapiregistry/.repo-metadata.json new file mode 100644 index 000000000000..102fcc9913a6 --- /dev/null +++ b/java-cloudapiregistry/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "cloudapiregistry", + "name_pretty": "Cloud API Registry API", + "product_documentation": "https://docs.cloud.google.com/api-registry/docs/overview", + "api_description": "Cloud API Registry lets you discover, govern, use, and monitor Model Context Protocol (MCP) servers and tools provided by Google, or by your organization through Apigee API hub.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-cloudapiregistry/latest/overview", + "release_level": "preview", + "transport": "both", + "language": "java", + "repo": "googleapis/google-cloud-java", + "repo_short": "java-cloudapiregistry", + "distribution_name": "com.google.cloud:google-cloud-cloudapiregistry", + "api_id": "cloudapiregistry.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/java-cloudapiregistry/README.md b/java-cloudapiregistry/README.md new file mode 100644 index 000000000000..d965c63c5aeb --- /dev/null +++ b/java-cloudapiregistry/README.md @@ -0,0 +1,205 @@ +# Google Cloud API Registry API Client for Java + +Java idiomatic client for [Cloud API Registry API][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + + +## Quickstart + + +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: + +```xml + + + + com.google.cloud + libraries-bom + 26.73.0 + pom + import + + + + + + + com.google.cloud + google-cloud-cloudapiregistry + + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + +```xml + + com.google.cloud + google-cloud-cloudapiregistry + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-cloudapiregistry:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-cloudapiregistry" % "0.0.0" +``` + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## Authorization + +The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired Cloud API Registry API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Cloud API Registry API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Cloud API Registry API [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Cloud API Registry API. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `google-cloud-cloudapiregistry` library. See the [Quickstart](#quickstart) section +to add `google-cloud-cloudapiregistry` as a dependency in your code. + +## About Cloud API Registry API + + +[Cloud API Registry API][product-docs] Cloud API Registry lets you discover, govern, use, and monitor Model Context Protocol (MCP) servers and tools provided by Google, or by your organization through Apigee API hub. + +See the [Cloud API Registry API client library docs][javadocs] to learn how to +use this Cloud API Registry API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Cloud API Registry API uses both gRPC and HTTP/JSON for the transport layer. + +## Supported Java Versions + +Java 8 or above is required for using this client. + +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + +## Versioning + + +This library follows [Semantic Versioning](http://semver.org/). + + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://docs.cloud.google.com/api-registry/docs/overview +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-cloudapiregistry/latest/overview +[stability-image]: https://img.shields.io/badge/stability-preview-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-cloudapiregistry.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-cloudapiregistry/0.0.0 +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-cli]: https://cloud.google.com/cli +[troubleshooting]: https://github.com/googleapis/google-cloud-java/blob/main/TROUBLESHOOTING.md +[contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing +[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=cloudapiregistry.googleapis.com +[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png + +[semver]: https://semver.org/ +[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained +[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries +[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html +[g-c-j]: http://github.com/googleapis/google-cloud-java diff --git a/java-cloudapiregistry/google-cloud-cloudapiregistry-bom/pom.xml b/java-cloudapiregistry/google-cloud-cloudapiregistry-bom/pom.xml new file mode 100644 index 000000000000..41ec48073fdc --- /dev/null +++ b/java-cloudapiregistry/google-cloud-cloudapiregistry-bom/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + com.google.cloud + google-cloud-cloudapiregistry-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-pom-parent + 1.76.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Cloud API Registry API BOM + + BOM for Cloud API Registry API + + + + true + + + + + + com.google.cloud + google-cloud-cloudapiregistry + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-cloudapiregistry-v1beta + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-cloudapiregistry-v1beta + 0.0.1-SNAPSHOT + + + + diff --git a/java-cloudapiregistry/google-cloud-cloudapiregistry/pom.xml b/java-cloudapiregistry/google-cloud-cloudapiregistry/pom.xml new file mode 100644 index 000000000000..0fd987cbc6d9 --- /dev/null +++ b/java-cloudapiregistry/google-cloud-cloudapiregistry/pom.xml @@ -0,0 +1,115 @@ + + + 4.0.0 + com.google.cloud + google-cloud-cloudapiregistry + 0.0.1-SNAPSHOT + jar + Google Cloud API Registry API + Cloud API Registry API Cloud API Registry lets you discover, govern, use, and monitor Model Context Protocol (MCP) servers and tools provided by Google, or by your organization through Apigee API hub. + + com.google.cloud + google-cloud-cloudapiregistry-parent + 0.0.1-SNAPSHOT + + + google-cloud-cloudapiregistry + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + com.google.api.grpc + proto-google-cloud-cloudapiregistry-v1beta + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.api.grpc + proto-google-iam-v1 + + + org.threeten + threetenbp + + + + + com.google.api.grpc + grpc-google-common-protos + test + + + com.google.api.grpc + grpc-google-iam-v1 + test + + + junit + junit + test + + + + com.google.api.grpc + grpc-google-cloud-cloudapiregistry-v1beta + test + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + diff --git a/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/CloudApiRegistryClient.java b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/CloudApiRegistryClient.java new file mode 100644 index 000000000000..310c63a3bcd9 --- /dev/null +++ b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/CloudApiRegistryClient.java @@ -0,0 +1,1289 @@ +/* + * 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; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apiregistry.v1beta.stub.CloudApiRegistryStub; +import com.google.cloud.apiregistry.v1beta.stub.CloudApiRegistryStubSettings; +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 com.google.common.util.concurrent.MoreExecutors; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: The Cloud API Registry service provides a central registry for managing API + * Data. + * + *

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(). + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants

GetMcpServer

Gets a single McpServer.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getMcpServer(GetMcpServerRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getMcpServer(McpServerName name) + *

  • getMcpServer(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getMcpServerCallable() + *

+ *

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.

+ *
    + *
  • listMcpServers(ListMcpServersRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listMcpServers(LocationName parent) + *

  • listMcpServers(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listMcpServersPagedCallable() + *

  • listMcpServersCallable() + *

+ *

GetMcpTool

Gets a single McpTool.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getMcpTool(GetMcpToolRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getMcpTool(McpToolName name) + *

  • getMcpTool(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getMcpToolCallable() + *

+ *

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.

+ *
    + *
  • listMcpTools(ListMcpToolsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listMcpTools(McpServerName parent) + *

  • listMcpTools(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listMcpToolsPagedCallable() + *

  • listMcpToolsCallable() + *

+ *

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.

+ *
    + *
  • listLocations(ListLocationsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLocationsPagedCallable() + *

  • listLocationsCallable() + *

+ *

GetLocation

Gets information about a location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getLocation(GetLocationRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getLocationCallable() + *

+ *
+ * + *

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 UnaryCallable getMcpServerCallable() { + return stub.getMcpServerCallable(); + } + + // 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()) {
+   *   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 UnaryCallable + listMcpServersPagedCallable() { + return stub.listMcpServersPagedCallable(); + } + + // 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();
+   *   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 UnaryCallable + listMcpServersCallable() { + return stub.listMcpServersCallable(); + } + + // 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()) {
+   *   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 UnaryCallable getMcpToolCallable() { + return stub.getMcpToolCallable(); + } + + // 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()) {
+   *   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 UnaryCallable + listMcpToolsPagedCallable() { + return stub.listMcpToolsPagedCallable(); + } + + // 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();
+   *   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 UnaryCallable listMcpToolsCallable() { + return stub.listMcpToolsCallable(); + } + + // 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();
+   *   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 UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // 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();
+   *   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 UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // 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();
+   *   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 UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + @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 ListMcpServersPagedResponse + extends AbstractPagedListResponse< + ListMcpServersRequest, + ListMcpServersResponse, + McpServer, + ListMcpServersPage, + ListMcpServersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListMcpServersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListMcpServersPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListMcpServersPagedResponse(ListMcpServersPage page) { + super(page, ListMcpServersFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListMcpServersPage + extends AbstractPage< + ListMcpServersRequest, ListMcpServersResponse, McpServer, ListMcpServersPage> { + + private ListMcpServersPage( + PageContext context, + ListMcpServersResponse response) { + super(context, response); + } + + private static ListMcpServersPage createEmptyPage() { + return new ListMcpServersPage(null, null); + } + + @Override + protected ListMcpServersPage createPage( + PageContext context, + ListMcpServersResponse response) { + return new ListMcpServersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListMcpServersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListMcpServersRequest, + ListMcpServersResponse, + McpServer, + ListMcpServersPage, + ListMcpServersFixedSizeCollection> { + + private ListMcpServersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListMcpServersFixedSizeCollection createEmptyCollection() { + return new ListMcpServersFixedSizeCollection(null, 0); + } + + @Override + protected ListMcpServersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListMcpServersFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListMcpToolsPagedResponse + extends AbstractPagedListResponse< + ListMcpToolsRequest, + ListMcpToolsResponse, + McpTool, + ListMcpToolsPage, + ListMcpToolsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListMcpToolsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListMcpToolsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListMcpToolsPagedResponse(ListMcpToolsPage page) { + super(page, ListMcpToolsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListMcpToolsPage + extends AbstractPage { + + private ListMcpToolsPage( + PageContext context, + ListMcpToolsResponse response) { + super(context, response); + } + + private static ListMcpToolsPage createEmptyPage() { + return new ListMcpToolsPage(null, null); + } + + @Override + protected ListMcpToolsPage createPage( + PageContext context, + ListMcpToolsResponse response) { + return new ListMcpToolsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListMcpToolsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListMcpToolsRequest, + ListMcpToolsResponse, + McpTool, + ListMcpToolsPage, + ListMcpToolsFixedSizeCollection> { + + private ListMcpToolsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListMcpToolsFixedSizeCollection createEmptyCollection() { + return new ListMcpToolsFixedSizeCollection(null, 0); + } + + @Override + protected ListMcpToolsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListMcpToolsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/CloudApiRegistrySettings.java b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/CloudApiRegistrySettings.java new file mode 100644 index 000000000000..467e0f25dea0 --- /dev/null +++ b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/CloudApiRegistrySettings.java @@ -0,0 +1,286 @@ +/* + * 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; + +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.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.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.apiregistry.v1beta.stub.CloudApiRegistryStubSettings; +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 java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link CloudApiRegistryClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (cloudapiregistry.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 + * [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 ClientSettings { + + /** Returns the object with the settings used for calls to getMcpServer. */ + public UnaryCallSettings getMcpServerSettings() { + return ((CloudApiRegistryStubSettings) getStubSettings()).getMcpServerSettings(); + } + + /** Returns the object with the settings used for calls to listMcpServers. */ + public PagedCallSettings< + ListMcpServersRequest, ListMcpServersResponse, ListMcpServersPagedResponse> + listMcpServersSettings() { + return ((CloudApiRegistryStubSettings) getStubSettings()).listMcpServersSettings(); + } + + /** Returns the object with the settings used for calls to getMcpTool. */ + public UnaryCallSettings getMcpToolSettings() { + return ((CloudApiRegistryStubSettings) getStubSettings()).getMcpToolSettings(); + } + + /** Returns the object with the settings used for calls to listMcpTools. */ + public PagedCallSettings + listMcpToolsSettings() { + return ((CloudApiRegistryStubSettings) getStubSettings()).listMcpToolsSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((CloudApiRegistryStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((CloudApiRegistryStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final CloudApiRegistrySettings create(CloudApiRegistryStubSettings stub) + throws IOException { + return new CloudApiRegistrySettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CloudApiRegistryStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CloudApiRegistryStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CloudApiRegistryStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CloudApiRegistryStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CloudApiRegistryStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return CloudApiRegistryStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CloudApiRegistryStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudApiRegistryStubSettings.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 CloudApiRegistrySettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CloudApiRegistrySettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(CloudApiRegistryStubSettings.newBuilder(clientContext)); + } + + protected Builder(CloudApiRegistrySettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CloudApiRegistryStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(CloudApiRegistryStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(CloudApiRegistryStubSettings.newHttpJsonBuilder()); + } + + public CloudApiRegistryStubSettings.Builder getStubSettingsBuilder() { + return ((CloudApiRegistryStubSettings.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 getMcpServer. */ + public UnaryCallSettings.Builder getMcpServerSettings() { + return getStubSettingsBuilder().getMcpServerSettings(); + } + + /** Returns the builder for the settings used for calls to listMcpServers. */ + public PagedCallSettings.Builder< + ListMcpServersRequest, ListMcpServersResponse, ListMcpServersPagedResponse> + listMcpServersSettings() { + return getStubSettingsBuilder().listMcpServersSettings(); + } + + /** Returns the builder for the settings used for calls to getMcpTool. */ + public UnaryCallSettings.Builder getMcpToolSettings() { + return getStubSettingsBuilder().getMcpToolSettings(); + } + + /** Returns the builder for the settings used for calls to listMcpTools. */ + public PagedCallSettings.Builder< + ListMcpToolsRequest, ListMcpToolsResponse, ListMcpToolsPagedResponse> + listMcpToolsSettings() { + return getStubSettingsBuilder().listMcpToolsSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + @Override + public CloudApiRegistrySettings build() throws IOException { + return new CloudApiRegistrySettings(this); + } + } +} diff --git a/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/gapic_metadata.json b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/gapic_metadata.json new file mode 100644 index 000000000000..b9ae741f8a48 --- /dev/null +++ b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/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.cloud.apiregistry.v1beta", + "libraryPackage": "com.google.cloud.apiregistry.v1beta", + "services": { + "CloudApiRegistry": { + "clients": { + "grpc": { + "libraryClient": "CloudApiRegistryClient", + "rpcs": { + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetMcpServer": { + "methods": ["getMcpServer", "getMcpServer", "getMcpServer", "getMcpServerCallable"] + }, + "GetMcpTool": { + "methods": ["getMcpTool", "getMcpTool", "getMcpTool", "getMcpToolCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListMcpServers": { + "methods": ["listMcpServers", "listMcpServers", "listMcpServers", "listMcpServersPagedCallable", "listMcpServersCallable"] + }, + "ListMcpTools": { + "methods": ["listMcpTools", "listMcpTools", "listMcpTools", "listMcpToolsPagedCallable", "listMcpToolsCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/package-info.java b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/package-info.java new file mode 100644 index 000000000000..f5ea6234b052 --- /dev/null +++ b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/package-info.java @@ -0,0 +1,45 @@ +/* + * 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. + */ + +/** + * A client to Cloud API Registry API + * + *

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: + * + *

{@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. + * + *

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 getMcpServerCallable() { + throw new UnsupportedOperationException("Not implemented: getMcpServerCallable()"); + } + + public UnaryCallable + listMcpServersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listMcpServersPagedCallable()"); + } + + public UnaryCallable listMcpServersCallable() { + throw new UnsupportedOperationException("Not implemented: listMcpServersCallable()"); + } + + public UnaryCallable getMcpToolCallable() { + throw new UnsupportedOperationException("Not implemented: getMcpToolCallable()"); + } + + public UnaryCallable listMcpToolsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listMcpToolsPagedCallable()"); + } + + public UnaryCallable listMcpToolsCallable() { + throw new UnsupportedOperationException("Not implemented: listMcpToolsCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/stub/CloudApiRegistryStubSettings.java b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/stub/CloudApiRegistryStubSettings.java new file mode 100644 index 000000000000..20cb4012e9c1 --- /dev/null +++ b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/stub/CloudApiRegistryStubSettings.java @@ -0,0 +1,656 @@ +/* + * 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.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.core.ObsoleteApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.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.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 com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link CloudApiRegistryStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (cloudapiregistry.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 + * [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
+ * 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 { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings getMcpServerSettings; + private final PagedCallSettings< + ListMcpServersRequest, ListMcpServersResponse, ListMcpServersPagedResponse> + listMcpServersSettings; + private final UnaryCallSettings getMcpToolSettings; + private final PagedCallSettings< + ListMcpToolsRequest, ListMcpToolsResponse, ListMcpToolsPagedResponse> + listMcpToolsSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + + private static final PagedListDescriptor + LIST_MCP_SERVERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListMcpServersRequest injectToken(ListMcpServersRequest payload, String token) { + return ListMcpServersRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListMcpServersRequest injectPageSize( + ListMcpServersRequest payload, int pageSize) { + return ListMcpServersRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListMcpServersRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListMcpServersResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListMcpServersResponse payload) { + return payload.getMcpServersList(); + } + }; + + private static final PagedListDescriptor + LIST_MCP_TOOLS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListMcpToolsRequest injectToken(ListMcpToolsRequest payload, String token) { + return ListMcpToolsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListMcpToolsRequest injectPageSize(ListMcpToolsRequest payload, int pageSize) { + return ListMcpToolsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListMcpToolsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListMcpToolsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListMcpToolsResponse payload) { + return payload.getMcpToolsList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListMcpServersRequest, ListMcpServersResponse, ListMcpServersPagedResponse> + LIST_MCP_SERVERS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListMcpServersRequest, ListMcpServersResponse, ListMcpServersPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListMcpServersRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_MCP_SERVERS_PAGE_STR_DESC, request, context); + return ListMcpServersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListMcpToolsRequest, ListMcpToolsResponse, ListMcpToolsPagedResponse> + LIST_MCP_TOOLS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListMcpToolsRequest, ListMcpToolsResponse, ListMcpToolsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListMcpToolsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_MCP_TOOLS_PAGE_STR_DESC, request, context); + return ListMcpToolsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to getMcpServer. */ + public UnaryCallSettings getMcpServerSettings() { + return getMcpServerSettings; + } + + /** Returns the object with the settings used for calls to listMcpServers. */ + public PagedCallSettings< + ListMcpServersRequest, ListMcpServersResponse, ListMcpServersPagedResponse> + listMcpServersSettings() { + return listMcpServersSettings; + } + + /** Returns the object with the settings used for calls to getMcpTool. */ + public UnaryCallSettings getMcpToolSettings() { + return getMcpToolSettings; + } + + /** Returns the object with the settings used for calls to listMcpTools. */ + public PagedCallSettings + listMcpToolsSettings() { + return listMcpToolsSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + public CloudApiRegistryStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCloudApiRegistryStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonCloudApiRegistryStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "cloudapiregistry"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "cloudapiregistry.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "cloudapiregistry.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CloudApiRegistryStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CloudApiRegistryStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudApiRegistryStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected CloudApiRegistryStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getMcpServerSettings = settingsBuilder.getMcpServerSettings().build(); + listMcpServersSettings = settingsBuilder.listMcpServersSettings().build(); + getMcpToolSettings = settingsBuilder.getMcpToolSettings().build(); + listMcpToolsSettings = settingsBuilder.listMcpToolsSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + } + + /** Builder for CloudApiRegistryStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder getMcpServerSettings; + private final PagedCallSettings.Builder< + ListMcpServersRequest, ListMcpServersResponse, ListMcpServersPagedResponse> + listMcpServersSettings; + private final UnaryCallSettings.Builder getMcpToolSettings; + private final PagedCallSettings.Builder< + ListMcpToolsRequest, ListMcpToolsResponse, ListMcpToolsPagedResponse> + listMcpToolsSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelayDuration(Duration.ofMillis(10000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getMcpServerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listMcpServersSettings = PagedCallSettings.newBuilder(LIST_MCP_SERVERS_PAGE_STR_FACT); + getMcpToolSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listMcpToolsSettings = PagedCallSettings.newBuilder(LIST_MCP_TOOLS_PAGE_STR_FACT); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getMcpServerSettings, + listMcpServersSettings, + getMcpToolSettings, + listMcpToolsSettings, + listLocationsSettings, + getLocationSettings); + initDefaults(this); + } + + protected Builder(CloudApiRegistryStubSettings settings) { + super(settings); + + getMcpServerSettings = settings.getMcpServerSettings.toBuilder(); + listMcpServersSettings = settings.listMcpServersSettings.toBuilder(); + getMcpToolSettings = settings.getMcpToolSettings.toBuilder(); + listMcpToolsSettings = settings.listMcpToolsSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getMcpServerSettings, + listMcpServersSettings, + getMcpToolSettings, + listMcpToolsSettings, + listLocationsSettings, + getLocationSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getMcpServerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listMcpServersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getMcpToolSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listMcpToolsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + return builder; + } + + /** + * 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(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to getMcpServer. */ + public UnaryCallSettings.Builder getMcpServerSettings() { + return getMcpServerSettings; + } + + /** Returns the builder for the settings used for calls to listMcpServers. */ + public PagedCallSettings.Builder< + ListMcpServersRequest, ListMcpServersResponse, ListMcpServersPagedResponse> + listMcpServersSettings() { + return listMcpServersSettings; + } + + /** Returns the builder for the settings used for calls to getMcpTool. */ + public UnaryCallSettings.Builder getMcpToolSettings() { + return getMcpToolSettings; + } + + /** Returns the builder for the settings used for calls to listMcpTools. */ + public PagedCallSettings.Builder< + ListMcpToolsRequest, ListMcpToolsResponse, ListMcpToolsPagedResponse> + listMcpToolsSettings() { + return listMcpToolsSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + @Override + public CloudApiRegistryStubSettings build() throws IOException { + return new CloudApiRegistryStubSettings(this); + } + } +} diff --git a/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/stub/GrpcCloudApiRegistryCallableFactory.java b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/stub/GrpcCloudApiRegistryCallableFactory.java new file mode 100644 index 000000000000..9ea7bf932d19 --- /dev/null +++ b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/stub/GrpcCloudApiRegistryCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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 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 CloudApiRegistry service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcCloudApiRegistryCallableFactory 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-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/stub/GrpcCloudApiRegistryStub.java b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/stub/GrpcCloudApiRegistryStub.java new file mode 100644 index 000000000000..180150aefe29 --- /dev/null +++ b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/stub/GrpcCloudApiRegistryStub.java @@ -0,0 +1,359 @@ +/* + * 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.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.RequestParamsBuilder; +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 com.google.longrunning.stub.GrpcOperationsStub; +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 CloudApiRegistry service API. + * + *

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 + getMcpServerMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apiregistry.v1beta.CloudApiRegistry/GetMcpServer") + .setRequestMarshaller(ProtoUtils.marshaller(GetMcpServerRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(McpServer.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listMcpServersMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apiregistry.v1beta.CloudApiRegistry/ListMcpServers") + .setRequestMarshaller( + ProtoUtils.marshaller(ListMcpServersRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListMcpServersResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getMcpToolMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apiregistry.v1beta.CloudApiRegistry/GetMcpTool") + .setRequestMarshaller(ProtoUtils.marshaller(GetMcpToolRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(McpTool.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listMcpToolsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apiregistry.v1beta.CloudApiRegistry/ListMcpTools") + .setRequestMarshaller(ProtoUtils.marshaller(ListMcpToolsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListMcpToolsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable getMcpServerCallable; + private final UnaryCallable listMcpServersCallable; + private final UnaryCallable + listMcpServersPagedCallable; + private final UnaryCallable getMcpToolCallable; + private final UnaryCallable listMcpToolsCallable; + private final UnaryCallable + listMcpToolsPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcCloudApiRegistryStub create(CloudApiRegistryStubSettings settings) + throws IOException { + return new GrpcCloudApiRegistryStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCloudApiRegistryStub create(ClientContext clientContext) + throws IOException { + return new GrpcCloudApiRegistryStub( + CloudApiRegistryStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCloudApiRegistryStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCloudApiRegistryStub( + CloudApiRegistryStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcCloudApiRegistryStub, 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 GrpcCloudApiRegistryStub( + CloudApiRegistryStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcCloudApiRegistryCallableFactory()); + } + + /** + * Constructs an instance of GrpcCloudApiRegistryStub, 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 GrpcCloudApiRegistryStub( + CloudApiRegistryStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getMcpServerTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getMcpServerMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listMcpServersTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listMcpServersMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getMcpToolTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getMcpToolMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listMcpToolsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listMcpToolsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.getMcpServerCallable = + callableFactory.createUnaryCallable( + getMcpServerTransportSettings, settings.getMcpServerSettings(), clientContext); + this.listMcpServersCallable = + callableFactory.createUnaryCallable( + listMcpServersTransportSettings, settings.listMcpServersSettings(), clientContext); + this.listMcpServersPagedCallable = + callableFactory.createPagedCallable( + listMcpServersTransportSettings, settings.listMcpServersSettings(), clientContext); + this.getMcpToolCallable = + callableFactory.createUnaryCallable( + getMcpToolTransportSettings, settings.getMcpToolSettings(), clientContext); + this.listMcpToolsCallable = + callableFactory.createUnaryCallable( + listMcpToolsTransportSettings, settings.listMcpToolsSettings(), clientContext); + this.listMcpToolsPagedCallable = + callableFactory.createPagedCallable( + listMcpToolsTransportSettings, settings.listMcpToolsSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getMcpServerCallable() { + return getMcpServerCallable; + } + + @Override + public UnaryCallable listMcpServersCallable() { + return listMcpServersCallable; + } + + @Override + public UnaryCallable + listMcpServersPagedCallable() { + return listMcpServersPagedCallable; + } + + @Override + public UnaryCallable getMcpToolCallable() { + return getMcpToolCallable; + } + + @Override + public UnaryCallable listMcpToolsCallable() { + return listMcpToolsCallable; + } + + @Override + public UnaryCallable listMcpToolsPagedCallable() { + return listMcpToolsPagedCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @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-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/stub/HttpJsonCloudApiRegistryCallableFactory.java b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/stub/HttpJsonCloudApiRegistryCallableFactory.java new file mode 100644 index 000000000000..fe02adbcafa4 --- /dev/null +++ b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/stub/HttpJsonCloudApiRegistryCallableFactory.java @@ -0,0 +1,103 @@ +/* + * 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 com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the CloudApiRegistry service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonCloudApiRegistryCallableFactory + 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-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/stub/HttpJsonCloudApiRegistryStub.java b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/stub/HttpJsonCloudApiRegistryStub.java new file mode 100644 index 000000000000..5f31b68ae096 --- /dev/null +++ b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/java/com/google/cloud/apiregistry/v1beta/stub/HttpJsonCloudApiRegistryStub.java @@ -0,0 +1,529 @@ +/* + * 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.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +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 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 CloudApiRegistry service API. + * + *

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 + getMcpServerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apiregistry.v1beta.CloudApiRegistry/GetMcpServer") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/mcpServers/*}", + 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(McpServer.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listMcpServersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apiregistry.v1beta.CloudApiRegistry/ListMcpServers") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*}/mcpServers", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListMcpServersResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getMcpToolMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apiregistry.v1beta.CloudApiRegistry/GetMcpTool") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/mcpServers/*/mcpTools/*}", + 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(McpTool.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listMcpToolsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apiregistry.v1beta.CloudApiRegistry/ListMcpTools") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*/mcpServers/*}/mcpTools", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListMcpToolsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*}/locations", + 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(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*}", + 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(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable getMcpServerCallable; + private final UnaryCallable listMcpServersCallable; + private final UnaryCallable + listMcpServersPagedCallable; + private final UnaryCallable getMcpToolCallable; + private final UnaryCallable listMcpToolsCallable; + private final UnaryCallable + listMcpToolsPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonCloudApiRegistryStub create(CloudApiRegistryStubSettings settings) + throws IOException { + return new HttpJsonCloudApiRegistryStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonCloudApiRegistryStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonCloudApiRegistryStub( + CloudApiRegistryStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonCloudApiRegistryStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonCloudApiRegistryStub( + CloudApiRegistryStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonCloudApiRegistryStub, 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 HttpJsonCloudApiRegistryStub( + CloudApiRegistryStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonCloudApiRegistryCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonCloudApiRegistryStub, 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 HttpJsonCloudApiRegistryStub( + CloudApiRegistryStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings getMcpServerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getMcpServerMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listMcpServersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMcpServersMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getMcpToolTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getMcpToolMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listMcpToolsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listMcpToolsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.getMcpServerCallable = + callableFactory.createUnaryCallable( + getMcpServerTransportSettings, settings.getMcpServerSettings(), clientContext); + this.listMcpServersCallable = + callableFactory.createUnaryCallable( + listMcpServersTransportSettings, settings.listMcpServersSettings(), clientContext); + this.listMcpServersPagedCallable = + callableFactory.createPagedCallable( + listMcpServersTransportSettings, settings.listMcpServersSettings(), clientContext); + this.getMcpToolCallable = + callableFactory.createUnaryCallable( + getMcpToolTransportSettings, settings.getMcpToolSettings(), clientContext); + this.listMcpToolsCallable = + callableFactory.createUnaryCallable( + listMcpToolsTransportSettings, settings.listMcpToolsSettings(), clientContext); + this.listMcpToolsPagedCallable = + callableFactory.createPagedCallable( + listMcpToolsTransportSettings, settings.listMcpToolsSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(getMcpServerMethodDescriptor); + methodDescriptors.add(listMcpServersMethodDescriptor); + methodDescriptors.add(getMcpToolMethodDescriptor); + methodDescriptors.add(listMcpToolsMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable getMcpServerCallable() { + return getMcpServerCallable; + } + + @Override + public UnaryCallable listMcpServersCallable() { + return listMcpServersCallable; + } + + @Override + public UnaryCallable + listMcpServersPagedCallable() { + return listMcpServersPagedCallable; + } + + @Override + public UnaryCallable getMcpToolCallable() { + return getMcpToolCallable; + } + + @Override + public UnaryCallable listMcpToolsCallable() { + return listMcpToolsCallable; + } + + @Override + public UnaryCallable listMcpToolsPagedCallable() { + return listMcpToolsPagedCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @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-cloudapiregistry/google-cloud-cloudapiregistry/src/main/resources/META-INF/native-image/com.google.cloud.apiregistry.v1beta/reflect-config.json b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/resources/META-INF/native-image/com.google.cloud.apiregistry.v1beta/reflect-config.json new file mode 100644 index 000000000000..95e91f3ddc71 --- /dev/null +++ b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/main/resources/META-INF/native-image/com.google.cloud.apiregistry.v1beta/reflect-config.json @@ -0,0 +1,1469 @@ +[ + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apiregistry.v1beta.GetMcpServerRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apiregistry.v1beta.GetMcpServerRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apiregistry.v1beta.GetMcpToolRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apiregistry.v1beta.GetMcpToolRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apiregistry.v1beta.ListMcpServersRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apiregistry.v1beta.ListMcpServersRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apiregistry.v1beta.ListMcpServersResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apiregistry.v1beta.ListMcpServersResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apiregistry.v1beta.McpServer", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apiregistry.v1beta.McpServer$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apiregistry.v1beta.McpTool", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apiregistry.v1beta.McpTool$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apiregistry.v1beta.State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$Edition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnumType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$FieldPresence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$JsonFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$MessageEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$RepeatedFieldEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Utf8Validation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.ListValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.ListValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.NullValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Struct", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Struct$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-cloudapiregistry/google-cloud-cloudapiregistry/src/test/java/com/google/cloud/apiregistry/v1beta/CloudApiRegistryClientHttpJsonTest.java b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/test/java/com/google/cloud/apiregistry/v1beta/CloudApiRegistryClientHttpJsonTest.java new file mode 100644 index 000000000000..8e5ae0ef52fd --- /dev/null +++ b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/test/java/com/google/cloud/apiregistry/v1beta/CloudApiRegistryClientHttpJsonTest.java @@ -0,0 +1,623 @@ +/* + * 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; + +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.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.apiregistry.v1beta.stub.HttpJsonCloudApiRegistryStub; +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 com.google.common.collect.Lists; +import com.google.protobuf.Any; +import com.google.protobuf.Struct; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class CloudApiRegistryClientHttpJsonTest { + private static MockHttpService mockService; + private static CloudApiRegistryClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonCloudApiRegistryStub.getMethodDescriptors(), + CloudApiRegistrySettings.getDefaultEndpoint()); + CloudApiRegistrySettings settings = + CloudApiRegistrySettings.newHttpJsonBuilder() + .setTransportChannelProvider( + CloudApiRegistrySettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudApiRegistryClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void getMcpServerTest() throws Exception { + McpServer expectedResponse = + McpServer.newBuilder() + .setName( + McpServerName.ofProjectLocationMcpServerName( + "[PROJECT]", "[LOCATION]", "[MCP_SERVER]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllUrls(new ArrayList()) + .setCapabilities(Struct.newBuilder().build()) + .setState(State.forNumber(0)) + .build(); + mockService.addResponse(expectedResponse); + + McpServerName name = + McpServerName.ofProjectLocationMcpServerName("[PROJECT]", "[LOCATION]", "[MCP_SERVER]"); + + McpServer actualResponse = client.getMcpServer(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getMcpServerExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + McpServerName name = + McpServerName.ofProjectLocationMcpServerName("[PROJECT]", "[LOCATION]", "[MCP_SERVER]"); + client.getMcpServer(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMcpServerTest2() throws Exception { + McpServer expectedResponse = + McpServer.newBuilder() + .setName( + McpServerName.ofProjectLocationMcpServerName( + "[PROJECT]", "[LOCATION]", "[MCP_SERVER]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllUrls(new ArrayList()) + .setCapabilities(Struct.newBuilder().build()) + .setState(State.forNumber(0)) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-5974/locations/location-5974/mcpServers/mcpServer-5974"; + + McpServer actualResponse = client.getMcpServer(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getMcpServerExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-5974/locations/location-5974/mcpServers/mcpServer-5974"; + client.getMcpServer(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMcpServersTest() throws Exception { + McpServer responsesElement = McpServer.newBuilder().build(); + ListMcpServersResponse expectedResponse = + ListMcpServersResponse.newBuilder() + .setNextPageToken("") + .addAllMcpServers(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListMcpServersPagedResponse pagedListResponse = client.listMcpServers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMcpServersList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listMcpServersExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listMcpServers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMcpServersTest2() throws Exception { + McpServer responsesElement = McpServer.newBuilder().build(); + ListMcpServersResponse expectedResponse = + ListMcpServersResponse.newBuilder() + .setNextPageToken("") + .addAllMcpServers(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListMcpServersPagedResponse pagedListResponse = client.listMcpServers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMcpServersList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listMcpServersExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listMcpServers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMcpToolTest() throws Exception { + McpTool expectedResponse = + McpTool.newBuilder() + .setName( + McpToolName.ofProjectLocationMcpServerMcpToolName( + "[PROJECT]", "[LOCATION]", "[MCP_SERVER]", "[MCP_TOOL]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllMcpServerUrls(new ArrayList()) + .setInputSchema(Struct.newBuilder().build()) + .setOutputSchema(Struct.newBuilder().build()) + .setAnnotations(Struct.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + McpToolName name = + McpToolName.ofProjectLocationMcpServerMcpToolName( + "[PROJECT]", "[LOCATION]", "[MCP_SERVER]", "[MCP_TOOL]"); + + McpTool actualResponse = client.getMcpTool(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getMcpToolExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + McpToolName name = + McpToolName.ofProjectLocationMcpServerMcpToolName( + "[PROJECT]", "[LOCATION]", "[MCP_SERVER]", "[MCP_TOOL]"); + client.getMcpTool(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMcpToolTest2() throws Exception { + McpTool expectedResponse = + McpTool.newBuilder() + .setName( + McpToolName.ofProjectLocationMcpServerMcpToolName( + "[PROJECT]", "[LOCATION]", "[MCP_SERVER]", "[MCP_TOOL]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllMcpServerUrls(new ArrayList()) + .setInputSchema(Struct.newBuilder().build()) + .setOutputSchema(Struct.newBuilder().build()) + .setAnnotations(Struct.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-9387/locations/location-9387/mcpServers/mcpServer-9387/mcpTools/mcpTool-9387"; + + McpTool actualResponse = client.getMcpTool(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getMcpToolExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-9387/locations/location-9387/mcpServers/mcpServer-9387/mcpTools/mcpTool-9387"; + client.getMcpTool(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMcpToolsTest() throws Exception { + McpTool responsesElement = McpTool.newBuilder().build(); + ListMcpToolsResponse expectedResponse = + ListMcpToolsResponse.newBuilder() + .setNextPageToken("") + .addAllMcpTools(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + McpServerName parent = + McpServerName.ofProjectLocationMcpServerName("[PROJECT]", "[LOCATION]", "[MCP_SERVER]"); + + ListMcpToolsPagedResponse pagedListResponse = client.listMcpTools(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMcpToolsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listMcpToolsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + McpServerName parent = + McpServerName.ofProjectLocationMcpServerName("[PROJECT]", "[LOCATION]", "[MCP_SERVER]"); + client.listMcpTools(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMcpToolsTest2() throws Exception { + McpTool responsesElement = McpTool.newBuilder().build(); + ListMcpToolsResponse expectedResponse = + ListMcpToolsResponse.newBuilder() + .setNextPageToken("") + .addAllMcpTools(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-9353/locations/location-9353/mcpServers/mcpServer-9353"; + + ListMcpToolsPagedResponse pagedListResponse = client.listMcpTools(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMcpToolsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listMcpToolsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-9353/locations/location-9353/mcpServers/mcpServer-9353"; + client.listMcpTools(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-cloudapiregistry/google-cloud-cloudapiregistry/src/test/java/com/google/cloud/apiregistry/v1beta/CloudApiRegistryClientTest.java b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/test/java/com/google/cloud/apiregistry/v1beta/CloudApiRegistryClientTest.java new file mode 100644 index 000000000000..116321ced162 --- /dev/null +++ b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/test/java/com/google/cloud/apiregistry/v1beta/CloudApiRegistryClientTest.java @@ -0,0 +1,564 @@ +/* + * 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; + +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.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +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 com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Struct; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class CloudApiRegistryClientTest { + private static MockCloudApiRegistry mockCloudApiRegistry; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private CloudApiRegistryClient client; + + @BeforeClass + public static void startStaticServer() { + mockCloudApiRegistry = new MockCloudApiRegistry(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockCloudApiRegistry, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + CloudApiRegistrySettings settings = + CloudApiRegistrySettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudApiRegistryClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getMcpServerTest() throws Exception { + McpServer expectedResponse = + McpServer.newBuilder() + .setName( + McpServerName.ofProjectLocationMcpServerName( + "[PROJECT]", "[LOCATION]", "[MCP_SERVER]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllUrls(new ArrayList()) + .setCapabilities(Struct.newBuilder().build()) + .setState(State.forNumber(0)) + .build(); + mockCloudApiRegistry.addResponse(expectedResponse); + + McpServerName name = + McpServerName.ofProjectLocationMcpServerName("[PROJECT]", "[LOCATION]", "[MCP_SERVER]"); + + McpServer actualResponse = client.getMcpServer(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudApiRegistry.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetMcpServerRequest actualRequest = ((GetMcpServerRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getMcpServerExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudApiRegistry.addException(exception); + + try { + McpServerName name = + McpServerName.ofProjectLocationMcpServerName("[PROJECT]", "[LOCATION]", "[MCP_SERVER]"); + client.getMcpServer(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMcpServerTest2() throws Exception { + McpServer expectedResponse = + McpServer.newBuilder() + .setName( + McpServerName.ofProjectLocationMcpServerName( + "[PROJECT]", "[LOCATION]", "[MCP_SERVER]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllUrls(new ArrayList()) + .setCapabilities(Struct.newBuilder().build()) + .setState(State.forNumber(0)) + .build(); + mockCloudApiRegistry.addResponse(expectedResponse); + + String name = "name3373707"; + + McpServer actualResponse = client.getMcpServer(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudApiRegistry.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetMcpServerRequest actualRequest = ((GetMcpServerRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getMcpServerExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudApiRegistry.addException(exception); + + try { + String name = "name3373707"; + client.getMcpServer(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMcpServersTest() throws Exception { + McpServer responsesElement = McpServer.newBuilder().build(); + ListMcpServersResponse expectedResponse = + ListMcpServersResponse.newBuilder() + .setNextPageToken("") + .addAllMcpServers(Arrays.asList(responsesElement)) + .build(); + mockCloudApiRegistry.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListMcpServersPagedResponse pagedListResponse = client.listMcpServers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMcpServersList().get(0), resources.get(0)); + + List actualRequests = mockCloudApiRegistry.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListMcpServersRequest actualRequest = ((ListMcpServersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listMcpServersExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudApiRegistry.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listMcpServers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMcpServersTest2() throws Exception { + McpServer responsesElement = McpServer.newBuilder().build(); + ListMcpServersResponse expectedResponse = + ListMcpServersResponse.newBuilder() + .setNextPageToken("") + .addAllMcpServers(Arrays.asList(responsesElement)) + .build(); + mockCloudApiRegistry.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListMcpServersPagedResponse pagedListResponse = client.listMcpServers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMcpServersList().get(0), resources.get(0)); + + List actualRequests = mockCloudApiRegistry.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListMcpServersRequest actualRequest = ((ListMcpServersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listMcpServersExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudApiRegistry.addException(exception); + + try { + String parent = "parent-995424086"; + client.listMcpServers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMcpToolTest() throws Exception { + McpTool expectedResponse = + McpTool.newBuilder() + .setName( + McpToolName.ofProjectLocationMcpServerMcpToolName( + "[PROJECT]", "[LOCATION]", "[MCP_SERVER]", "[MCP_TOOL]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllMcpServerUrls(new ArrayList()) + .setInputSchema(Struct.newBuilder().build()) + .setOutputSchema(Struct.newBuilder().build()) + .setAnnotations(Struct.newBuilder().build()) + .build(); + mockCloudApiRegistry.addResponse(expectedResponse); + + McpToolName name = + McpToolName.ofProjectLocationMcpServerMcpToolName( + "[PROJECT]", "[LOCATION]", "[MCP_SERVER]", "[MCP_TOOL]"); + + McpTool actualResponse = client.getMcpTool(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudApiRegistry.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetMcpToolRequest actualRequest = ((GetMcpToolRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getMcpToolExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudApiRegistry.addException(exception); + + try { + McpToolName name = + McpToolName.ofProjectLocationMcpServerMcpToolName( + "[PROJECT]", "[LOCATION]", "[MCP_SERVER]", "[MCP_TOOL]"); + client.getMcpTool(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getMcpToolTest2() throws Exception { + McpTool expectedResponse = + McpTool.newBuilder() + .setName( + McpToolName.ofProjectLocationMcpServerMcpToolName( + "[PROJECT]", "[LOCATION]", "[MCP_SERVER]", "[MCP_TOOL]") + .toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .addAllMcpServerUrls(new ArrayList()) + .setInputSchema(Struct.newBuilder().build()) + .setOutputSchema(Struct.newBuilder().build()) + .setAnnotations(Struct.newBuilder().build()) + .build(); + mockCloudApiRegistry.addResponse(expectedResponse); + + String name = "name3373707"; + + McpTool actualResponse = client.getMcpTool(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudApiRegistry.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetMcpToolRequest actualRequest = ((GetMcpToolRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getMcpToolExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudApiRegistry.addException(exception); + + try { + String name = "name3373707"; + client.getMcpTool(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMcpToolsTest() throws Exception { + McpTool responsesElement = McpTool.newBuilder().build(); + ListMcpToolsResponse expectedResponse = + ListMcpToolsResponse.newBuilder() + .setNextPageToken("") + .addAllMcpTools(Arrays.asList(responsesElement)) + .build(); + mockCloudApiRegistry.addResponse(expectedResponse); + + McpServerName parent = + McpServerName.ofProjectLocationMcpServerName("[PROJECT]", "[LOCATION]", "[MCP_SERVER]"); + + ListMcpToolsPagedResponse pagedListResponse = client.listMcpTools(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMcpToolsList().get(0), resources.get(0)); + + List actualRequests = mockCloudApiRegistry.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListMcpToolsRequest actualRequest = ((ListMcpToolsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listMcpToolsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudApiRegistry.addException(exception); + + try { + McpServerName parent = + McpServerName.ofProjectLocationMcpServerName("[PROJECT]", "[LOCATION]", "[MCP_SERVER]"); + client.listMcpTools(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMcpToolsTest2() throws Exception { + McpTool responsesElement = McpTool.newBuilder().build(); + ListMcpToolsResponse expectedResponse = + ListMcpToolsResponse.newBuilder() + .setNextPageToken("") + .addAllMcpTools(Arrays.asList(responsesElement)) + .build(); + mockCloudApiRegistry.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListMcpToolsPagedResponse pagedListResponse = client.listMcpTools(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMcpToolsList().get(0), resources.get(0)); + + List actualRequests = mockCloudApiRegistry.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListMcpToolsRequest actualRequest = ((ListMcpToolsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listMcpToolsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudApiRegistry.addException(exception); + + try { + String parent = "parent-995424086"; + client.listMcpTools(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-cloudapiregistry/google-cloud-cloudapiregistry/src/test/java/com/google/cloud/apiregistry/v1beta/MockCloudApiRegistry.java b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/test/java/com/google/cloud/apiregistry/v1beta/MockCloudApiRegistry.java new file mode 100644 index 000000000000..de872fb02c8f --- /dev/null +++ b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/test/java/com/google/cloud/apiregistry/v1beta/MockCloudApiRegistry.java @@ -0,0 +1,59 @@ +/* + * 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; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockCloudApiRegistry implements MockGrpcService { + private final MockCloudApiRegistryImpl serviceImpl; + + public MockCloudApiRegistry() { + serviceImpl = new MockCloudApiRegistryImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-cloudapiregistry/google-cloud-cloudapiregistry/src/test/java/com/google/cloud/apiregistry/v1beta/MockCloudApiRegistryImpl.java b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/test/java/com/google/cloud/apiregistry/v1beta/MockCloudApiRegistryImpl.java new file mode 100644 index 000000000000..f92167ad32dd --- /dev/null +++ b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/test/java/com/google/cloud/apiregistry/v1beta/MockCloudApiRegistryImpl.java @@ -0,0 +1,143 @@ +/* + * 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; + +import com.google.api.core.BetaApi; +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryGrpc.CloudApiRegistryImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockCloudApiRegistryImpl extends CloudApiRegistryImplBase { + private List requests; + private Queue responses; + + public MockCloudApiRegistryImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void getMcpServer( + GetMcpServerRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof McpServer) { + requests.add(request); + responseObserver.onNext(((McpServer) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetMcpServer, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + McpServer.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listMcpServers( + ListMcpServersRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListMcpServersResponse) { + requests.add(request); + responseObserver.onNext(((ListMcpServersResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListMcpServers, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListMcpServersResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getMcpTool(GetMcpToolRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof McpTool) { + requests.add(request); + responseObserver.onNext(((McpTool) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetMcpTool, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + McpTool.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listMcpTools( + ListMcpToolsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListMcpToolsResponse) { + requests.add(request); + responseObserver.onNext(((ListMcpToolsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListMcpTools, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListMcpToolsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-cloudapiregistry/google-cloud-cloudapiregistry/src/test/java/com/google/cloud/apiregistry/v1beta/MockLocations.java b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/test/java/com/google/cloud/apiregistry/v1beta/MockLocations.java new file mode 100644 index 000000000000..063708b129f1 --- /dev/null +++ b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/test/java/com/google/cloud/apiregistry/v1beta/MockLocations.java @@ -0,0 +1,59 @@ +/* + * 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; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-cloudapiregistry/google-cloud-cloudapiregistry/src/test/java/com/google/cloud/apiregistry/v1beta/MockLocationsImpl.java b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/test/java/com/google/cloud/apiregistry/v1beta/MockLocationsImpl.java new file mode 100644 index 000000000000..c277cf507283 --- /dev/null +++ b/java-cloudapiregistry/google-cloud-cloudapiregistry/src/test/java/com/google/cloud/apiregistry/v1beta/MockLocationsImpl.java @@ -0,0 +1,105 @@ +/* + * 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; + +import com.google.api.core.BetaApi; +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 com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-cloudapiregistry/grpc-google-cloud-cloudapiregistry-v1beta/pom.xml b/java-cloudapiregistry/grpc-google-cloud-cloudapiregistry-v1beta/pom.xml new file mode 100644 index 000000000000..3bd7f02499a2 --- /dev/null +++ b/java-cloudapiregistry/grpc-google-cloud-cloudapiregistry-v1beta/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-cloudapiregistry-v1beta + 0.0.1-SNAPSHOT + grpc-google-cloud-cloudapiregistry-v1beta + GRPC library for google-cloud-cloudapiregistry + + com.google.cloud + google-cloud-cloudapiregistry-parent + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-cloudapiregistry-v1beta + + + com.google.guava + guava + + + diff --git a/java-cloudapiregistry/grpc-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/CloudApiRegistryGrpc.java b/java-cloudapiregistry/grpc-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/CloudApiRegistryGrpc.java new file mode 100644 index 000000000000..7723152df8ac --- /dev/null +++ b/java-cloudapiregistry/grpc-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/CloudApiRegistryGrpc.java @@ -0,0 +1,830 @@ +/* + * 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; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * The Cloud API Registry service provides a central registry for managing API
+ * Data.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class CloudApiRegistryGrpc { + + private CloudApiRegistryGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.apiregistry.v1beta.CloudApiRegistry"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apiregistry.v1beta.GetMcpServerRequest, + com.google.cloud.apiregistry.v1beta.McpServer> + getGetMcpServerMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetMcpServer", + requestType = com.google.cloud.apiregistry.v1beta.GetMcpServerRequest.class, + responseType = com.google.cloud.apiregistry.v1beta.McpServer.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apiregistry.v1beta.GetMcpServerRequest, + com.google.cloud.apiregistry.v1beta.McpServer> + getGetMcpServerMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apiregistry.v1beta.GetMcpServerRequest, + com.google.cloud.apiregistry.v1beta.McpServer> + getGetMcpServerMethod; + if ((getGetMcpServerMethod = CloudApiRegistryGrpc.getGetMcpServerMethod) == null) { + synchronized (CloudApiRegistryGrpc.class) { + if ((getGetMcpServerMethod = CloudApiRegistryGrpc.getGetMcpServerMethod) == null) { + CloudApiRegistryGrpc.getGetMcpServerMethod = + getGetMcpServerMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetMcpServer")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apiregistry.v1beta.GetMcpServerRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apiregistry.v1beta.McpServer.getDefaultInstance())) + .setSchemaDescriptor( + new CloudApiRegistryMethodDescriptorSupplier("GetMcpServer")) + .build(); + } + } + } + return getGetMcpServerMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apiregistry.v1beta.ListMcpServersRequest, + com.google.cloud.apiregistry.v1beta.ListMcpServersResponse> + getListMcpServersMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListMcpServers", + requestType = com.google.cloud.apiregistry.v1beta.ListMcpServersRequest.class, + responseType = com.google.cloud.apiregistry.v1beta.ListMcpServersResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apiregistry.v1beta.ListMcpServersRequest, + com.google.cloud.apiregistry.v1beta.ListMcpServersResponse> + getListMcpServersMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apiregistry.v1beta.ListMcpServersRequest, + com.google.cloud.apiregistry.v1beta.ListMcpServersResponse> + getListMcpServersMethod; + if ((getListMcpServersMethod = CloudApiRegistryGrpc.getListMcpServersMethod) == null) { + synchronized (CloudApiRegistryGrpc.class) { + if ((getListMcpServersMethod = CloudApiRegistryGrpc.getListMcpServersMethod) == null) { + CloudApiRegistryGrpc.getListMcpServersMethod = + getListMcpServersMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListMcpServers")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apiregistry.v1beta.ListMcpServersRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apiregistry.v1beta.ListMcpServersResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudApiRegistryMethodDescriptorSupplier("ListMcpServers")) + .build(); + } + } + } + return getListMcpServersMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apiregistry.v1beta.GetMcpToolRequest, + com.google.cloud.apiregistry.v1beta.McpTool> + getGetMcpToolMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetMcpTool", + requestType = com.google.cloud.apiregistry.v1beta.GetMcpToolRequest.class, + responseType = com.google.cloud.apiregistry.v1beta.McpTool.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apiregistry.v1beta.GetMcpToolRequest, + com.google.cloud.apiregistry.v1beta.McpTool> + getGetMcpToolMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apiregistry.v1beta.GetMcpToolRequest, + com.google.cloud.apiregistry.v1beta.McpTool> + getGetMcpToolMethod; + if ((getGetMcpToolMethod = CloudApiRegistryGrpc.getGetMcpToolMethod) == null) { + synchronized (CloudApiRegistryGrpc.class) { + if ((getGetMcpToolMethod = CloudApiRegistryGrpc.getGetMcpToolMethod) == null) { + CloudApiRegistryGrpc.getGetMcpToolMethod = + getGetMcpToolMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetMcpTool")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apiregistry.v1beta.GetMcpToolRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apiregistry.v1beta.McpTool.getDefaultInstance())) + .setSchemaDescriptor( + new CloudApiRegistryMethodDescriptorSupplier("GetMcpTool")) + .build(); + } + } + } + return getGetMcpToolMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest, + com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse> + getListMcpToolsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListMcpTools", + requestType = com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest.class, + responseType = com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest, + com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse> + getListMcpToolsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest, + com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse> + getListMcpToolsMethod; + if ((getListMcpToolsMethod = CloudApiRegistryGrpc.getListMcpToolsMethod) == null) { + synchronized (CloudApiRegistryGrpc.class) { + if ((getListMcpToolsMethod = CloudApiRegistryGrpc.getListMcpToolsMethod) == null) { + CloudApiRegistryGrpc.getListMcpToolsMethod = + getListMcpToolsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListMcpTools")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudApiRegistryMethodDescriptorSupplier("ListMcpTools")) + .build(); + } + } + } + return getListMcpToolsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static CloudApiRegistryStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudApiRegistryStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudApiRegistryStub(channel, callOptions); + } + }; + return CloudApiRegistryStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static CloudApiRegistryBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudApiRegistryBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudApiRegistryBlockingV2Stub(channel, callOptions); + } + }; + return CloudApiRegistryBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CloudApiRegistryBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudApiRegistryBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudApiRegistryBlockingStub(channel, callOptions); + } + }; + return CloudApiRegistryBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static CloudApiRegistryFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudApiRegistryFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudApiRegistryFutureStub(channel, callOptions); + } + }; + return CloudApiRegistryFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * The Cloud API Registry service provides a central registry for managing API
+   * Data.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Gets a single McpServer.
+     * 
+ */ + default void getMcpServer( + com.google.cloud.apiregistry.v1beta.GetMcpServerRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetMcpServerMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists McpServers in a given Project.
+     * 
+ */ + default void listMcpServers( + com.google.cloud.apiregistry.v1beta.ListMcpServersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListMcpServersMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a single McpTool.
+     * 
+ */ + default void getMcpTool( + com.google.cloud.apiregistry.v1beta.GetMcpToolRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetMcpToolMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists McpTools in a given McpServer.
+     * 
+ */ + default void listMcpTools( + com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListMcpToolsMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service CloudApiRegistry. + * + *
+   * The Cloud API Registry service provides a central registry for managing API
+   * Data.
+   * 
+ */ + public abstract static class CloudApiRegistryImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return CloudApiRegistryGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service CloudApiRegistry. + * + *
+   * The Cloud API Registry service provides a central registry for managing API
+   * Data.
+   * 
+ */ + public static final class CloudApiRegistryStub + extends io.grpc.stub.AbstractAsyncStub { + private CloudApiRegistryStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudApiRegistryStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudApiRegistryStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets a single McpServer.
+     * 
+ */ + public void getMcpServer( + com.google.cloud.apiregistry.v1beta.GetMcpServerRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetMcpServerMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists McpServers in a given Project.
+     * 
+ */ + public void listMcpServers( + com.google.cloud.apiregistry.v1beta.ListMcpServersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListMcpServersMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a single McpTool.
+     * 
+ */ + public void getMcpTool( + com.google.cloud.apiregistry.v1beta.GetMcpToolRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetMcpToolMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists McpTools in a given McpServer.
+     * 
+ */ + public void listMcpTools( + com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListMcpToolsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service CloudApiRegistry. + * + *
+   * The Cloud API Registry service provides a central registry for managing API
+   * Data.
+   * 
+ */ + public static final class CloudApiRegistryBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private CloudApiRegistryBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudApiRegistryBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudApiRegistryBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Gets a single McpServer.
+     * 
+ */ + public com.google.cloud.apiregistry.v1beta.McpServer getMcpServer( + com.google.cloud.apiregistry.v1beta.GetMcpServerRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetMcpServerMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists McpServers in a given Project.
+     * 
+ */ + public com.google.cloud.apiregistry.v1beta.ListMcpServersResponse listMcpServers( + com.google.cloud.apiregistry.v1beta.ListMcpServersRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListMcpServersMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a single McpTool.
+     * 
+ */ + public com.google.cloud.apiregistry.v1beta.McpTool getMcpTool( + com.google.cloud.apiregistry.v1beta.GetMcpToolRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetMcpToolMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists McpTools in a given McpServer.
+     * 
+ */ + public com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse listMcpTools( + com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListMcpToolsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service CloudApiRegistry. + * + *
+   * The Cloud API Registry service provides a central registry for managing API
+   * Data.
+   * 
+ */ + public static final class CloudApiRegistryBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private CloudApiRegistryBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudApiRegistryBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudApiRegistryBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets a single McpServer.
+     * 
+ */ + public com.google.cloud.apiregistry.v1beta.McpServer getMcpServer( + com.google.cloud.apiregistry.v1beta.GetMcpServerRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetMcpServerMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists McpServers in a given Project.
+     * 
+ */ + public com.google.cloud.apiregistry.v1beta.ListMcpServersResponse listMcpServers( + com.google.cloud.apiregistry.v1beta.ListMcpServersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListMcpServersMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a single McpTool.
+     * 
+ */ + public com.google.cloud.apiregistry.v1beta.McpTool getMcpTool( + com.google.cloud.apiregistry.v1beta.GetMcpToolRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetMcpToolMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists McpTools in a given McpServer.
+     * 
+ */ + public com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse listMcpTools( + com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListMcpToolsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service CloudApiRegistry. + * + *
+   * The Cloud API Registry service provides a central registry for managing API
+   * Data.
+   * 
+ */ + public static final class CloudApiRegistryFutureStub + extends io.grpc.stub.AbstractFutureStub { + private CloudApiRegistryFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudApiRegistryFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudApiRegistryFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets a single McpServer.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apiregistry.v1beta.McpServer> + getMcpServer(com.google.cloud.apiregistry.v1beta.GetMcpServerRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetMcpServerMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists McpServers in a given Project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apiregistry.v1beta.ListMcpServersResponse> + listMcpServers(com.google.cloud.apiregistry.v1beta.ListMcpServersRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListMcpServersMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a single McpTool.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apiregistry.v1beta.McpTool> + getMcpTool(com.google.cloud.apiregistry.v1beta.GetMcpToolRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetMcpToolMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists McpTools in a given McpServer.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse> + listMcpTools(com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListMcpToolsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_MCP_SERVER = 0; + private static final int METHODID_LIST_MCP_SERVERS = 1; + private static final int METHODID_GET_MCP_TOOL = 2; + private static final int METHODID_LIST_MCP_TOOLS = 3; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GET_MCP_SERVER: + serviceImpl.getMcpServer( + (com.google.cloud.apiregistry.v1beta.GetMcpServerRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_MCP_SERVERS: + serviceImpl.listMcpServers( + (com.google.cloud.apiregistry.v1beta.ListMcpServersRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.apiregistry.v1beta.ListMcpServersResponse>) + responseObserver); + break; + case METHODID_GET_MCP_TOOL: + serviceImpl.getMcpTool( + (com.google.cloud.apiregistry.v1beta.GetMcpToolRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_MCP_TOOLS: + serviceImpl.listMcpTools( + (com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse>) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetMcpServerMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apiregistry.v1beta.GetMcpServerRequest, + com.google.cloud.apiregistry.v1beta.McpServer>( + service, METHODID_GET_MCP_SERVER))) + .addMethod( + getListMcpServersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apiregistry.v1beta.ListMcpServersRequest, + com.google.cloud.apiregistry.v1beta.ListMcpServersResponse>( + service, METHODID_LIST_MCP_SERVERS))) + .addMethod( + getGetMcpToolMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apiregistry.v1beta.GetMcpToolRequest, + com.google.cloud.apiregistry.v1beta.McpTool>(service, METHODID_GET_MCP_TOOL))) + .addMethod( + getListMcpToolsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest, + com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse>( + service, METHODID_LIST_MCP_TOOLS))) + .build(); + } + + private abstract static class CloudApiRegistryBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CloudApiRegistryBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.apiregistry.v1beta.ServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CloudApiRegistry"); + } + } + + private static final class CloudApiRegistryFileDescriptorSupplier + extends CloudApiRegistryBaseDescriptorSupplier { + CloudApiRegistryFileDescriptorSupplier() {} + } + + private static final class CloudApiRegistryMethodDescriptorSupplier + extends CloudApiRegistryBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + CloudApiRegistryMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (CloudApiRegistryGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CloudApiRegistryFileDescriptorSupplier()) + .addMethod(getGetMcpServerMethod()) + .addMethod(getListMcpServersMethod()) + .addMethod(getGetMcpToolMethod()) + .addMethod(getListMcpToolsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-cloudapiregistry/owlbot.py b/java-cloudapiregistry/owlbot.py new file mode 100644 index 000000000000..2ba11e6bba67 --- /dev/null +++ b/java-cloudapiregistry/owlbot.py @@ -0,0 +1,36 @@ +# 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. + +import synthtool as s +from synthtool.languages import java + + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates(monorepo=True, excludes=[ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "renovate.json", + ".gitignore" +]) \ No newline at end of file diff --git a/java-cloudapiregistry/pom.xml b/java-cloudapiregistry/pom.xml new file mode 100644 index 000000000000..afab1328ad0b --- /dev/null +++ b/java-cloudapiregistry/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + com.google.cloud + google-cloud-cloudapiregistry-parent + pom + 0.0.1-SNAPSHOT + Google Cloud API Registry API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.76.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-cloud-cloudapiregistry-parent + + + + + + com.google.cloud + google-cloud-cloudapiregistry + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-cloudapiregistry-v1beta + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-cloudapiregistry-v1beta + 0.0.1-SNAPSHOT + + + + + + + google-cloud-cloudapiregistry + grpc-google-cloud-cloudapiregistry-v1beta + proto-google-cloud-cloudapiregistry-v1beta + google-cloud-cloudapiregistry-bom + + + diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/clirr-ignored-differences.xml b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/clirr-ignored-differences.xml new file mode 100644 index 000000000000..d401b48d73cd --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/clirr-ignored-differences.xml @@ -0,0 +1,80 @@ + + + + + 7012 + com/google/cloud/apiregistry/v1beta/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/apiregistry/v1beta/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/apiregistry/v1beta/*OrBuilder + boolean has*(*) + + + + 7006 + com/google/cloud/apiregistry/v1beta/** + * getDefaultInstanceForType() + ** + + + 7006 + com/google/cloud/apiregistry/v1beta/** + * addRepeatedField(*) + ** + + + 7006 + com/google/cloud/apiregistry/v1beta/** + * clear() + ** + + + 7006 + com/google/cloud/apiregistry/v1beta/** + * clearField(*) + ** + + + 7006 + com/google/cloud/apiregistry/v1beta/** + * clearOneof(*) + ** + + + 7006 + com/google/cloud/apiregistry/v1beta/** + * clone() + ** + + + 7006 + com/google/cloud/apiregistry/v1beta/** + * mergeUnknownFields(*) + ** + + + 7006 + com/google/cloud/apiregistry/v1beta/** + * setField(*) + ** + + + 7006 + com/google/cloud/apiregistry/v1beta/** + * setRepeatedField(*) + ** + + + 7006 + com/google/cloud/apiregistry/v1beta/** + * setUnknownFields(*) + ** + + diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/pom.xml b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/pom.xml new file mode 100644 index 000000000000..5d0ed85a242d --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-cloudapiregistry-v1beta + 0.0.1-SNAPSHOT + proto-google-cloud-cloudapiregistry-v1beta + Proto library for google-cloud-cloudapiregistry + + com.google.cloud + google-cloud-cloudapiregistry-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/CommonProto.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/CommonProto.java new file mode 100644 index 000000000000..c7dae5576fbc --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/CommonProto.java @@ -0,0 +1,56 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/apiregistry/v1beta/common.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.apiregistry.v1beta; + +public final class CommonProto { + private CommonProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n,google/cloud/apiregistry/v1beta/common" + + ".proto\022\037google.cloud.apiregistry.v1beta*" + + "9\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007ENABL" + + "ED\020\001\022\014\n\010DISABLED\020\002B\344\001\n#com.google.cloud." + + "apiregistry.v1betaB\013CommonProtoP\001ZEcloud" + + ".google.com/go/apiregistry/apiv1beta/api" + + "registrypb;apiregistrypb\252\002\037Google.Cloud." + + "ApiRegistry.V1Beta\312\002\037Google\\Cloud\\ApiReg" + + "istry\\V1beta\352\002\"Google::Cloud::ApiRegistr" + + "y::V1betab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/GetMcpServerRequest.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/GetMcpServerRequest.java new file mode 100644 index 000000000000..3c633b4d523b --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/GetMcpServerRequest.java @@ -0,0 +1,649 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/apiregistry/v1beta/service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.apiregistry.v1beta; + +/** + * + * + *
+ * Message for getting a McpServer
+ * 
+ * + * Protobuf type {@code google.cloud.apiregistry.v1beta.GetMcpServerRequest} + */ +public final class GetMcpServerRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apiregistry.v1beta.GetMcpServerRequest) + GetMcpServerRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetMcpServerRequest.newBuilder() to construct. + private GetMcpServerRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetMcpServerRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetMcpServerRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_GetMcpServerRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_GetMcpServerRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apiregistry.v1beta.GetMcpServerRequest.class, + com.google.cloud.apiregistry.v1beta.GetMcpServerRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.apiregistry.v1beta.GetMcpServerRequest)) { + return super.equals(obj); + } + com.google.cloud.apiregistry.v1beta.GetMcpServerRequest other = + (com.google.cloud.apiregistry.v1beta.GetMcpServerRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpServerRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpServerRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpServerRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpServerRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpServerRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpServerRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpServerRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpServerRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpServerRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpServerRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpServerRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpServerRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.apiregistry.v1beta.GetMcpServerRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Message for getting a McpServer
+   * 
+ * + * Protobuf type {@code google.cloud.apiregistry.v1beta.GetMcpServerRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apiregistry.v1beta.GetMcpServerRequest) + com.google.cloud.apiregistry.v1beta.GetMcpServerRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_GetMcpServerRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_GetMcpServerRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apiregistry.v1beta.GetMcpServerRequest.class, + com.google.cloud.apiregistry.v1beta.GetMcpServerRequest.Builder.class); + } + + // Construct using com.google.cloud.apiregistry.v1beta.GetMcpServerRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_GetMcpServerRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.GetMcpServerRequest getDefaultInstanceForType() { + return com.google.cloud.apiregistry.v1beta.GetMcpServerRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.GetMcpServerRequest build() { + com.google.cloud.apiregistry.v1beta.GetMcpServerRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.GetMcpServerRequest buildPartial() { + com.google.cloud.apiregistry.v1beta.GetMcpServerRequest result = + new com.google.cloud.apiregistry.v1beta.GetMcpServerRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apiregistry.v1beta.GetMcpServerRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.apiregistry.v1beta.GetMcpServerRequest) { + return mergeFrom((com.google.cloud.apiregistry.v1beta.GetMcpServerRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apiregistry.v1beta.GetMcpServerRequest other) { + if (other == com.google.cloud.apiregistry.v1beta.GetMcpServerRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.apiregistry.v1beta.GetMcpServerRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apiregistry.v1beta.GetMcpServerRequest) + private static final com.google.cloud.apiregistry.v1beta.GetMcpServerRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apiregistry.v1beta.GetMcpServerRequest(); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpServerRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetMcpServerRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.GetMcpServerRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/GetMcpServerRequestOrBuilder.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/GetMcpServerRequestOrBuilder.java new file mode 100644 index 000000000000..2cdfa5895b54 --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/GetMcpServerRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/apiregistry/v1beta/service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.apiregistry.v1beta; + +public interface GetMcpServerRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apiregistry.v1beta.GetMcpServerRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/GetMcpToolRequest.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/GetMcpToolRequest.java new file mode 100644 index 000000000000..eb812f5f0c51 --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/GetMcpToolRequest.java @@ -0,0 +1,649 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/apiregistry/v1beta/service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.apiregistry.v1beta; + +/** + * + * + *
+ * Message for getting a McpTool
+ * 
+ * + * Protobuf type {@code google.cloud.apiregistry.v1beta.GetMcpToolRequest} + */ +public final class GetMcpToolRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apiregistry.v1beta.GetMcpToolRequest) + GetMcpToolRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetMcpToolRequest.newBuilder() to construct. + private GetMcpToolRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetMcpToolRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetMcpToolRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_GetMcpToolRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_GetMcpToolRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apiregistry.v1beta.GetMcpToolRequest.class, + com.google.cloud.apiregistry.v1beta.GetMcpToolRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.apiregistry.v1beta.GetMcpToolRequest)) { + return super.equals(obj); + } + com.google.cloud.apiregistry.v1beta.GetMcpToolRequest other = + (com.google.cloud.apiregistry.v1beta.GetMcpToolRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpToolRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpToolRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpToolRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpToolRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpToolRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpToolRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpToolRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpToolRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpToolRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpToolRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpToolRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpToolRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.apiregistry.v1beta.GetMcpToolRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Message for getting a McpTool
+   * 
+ * + * Protobuf type {@code google.cloud.apiregistry.v1beta.GetMcpToolRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apiregistry.v1beta.GetMcpToolRequest) + com.google.cloud.apiregistry.v1beta.GetMcpToolRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_GetMcpToolRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_GetMcpToolRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apiregistry.v1beta.GetMcpToolRequest.class, + com.google.cloud.apiregistry.v1beta.GetMcpToolRequest.Builder.class); + } + + // Construct using com.google.cloud.apiregistry.v1beta.GetMcpToolRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_GetMcpToolRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.GetMcpToolRequest getDefaultInstanceForType() { + return com.google.cloud.apiregistry.v1beta.GetMcpToolRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.GetMcpToolRequest build() { + com.google.cloud.apiregistry.v1beta.GetMcpToolRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.GetMcpToolRequest buildPartial() { + com.google.cloud.apiregistry.v1beta.GetMcpToolRequest result = + new com.google.cloud.apiregistry.v1beta.GetMcpToolRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apiregistry.v1beta.GetMcpToolRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.apiregistry.v1beta.GetMcpToolRequest) { + return mergeFrom((com.google.cloud.apiregistry.v1beta.GetMcpToolRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apiregistry.v1beta.GetMcpToolRequest other) { + if (other == com.google.cloud.apiregistry.v1beta.GetMcpToolRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Name of the resource
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.apiregistry.v1beta.GetMcpToolRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apiregistry.v1beta.GetMcpToolRequest) + private static final com.google.cloud.apiregistry.v1beta.GetMcpToolRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apiregistry.v1beta.GetMcpToolRequest(); + } + + public static com.google.cloud.apiregistry.v1beta.GetMcpToolRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetMcpToolRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.GetMcpToolRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/GetMcpToolRequestOrBuilder.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/GetMcpToolRequestOrBuilder.java new file mode 100644 index 000000000000..af8f444e074e --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/GetMcpToolRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/apiregistry/v1beta/service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.apiregistry.v1beta; + +public interface GetMcpToolRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apiregistry.v1beta.GetMcpToolRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. Name of the resource
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpServersRequest.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpServersRequest.java new file mode 100644 index 000000000000..734d8142721d --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpServersRequest.java @@ -0,0 +1,1317 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/apiregistry/v1beta/service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.apiregistry.v1beta; + +/** + * + * + *
+ * Message for requesting list of McpServers
+ * 
+ * + * Protobuf type {@code google.cloud.apiregistry.v1beta.ListMcpServersRequest} + */ +public final class ListMcpServersRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apiregistry.v1beta.ListMcpServersRequest) + ListMcpServersRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListMcpServersRequest.newBuilder() to construct. + private ListMcpServersRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListMcpServersRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListMcpServersRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_ListMcpServersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_ListMcpServersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apiregistry.v1beta.ListMcpServersRequest.class, + com.google.cloud.apiregistry.v1beta.ListMcpServersRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. Parent value for ListMcpServersRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Parent value for ListMcpServersRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.apiregistry.v1beta.ListMcpServersRequest)) { + return super.equals(obj); + } + com.google.cloud.apiregistry.v1beta.ListMcpServersRequest other = + (com.google.cloud.apiregistry.v1beta.ListMcpServersRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.apiregistry.v1beta.ListMcpServersRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Message for requesting list of McpServers
+   * 
+ * + * Protobuf type {@code google.cloud.apiregistry.v1beta.ListMcpServersRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apiregistry.v1beta.ListMcpServersRequest) + com.google.cloud.apiregistry.v1beta.ListMcpServersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_ListMcpServersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_ListMcpServersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apiregistry.v1beta.ListMcpServersRequest.class, + com.google.cloud.apiregistry.v1beta.ListMcpServersRequest.Builder.class); + } + + // Construct using com.google.cloud.apiregistry.v1beta.ListMcpServersRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_ListMcpServersRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.ListMcpServersRequest getDefaultInstanceForType() { + return com.google.cloud.apiregistry.v1beta.ListMcpServersRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.ListMcpServersRequest build() { + com.google.cloud.apiregistry.v1beta.ListMcpServersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.ListMcpServersRequest buildPartial() { + com.google.cloud.apiregistry.v1beta.ListMcpServersRequest result = + new com.google.cloud.apiregistry.v1beta.ListMcpServersRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apiregistry.v1beta.ListMcpServersRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.apiregistry.v1beta.ListMcpServersRequest) { + return mergeFrom((com.google.cloud.apiregistry.v1beta.ListMcpServersRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apiregistry.v1beta.ListMcpServersRequest other) { + if (other == com.google.cloud.apiregistry.v1beta.ListMcpServersRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. Parent value for ListMcpServersRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Parent value for ListMcpServersRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Parent value for ListMcpServersRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Parent value for ListMcpServersRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Parent value for ListMcpServersRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.apiregistry.v1beta.ListMcpServersRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apiregistry.v1beta.ListMcpServersRequest) + private static final com.google.cloud.apiregistry.v1beta.ListMcpServersRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apiregistry.v1beta.ListMcpServersRequest(); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListMcpServersRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.ListMcpServersRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpServersRequestOrBuilder.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpServersRequestOrBuilder.java new file mode 100644 index 000000000000..6be14a5d1638 --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpServersRequestOrBuilder.java @@ -0,0 +1,148 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/apiregistry/v1beta/service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.apiregistry.v1beta; + +public interface ListMcpServersRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apiregistry.v1beta.ListMcpServersRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent value for ListMcpServersRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. Parent value for ListMcpServersRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpServersResponse.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpServersResponse.java new file mode 100644 index 000000000000..042a5086f6da --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpServersResponse.java @@ -0,0 +1,1443 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/apiregistry/v1beta/service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.apiregistry.v1beta; + +/** + * + * + *
+ * Message for response to listing McpServers
+ * 
+ * + * Protobuf type {@code google.cloud.apiregistry.v1beta.ListMcpServersResponse} + */ +public final class ListMcpServersResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apiregistry.v1beta.ListMcpServersResponse) + ListMcpServersResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListMcpServersResponse.newBuilder() to construct. + private ListMcpServersResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListMcpServersResponse() { + mcpServers_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListMcpServersResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_ListMcpServersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_ListMcpServersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apiregistry.v1beta.ListMcpServersResponse.class, + com.google.cloud.apiregistry.v1beta.ListMcpServersResponse.Builder.class); + } + + public static final int MCP_SERVERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List mcpServers_; + + /** + * + * + *
+   * The list of McpServer
+   * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + @java.lang.Override + public java.util.List getMcpServersList() { + return mcpServers_; + } + + /** + * + * + *
+   * The list of McpServer
+   * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + @java.lang.Override + public java.util.List + getMcpServersOrBuilderList() { + return mcpServers_; + } + + /** + * + * + *
+   * The list of McpServer
+   * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + @java.lang.Override + public int getMcpServersCount() { + return mcpServers_.size(); + } + + /** + * + * + *
+   * The list of McpServer
+   * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.McpServer getMcpServers(int index) { + return mcpServers_.get(index); + } + + /** + * + * + *
+   * The list of McpServer
+   * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.McpServerOrBuilder getMcpServersOrBuilder(int index) { + return mcpServers_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < mcpServers_.size(); i++) { + output.writeMessage(1, mcpServers_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < mcpServers_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, mcpServers_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.apiregistry.v1beta.ListMcpServersResponse)) { + return super.equals(obj); + } + com.google.cloud.apiregistry.v1beta.ListMcpServersResponse other = + (com.google.cloud.apiregistry.v1beta.ListMcpServersResponse) obj; + + if (!getMcpServersList().equals(other.getMcpServersList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getMcpServersCount() > 0) { + hash = (37 * hash) + MCP_SERVERS_FIELD_NUMBER; + hash = (53 * hash) + getMcpServersList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.apiregistry.v1beta.ListMcpServersResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Message for response to listing McpServers
+   * 
+ * + * Protobuf type {@code google.cloud.apiregistry.v1beta.ListMcpServersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apiregistry.v1beta.ListMcpServersResponse) + com.google.cloud.apiregistry.v1beta.ListMcpServersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_ListMcpServersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_ListMcpServersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apiregistry.v1beta.ListMcpServersResponse.class, + com.google.cloud.apiregistry.v1beta.ListMcpServersResponse.Builder.class); + } + + // Construct using com.google.cloud.apiregistry.v1beta.ListMcpServersResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (mcpServersBuilder_ == null) { + mcpServers_ = java.util.Collections.emptyList(); + } else { + mcpServers_ = null; + mcpServersBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_ListMcpServersResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.ListMcpServersResponse getDefaultInstanceForType() { + return com.google.cloud.apiregistry.v1beta.ListMcpServersResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.ListMcpServersResponse build() { + com.google.cloud.apiregistry.v1beta.ListMcpServersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.ListMcpServersResponse buildPartial() { + com.google.cloud.apiregistry.v1beta.ListMcpServersResponse result = + new com.google.cloud.apiregistry.v1beta.ListMcpServersResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.apiregistry.v1beta.ListMcpServersResponse result) { + if (mcpServersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + mcpServers_ = java.util.Collections.unmodifiableList(mcpServers_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.mcpServers_ = mcpServers_; + } else { + result.mcpServers_ = mcpServersBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.apiregistry.v1beta.ListMcpServersResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + unreachable_.makeImmutable(); + result.unreachable_ = unreachable_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.apiregistry.v1beta.ListMcpServersResponse) { + return mergeFrom((com.google.cloud.apiregistry.v1beta.ListMcpServersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apiregistry.v1beta.ListMcpServersResponse other) { + if (other == com.google.cloud.apiregistry.v1beta.ListMcpServersResponse.getDefaultInstance()) + return this; + if (mcpServersBuilder_ == null) { + if (!other.mcpServers_.isEmpty()) { + if (mcpServers_.isEmpty()) { + mcpServers_ = other.mcpServers_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMcpServersIsMutable(); + mcpServers_.addAll(other.mcpServers_); + } + onChanged(); + } + } else { + if (!other.mcpServers_.isEmpty()) { + if (mcpServersBuilder_.isEmpty()) { + mcpServersBuilder_.dispose(); + mcpServersBuilder_ = null; + mcpServers_ = other.mcpServers_; + bitField0_ = (bitField0_ & ~0x00000001); + mcpServersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMcpServersFieldBuilder() + : null; + } else { + mcpServersBuilder_.addAllMessages(other.mcpServers_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ |= 0x00000004; + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.apiregistry.v1beta.McpServer m = + input.readMessage( + com.google.cloud.apiregistry.v1beta.McpServer.parser(), extensionRegistry); + if (mcpServersBuilder_ == null) { + ensureMcpServersIsMutable(); + mcpServers_.add(m); + } else { + mcpServersBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List mcpServers_ = + java.util.Collections.emptyList(); + + private void ensureMcpServersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + mcpServers_ = + new java.util.ArrayList(mcpServers_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apiregistry.v1beta.McpServer, + com.google.cloud.apiregistry.v1beta.McpServer.Builder, + com.google.cloud.apiregistry.v1beta.McpServerOrBuilder> + mcpServersBuilder_; + + /** + * + * + *
+     * The list of McpServer
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + public java.util.List getMcpServersList() { + if (mcpServersBuilder_ == null) { + return java.util.Collections.unmodifiableList(mcpServers_); + } else { + return mcpServersBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The list of McpServer
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + public int getMcpServersCount() { + if (mcpServersBuilder_ == null) { + return mcpServers_.size(); + } else { + return mcpServersBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The list of McpServer
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + public com.google.cloud.apiregistry.v1beta.McpServer getMcpServers(int index) { + if (mcpServersBuilder_ == null) { + return mcpServers_.get(index); + } else { + return mcpServersBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The list of McpServer
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + public Builder setMcpServers(int index, com.google.cloud.apiregistry.v1beta.McpServer value) { + if (mcpServersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMcpServersIsMutable(); + mcpServers_.set(index, value); + onChanged(); + } else { + mcpServersBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of McpServer
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + public Builder setMcpServers( + int index, com.google.cloud.apiregistry.v1beta.McpServer.Builder builderForValue) { + if (mcpServersBuilder_ == null) { + ensureMcpServersIsMutable(); + mcpServers_.set(index, builderForValue.build()); + onChanged(); + } else { + mcpServersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of McpServer
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + public Builder addMcpServers(com.google.cloud.apiregistry.v1beta.McpServer value) { + if (mcpServersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMcpServersIsMutable(); + mcpServers_.add(value); + onChanged(); + } else { + mcpServersBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The list of McpServer
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + public Builder addMcpServers(int index, com.google.cloud.apiregistry.v1beta.McpServer value) { + if (mcpServersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMcpServersIsMutable(); + mcpServers_.add(index, value); + onChanged(); + } else { + mcpServersBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of McpServer
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + public Builder addMcpServers( + com.google.cloud.apiregistry.v1beta.McpServer.Builder builderForValue) { + if (mcpServersBuilder_ == null) { + ensureMcpServersIsMutable(); + mcpServers_.add(builderForValue.build()); + onChanged(); + } else { + mcpServersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of McpServer
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + public Builder addMcpServers( + int index, com.google.cloud.apiregistry.v1beta.McpServer.Builder builderForValue) { + if (mcpServersBuilder_ == null) { + ensureMcpServersIsMutable(); + mcpServers_.add(index, builderForValue.build()); + onChanged(); + } else { + mcpServersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of McpServer
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + public Builder addAllMcpServers( + java.lang.Iterable values) { + if (mcpServersBuilder_ == null) { + ensureMcpServersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, mcpServers_); + onChanged(); + } else { + mcpServersBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The list of McpServer
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + public Builder clearMcpServers() { + if (mcpServersBuilder_ == null) { + mcpServers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + mcpServersBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The list of McpServer
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + public Builder removeMcpServers(int index) { + if (mcpServersBuilder_ == null) { + ensureMcpServersIsMutable(); + mcpServers_.remove(index); + onChanged(); + } else { + mcpServersBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The list of McpServer
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + public com.google.cloud.apiregistry.v1beta.McpServer.Builder getMcpServersBuilder(int index) { + return getMcpServersFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The list of McpServer
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + public com.google.cloud.apiregistry.v1beta.McpServerOrBuilder getMcpServersOrBuilder( + int index) { + if (mcpServersBuilder_ == null) { + return mcpServers_.get(index); + } else { + return mcpServersBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The list of McpServer
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + public java.util.List + getMcpServersOrBuilderList() { + if (mcpServersBuilder_ != null) { + return mcpServersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(mcpServers_); + } + } + + /** + * + * + *
+     * The list of McpServer
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + public com.google.cloud.apiregistry.v1beta.McpServer.Builder addMcpServersBuilder() { + return getMcpServersFieldBuilder() + .addBuilder(com.google.cloud.apiregistry.v1beta.McpServer.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of McpServer
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + public com.google.cloud.apiregistry.v1beta.McpServer.Builder addMcpServersBuilder(int index) { + return getMcpServersFieldBuilder() + .addBuilder(index, com.google.cloud.apiregistry.v1beta.McpServer.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of McpServer
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + public java.util.List + getMcpServersBuilderList() { + return getMcpServersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apiregistry.v1beta.McpServer, + com.google.cloud.apiregistry.v1beta.McpServer.Builder, + com.google.cloud.apiregistry.v1beta.McpServerOrBuilder> + getMcpServersFieldBuilder() { + if (mcpServersBuilder_ == null) { + mcpServersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apiregistry.v1beta.McpServer, + com.google.cloud.apiregistry.v1beta.McpServer.Builder, + com.google.cloud.apiregistry.v1beta.McpServerOrBuilder>( + mcpServers_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + mcpServers_ = null; + } + return mcpServersBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureUnreachableIsMutable() { + if (!unreachable_.isModifiable()) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + } + bitField0_ |= 0x00000004; + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + unreachable_.makeImmutable(); + return unreachable_; + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.apiregistry.v1beta.ListMcpServersResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apiregistry.v1beta.ListMcpServersResponse) + private static final com.google.cloud.apiregistry.v1beta.ListMcpServersResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apiregistry.v1beta.ListMcpServersResponse(); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpServersResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListMcpServersResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.ListMcpServersResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpServersResponseOrBuilder.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpServersResponseOrBuilder.java new file mode 100644 index 000000000000..2f9d1b0c3778 --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpServersResponseOrBuilder.java @@ -0,0 +1,162 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/apiregistry/v1beta/service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.apiregistry.v1beta; + +public interface ListMcpServersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apiregistry.v1beta.ListMcpServersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of McpServer
+   * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + java.util.List getMcpServersList(); + + /** + * + * + *
+   * The list of McpServer
+   * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + com.google.cloud.apiregistry.v1beta.McpServer getMcpServers(int index); + + /** + * + * + *
+   * The list of McpServer
+   * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + int getMcpServersCount(); + + /** + * + * + *
+   * The list of McpServer
+   * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + java.util.List + getMcpServersOrBuilderList(); + + /** + * + * + *
+   * The list of McpServer
+   * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpServer mcp_servers = 1; + */ + com.google.cloud.apiregistry.v1beta.McpServerOrBuilder getMcpServersOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpToolsRequest.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpToolsRequest.java new file mode 100644 index 000000000000..d09a0d950add --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpToolsRequest.java @@ -0,0 +1,1317 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/apiregistry/v1beta/service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.apiregistry.v1beta; + +/** + * + * + *
+ * Message for requesting list of McpTools
+ * 
+ * + * Protobuf type {@code google.cloud.apiregistry.v1beta.ListMcpToolsRequest} + */ +public final class ListMcpToolsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apiregistry.v1beta.ListMcpToolsRequest) + ListMcpToolsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListMcpToolsRequest.newBuilder() to construct. + private ListMcpToolsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListMcpToolsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListMcpToolsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_ListMcpToolsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_ListMcpToolsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest.class, + com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. Parent value for ListMcpToolsRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Parent value for ListMcpToolsRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest)) { + return super.equals(obj); + } + com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest other = + (com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Message for requesting list of McpTools
+   * 
+ * + * Protobuf type {@code google.cloud.apiregistry.v1beta.ListMcpToolsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apiregistry.v1beta.ListMcpToolsRequest) + com.google.cloud.apiregistry.v1beta.ListMcpToolsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_ListMcpToolsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_ListMcpToolsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest.class, + com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest.Builder.class); + } + + // Construct using com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_ListMcpToolsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest getDefaultInstanceForType() { + return com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest build() { + com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest buildPartial() { + com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest result = + new com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest) { + return mergeFrom((com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest other) { + if (other == com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. Parent value for ListMcpToolsRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Parent value for ListMcpToolsRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Parent value for ListMcpToolsRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Parent value for ListMcpToolsRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Parent value for ListMcpToolsRequest
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Hint for how to order the results
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.apiregistry.v1beta.ListMcpToolsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apiregistry.v1beta.ListMcpToolsRequest) + private static final com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest(); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListMcpToolsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpToolsRequestOrBuilder.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpToolsRequestOrBuilder.java new file mode 100644 index 000000000000..ffbc699714c3 --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpToolsRequestOrBuilder.java @@ -0,0 +1,148 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/apiregistry/v1beta/service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.apiregistry.v1beta; + +public interface ListMcpToolsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apiregistry.v1beta.ListMcpToolsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent value for ListMcpToolsRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. Parent value for ListMcpToolsRequest
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpToolsResponse.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpToolsResponse.java new file mode 100644 index 000000000000..f869328b03bb --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpToolsResponse.java @@ -0,0 +1,1441 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/apiregistry/v1beta/service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.apiregistry.v1beta; + +/** + * + * + *
+ * Message for response to listing McpTools
+ * 
+ * + * Protobuf type {@code google.cloud.apiregistry.v1beta.ListMcpToolsResponse} + */ +public final class ListMcpToolsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apiregistry.v1beta.ListMcpToolsResponse) + ListMcpToolsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListMcpToolsResponse.newBuilder() to construct. + private ListMcpToolsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListMcpToolsResponse() { + mcpTools_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListMcpToolsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_ListMcpToolsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_ListMcpToolsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse.class, + com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse.Builder.class); + } + + public static final int MCP_TOOLS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List mcpTools_; + + /** + * + * + *
+   * The list of McpTool
+   * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + @java.lang.Override + public java.util.List getMcpToolsList() { + return mcpTools_; + } + + /** + * + * + *
+   * The list of McpTool
+   * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + @java.lang.Override + public java.util.List + getMcpToolsOrBuilderList() { + return mcpTools_; + } + + /** + * + * + *
+   * The list of McpTool
+   * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + @java.lang.Override + public int getMcpToolsCount() { + return mcpTools_.size(); + } + + /** + * + * + *
+   * The list of McpTool
+   * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.McpTool getMcpTools(int index) { + return mcpTools_.get(index); + } + + /** + * + * + *
+   * The list of McpTool
+   * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.McpToolOrBuilder getMcpToolsOrBuilder(int index) { + return mcpTools_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < mcpTools_.size(); i++) { + output.writeMessage(1, mcpTools_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < mcpTools_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, mcpTools_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse)) { + return super.equals(obj); + } + com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse other = + (com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse) obj; + + if (!getMcpToolsList().equals(other.getMcpToolsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getMcpToolsCount() > 0) { + hash = (37 * hash) + MCP_TOOLS_FIELD_NUMBER; + hash = (53 * hash) + getMcpToolsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Message for response to listing McpTools
+   * 
+ * + * Protobuf type {@code google.cloud.apiregistry.v1beta.ListMcpToolsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apiregistry.v1beta.ListMcpToolsResponse) + com.google.cloud.apiregistry.v1beta.ListMcpToolsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_ListMcpToolsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_ListMcpToolsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse.class, + com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse.Builder.class); + } + + // Construct using com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (mcpToolsBuilder_ == null) { + mcpTools_ = java.util.Collections.emptyList(); + } else { + mcpTools_ = null; + mcpToolsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apiregistry.v1beta.ServiceProto + .internal_static_google_cloud_apiregistry_v1beta_ListMcpToolsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse getDefaultInstanceForType() { + return com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse build() { + com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse buildPartial() { + com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse result = + new com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse result) { + if (mcpToolsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + mcpTools_ = java.util.Collections.unmodifiableList(mcpTools_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.mcpTools_ = mcpTools_; + } else { + result.mcpTools_ = mcpToolsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + unreachable_.makeImmutable(); + result.unreachable_ = unreachable_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse) { + return mergeFrom((com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse other) { + if (other == com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse.getDefaultInstance()) + return this; + if (mcpToolsBuilder_ == null) { + if (!other.mcpTools_.isEmpty()) { + if (mcpTools_.isEmpty()) { + mcpTools_ = other.mcpTools_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMcpToolsIsMutable(); + mcpTools_.addAll(other.mcpTools_); + } + onChanged(); + } + } else { + if (!other.mcpTools_.isEmpty()) { + if (mcpToolsBuilder_.isEmpty()) { + mcpToolsBuilder_.dispose(); + mcpToolsBuilder_ = null; + mcpTools_ = other.mcpTools_; + bitField0_ = (bitField0_ & ~0x00000001); + mcpToolsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMcpToolsFieldBuilder() + : null; + } else { + mcpToolsBuilder_.addAllMessages(other.mcpTools_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ |= 0x00000004; + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.apiregistry.v1beta.McpTool m = + input.readMessage( + com.google.cloud.apiregistry.v1beta.McpTool.parser(), extensionRegistry); + if (mcpToolsBuilder_ == null) { + ensureMcpToolsIsMutable(); + mcpTools_.add(m); + } else { + mcpToolsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List mcpTools_ = + java.util.Collections.emptyList(); + + private void ensureMcpToolsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + mcpTools_ = new java.util.ArrayList(mcpTools_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apiregistry.v1beta.McpTool, + com.google.cloud.apiregistry.v1beta.McpTool.Builder, + com.google.cloud.apiregistry.v1beta.McpToolOrBuilder> + mcpToolsBuilder_; + + /** + * + * + *
+     * The list of McpTool
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + public java.util.List getMcpToolsList() { + if (mcpToolsBuilder_ == null) { + return java.util.Collections.unmodifiableList(mcpTools_); + } else { + return mcpToolsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The list of McpTool
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + public int getMcpToolsCount() { + if (mcpToolsBuilder_ == null) { + return mcpTools_.size(); + } else { + return mcpToolsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The list of McpTool
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + public com.google.cloud.apiregistry.v1beta.McpTool getMcpTools(int index) { + if (mcpToolsBuilder_ == null) { + return mcpTools_.get(index); + } else { + return mcpToolsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The list of McpTool
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + public Builder setMcpTools(int index, com.google.cloud.apiregistry.v1beta.McpTool value) { + if (mcpToolsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMcpToolsIsMutable(); + mcpTools_.set(index, value); + onChanged(); + } else { + mcpToolsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of McpTool
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + public Builder setMcpTools( + int index, com.google.cloud.apiregistry.v1beta.McpTool.Builder builderForValue) { + if (mcpToolsBuilder_ == null) { + ensureMcpToolsIsMutable(); + mcpTools_.set(index, builderForValue.build()); + onChanged(); + } else { + mcpToolsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of McpTool
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + public Builder addMcpTools(com.google.cloud.apiregistry.v1beta.McpTool value) { + if (mcpToolsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMcpToolsIsMutable(); + mcpTools_.add(value); + onChanged(); + } else { + mcpToolsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The list of McpTool
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + public Builder addMcpTools(int index, com.google.cloud.apiregistry.v1beta.McpTool value) { + if (mcpToolsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMcpToolsIsMutable(); + mcpTools_.add(index, value); + onChanged(); + } else { + mcpToolsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The list of McpTool
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + public Builder addMcpTools( + com.google.cloud.apiregistry.v1beta.McpTool.Builder builderForValue) { + if (mcpToolsBuilder_ == null) { + ensureMcpToolsIsMutable(); + mcpTools_.add(builderForValue.build()); + onChanged(); + } else { + mcpToolsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of McpTool
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + public Builder addMcpTools( + int index, com.google.cloud.apiregistry.v1beta.McpTool.Builder builderForValue) { + if (mcpToolsBuilder_ == null) { + ensureMcpToolsIsMutable(); + mcpTools_.add(index, builderForValue.build()); + onChanged(); + } else { + mcpToolsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The list of McpTool
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + public Builder addAllMcpTools( + java.lang.Iterable values) { + if (mcpToolsBuilder_ == null) { + ensureMcpToolsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, mcpTools_); + onChanged(); + } else { + mcpToolsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The list of McpTool
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + public Builder clearMcpTools() { + if (mcpToolsBuilder_ == null) { + mcpTools_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + mcpToolsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The list of McpTool
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + public Builder removeMcpTools(int index) { + if (mcpToolsBuilder_ == null) { + ensureMcpToolsIsMutable(); + mcpTools_.remove(index); + onChanged(); + } else { + mcpToolsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The list of McpTool
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + public com.google.cloud.apiregistry.v1beta.McpTool.Builder getMcpToolsBuilder(int index) { + return getMcpToolsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The list of McpTool
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + public com.google.cloud.apiregistry.v1beta.McpToolOrBuilder getMcpToolsOrBuilder(int index) { + if (mcpToolsBuilder_ == null) { + return mcpTools_.get(index); + } else { + return mcpToolsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The list of McpTool
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + public java.util.List + getMcpToolsOrBuilderList() { + if (mcpToolsBuilder_ != null) { + return mcpToolsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(mcpTools_); + } + } + + /** + * + * + *
+     * The list of McpTool
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + public com.google.cloud.apiregistry.v1beta.McpTool.Builder addMcpToolsBuilder() { + return getMcpToolsFieldBuilder() + .addBuilder(com.google.cloud.apiregistry.v1beta.McpTool.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of McpTool
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + public com.google.cloud.apiregistry.v1beta.McpTool.Builder addMcpToolsBuilder(int index) { + return getMcpToolsFieldBuilder() + .addBuilder(index, com.google.cloud.apiregistry.v1beta.McpTool.getDefaultInstance()); + } + + /** + * + * + *
+     * The list of McpTool
+     * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + public java.util.List + getMcpToolsBuilderList() { + return getMcpToolsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apiregistry.v1beta.McpTool, + com.google.cloud.apiregistry.v1beta.McpTool.Builder, + com.google.cloud.apiregistry.v1beta.McpToolOrBuilder> + getMcpToolsFieldBuilder() { + if (mcpToolsBuilder_ == null) { + mcpToolsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.apiregistry.v1beta.McpTool, + com.google.cloud.apiregistry.v1beta.McpTool.Builder, + com.google.cloud.apiregistry.v1beta.McpToolOrBuilder>( + mcpTools_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + mcpTools_ = null; + } + return mcpToolsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureUnreachableIsMutable() { + if (!unreachable_.isModifiable()) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + } + bitField0_ |= 0x00000004; + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + unreachable_.makeImmutable(); + return unreachable_; + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.apiregistry.v1beta.ListMcpToolsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apiregistry.v1beta.ListMcpToolsResponse) + private static final com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse(); + } + + public static com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListMcpToolsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpToolsResponseOrBuilder.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpToolsResponseOrBuilder.java new file mode 100644 index 000000000000..45632ca1764d --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ListMcpToolsResponseOrBuilder.java @@ -0,0 +1,162 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/apiregistry/v1beta/service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.apiregistry.v1beta; + +public interface ListMcpToolsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apiregistry.v1beta.ListMcpToolsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of McpTool
+   * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + java.util.List getMcpToolsList(); + + /** + * + * + *
+   * The list of McpTool
+   * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + com.google.cloud.apiregistry.v1beta.McpTool getMcpTools(int index); + + /** + * + * + *
+   * The list of McpTool
+   * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + int getMcpToolsCount(); + + /** + * + * + *
+   * The list of McpTool
+   * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + java.util.List + getMcpToolsOrBuilderList(); + + /** + * + * + *
+   * The list of McpTool
+   * 
+ * + * repeated .google.cloud.apiregistry.v1beta.McpTool mcp_tools = 1; + */ + com.google.cloud.apiregistry.v1beta.McpToolOrBuilder getMcpToolsOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/LocationName.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/LocationName.java new file mode 100644 index 000000000000..733673705248 --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/LocationName.java @@ -0,0 +1,192 @@ +/* + * 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; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/McpServer.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/McpServer.java new file mode 100644 index 000000000000..5933b8c82493 --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/McpServer.java @@ -0,0 +1,1833 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/apiregistry/v1beta/resources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.apiregistry.v1beta; + +/** + * + * + *
+ * Represents an MCP Server. MCP Servers act as endpoints that expose a
+ * collection of tools that can be invoked by agents.
+ * 
+ * + * Protobuf type {@code google.cloud.apiregistry.v1beta.McpServer} + */ +public final class McpServer extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apiregistry.v1beta.McpServer) + McpServerOrBuilder { + private static final long serialVersionUID = 0L; + + // Use McpServer.newBuilder() to construct. + private McpServer(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private McpServer() { + name_ = ""; + displayName_ = ""; + description_ = ""; + urls_ = com.google.protobuf.LazyStringArrayList.emptyList(); + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new McpServer(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apiregistry.v1beta.ResourcesProto + .internal_static_google_cloud_apiregistry_v1beta_McpServer_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apiregistry.v1beta.ResourcesProto + .internal_static_google_cloud_apiregistry_v1beta_McpServer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apiregistry.v1beta.McpServer.class, + com.google.cloud.apiregistry.v1beta.McpServer.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Identifier. The resource name of the MCP Server.
+   * Format:
+   * `projects/{project}/locations/{location}/mcpServers/{mcp_server}`.
+   * Example:
+   * projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp
+   * for 1p
+   * projects/12345/locations/us-central1/mcpServers/apphub:starbucks for
+   * 2p
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Identifier. The resource name of the MCP Server.
+   * Format:
+   * `projects/{project}/locations/{location}/mcpServers/{mcp_server}`.
+   * Example:
+   * projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp
+   * for 1p
+   * projects/12345/locations/us-central1/mcpServers/apphub:starbucks for
+   * 2p
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + + /** + * + * + *
+   * Optional. A human readable name for the MCP server.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. A human readable name for the MCP server.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
+   * Optional. A human-readable description of the MCP Server's functionality.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. A human-readable description of the MCP Server's functionality.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int URLS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList urls_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
+   * 
+ * + * repeated string urls = 4; + * + * @return A list containing the urls. + */ + public com.google.protobuf.ProtocolStringList getUrlsList() { + return urls_; + } + + /** + * + * + *
+   * The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
+   * 
+ * + * repeated string urls = 4; + * + * @return The count of urls. + */ + public int getUrlsCount() { + return urls_.size(); + } + + /** + * + * + *
+   * The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
+   * 
+ * + * repeated string urls = 4; + * + * @param index The index of the element to return. + * @return The urls at the given index. + */ + public java.lang.String getUrls(int index) { + return urls_.get(index); + } + + /** + * + * + *
+   * The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
+   * 
+ * + * repeated string urls = 4; + * + * @param index The index of the value to return. + * @return The bytes of the urls at the given index. + */ + public com.google.protobuf.ByteString getUrlsBytes(int index) { + return urls_.getByteString(index); + } + + public static final int CAPABILITIES_FIELD_NUMBER = 6; + private com.google.protobuf.Struct capabilities_; + + /** + * + * + *
+   * The capabilities that a server may support. Known capabilities defined in
+   * https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities
+   * and additional capabilities defined by the servers.
+   * 
+ * + * .google.protobuf.Struct capabilities = 6; + * + * @return Whether the capabilities field is set. + */ + @java.lang.Override + public boolean hasCapabilities() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The capabilities that a server may support. Known capabilities defined in
+   * https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities
+   * and additional capabilities defined by the servers.
+   * 
+ * + * .google.protobuf.Struct capabilities = 6; + * + * @return The capabilities. + */ + @java.lang.Override + public com.google.protobuf.Struct getCapabilities() { + return capabilities_ == null ? com.google.protobuf.Struct.getDefaultInstance() : capabilities_; + } + + /** + * + * + *
+   * The capabilities that a server may support. Known capabilities defined in
+   * https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities
+   * and additional capabilities defined by the servers.
+   * 
+ * + * .google.protobuf.Struct capabilities = 6; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getCapabilitiesOrBuilder() { + return capabilities_ == null ? com.google.protobuf.Struct.getDefaultInstance() : capabilities_; + } + + public static final int STATE_FIELD_NUMBER = 7; + private int state_ = 0; + + /** + * + * + *
+   * Output only. The state of the MCP Server.
+   * 
+ * + * + * .google.cloud.apiregistry.v1beta.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+   * Output only. The state of the MCP Server.
+   * 
+ * + * + * .google.cloud.apiregistry.v1beta.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.State getState() { + com.google.cloud.apiregistry.v1beta.State result = + com.google.cloud.apiregistry.v1beta.State.forNumber(state_); + return result == null ? com.google.cloud.apiregistry.v1beta.State.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + for (int i = 0; i < urls_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, urls_.getRaw(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getCapabilities()); + } + if (state_ != com.google.cloud.apiregistry.v1beta.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(7, state_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + { + int dataSize = 0; + for (int i = 0; i < urls_.size(); i++) { + dataSize += computeStringSizeNoTag(urls_.getRaw(i)); + } + size += dataSize; + size += 1 * getUrlsList().size(); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCapabilities()); + } + if (state_ != com.google.cloud.apiregistry.v1beta.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, state_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.apiregistry.v1beta.McpServer)) { + return super.equals(obj); + } + com.google.cloud.apiregistry.v1beta.McpServer other = + (com.google.cloud.apiregistry.v1beta.McpServer) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getUrlsList().equals(other.getUrlsList())) return false; + if (hasCapabilities() != other.hasCapabilities()) return false; + if (hasCapabilities()) { + if (!getCapabilities().equals(other.getCapabilities())) return false; + } + if (state_ != other.state_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getUrlsCount() > 0) { + hash = (37 * hash) + URLS_FIELD_NUMBER; + hash = (53 * hash) + getUrlsList().hashCode(); + } + if (hasCapabilities()) { + hash = (37 * hash) + CAPABILITIES_FIELD_NUMBER; + hash = (53 * hash) + getCapabilities().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apiregistry.v1beta.McpServer parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.McpServer parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.McpServer parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.McpServer parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.McpServer parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.McpServer parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.McpServer parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.McpServer parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.McpServer parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.McpServer parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.McpServer parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.McpServer parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.apiregistry.v1beta.McpServer prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Represents an MCP Server. MCP Servers act as endpoints that expose a
+   * collection of tools that can be invoked by agents.
+   * 
+ * + * Protobuf type {@code google.cloud.apiregistry.v1beta.McpServer} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apiregistry.v1beta.McpServer) + com.google.cloud.apiregistry.v1beta.McpServerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apiregistry.v1beta.ResourcesProto + .internal_static_google_cloud_apiregistry_v1beta_McpServer_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apiregistry.v1beta.ResourcesProto + .internal_static_google_cloud_apiregistry_v1beta_McpServer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apiregistry.v1beta.McpServer.class, + com.google.cloud.apiregistry.v1beta.McpServer.Builder.class); + } + + // Construct using com.google.cloud.apiregistry.v1beta.McpServer.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCapabilitiesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + description_ = ""; + urls_ = com.google.protobuf.LazyStringArrayList.emptyList(); + capabilities_ = null; + if (capabilitiesBuilder_ != null) { + capabilitiesBuilder_.dispose(); + capabilitiesBuilder_ = null; + } + state_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apiregistry.v1beta.ResourcesProto + .internal_static_google_cloud_apiregistry_v1beta_McpServer_descriptor; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.McpServer getDefaultInstanceForType() { + return com.google.cloud.apiregistry.v1beta.McpServer.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.McpServer build() { + com.google.cloud.apiregistry.v1beta.McpServer result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.McpServer buildPartial() { + com.google.cloud.apiregistry.v1beta.McpServer result = + new com.google.cloud.apiregistry.v1beta.McpServer(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apiregistry.v1beta.McpServer result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + urls_.makeImmutable(); + result.urls_ = urls_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.capabilities_ = + capabilitiesBuilder_ == null ? capabilities_ : capabilitiesBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.state_ = state_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.apiregistry.v1beta.McpServer) { + return mergeFrom((com.google.cloud.apiregistry.v1beta.McpServer) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apiregistry.v1beta.McpServer other) { + if (other == com.google.cloud.apiregistry.v1beta.McpServer.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.urls_.isEmpty()) { + if (urls_.isEmpty()) { + urls_ = other.urls_; + bitField0_ |= 0x00000008; + } else { + ensureUrlsIsMutable(); + urls_.addAll(other.urls_); + } + onChanged(); + } + if (other.hasCapabilities()) { + mergeCapabilities(other.getCapabilities()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUrlsIsMutable(); + urls_.add(s); + break; + } // case 34 + case 50: + { + input.readMessage(getCapabilitiesFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 50 + case 56: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 56 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Identifier. The resource name of the MCP Server.
+     * Format:
+     * `projects/{project}/locations/{location}/mcpServers/{mcp_server}`.
+     * Example:
+     * projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp
+     * for 1p
+     * projects/12345/locations/us-central1/mcpServers/apphub:starbucks for
+     * 2p
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Identifier. The resource name of the MCP Server.
+     * Format:
+     * `projects/{project}/locations/{location}/mcpServers/{mcp_server}`.
+     * Example:
+     * projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp
+     * for 1p
+     * projects/12345/locations/us-central1/mcpServers/apphub:starbucks for
+     * 2p
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Identifier. The resource name of the MCP Server.
+     * Format:
+     * `projects/{project}/locations/{location}/mcpServers/{mcp_server}`.
+     * Example:
+     * projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp
+     * for 1p
+     * projects/12345/locations/us-central1/mcpServers/apphub:starbucks for
+     * 2p
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier. The resource name of the MCP Server.
+     * Format:
+     * `projects/{project}/locations/{location}/mcpServers/{mcp_server}`.
+     * Example:
+     * projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp
+     * for 1p
+     * projects/12345/locations/us-central1/mcpServers/apphub:starbucks for
+     * 2p
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier. The resource name of the MCP Server.
+     * Format:
+     * `projects/{project}/locations/{location}/mcpServers/{mcp_server}`.
+     * Example:
+     * projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp
+     * for 1p
+     * projects/12345/locations/us-central1/mcpServers/apphub:starbucks for
+     * 2p
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + + /** + * + * + *
+     * Optional. A human readable name for the MCP server.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. A human readable name for the MCP server.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. A human readable name for the MCP server.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A human readable name for the MCP server.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A human readable name for the MCP server.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
+     * Optional. A human-readable description of the MCP Server's functionality.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. A human-readable description of the MCP Server's functionality.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. A human-readable description of the MCP Server's functionality.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A human-readable description of the MCP Server's functionality.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A human-readable description of the MCP Server's functionality.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList urls_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureUrlsIsMutable() { + if (!urls_.isModifiable()) { + urls_ = new com.google.protobuf.LazyStringArrayList(urls_); + } + bitField0_ |= 0x00000008; + } + + /** + * + * + *
+     * The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
+     * 
+ * + * repeated string urls = 4; + * + * @return A list containing the urls. + */ + public com.google.protobuf.ProtocolStringList getUrlsList() { + urls_.makeImmutable(); + return urls_; + } + + /** + * + * + *
+     * The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
+     * 
+ * + * repeated string urls = 4; + * + * @return The count of urls. + */ + public int getUrlsCount() { + return urls_.size(); + } + + /** + * + * + *
+     * The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
+     * 
+ * + * repeated string urls = 4; + * + * @param index The index of the element to return. + * @return The urls at the given index. + */ + public java.lang.String getUrls(int index) { + return urls_.get(index); + } + + /** + * + * + *
+     * The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
+     * 
+ * + * repeated string urls = 4; + * + * @param index The index of the value to return. + * @return The bytes of the urls at the given index. + */ + public com.google.protobuf.ByteString getUrlsBytes(int index) { + return urls_.getByteString(index); + } + + /** + * + * + *
+     * The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
+     * 
+ * + * repeated string urls = 4; + * + * @param index The index to set the value at. + * @param value The urls to set. + * @return This builder for chaining. + */ + public Builder setUrls(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUrlsIsMutable(); + urls_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
+     * 
+ * + * repeated string urls = 4; + * + * @param value The urls to add. + * @return This builder for chaining. + */ + public Builder addUrls(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUrlsIsMutable(); + urls_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
+     * 
+ * + * repeated string urls = 4; + * + * @param values The urls to add. + * @return This builder for chaining. + */ + public Builder addAllUrls(java.lang.Iterable values) { + ensureUrlsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, urls_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
+     * 
+ * + * repeated string urls = 4; + * + * @return This builder for chaining. + */ + public Builder clearUrls() { + urls_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
+     * 
+ * + * repeated string urls = 4; + * + * @param value The bytes of the urls to add. + * @return This builder for chaining. + */ + public Builder addUrlsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUrlsIsMutable(); + urls_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.Struct capabilities_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + capabilitiesBuilder_; + + /** + * + * + *
+     * The capabilities that a server may support. Known capabilities defined in
+     * https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities
+     * and additional capabilities defined by the servers.
+     * 
+ * + * .google.protobuf.Struct capabilities = 6; + * + * @return Whether the capabilities field is set. + */ + public boolean hasCapabilities() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * The capabilities that a server may support. Known capabilities defined in
+     * https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities
+     * and additional capabilities defined by the servers.
+     * 
+ * + * .google.protobuf.Struct capabilities = 6; + * + * @return The capabilities. + */ + public com.google.protobuf.Struct getCapabilities() { + if (capabilitiesBuilder_ == null) { + return capabilities_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : capabilities_; + } else { + return capabilitiesBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The capabilities that a server may support. Known capabilities defined in
+     * https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities
+     * and additional capabilities defined by the servers.
+     * 
+ * + * .google.protobuf.Struct capabilities = 6; + */ + public Builder setCapabilities(com.google.protobuf.Struct value) { + if (capabilitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + capabilities_ = value; + } else { + capabilitiesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The capabilities that a server may support. Known capabilities defined in
+     * https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities
+     * and additional capabilities defined by the servers.
+     * 
+ * + * .google.protobuf.Struct capabilities = 6; + */ + public Builder setCapabilities(com.google.protobuf.Struct.Builder builderForValue) { + if (capabilitiesBuilder_ == null) { + capabilities_ = builderForValue.build(); + } else { + capabilitiesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The capabilities that a server may support. Known capabilities defined in
+     * https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities
+     * and additional capabilities defined by the servers.
+     * 
+ * + * .google.protobuf.Struct capabilities = 6; + */ + public Builder mergeCapabilities(com.google.protobuf.Struct value) { + if (capabilitiesBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && capabilities_ != null + && capabilities_ != com.google.protobuf.Struct.getDefaultInstance()) { + getCapabilitiesBuilder().mergeFrom(value); + } else { + capabilities_ = value; + } + } else { + capabilitiesBuilder_.mergeFrom(value); + } + if (capabilities_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The capabilities that a server may support. Known capabilities defined in
+     * https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities
+     * and additional capabilities defined by the servers.
+     * 
+ * + * .google.protobuf.Struct capabilities = 6; + */ + public Builder clearCapabilities() { + bitField0_ = (bitField0_ & ~0x00000010); + capabilities_ = null; + if (capabilitiesBuilder_ != null) { + capabilitiesBuilder_.dispose(); + capabilitiesBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The capabilities that a server may support. Known capabilities defined in
+     * https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities
+     * and additional capabilities defined by the servers.
+     * 
+ * + * .google.protobuf.Struct capabilities = 6; + */ + public com.google.protobuf.Struct.Builder getCapabilitiesBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getCapabilitiesFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The capabilities that a server may support. Known capabilities defined in
+     * https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities
+     * and additional capabilities defined by the servers.
+     * 
+ * + * .google.protobuf.Struct capabilities = 6; + */ + public com.google.protobuf.StructOrBuilder getCapabilitiesOrBuilder() { + if (capabilitiesBuilder_ != null) { + return capabilitiesBuilder_.getMessageOrBuilder(); + } else { + return capabilities_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : capabilities_; + } + } + + /** + * + * + *
+     * The capabilities that a server may support. Known capabilities defined in
+     * https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities
+     * and additional capabilities defined by the servers.
+     * 
+ * + * .google.protobuf.Struct capabilities = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getCapabilitiesFieldBuilder() { + if (capabilitiesBuilder_ == null) { + capabilitiesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getCapabilities(), getParentForChildren(), isClean()); + capabilities_ = null; + } + return capabilitiesBuilder_; + } + + private int state_ = 0; + + /** + * + * + *
+     * Output only. The state of the MCP Server.
+     * 
+ * + * + * .google.cloud.apiregistry.v1beta.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+     * Output only. The state of the MCP Server.
+     * 
+ * + * + * .google.cloud.apiregistry.v1beta.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The state of the MCP Server.
+     * 
+ * + * + * .google.cloud.apiregistry.v1beta.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.State getState() { + com.google.cloud.apiregistry.v1beta.State result = + com.google.cloud.apiregistry.v1beta.State.forNumber(state_); + return result == null ? com.google.cloud.apiregistry.v1beta.State.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Output only. The state of the MCP Server.
+     * 
+ * + * + * .google.cloud.apiregistry.v1beta.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.apiregistry.v1beta.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + state_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The state of the MCP Server.
+     * 
+ * + * + * .google.cloud.apiregistry.v1beta.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000020); + state_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.apiregistry.v1beta.McpServer) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apiregistry.v1beta.McpServer) + private static final com.google.cloud.apiregistry.v1beta.McpServer DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apiregistry.v1beta.McpServer(); + } + + public static com.google.cloud.apiregistry.v1beta.McpServer getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public McpServer parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.McpServer getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/McpServerName.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/McpServerName.java new file mode 100644 index 000000000000..3ee09be6792a --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/McpServerName.java @@ -0,0 +1,377 @@ +/* + * 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; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class McpServerName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_API_NAMESPACE_MCP_SERVER = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/apiNamespaces/{api_namespace}/mcpServers/{mcp_server}"); + private static final PathTemplate PROJECT_LOCATION_MCP_SERVER = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/mcpServers/{mcp_server}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String apiNamespace; + private final String mcpServer; + + @Deprecated + protected McpServerName() { + project = null; + location = null; + apiNamespace = null; + mcpServer = null; + } + + private McpServerName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + apiNamespace = Preconditions.checkNotNull(builder.getApiNamespace()); + mcpServer = Preconditions.checkNotNull(builder.getMcpServer()); + pathTemplate = PROJECT_LOCATION_API_NAMESPACE_MCP_SERVER; + } + + private McpServerName(ProjectLocationMcpServerBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + mcpServer = Preconditions.checkNotNull(builder.getMcpServer()); + apiNamespace = null; + pathTemplate = PROJECT_LOCATION_MCP_SERVER; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getApiNamespace() { + return apiNamespace; + } + + public String getMcpServer() { + return mcpServer; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static Builder newProjectLocationApiNamespaceMcpServerBuilder() { + return new Builder(); + } + + public static ProjectLocationMcpServerBuilder newProjectLocationMcpServerBuilder() { + return new ProjectLocationMcpServerBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static McpServerName of( + String project, String location, String apiNamespace, String mcpServer) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setApiNamespace(apiNamespace) + .setMcpServer(mcpServer) + .build(); + } + + public static McpServerName ofProjectLocationApiNamespaceMcpServerName( + String project, String location, String apiNamespace, String mcpServer) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setApiNamespace(apiNamespace) + .setMcpServer(mcpServer) + .build(); + } + + public static McpServerName ofProjectLocationMcpServerName( + String project, String location, String mcpServer) { + return newProjectLocationMcpServerBuilder() + .setProject(project) + .setLocation(location) + .setMcpServer(mcpServer) + .build(); + } + + public static String format( + String project, String location, String apiNamespace, String mcpServer) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setApiNamespace(apiNamespace) + .setMcpServer(mcpServer) + .build() + .toString(); + } + + public static String formatProjectLocationApiNamespaceMcpServerName( + String project, String location, String apiNamespace, String mcpServer) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setApiNamespace(apiNamespace) + .setMcpServer(mcpServer) + .build() + .toString(); + } + + public static String formatProjectLocationMcpServerName( + String project, String location, String mcpServer) { + return newProjectLocationMcpServerBuilder() + .setProject(project) + .setLocation(location) + .setMcpServer(mcpServer) + .build() + .toString(); + } + + public static McpServerName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_API_NAMESPACE_MCP_SERVER.matches(formattedString)) { + Map matchMap = + PROJECT_LOCATION_API_NAMESPACE_MCP_SERVER.match(formattedString); + return ofProjectLocationApiNamespaceMcpServerName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("api_namespace"), + matchMap.get("mcp_server")); + } else if (PROJECT_LOCATION_MCP_SERVER.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_MCP_SERVER.match(formattedString); + return ofProjectLocationMcpServerName( + matchMap.get("project"), matchMap.get("location"), matchMap.get("mcp_server")); + } + throw new ValidationException("McpServerName.parse: formattedString not in valid format"); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (McpServerName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_API_NAMESPACE_MCP_SERVER.matches(formattedString) + || PROJECT_LOCATION_MCP_SERVER.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (apiNamespace != null) { + fieldMapBuilder.put("api_namespace", apiNamespace); + } + if (mcpServer != null) { + fieldMapBuilder.put("mcp_server", mcpServer); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + McpServerName that = ((McpServerName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.apiNamespace, that.apiNamespace) + && Objects.equals(this.mcpServer, that.mcpServer); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(apiNamespace); + h *= 1000003; + h ^= Objects.hashCode(mcpServer); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/apiNamespaces/{api_namespace}/mcpServers/{mcp_server}. + */ + public static class Builder { + private String project; + private String location; + private String apiNamespace; + private String mcpServer; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getApiNamespace() { + return apiNamespace; + } + + public String getMcpServer() { + return mcpServer; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setApiNamespace(String apiNamespace) { + this.apiNamespace = apiNamespace; + return this; + } + + public Builder setMcpServer(String mcpServer) { + this.mcpServer = mcpServer; + return this; + } + + private Builder(McpServerName mcpServerName) { + Preconditions.checkArgument( + Objects.equals(mcpServerName.pathTemplate, PROJECT_LOCATION_API_NAMESPACE_MCP_SERVER), + "toBuilder is only supported when McpServerName has the pattern of" + + " projects/{project}/locations/{location}/apiNamespaces/{api_namespace}/mcpServers/{mcp_server}"); + this.project = mcpServerName.project; + this.location = mcpServerName.location; + this.apiNamespace = mcpServerName.apiNamespace; + this.mcpServer = mcpServerName.mcpServer; + } + + public McpServerName build() { + return new McpServerName(this); + } + } + + /** Builder for projects/{project}/locations/{location}/mcpServers/{mcp_server}. */ + public static class ProjectLocationMcpServerBuilder { + private String project; + private String location; + private String mcpServer; + + protected ProjectLocationMcpServerBuilder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getMcpServer() { + return mcpServer; + } + + public ProjectLocationMcpServerBuilder setProject(String project) { + this.project = project; + return this; + } + + public ProjectLocationMcpServerBuilder setLocation(String location) { + this.location = location; + return this; + } + + public ProjectLocationMcpServerBuilder setMcpServer(String mcpServer) { + this.mcpServer = mcpServer; + return this; + } + + public McpServerName build() { + return new McpServerName(this); + } + } +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/McpServerOrBuilder.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/McpServerOrBuilder.java new file mode 100644 index 000000000000..9a6b18df5fb6 --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/McpServerOrBuilder.java @@ -0,0 +1,245 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/apiregistry/v1beta/resources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.apiregistry.v1beta; + +public interface McpServerOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apiregistry.v1beta.McpServer) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The resource name of the MCP Server.
+   * Format:
+   * `projects/{project}/locations/{location}/mcpServers/{mcp_server}`.
+   * Example:
+   * projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp
+   * for 1p
+   * projects/12345/locations/us-central1/mcpServers/apphub:starbucks for
+   * 2p
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Identifier. The resource name of the MCP Server.
+   * Format:
+   * `projects/{project}/locations/{location}/mcpServers/{mcp_server}`.
+   * Example:
+   * projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp
+   * for 1p
+   * projects/12345/locations/us-central1/mcpServers/apphub:starbucks for
+   * 2p
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. A human readable name for the MCP server.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + + /** + * + * + *
+   * Optional. A human readable name for the MCP server.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Optional. A human-readable description of the MCP Server's functionality.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
+   * Optional. A human-readable description of the MCP Server's functionality.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
+   * 
+ * + * repeated string urls = 4; + * + * @return A list containing the urls. + */ + java.util.List getUrlsList(); + + /** + * + * + *
+   * The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
+   * 
+ * + * repeated string urls = 4; + * + * @return The count of urls. + */ + int getUrlsCount(); + + /** + * + * + *
+   * The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
+   * 
+ * + * repeated string urls = 4; + * + * @param index The index of the element to return. + * @return The urls at the given index. + */ + java.lang.String getUrls(int index); + + /** + * + * + *
+   * The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
+   * 
+ * + * repeated string urls = 4; + * + * @param index The index of the value to return. + * @return The bytes of the urls at the given index. + */ + com.google.protobuf.ByteString getUrlsBytes(int index); + + /** + * + * + *
+   * The capabilities that a server may support. Known capabilities defined in
+   * https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities
+   * and additional capabilities defined by the servers.
+   * 
+ * + * .google.protobuf.Struct capabilities = 6; + * + * @return Whether the capabilities field is set. + */ + boolean hasCapabilities(); + + /** + * + * + *
+   * The capabilities that a server may support. Known capabilities defined in
+   * https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities
+   * and additional capabilities defined by the servers.
+   * 
+ * + * .google.protobuf.Struct capabilities = 6; + * + * @return The capabilities. + */ + com.google.protobuf.Struct getCapabilities(); + + /** + * + * + *
+   * The capabilities that a server may support. Known capabilities defined in
+   * https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities
+   * and additional capabilities defined by the servers.
+   * 
+ * + * .google.protobuf.Struct capabilities = 6; + */ + com.google.protobuf.StructOrBuilder getCapabilitiesOrBuilder(); + + /** + * + * + *
+   * Output only. The state of the MCP Server.
+   * 
+ * + * + * .google.cloud.apiregistry.v1beta.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + + /** + * + * + *
+   * Output only. The state of the MCP Server.
+   * 
+ * + * + * .google.cloud.apiregistry.v1beta.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.apiregistry.v1beta.State getState(); +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/McpTool.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/McpTool.java new file mode 100644 index 000000000000..3038631e8ff5 --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/McpTool.java @@ -0,0 +1,2409 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/apiregistry/v1beta/resources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.apiregistry.v1beta; + +/** + * + * + *
+ * Message describing McpTool object
+ * 
+ * + * Protobuf type {@code google.cloud.apiregistry.v1beta.McpTool} + */ +public final class McpTool extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.apiregistry.v1beta.McpTool) + McpToolOrBuilder { + private static final long serialVersionUID = 0L; + + // Use McpTool.newBuilder() to construct. + private McpTool(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private McpTool() { + name_ = ""; + displayName_ = ""; + description_ = ""; + mcpServerUrls_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new McpTool(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apiregistry.v1beta.ResourcesProto + .internal_static_google_cloud_apiregistry_v1beta_McpTool_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apiregistry.v1beta.ResourcesProto + .internal_static_google_cloud_apiregistry_v1beta_McpTool_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apiregistry.v1beta.McpTool.class, + com.google.cloud.apiregistry.v1beta.McpTool.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Identifier. The resource name of the McpTool.
+   * Format:
+   * `projects/{project}/locations/{location}/mcpServers/{mcp_server}/mcpTools/{mcp_tool}`.
+   * Example:
+   * projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp/mcpTools/insert_job
+   * for 1p
+   * projects/12345/locations/us-central1/mcpServers/apphub:starbucks/mcpTools/order_pizza
+   * for 2p
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Identifier. The resource name of the McpTool.
+   * Format:
+   * `projects/{project}/locations/{location}/mcpServers/{mcp_server}/mcpTools/{mcp_tool}`.
+   * Example:
+   * projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp/mcpTools/insert_job
+   * for 1p
+   * projects/12345/locations/us-central1/mcpServers/apphub:starbucks/mcpTools/order_pizza
+   * for 2p
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + + /** + * + * + *
+   * Optional. A human-readable name for the tool, suitable for display.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. A human-readable name for the tool, suitable for display.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
+   * A human-readable description of the tool's functionality.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + + /** + * + * + *
+   * A human-readable description of the tool's functionality.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MCP_SERVER_URLS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList mcpServerUrls_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Automatically populated reference to MCP Server. Helpful when multiple
+   * tools are requested across different MCP Servers.
+   * 
+ * + * repeated string mcp_server_urls = 4; + * + * @return A list containing the mcpServerUrls. + */ + public com.google.protobuf.ProtocolStringList getMcpServerUrlsList() { + return mcpServerUrls_; + } + + /** + * + * + *
+   * Automatically populated reference to MCP Server. Helpful when multiple
+   * tools are requested across different MCP Servers.
+   * 
+ * + * repeated string mcp_server_urls = 4; + * + * @return The count of mcpServerUrls. + */ + public int getMcpServerUrlsCount() { + return mcpServerUrls_.size(); + } + + /** + * + * + *
+   * Automatically populated reference to MCP Server. Helpful when multiple
+   * tools are requested across different MCP Servers.
+   * 
+ * + * repeated string mcp_server_urls = 4; + * + * @param index The index of the element to return. + * @return The mcpServerUrls at the given index. + */ + public java.lang.String getMcpServerUrls(int index) { + return mcpServerUrls_.get(index); + } + + /** + * + * + *
+   * Automatically populated reference to MCP Server. Helpful when multiple
+   * tools are requested across different MCP Servers.
+   * 
+ * + * repeated string mcp_server_urls = 4; + * + * @param index The index of the value to return. + * @return The bytes of the mcpServerUrls at the given index. + */ + public com.google.protobuf.ByteString getMcpServerUrlsBytes(int index) { + return mcpServerUrls_.getByteString(index); + } + + public static final int INPUT_SCHEMA_FIELD_NUMBER = 5; + private com.google.protobuf.Struct inputSchema_; + + /** + * + * + *
+   * A JSON Schema object defining the expected parameters for invoking the
+   * tool.
+   * 
+ * + * .google.protobuf.Struct input_schema = 5; + * + * @return Whether the inputSchema field is set. + */ + @java.lang.Override + public boolean hasInputSchema() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * A JSON Schema object defining the expected parameters for invoking the
+   * tool.
+   * 
+ * + * .google.protobuf.Struct input_schema = 5; + * + * @return The inputSchema. + */ + @java.lang.Override + public com.google.protobuf.Struct getInputSchema() { + return inputSchema_ == null ? com.google.protobuf.Struct.getDefaultInstance() : inputSchema_; + } + + /** + * + * + *
+   * A JSON Schema object defining the expected parameters for invoking the
+   * tool.
+   * 
+ * + * .google.protobuf.Struct input_schema = 5; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getInputSchemaOrBuilder() { + return inputSchema_ == null ? com.google.protobuf.Struct.getDefaultInstance() : inputSchema_; + } + + public static final int OUTPUT_SCHEMA_FIELD_NUMBER = 6; + private com.google.protobuf.Struct outputSchema_; + + /** + * + * + *
+   * Optional. A JSON Schema object defining the expected structure of the
+   * tool's output.
+   * 
+ * + * .google.protobuf.Struct output_schema = 6; + * + * @return Whether the outputSchema field is set. + */ + @java.lang.Override + public boolean hasOutputSchema() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. A JSON Schema object defining the expected structure of the
+   * tool's output.
+   * 
+ * + * .google.protobuf.Struct output_schema = 6; + * + * @return The outputSchema. + */ + @java.lang.Override + public com.google.protobuf.Struct getOutputSchema() { + return outputSchema_ == null ? com.google.protobuf.Struct.getDefaultInstance() : outputSchema_; + } + + /** + * + * + *
+   * Optional. A JSON Schema object defining the expected structure of the
+   * tool's output.
+   * 
+ * + * .google.protobuf.Struct output_schema = 6; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getOutputSchemaOrBuilder() { + return outputSchema_ == null ? com.google.protobuf.Struct.getDefaultInstance() : outputSchema_; + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 7; + private com.google.protobuf.Struct annotations_; + + /** + * + * + *
+   * Optional key-value object that allows developers to provide additional
+   * information regarding tool properties, behavior, and usage best practices.
+   * Annotations or tags to facilitate semantic search across tools ("semantic
+   * tags") are not in the MVP scope. When implemented, the first set of
+   * supported annotations will likely be the standard, predefined annotations
+   * from the open-source MCP spec. These include:
+   *   - title: A human-readable title for the tool, useful for UI display.
+   *   - readOnlyHint: If true, indicates the tool does not modify its
+   *   environment.
+   *   - destructiveHint: If true, the tool may perform destructive updates
+   *   (only meaningful when readOnlyHint is false).
+   *   - idempotentHint: If true, calling the tool repeatedly with the same
+   *   arguments has no additional effect (only meaningful when readOnlyHint is
+   *   false).
+   *   - openWorldHint: If true, the tool may interact with an "open world" of
+   *   external entities.
+   * 
+ * + * .google.protobuf.Struct annotations = 7; + * + * @return Whether the annotations field is set. + */ + @java.lang.Override + public boolean hasAnnotations() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Optional key-value object that allows developers to provide additional
+   * information regarding tool properties, behavior, and usage best practices.
+   * Annotations or tags to facilitate semantic search across tools ("semantic
+   * tags") are not in the MVP scope. When implemented, the first set of
+   * supported annotations will likely be the standard, predefined annotations
+   * from the open-source MCP spec. These include:
+   *   - title: A human-readable title for the tool, useful for UI display.
+   *   - readOnlyHint: If true, indicates the tool does not modify its
+   *   environment.
+   *   - destructiveHint: If true, the tool may perform destructive updates
+   *   (only meaningful when readOnlyHint is false).
+   *   - idempotentHint: If true, calling the tool repeatedly with the same
+   *   arguments has no additional effect (only meaningful when readOnlyHint is
+   *   false).
+   *   - openWorldHint: If true, the tool may interact with an "open world" of
+   *   external entities.
+   * 
+ * + * .google.protobuf.Struct annotations = 7; + * + * @return The annotations. + */ + @java.lang.Override + public com.google.protobuf.Struct getAnnotations() { + return annotations_ == null ? com.google.protobuf.Struct.getDefaultInstance() : annotations_; + } + + /** + * + * + *
+   * Optional key-value object that allows developers to provide additional
+   * information regarding tool properties, behavior, and usage best practices.
+   * Annotations or tags to facilitate semantic search across tools ("semantic
+   * tags") are not in the MVP scope. When implemented, the first set of
+   * supported annotations will likely be the standard, predefined annotations
+   * from the open-source MCP spec. These include:
+   *   - title: A human-readable title for the tool, useful for UI display.
+   *   - readOnlyHint: If true, indicates the tool does not modify its
+   *   environment.
+   *   - destructiveHint: If true, the tool may perform destructive updates
+   *   (only meaningful when readOnlyHint is false).
+   *   - idempotentHint: If true, calling the tool repeatedly with the same
+   *   arguments has no additional effect (only meaningful when readOnlyHint is
+   *   false).
+   *   - openWorldHint: If true, the tool may interact with an "open world" of
+   *   external entities.
+   * 
+ * + * .google.protobuf.Struct annotations = 7; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getAnnotationsOrBuilder() { + return annotations_ == null ? com.google.protobuf.Struct.getDefaultInstance() : annotations_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + for (int i = 0; i < mcpServerUrls_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, mcpServerUrls_.getRaw(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getInputSchema()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getOutputSchema()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(7, getAnnotations()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + { + int dataSize = 0; + for (int i = 0; i < mcpServerUrls_.size(); i++) { + dataSize += computeStringSizeNoTag(mcpServerUrls_.getRaw(i)); + } + size += dataSize; + size += 1 * getMcpServerUrlsList().size(); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getInputSchema()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getOutputSchema()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getAnnotations()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.apiregistry.v1beta.McpTool)) { + return super.equals(obj); + } + com.google.cloud.apiregistry.v1beta.McpTool other = + (com.google.cloud.apiregistry.v1beta.McpTool) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getMcpServerUrlsList().equals(other.getMcpServerUrlsList())) return false; + if (hasInputSchema() != other.hasInputSchema()) return false; + if (hasInputSchema()) { + if (!getInputSchema().equals(other.getInputSchema())) return false; + } + if (hasOutputSchema() != other.hasOutputSchema()) return false; + if (hasOutputSchema()) { + if (!getOutputSchema().equals(other.getOutputSchema())) return false; + } + if (hasAnnotations() != other.hasAnnotations()) return false; + if (hasAnnotations()) { + if (!getAnnotations().equals(other.getAnnotations())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getMcpServerUrlsCount() > 0) { + hash = (37 * hash) + MCP_SERVER_URLS_FIELD_NUMBER; + hash = (53 * hash) + getMcpServerUrlsList().hashCode(); + } + if (hasInputSchema()) { + hash = (37 * hash) + INPUT_SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getInputSchema().hashCode(); + } + if (hasOutputSchema()) { + hash = (37 * hash) + OUTPUT_SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getOutputSchema().hashCode(); + } + if (hasAnnotations()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + getAnnotations().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.apiregistry.v1beta.McpTool parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.McpTool parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.McpTool parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.McpTool parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.McpTool parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.apiregistry.v1beta.McpTool parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.McpTool parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.McpTool parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.McpTool parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.McpTool parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.apiregistry.v1beta.McpTool parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.apiregistry.v1beta.McpTool parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.apiregistry.v1beta.McpTool prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Message describing McpTool object
+   * 
+ * + * Protobuf type {@code google.cloud.apiregistry.v1beta.McpTool} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.apiregistry.v1beta.McpTool) + com.google.cloud.apiregistry.v1beta.McpToolOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.apiregistry.v1beta.ResourcesProto + .internal_static_google_cloud_apiregistry_v1beta_McpTool_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.apiregistry.v1beta.ResourcesProto + .internal_static_google_cloud_apiregistry_v1beta_McpTool_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.apiregistry.v1beta.McpTool.class, + com.google.cloud.apiregistry.v1beta.McpTool.Builder.class); + } + + // Construct using com.google.cloud.apiregistry.v1beta.McpTool.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getInputSchemaFieldBuilder(); + getOutputSchemaFieldBuilder(); + getAnnotationsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + description_ = ""; + mcpServerUrls_ = com.google.protobuf.LazyStringArrayList.emptyList(); + inputSchema_ = null; + if (inputSchemaBuilder_ != null) { + inputSchemaBuilder_.dispose(); + inputSchemaBuilder_ = null; + } + outputSchema_ = null; + if (outputSchemaBuilder_ != null) { + outputSchemaBuilder_.dispose(); + outputSchemaBuilder_ = null; + } + annotations_ = null; + if (annotationsBuilder_ != null) { + annotationsBuilder_.dispose(); + annotationsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.apiregistry.v1beta.ResourcesProto + .internal_static_google_cloud_apiregistry_v1beta_McpTool_descriptor; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.McpTool getDefaultInstanceForType() { + return com.google.cloud.apiregistry.v1beta.McpTool.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.McpTool build() { + com.google.cloud.apiregistry.v1beta.McpTool result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.McpTool buildPartial() { + com.google.cloud.apiregistry.v1beta.McpTool result = + new com.google.cloud.apiregistry.v1beta.McpTool(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.apiregistry.v1beta.McpTool result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + mcpServerUrls_.makeImmutable(); + result.mcpServerUrls_ = mcpServerUrls_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.inputSchema_ = + inputSchemaBuilder_ == null ? inputSchema_ : inputSchemaBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.outputSchema_ = + outputSchemaBuilder_ == null ? outputSchema_ : outputSchemaBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.annotations_ = + annotationsBuilder_ == null ? annotations_ : annotationsBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.apiregistry.v1beta.McpTool) { + return mergeFrom((com.google.cloud.apiregistry.v1beta.McpTool) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.apiregistry.v1beta.McpTool other) { + if (other == com.google.cloud.apiregistry.v1beta.McpTool.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.mcpServerUrls_.isEmpty()) { + if (mcpServerUrls_.isEmpty()) { + mcpServerUrls_ = other.mcpServerUrls_; + bitField0_ |= 0x00000008; + } else { + ensureMcpServerUrlsIsMutable(); + mcpServerUrls_.addAll(other.mcpServerUrls_); + } + onChanged(); + } + if (other.hasInputSchema()) { + mergeInputSchema(other.getInputSchema()); + } + if (other.hasOutputSchema()) { + mergeOutputSchema(other.getOutputSchema()); + } + if (other.hasAnnotations()) { + mergeAnnotations(other.getAnnotations()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureMcpServerUrlsIsMutable(); + mcpServerUrls_.add(s); + break; + } // case 34 + case 42: + { + input.readMessage(getInputSchemaFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(getOutputSchemaFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage(getAnnotationsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Identifier. The resource name of the McpTool.
+     * Format:
+     * `projects/{project}/locations/{location}/mcpServers/{mcp_server}/mcpTools/{mcp_tool}`.
+     * Example:
+     * projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp/mcpTools/insert_job
+     * for 1p
+     * projects/12345/locations/us-central1/mcpServers/apphub:starbucks/mcpTools/order_pizza
+     * for 2p
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Identifier. The resource name of the McpTool.
+     * Format:
+     * `projects/{project}/locations/{location}/mcpServers/{mcp_server}/mcpTools/{mcp_tool}`.
+     * Example:
+     * projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp/mcpTools/insert_job
+     * for 1p
+     * projects/12345/locations/us-central1/mcpServers/apphub:starbucks/mcpTools/order_pizza
+     * for 2p
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Identifier. The resource name of the McpTool.
+     * Format:
+     * `projects/{project}/locations/{location}/mcpServers/{mcp_server}/mcpTools/{mcp_tool}`.
+     * Example:
+     * projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp/mcpTools/insert_job
+     * for 1p
+     * projects/12345/locations/us-central1/mcpServers/apphub:starbucks/mcpTools/order_pizza
+     * for 2p
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier. The resource name of the McpTool.
+     * Format:
+     * `projects/{project}/locations/{location}/mcpServers/{mcp_server}/mcpTools/{mcp_tool}`.
+     * Example:
+     * projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp/mcpTools/insert_job
+     * for 1p
+     * projects/12345/locations/us-central1/mcpServers/apphub:starbucks/mcpTools/order_pizza
+     * for 2p
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier. The resource name of the McpTool.
+     * Format:
+     * `projects/{project}/locations/{location}/mcpServers/{mcp_server}/mcpTools/{mcp_tool}`.
+     * Example:
+     * projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp/mcpTools/insert_job
+     * for 1p
+     * projects/12345/locations/us-central1/mcpServers/apphub:starbucks/mcpTools/order_pizza
+     * for 2p
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + + /** + * + * + *
+     * Optional. A human-readable name for the tool, suitable for display.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. A human-readable name for the tool, suitable for display.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. A human-readable name for the tool, suitable for display.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A human-readable name for the tool, suitable for display.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A human-readable name for the tool, suitable for display.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
+     * A human-readable description of the tool's functionality.
+     * 
+ * + * string description = 3; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A human-readable description of the tool's functionality.
+     * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A human-readable description of the tool's functionality.
+     * 
+ * + * string description = 3; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * A human-readable description of the tool's functionality.
+     * 
+ * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * A human-readable description of the tool's functionality.
+     * 
+ * + * string description = 3; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList mcpServerUrls_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureMcpServerUrlsIsMutable() { + if (!mcpServerUrls_.isModifiable()) { + mcpServerUrls_ = new com.google.protobuf.LazyStringArrayList(mcpServerUrls_); + } + bitField0_ |= 0x00000008; + } + + /** + * + * + *
+     * Automatically populated reference to MCP Server. Helpful when multiple
+     * tools are requested across different MCP Servers.
+     * 
+ * + * repeated string mcp_server_urls = 4; + * + * @return A list containing the mcpServerUrls. + */ + public com.google.protobuf.ProtocolStringList getMcpServerUrlsList() { + mcpServerUrls_.makeImmutable(); + return mcpServerUrls_; + } + + /** + * + * + *
+     * Automatically populated reference to MCP Server. Helpful when multiple
+     * tools are requested across different MCP Servers.
+     * 
+ * + * repeated string mcp_server_urls = 4; + * + * @return The count of mcpServerUrls. + */ + public int getMcpServerUrlsCount() { + return mcpServerUrls_.size(); + } + + /** + * + * + *
+     * Automatically populated reference to MCP Server. Helpful when multiple
+     * tools are requested across different MCP Servers.
+     * 
+ * + * repeated string mcp_server_urls = 4; + * + * @param index The index of the element to return. + * @return The mcpServerUrls at the given index. + */ + public java.lang.String getMcpServerUrls(int index) { + return mcpServerUrls_.get(index); + } + + /** + * + * + *
+     * Automatically populated reference to MCP Server. Helpful when multiple
+     * tools are requested across different MCP Servers.
+     * 
+ * + * repeated string mcp_server_urls = 4; + * + * @param index The index of the value to return. + * @return The bytes of the mcpServerUrls at the given index. + */ + public com.google.protobuf.ByteString getMcpServerUrlsBytes(int index) { + return mcpServerUrls_.getByteString(index); + } + + /** + * + * + *
+     * Automatically populated reference to MCP Server. Helpful when multiple
+     * tools are requested across different MCP Servers.
+     * 
+ * + * repeated string mcp_server_urls = 4; + * + * @param index The index to set the value at. + * @param value The mcpServerUrls to set. + * @return This builder for chaining. + */ + public Builder setMcpServerUrls(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMcpServerUrlsIsMutable(); + mcpServerUrls_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Automatically populated reference to MCP Server. Helpful when multiple
+     * tools are requested across different MCP Servers.
+     * 
+ * + * repeated string mcp_server_urls = 4; + * + * @param value The mcpServerUrls to add. + * @return This builder for chaining. + */ + public Builder addMcpServerUrls(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMcpServerUrlsIsMutable(); + mcpServerUrls_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Automatically populated reference to MCP Server. Helpful when multiple
+     * tools are requested across different MCP Servers.
+     * 
+ * + * repeated string mcp_server_urls = 4; + * + * @param values The mcpServerUrls to add. + * @return This builder for chaining. + */ + public Builder addAllMcpServerUrls(java.lang.Iterable values) { + ensureMcpServerUrlsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, mcpServerUrls_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Automatically populated reference to MCP Server. Helpful when multiple
+     * tools are requested across different MCP Servers.
+     * 
+ * + * repeated string mcp_server_urls = 4; + * + * @return This builder for chaining. + */ + public Builder clearMcpServerUrls() { + mcpServerUrls_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Automatically populated reference to MCP Server. Helpful when multiple
+     * tools are requested across different MCP Servers.
+     * 
+ * + * repeated string mcp_server_urls = 4; + * + * @param value The bytes of the mcpServerUrls to add. + * @return This builder for chaining. + */ + public Builder addMcpServerUrlsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureMcpServerUrlsIsMutable(); + mcpServerUrls_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.Struct inputSchema_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + inputSchemaBuilder_; + + /** + * + * + *
+     * A JSON Schema object defining the expected parameters for invoking the
+     * tool.
+     * 
+ * + * .google.protobuf.Struct input_schema = 5; + * + * @return Whether the inputSchema field is set. + */ + public boolean hasInputSchema() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * A JSON Schema object defining the expected parameters for invoking the
+     * tool.
+     * 
+ * + * .google.protobuf.Struct input_schema = 5; + * + * @return The inputSchema. + */ + public com.google.protobuf.Struct getInputSchema() { + if (inputSchemaBuilder_ == null) { + return inputSchema_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : inputSchema_; + } else { + return inputSchemaBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * A JSON Schema object defining the expected parameters for invoking the
+     * tool.
+     * 
+ * + * .google.protobuf.Struct input_schema = 5; + */ + public Builder setInputSchema(com.google.protobuf.Struct value) { + if (inputSchemaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputSchema_ = value; + } else { + inputSchemaBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * A JSON Schema object defining the expected parameters for invoking the
+     * tool.
+     * 
+ * + * .google.protobuf.Struct input_schema = 5; + */ + public Builder setInputSchema(com.google.protobuf.Struct.Builder builderForValue) { + if (inputSchemaBuilder_ == null) { + inputSchema_ = builderForValue.build(); + } else { + inputSchemaBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * A JSON Schema object defining the expected parameters for invoking the
+     * tool.
+     * 
+ * + * .google.protobuf.Struct input_schema = 5; + */ + public Builder mergeInputSchema(com.google.protobuf.Struct value) { + if (inputSchemaBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && inputSchema_ != null + && inputSchema_ != com.google.protobuf.Struct.getDefaultInstance()) { + getInputSchemaBuilder().mergeFrom(value); + } else { + inputSchema_ = value; + } + } else { + inputSchemaBuilder_.mergeFrom(value); + } + if (inputSchema_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * A JSON Schema object defining the expected parameters for invoking the
+     * tool.
+     * 
+ * + * .google.protobuf.Struct input_schema = 5; + */ + public Builder clearInputSchema() { + bitField0_ = (bitField0_ & ~0x00000010); + inputSchema_ = null; + if (inputSchemaBuilder_ != null) { + inputSchemaBuilder_.dispose(); + inputSchemaBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * A JSON Schema object defining the expected parameters for invoking the
+     * tool.
+     * 
+ * + * .google.protobuf.Struct input_schema = 5; + */ + public com.google.protobuf.Struct.Builder getInputSchemaBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getInputSchemaFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * A JSON Schema object defining the expected parameters for invoking the
+     * tool.
+     * 
+ * + * .google.protobuf.Struct input_schema = 5; + */ + public com.google.protobuf.StructOrBuilder getInputSchemaOrBuilder() { + if (inputSchemaBuilder_ != null) { + return inputSchemaBuilder_.getMessageOrBuilder(); + } else { + return inputSchema_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : inputSchema_; + } + } + + /** + * + * + *
+     * A JSON Schema object defining the expected parameters for invoking the
+     * tool.
+     * 
+ * + * .google.protobuf.Struct input_schema = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getInputSchemaFieldBuilder() { + if (inputSchemaBuilder_ == null) { + inputSchemaBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getInputSchema(), getParentForChildren(), isClean()); + inputSchema_ = null; + } + return inputSchemaBuilder_; + } + + private com.google.protobuf.Struct outputSchema_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + outputSchemaBuilder_; + + /** + * + * + *
+     * Optional. A JSON Schema object defining the expected structure of the
+     * tool's output.
+     * 
+ * + * .google.protobuf.Struct output_schema = 6; + * + * @return Whether the outputSchema field is set. + */ + public boolean hasOutputSchema() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Optional. A JSON Schema object defining the expected structure of the
+     * tool's output.
+     * 
+ * + * .google.protobuf.Struct output_schema = 6; + * + * @return The outputSchema. + */ + public com.google.protobuf.Struct getOutputSchema() { + if (outputSchemaBuilder_ == null) { + return outputSchema_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : outputSchema_; + } else { + return outputSchemaBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. A JSON Schema object defining the expected structure of the
+     * tool's output.
+     * 
+ * + * .google.protobuf.Struct output_schema = 6; + */ + public Builder setOutputSchema(com.google.protobuf.Struct value) { + if (outputSchemaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputSchema_ = value; + } else { + outputSchemaBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A JSON Schema object defining the expected structure of the
+     * tool's output.
+     * 
+ * + * .google.protobuf.Struct output_schema = 6; + */ + public Builder setOutputSchema(com.google.protobuf.Struct.Builder builderForValue) { + if (outputSchemaBuilder_ == null) { + outputSchema_ = builderForValue.build(); + } else { + outputSchemaBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A JSON Schema object defining the expected structure of the
+     * tool's output.
+     * 
+ * + * .google.protobuf.Struct output_schema = 6; + */ + public Builder mergeOutputSchema(com.google.protobuf.Struct value) { + if (outputSchemaBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && outputSchema_ != null + && outputSchema_ != com.google.protobuf.Struct.getDefaultInstance()) { + getOutputSchemaBuilder().mergeFrom(value); + } else { + outputSchema_ = value; + } + } else { + outputSchemaBuilder_.mergeFrom(value); + } + if (outputSchema_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. A JSON Schema object defining the expected structure of the
+     * tool's output.
+     * 
+ * + * .google.protobuf.Struct output_schema = 6; + */ + public Builder clearOutputSchema() { + bitField0_ = (bitField0_ & ~0x00000020); + outputSchema_ = null; + if (outputSchemaBuilder_ != null) { + outputSchemaBuilder_.dispose(); + outputSchemaBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A JSON Schema object defining the expected structure of the
+     * tool's output.
+     * 
+ * + * .google.protobuf.Struct output_schema = 6; + */ + public com.google.protobuf.Struct.Builder getOutputSchemaBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getOutputSchemaFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. A JSON Schema object defining the expected structure of the
+     * tool's output.
+     * 
+ * + * .google.protobuf.Struct output_schema = 6; + */ + public com.google.protobuf.StructOrBuilder getOutputSchemaOrBuilder() { + if (outputSchemaBuilder_ != null) { + return outputSchemaBuilder_.getMessageOrBuilder(); + } else { + return outputSchema_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : outputSchema_; + } + } + + /** + * + * + *
+     * Optional. A JSON Schema object defining the expected structure of the
+     * tool's output.
+     * 
+ * + * .google.protobuf.Struct output_schema = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getOutputSchemaFieldBuilder() { + if (outputSchemaBuilder_ == null) { + outputSchemaBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getOutputSchema(), getParentForChildren(), isClean()); + outputSchema_ = null; + } + return outputSchemaBuilder_; + } + + private com.google.protobuf.Struct annotations_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + annotationsBuilder_; + + /** + * + * + *
+     * Optional key-value object that allows developers to provide additional
+     * information regarding tool properties, behavior, and usage best practices.
+     * Annotations or tags to facilitate semantic search across tools ("semantic
+     * tags") are not in the MVP scope. When implemented, the first set of
+     * supported annotations will likely be the standard, predefined annotations
+     * from the open-source MCP spec. These include:
+     *   - title: A human-readable title for the tool, useful for UI display.
+     *   - readOnlyHint: If true, indicates the tool does not modify its
+     *   environment.
+     *   - destructiveHint: If true, the tool may perform destructive updates
+     *   (only meaningful when readOnlyHint is false).
+     *   - idempotentHint: If true, calling the tool repeatedly with the same
+     *   arguments has no additional effect (only meaningful when readOnlyHint is
+     *   false).
+     *   - openWorldHint: If true, the tool may interact with an "open world" of
+     *   external entities.
+     * 
+ * + * .google.protobuf.Struct annotations = 7; + * + * @return Whether the annotations field is set. + */ + public boolean hasAnnotations() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Optional key-value object that allows developers to provide additional
+     * information regarding tool properties, behavior, and usage best practices.
+     * Annotations or tags to facilitate semantic search across tools ("semantic
+     * tags") are not in the MVP scope. When implemented, the first set of
+     * supported annotations will likely be the standard, predefined annotations
+     * from the open-source MCP spec. These include:
+     *   - title: A human-readable title for the tool, useful for UI display.
+     *   - readOnlyHint: If true, indicates the tool does not modify its
+     *   environment.
+     *   - destructiveHint: If true, the tool may perform destructive updates
+     *   (only meaningful when readOnlyHint is false).
+     *   - idempotentHint: If true, calling the tool repeatedly with the same
+     *   arguments has no additional effect (only meaningful when readOnlyHint is
+     *   false).
+     *   - openWorldHint: If true, the tool may interact with an "open world" of
+     *   external entities.
+     * 
+ * + * .google.protobuf.Struct annotations = 7; + * + * @return The annotations. + */ + public com.google.protobuf.Struct getAnnotations() { + if (annotationsBuilder_ == null) { + return annotations_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : annotations_; + } else { + return annotationsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional key-value object that allows developers to provide additional
+     * information regarding tool properties, behavior, and usage best practices.
+     * Annotations or tags to facilitate semantic search across tools ("semantic
+     * tags") are not in the MVP scope. When implemented, the first set of
+     * supported annotations will likely be the standard, predefined annotations
+     * from the open-source MCP spec. These include:
+     *   - title: A human-readable title for the tool, useful for UI display.
+     *   - readOnlyHint: If true, indicates the tool does not modify its
+     *   environment.
+     *   - destructiveHint: If true, the tool may perform destructive updates
+     *   (only meaningful when readOnlyHint is false).
+     *   - idempotentHint: If true, calling the tool repeatedly with the same
+     *   arguments has no additional effect (only meaningful when readOnlyHint is
+     *   false).
+     *   - openWorldHint: If true, the tool may interact with an "open world" of
+     *   external entities.
+     * 
+ * + * .google.protobuf.Struct annotations = 7; + */ + public Builder setAnnotations(com.google.protobuf.Struct value) { + if (annotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + annotations_ = value; + } else { + annotationsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional key-value object that allows developers to provide additional
+     * information regarding tool properties, behavior, and usage best practices.
+     * Annotations or tags to facilitate semantic search across tools ("semantic
+     * tags") are not in the MVP scope. When implemented, the first set of
+     * supported annotations will likely be the standard, predefined annotations
+     * from the open-source MCP spec. These include:
+     *   - title: A human-readable title for the tool, useful for UI display.
+     *   - readOnlyHint: If true, indicates the tool does not modify its
+     *   environment.
+     *   - destructiveHint: If true, the tool may perform destructive updates
+     *   (only meaningful when readOnlyHint is false).
+     *   - idempotentHint: If true, calling the tool repeatedly with the same
+     *   arguments has no additional effect (only meaningful when readOnlyHint is
+     *   false).
+     *   - openWorldHint: If true, the tool may interact with an "open world" of
+     *   external entities.
+     * 
+ * + * .google.protobuf.Struct annotations = 7; + */ + public Builder setAnnotations(com.google.protobuf.Struct.Builder builderForValue) { + if (annotationsBuilder_ == null) { + annotations_ = builderForValue.build(); + } else { + annotationsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional key-value object that allows developers to provide additional
+     * information regarding tool properties, behavior, and usage best practices.
+     * Annotations or tags to facilitate semantic search across tools ("semantic
+     * tags") are not in the MVP scope. When implemented, the first set of
+     * supported annotations will likely be the standard, predefined annotations
+     * from the open-source MCP spec. These include:
+     *   - title: A human-readable title for the tool, useful for UI display.
+     *   - readOnlyHint: If true, indicates the tool does not modify its
+     *   environment.
+     *   - destructiveHint: If true, the tool may perform destructive updates
+     *   (only meaningful when readOnlyHint is false).
+     *   - idempotentHint: If true, calling the tool repeatedly with the same
+     *   arguments has no additional effect (only meaningful when readOnlyHint is
+     *   false).
+     *   - openWorldHint: If true, the tool may interact with an "open world" of
+     *   external entities.
+     * 
+ * + * .google.protobuf.Struct annotations = 7; + */ + public Builder mergeAnnotations(com.google.protobuf.Struct value) { + if (annotationsBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && annotations_ != null + && annotations_ != com.google.protobuf.Struct.getDefaultInstance()) { + getAnnotationsBuilder().mergeFrom(value); + } else { + annotations_ = value; + } + } else { + annotationsBuilder_.mergeFrom(value); + } + if (annotations_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional key-value object that allows developers to provide additional
+     * information regarding tool properties, behavior, and usage best practices.
+     * Annotations or tags to facilitate semantic search across tools ("semantic
+     * tags") are not in the MVP scope. When implemented, the first set of
+     * supported annotations will likely be the standard, predefined annotations
+     * from the open-source MCP spec. These include:
+     *   - title: A human-readable title for the tool, useful for UI display.
+     *   - readOnlyHint: If true, indicates the tool does not modify its
+     *   environment.
+     *   - destructiveHint: If true, the tool may perform destructive updates
+     *   (only meaningful when readOnlyHint is false).
+     *   - idempotentHint: If true, calling the tool repeatedly with the same
+     *   arguments has no additional effect (only meaningful when readOnlyHint is
+     *   false).
+     *   - openWorldHint: If true, the tool may interact with an "open world" of
+     *   external entities.
+     * 
+ * + * .google.protobuf.Struct annotations = 7; + */ + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00000040); + annotations_ = null; + if (annotationsBuilder_ != null) { + annotationsBuilder_.dispose(); + annotationsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional key-value object that allows developers to provide additional
+     * information regarding tool properties, behavior, and usage best practices.
+     * Annotations or tags to facilitate semantic search across tools ("semantic
+     * tags") are not in the MVP scope. When implemented, the first set of
+     * supported annotations will likely be the standard, predefined annotations
+     * from the open-source MCP spec. These include:
+     *   - title: A human-readable title for the tool, useful for UI display.
+     *   - readOnlyHint: If true, indicates the tool does not modify its
+     *   environment.
+     *   - destructiveHint: If true, the tool may perform destructive updates
+     *   (only meaningful when readOnlyHint is false).
+     *   - idempotentHint: If true, calling the tool repeatedly with the same
+     *   arguments has no additional effect (only meaningful when readOnlyHint is
+     *   false).
+     *   - openWorldHint: If true, the tool may interact with an "open world" of
+     *   external entities.
+     * 
+ * + * .google.protobuf.Struct annotations = 7; + */ + public com.google.protobuf.Struct.Builder getAnnotationsBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getAnnotationsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional key-value object that allows developers to provide additional
+     * information regarding tool properties, behavior, and usage best practices.
+     * Annotations or tags to facilitate semantic search across tools ("semantic
+     * tags") are not in the MVP scope. When implemented, the first set of
+     * supported annotations will likely be the standard, predefined annotations
+     * from the open-source MCP spec. These include:
+     *   - title: A human-readable title for the tool, useful for UI display.
+     *   - readOnlyHint: If true, indicates the tool does not modify its
+     *   environment.
+     *   - destructiveHint: If true, the tool may perform destructive updates
+     *   (only meaningful when readOnlyHint is false).
+     *   - idempotentHint: If true, calling the tool repeatedly with the same
+     *   arguments has no additional effect (only meaningful when readOnlyHint is
+     *   false).
+     *   - openWorldHint: If true, the tool may interact with an "open world" of
+     *   external entities.
+     * 
+ * + * .google.protobuf.Struct annotations = 7; + */ + public com.google.protobuf.StructOrBuilder getAnnotationsOrBuilder() { + if (annotationsBuilder_ != null) { + return annotationsBuilder_.getMessageOrBuilder(); + } else { + return annotations_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : annotations_; + } + } + + /** + * + * + *
+     * Optional key-value object that allows developers to provide additional
+     * information regarding tool properties, behavior, and usage best practices.
+     * Annotations or tags to facilitate semantic search across tools ("semantic
+     * tags") are not in the MVP scope. When implemented, the first set of
+     * supported annotations will likely be the standard, predefined annotations
+     * from the open-source MCP spec. These include:
+     *   - title: A human-readable title for the tool, useful for UI display.
+     *   - readOnlyHint: If true, indicates the tool does not modify its
+     *   environment.
+     *   - destructiveHint: If true, the tool may perform destructive updates
+     *   (only meaningful when readOnlyHint is false).
+     *   - idempotentHint: If true, calling the tool repeatedly with the same
+     *   arguments has no additional effect (only meaningful when readOnlyHint is
+     *   false).
+     *   - openWorldHint: If true, the tool may interact with an "open world" of
+     *   external entities.
+     * 
+ * + * .google.protobuf.Struct annotations = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getAnnotationsFieldBuilder() { + if (annotationsBuilder_ == null) { + annotationsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getAnnotations(), getParentForChildren(), isClean()); + annotations_ = null; + } + return annotationsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.apiregistry.v1beta.McpTool) + } + + // @@protoc_insertion_point(class_scope:google.cloud.apiregistry.v1beta.McpTool) + private static final com.google.cloud.apiregistry.v1beta.McpTool DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.apiregistry.v1beta.McpTool(); + } + + public static com.google.cloud.apiregistry.v1beta.McpTool getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public McpTool parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.apiregistry.v1beta.McpTool getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/McpToolName.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/McpToolName.java new file mode 100644 index 000000000000..abf61cee8a85 --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/McpToolName.java @@ -0,0 +1,426 @@ +/* + * 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; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class McpToolName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_API_NAMESPACE_MCP_SERVER_MCP_TOOL = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/apiNamespaces/{api_namespace}/mcpServers/{mcp_server}/mcpTools/{mcp_tool}"); + private static final PathTemplate PROJECT_LOCATION_MCP_SERVER_MCP_TOOL = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/mcpServers/{mcp_server}/mcpTools/{mcp_tool}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String apiNamespace; + private final String mcpServer; + private final String mcpTool; + + @Deprecated + protected McpToolName() { + project = null; + location = null; + apiNamespace = null; + mcpServer = null; + mcpTool = null; + } + + private McpToolName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + apiNamespace = Preconditions.checkNotNull(builder.getApiNamespace()); + mcpServer = Preconditions.checkNotNull(builder.getMcpServer()); + mcpTool = Preconditions.checkNotNull(builder.getMcpTool()); + pathTemplate = PROJECT_LOCATION_API_NAMESPACE_MCP_SERVER_MCP_TOOL; + } + + private McpToolName(ProjectLocationMcpServerMcpToolBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + mcpServer = Preconditions.checkNotNull(builder.getMcpServer()); + mcpTool = Preconditions.checkNotNull(builder.getMcpTool()); + apiNamespace = null; + pathTemplate = PROJECT_LOCATION_MCP_SERVER_MCP_TOOL; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getApiNamespace() { + return apiNamespace; + } + + public String getMcpServer() { + return mcpServer; + } + + public String getMcpTool() { + return mcpTool; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static Builder newProjectLocationApiNamespaceMcpServerMcpToolBuilder() { + return new Builder(); + } + + public static ProjectLocationMcpServerMcpToolBuilder newProjectLocationMcpServerMcpToolBuilder() { + return new ProjectLocationMcpServerMcpToolBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static McpToolName of( + String project, String location, String apiNamespace, String mcpServer, String mcpTool) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setApiNamespace(apiNamespace) + .setMcpServer(mcpServer) + .setMcpTool(mcpTool) + .build(); + } + + public static McpToolName ofProjectLocationApiNamespaceMcpServerMcpToolName( + String project, String location, String apiNamespace, String mcpServer, String mcpTool) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setApiNamespace(apiNamespace) + .setMcpServer(mcpServer) + .setMcpTool(mcpTool) + .build(); + } + + public static McpToolName ofProjectLocationMcpServerMcpToolName( + String project, String location, String mcpServer, String mcpTool) { + return newProjectLocationMcpServerMcpToolBuilder() + .setProject(project) + .setLocation(location) + .setMcpServer(mcpServer) + .setMcpTool(mcpTool) + .build(); + } + + public static String format( + String project, String location, String apiNamespace, String mcpServer, String mcpTool) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setApiNamespace(apiNamespace) + .setMcpServer(mcpServer) + .setMcpTool(mcpTool) + .build() + .toString(); + } + + public static String formatProjectLocationApiNamespaceMcpServerMcpToolName( + String project, String location, String apiNamespace, String mcpServer, String mcpTool) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setApiNamespace(apiNamespace) + .setMcpServer(mcpServer) + .setMcpTool(mcpTool) + .build() + .toString(); + } + + public static String formatProjectLocationMcpServerMcpToolName( + String project, String location, String mcpServer, String mcpTool) { + return newProjectLocationMcpServerMcpToolBuilder() + .setProject(project) + .setLocation(location) + .setMcpServer(mcpServer) + .setMcpTool(mcpTool) + .build() + .toString(); + } + + public static McpToolName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_API_NAMESPACE_MCP_SERVER_MCP_TOOL.matches(formattedString)) { + Map matchMap = + PROJECT_LOCATION_API_NAMESPACE_MCP_SERVER_MCP_TOOL.match(formattedString); + return ofProjectLocationApiNamespaceMcpServerMcpToolName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("api_namespace"), + matchMap.get("mcp_server"), + matchMap.get("mcp_tool")); + } else if (PROJECT_LOCATION_MCP_SERVER_MCP_TOOL.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_MCP_SERVER_MCP_TOOL.match(formattedString); + return ofProjectLocationMcpServerMcpToolName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("mcp_server"), + matchMap.get("mcp_tool")); + } + throw new ValidationException("McpToolName.parse: formattedString not in valid format"); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (McpToolName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_API_NAMESPACE_MCP_SERVER_MCP_TOOL.matches(formattedString) + || PROJECT_LOCATION_MCP_SERVER_MCP_TOOL.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (apiNamespace != null) { + fieldMapBuilder.put("api_namespace", apiNamespace); + } + if (mcpServer != null) { + fieldMapBuilder.put("mcp_server", mcpServer); + } + if (mcpTool != null) { + fieldMapBuilder.put("mcp_tool", mcpTool); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + McpToolName that = ((McpToolName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.apiNamespace, that.apiNamespace) + && Objects.equals(this.mcpServer, that.mcpServer) + && Objects.equals(this.mcpTool, that.mcpTool); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(apiNamespace); + h *= 1000003; + h ^= Objects.hashCode(mcpServer); + h *= 1000003; + h ^= Objects.hashCode(mcpTool); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/apiNamespaces/{api_namespace}/mcpServers/{mcp_server}/mcpTools/{mcp_tool}. + */ + public static class Builder { + private String project; + private String location; + private String apiNamespace; + private String mcpServer; + private String mcpTool; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getApiNamespace() { + return apiNamespace; + } + + public String getMcpServer() { + return mcpServer; + } + + public String getMcpTool() { + return mcpTool; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setApiNamespace(String apiNamespace) { + this.apiNamespace = apiNamespace; + return this; + } + + public Builder setMcpServer(String mcpServer) { + this.mcpServer = mcpServer; + return this; + } + + public Builder setMcpTool(String mcpTool) { + this.mcpTool = mcpTool; + return this; + } + + private Builder(McpToolName mcpToolName) { + Preconditions.checkArgument( + Objects.equals( + mcpToolName.pathTemplate, PROJECT_LOCATION_API_NAMESPACE_MCP_SERVER_MCP_TOOL), + "toBuilder is only supported when McpToolName has the pattern of" + + " projects/{project}/locations/{location}/apiNamespaces/{api_namespace}/mcpServers/{mcp_server}/mcpTools/{mcp_tool}"); + this.project = mcpToolName.project; + this.location = mcpToolName.location; + this.apiNamespace = mcpToolName.apiNamespace; + this.mcpServer = mcpToolName.mcpServer; + this.mcpTool = mcpToolName.mcpTool; + } + + public McpToolName build() { + return new McpToolName(this); + } + } + + /** + * Builder for + * projects/{project}/locations/{location}/mcpServers/{mcp_server}/mcpTools/{mcp_tool}. + */ + public static class ProjectLocationMcpServerMcpToolBuilder { + private String project; + private String location; + private String mcpServer; + private String mcpTool; + + protected ProjectLocationMcpServerMcpToolBuilder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getMcpServer() { + return mcpServer; + } + + public String getMcpTool() { + return mcpTool; + } + + public ProjectLocationMcpServerMcpToolBuilder setProject(String project) { + this.project = project; + return this; + } + + public ProjectLocationMcpServerMcpToolBuilder setLocation(String location) { + this.location = location; + return this; + } + + public ProjectLocationMcpServerMcpToolBuilder setMcpServer(String mcpServer) { + this.mcpServer = mcpServer; + return this; + } + + public ProjectLocationMcpServerMcpToolBuilder setMcpTool(String mcpTool) { + this.mcpTool = mcpTool; + return this; + } + + public McpToolName build() { + return new McpToolName(this); + } + } +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/McpToolOrBuilder.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/McpToolOrBuilder.java new file mode 100644 index 000000000000..8d636b0f7d6a --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/McpToolOrBuilder.java @@ -0,0 +1,338 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/apiregistry/v1beta/resources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.apiregistry.v1beta; + +public interface McpToolOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.apiregistry.v1beta.McpTool) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The resource name of the McpTool.
+   * Format:
+   * `projects/{project}/locations/{location}/mcpServers/{mcp_server}/mcpTools/{mcp_tool}`.
+   * Example:
+   * projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp/mcpTools/insert_job
+   * for 1p
+   * projects/12345/locations/us-central1/mcpServers/apphub:starbucks/mcpTools/order_pizza
+   * for 2p
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Identifier. The resource name of the McpTool.
+   * Format:
+   * `projects/{project}/locations/{location}/mcpServers/{mcp_server}/mcpTools/{mcp_tool}`.
+   * Example:
+   * projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp/mcpTools/insert_job
+   * for 1p
+   * projects/12345/locations/us-central1/mcpServers/apphub:starbucks/mcpTools/order_pizza
+   * for 2p
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. A human-readable name for the tool, suitable for display.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + + /** + * + * + *
+   * Optional. A human-readable name for the tool, suitable for display.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * A human-readable description of the tool's functionality.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
+   * A human-readable description of the tool's functionality.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Automatically populated reference to MCP Server. Helpful when multiple
+   * tools are requested across different MCP Servers.
+   * 
+ * + * repeated string mcp_server_urls = 4; + * + * @return A list containing the mcpServerUrls. + */ + java.util.List getMcpServerUrlsList(); + + /** + * + * + *
+   * Automatically populated reference to MCP Server. Helpful when multiple
+   * tools are requested across different MCP Servers.
+   * 
+ * + * repeated string mcp_server_urls = 4; + * + * @return The count of mcpServerUrls. + */ + int getMcpServerUrlsCount(); + + /** + * + * + *
+   * Automatically populated reference to MCP Server. Helpful when multiple
+   * tools are requested across different MCP Servers.
+   * 
+ * + * repeated string mcp_server_urls = 4; + * + * @param index The index of the element to return. + * @return The mcpServerUrls at the given index. + */ + java.lang.String getMcpServerUrls(int index); + + /** + * + * + *
+   * Automatically populated reference to MCP Server. Helpful when multiple
+   * tools are requested across different MCP Servers.
+   * 
+ * + * repeated string mcp_server_urls = 4; + * + * @param index The index of the value to return. + * @return The bytes of the mcpServerUrls at the given index. + */ + com.google.protobuf.ByteString getMcpServerUrlsBytes(int index); + + /** + * + * + *
+   * A JSON Schema object defining the expected parameters for invoking the
+   * tool.
+   * 
+ * + * .google.protobuf.Struct input_schema = 5; + * + * @return Whether the inputSchema field is set. + */ + boolean hasInputSchema(); + + /** + * + * + *
+   * A JSON Schema object defining the expected parameters for invoking the
+   * tool.
+   * 
+ * + * .google.protobuf.Struct input_schema = 5; + * + * @return The inputSchema. + */ + com.google.protobuf.Struct getInputSchema(); + + /** + * + * + *
+   * A JSON Schema object defining the expected parameters for invoking the
+   * tool.
+   * 
+ * + * .google.protobuf.Struct input_schema = 5; + */ + com.google.protobuf.StructOrBuilder getInputSchemaOrBuilder(); + + /** + * + * + *
+   * Optional. A JSON Schema object defining the expected structure of the
+   * tool's output.
+   * 
+ * + * .google.protobuf.Struct output_schema = 6; + * + * @return Whether the outputSchema field is set. + */ + boolean hasOutputSchema(); + + /** + * + * + *
+   * Optional. A JSON Schema object defining the expected structure of the
+   * tool's output.
+   * 
+ * + * .google.protobuf.Struct output_schema = 6; + * + * @return The outputSchema. + */ + com.google.protobuf.Struct getOutputSchema(); + + /** + * + * + *
+   * Optional. A JSON Schema object defining the expected structure of the
+   * tool's output.
+   * 
+ * + * .google.protobuf.Struct output_schema = 6; + */ + com.google.protobuf.StructOrBuilder getOutputSchemaOrBuilder(); + + /** + * + * + *
+   * Optional key-value object that allows developers to provide additional
+   * information regarding tool properties, behavior, and usage best practices.
+   * Annotations or tags to facilitate semantic search across tools ("semantic
+   * tags") are not in the MVP scope. When implemented, the first set of
+   * supported annotations will likely be the standard, predefined annotations
+   * from the open-source MCP spec. These include:
+   *   - title: A human-readable title for the tool, useful for UI display.
+   *   - readOnlyHint: If true, indicates the tool does not modify its
+   *   environment.
+   *   - destructiveHint: If true, the tool may perform destructive updates
+   *   (only meaningful when readOnlyHint is false).
+   *   - idempotentHint: If true, calling the tool repeatedly with the same
+   *   arguments has no additional effect (only meaningful when readOnlyHint is
+   *   false).
+   *   - openWorldHint: If true, the tool may interact with an "open world" of
+   *   external entities.
+   * 
+ * + * .google.protobuf.Struct annotations = 7; + * + * @return Whether the annotations field is set. + */ + boolean hasAnnotations(); + + /** + * + * + *
+   * Optional key-value object that allows developers to provide additional
+   * information regarding tool properties, behavior, and usage best practices.
+   * Annotations or tags to facilitate semantic search across tools ("semantic
+   * tags") are not in the MVP scope. When implemented, the first set of
+   * supported annotations will likely be the standard, predefined annotations
+   * from the open-source MCP spec. These include:
+   *   - title: A human-readable title for the tool, useful for UI display.
+   *   - readOnlyHint: If true, indicates the tool does not modify its
+   *   environment.
+   *   - destructiveHint: If true, the tool may perform destructive updates
+   *   (only meaningful when readOnlyHint is false).
+   *   - idempotentHint: If true, calling the tool repeatedly with the same
+   *   arguments has no additional effect (only meaningful when readOnlyHint is
+   *   false).
+   *   - openWorldHint: If true, the tool may interact with an "open world" of
+   *   external entities.
+   * 
+ * + * .google.protobuf.Struct annotations = 7; + * + * @return The annotations. + */ + com.google.protobuf.Struct getAnnotations(); + + /** + * + * + *
+   * Optional key-value object that allows developers to provide additional
+   * information regarding tool properties, behavior, and usage best practices.
+   * Annotations or tags to facilitate semantic search across tools ("semantic
+   * tags") are not in the MVP scope. When implemented, the first set of
+   * supported annotations will likely be the standard, predefined annotations
+   * from the open-source MCP spec. These include:
+   *   - title: A human-readable title for the tool, useful for UI display.
+   *   - readOnlyHint: If true, indicates the tool does not modify its
+   *   environment.
+   *   - destructiveHint: If true, the tool may perform destructive updates
+   *   (only meaningful when readOnlyHint is false).
+   *   - idempotentHint: If true, calling the tool repeatedly with the same
+   *   arguments has no additional effect (only meaningful when readOnlyHint is
+   *   false).
+   *   - openWorldHint: If true, the tool may interact with an "open world" of
+   *   external entities.
+   * 
+ * + * .google.protobuf.Struct annotations = 7; + */ + com.google.protobuf.StructOrBuilder getAnnotationsOrBuilder(); +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ResourcesProto.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ResourcesProto.java new file mode 100644 index 000000000000..48830a5bab6f --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ResourcesProto.java @@ -0,0 +1,127 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/apiregistry/v1beta/resources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.apiregistry.v1beta; + +public final class ResourcesProto { + private ResourcesProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apiregistry_v1beta_McpServer_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apiregistry_v1beta_McpServer_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apiregistry_v1beta_McpTool_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apiregistry_v1beta_McpTool_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n" + + "/google/cloud/apiregistry/v1beta/resources.proto\022\037google.cloud.apiregistry.v1be" + + "ta\032\037google/api/field_behavior.proto\032\031goo" + + "gle/api/resource.proto\032,google/cloud/api" + + "registry/v1beta/common.proto\032\034google/protobuf/struct.proto\"\265\003\n" + + "\tMcpServer\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\010\022\031\n" + + "\014display_name\030\002 \001(\tB\003\340A\001\022\030\n" + + "\013description\030\003 \001(\tB\003\340A\001\022\014\n" + + "\004urls\030\004 \003(\t\022-\n" + + "\014capabilities\030\006 \001(\0132\027.google.protobuf.Struct\022:\n" + + "\005state\030\007" + + " \001(\0162&.google.cloud.apiregistry.v1beta.StateB\003\340A\003:\346\001\352A\342\001\n" + + ")cloudapiregistry.googleapis.com/McpServer\022]pro" + + "jects/{project}/locations/{location}/apiNamespaces/{api_namespace}/mcpServers/{m" + + "cp_server}\022?projects/{project}/locations/{location}/mcpServers/{mcp_server}*\n" + + "mcpServers2\tmcpServer\"\375\003\n" + + "\007McpTool\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\010\022\031\n" + + "\014display_name\030\002 \001(\tB\003\340A\001\022\023\n" + + "\013description\030\003 \001(\t\022\027\n" + + "\017mcp_server_urls\030\004 \003(\t\022-\n" + + "\014input_schema\030\005 \001(\0132\027.google.protobuf.Struct\022.\n\r" + + "output_schema\030\006 \001(\0132\027.google.protobuf.Struct\022,\n" + + "\013annotations\030\007 \001(\0132\027.google.protobuf.Struct:\210\002\352A\204\002\n" + + "\'cloudapiregistry.googleapis.com/McpTool\022qproject" + + "s/{project}/locations/{location}/apiNamespaces/{api_namespace}/mcpServers/{mcp_s" + + "erver}/mcpTools/{mcp_tool}\022Sprojects/{project}/locations/{location}/mcpServers/{" + + "mcp_server}/mcpTools/{mcp_tool}*\010mcpTools2\007mcpToolB\347\001\n" + + "#com.google.cloud.apiregistry.v1betaB\016ResourcesProtoP\001ZEcloud.goog" + + "le.com/go/apiregistry/apiv1beta/apiregis" + + "trypb;apiregistrypb\252\002\037Google.Cloud.ApiRe" + + "gistry.V1Beta\312\002\037Google\\Cloud\\ApiRegistry" + + "\\V1beta\352\002\"Google::Cloud::ApiRegistry::V1betab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.apiregistry.v1beta.CommonProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + }); + internal_static_google_cloud_apiregistry_v1beta_McpServer_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_apiregistry_v1beta_McpServer_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apiregistry_v1beta_McpServer_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "Description", "Urls", "Capabilities", "State", + }); + internal_static_google_cloud_apiregistry_v1beta_McpTool_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_apiregistry_v1beta_McpTool_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apiregistry_v1beta_McpTool_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Description", + "McpServerUrls", + "InputSchema", + "OutputSchema", + "Annotations", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.apiregistry.v1beta.CommonProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ServiceProto.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ServiceProto.java new file mode 100644 index 000000000000..7868fb10d3dd --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/ServiceProto.java @@ -0,0 +1,203 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/apiregistry/v1beta/service.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.apiregistry.v1beta; + +public final class ServiceProto { + private ServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apiregistry_v1beta_GetMcpServerRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apiregistry_v1beta_GetMcpServerRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apiregistry_v1beta_ListMcpServersRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apiregistry_v1beta_ListMcpServersRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apiregistry_v1beta_ListMcpServersResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apiregistry_v1beta_ListMcpServersResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apiregistry_v1beta_GetMcpToolRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apiregistry_v1beta_GetMcpToolRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apiregistry_v1beta_ListMcpToolsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apiregistry_v1beta_ListMcpToolsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_apiregistry_v1beta_ListMcpToolsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_apiregistry_v1beta_ListMcpToolsResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n" + + "-google/cloud/apiregistry/v1beta/service.proto\022\037google.cloud.apiregistry.v1beta" + + "\032\034google/api/annotations.proto\032\027google/a" + + "pi/client.proto\032\037google/api/field_behavi" + + "or.proto\032\031google/api/resource.proto\032/goo" + + "gle/cloud/apiregistry/v1beta/resources.proto\"V\n" + + "\023GetMcpServerRequest\022?\n" + + "\004name\030\001 \001(\tB1\340A\002\372A+\n" + + ")cloudapiregistry.googleapis.com/McpServer\"\257\001\n" + + "\025ListMcpServersRequest\0229\n" + + "\006parent\030\001 \001(\tB)\340A\002\372A#\n" + + "!locations.googleapis.com/Location\022\026\n" + + "\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\n" + + "page_token\030\003 \001(\tB\003\340A\001\022\023\n" + + "\006filter\030\004 \001(\tB\003\340A\001\022\025\n" + + "\010order_by\030\005 \001(\tB\003\340A\001\"\207\001\n" + + "\026ListMcpServersResponse\022?\n" + + "\013mcp_servers\030\001 \003(\0132*" + + ".google.cloud.apiregistry.v1beta.McpServer\022\027\n" + + "\017next_page_token\030\002 \001(\t\022\023\n" + + "\013unreachable\030\003 \003(\t\"R\n" + + "\021GetMcpToolRequest\022=\n" + + "\004name\030\001 \001(\tB/\340A\002\372A)\n" + + "\'cloudapiregistry.googleapis.com/McpTool\"\263\001\n" + + "\023ListMcpToolsRequest\022?\n" + + "\006parent\030\001 \001(" + + "\tB/\340A\002\372A)\022\'cloudapiregistry.googleapis.com/McpTool\022\026\n" + + "\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\n" + + "page_token\030\003 \001(\tB\003\340A\001\022\023\n" + + "\006filter\030\004 \001(\tB\003\340A\001\022\025\n" + + "\010order_by\030\005 \001(\tB\003\340A\001\"\201\001\n" + + "\024ListMcpToolsResponse\022;\n" + + "\tmcp_tools\030\001 \003(\0132(.google.cloud.apiregistry.v1beta.McpTool\022\027\n" + + "\017next_page_token\030\002 \001(\t\022\023\n" + + "\013unreachable\030\003 \003(\t2\357\006\n" + + "\020CloudApiRegistry\022\263\001\n" + + "\014GetMcpServer\0224.google.cloud.apiregistry.v1beta.G" + + "etMcpServerRequest\032*.google.cloud.apireg" + + "istry.v1beta.McpServer\"A\332A\004name\202\323\344\223\0024\0222/" + + "v1beta/{name=projects/*/locations/*/mcpServers/*}\022\306\001\n" + + "\016ListMcpServers\0226.google.cloud.apiregistry.v1beta.ListMcpServersReq" + + "uest\0327.google.cloud.apiregistry.v1beta.L" + + "istMcpServersResponse\"C\332A\006parent\202\323\344\223\0024\0222" + + "/v1beta/{parent=projects/*/locations/*}/mcpServers\022\270\001\n\n" + + "GetMcpTool\0222.google.cloud.apiregistry.v1beta.GetMcpToolRequest\032(." + + "google.cloud.apiregistry.v1beta.McpTool\"" + + "L\332A\004name\202\323\344\223\002?\022=/v1beta/{name=projects/*" + + "/locations/*/mcpServers/*/mcpTools/*}\022\313\001\n" + + "\014ListMcpTools\0224.google.cloud.apiregistr" + + "y.v1beta.ListMcpToolsRequest\0325.google.cloud.apiregistry.v1beta.ListMcpToolsRespo" + + "nse\"N\332A\006parent\202\323\344\223\002?\022=/v1beta/{parent=pr" + + "ojects/*/locations/*/mcpServers/*}/mcpTo" + + "ols\032S\312A\037cloudapiregistry.googleapis.com\322" + + "A.https://www.googleapis.com/auth/cloud-platformB\335\002\n" + + "#com.google.cloud.apiregistry.v1betaB\014ServiceProtoP\001ZEcloud.google.c" + + "om/go/apiregistry/apiv1beta/apiregistryp" + + "b;apiregistrypb\252\002\037Google.Cloud.ApiRegist" + + "ry.V1Beta\312\002\037Google\\Cloud\\ApiRegistry\\V1b" + + "eta\352\002\"Google::Cloud::ApiRegistry::V1beta\352Au\n" + + ",cloudapiregistry.googleapis.com/ApiNamespace\022Eprojects/{project}/locations/" + + "{location}/apiNamespaces/{api_namespace}b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.apiregistry.v1beta.ResourcesProto.getDescriptor(), + }); + internal_static_google_cloud_apiregistry_v1beta_GetMcpServerRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_apiregistry_v1beta_GetMcpServerRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apiregistry_v1beta_GetMcpServerRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apiregistry_v1beta_ListMcpServersRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_apiregistry_v1beta_ListMcpServersRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apiregistry_v1beta_ListMcpServersRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_apiregistry_v1beta_ListMcpServersResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_apiregistry_v1beta_ListMcpServersResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apiregistry_v1beta_ListMcpServersResponse_descriptor, + new java.lang.String[] { + "McpServers", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_apiregistry_v1beta_GetMcpToolRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_apiregistry_v1beta_GetMcpToolRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apiregistry_v1beta_GetMcpToolRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_apiregistry_v1beta_ListMcpToolsRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_apiregistry_v1beta_ListMcpToolsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apiregistry_v1beta_ListMcpToolsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_apiregistry_v1beta_ListMcpToolsResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_apiregistry_v1beta_ListMcpToolsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_apiregistry_v1beta_ListMcpToolsResponse_descriptor, + new java.lang.String[] { + "McpTools", "NextPageToken", "Unreachable", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.apiregistry.v1beta.ResourcesProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/State.java b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/State.java new file mode 100644 index 000000000000..283da280e409 --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/java/com/google/cloud/apiregistry/v1beta/State.java @@ -0,0 +1,179 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/apiregistry/v1beta/common.proto + +// Protobuf Java Version: 3.25.8 +package com.google.cloud.apiregistry.v1beta; + +/** + * + * + *
+ * The state of McpServer resource.
+ * 
+ * + * Protobuf enum {@code google.cloud.apiregistry.v1beta.State} + */ +public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The McpServer state is unspecified.
+   * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+   * The McpServer is enabled.
+   * 
+ * + * ENABLED = 1; + */ + ENABLED(1), + /** + * + * + *
+   * The McpServer is disabled.
+   * 
+ * + * DISABLED = 2; + */ + DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * The McpServer state is unspecified.
+   * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * The McpServer is enabled.
+   * 
+ * + * ENABLED = 1; + */ + public static final int ENABLED_VALUE = 1; + + /** + * + * + *
+   * The McpServer is disabled.
+   * 
+ * + * DISABLED = 2; + */ + public static final int DISABLED_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return ENABLED; + case 2: + return DISABLED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.apiregistry.v1beta.CommonProto.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.apiregistry.v1beta.State) +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/proto/google/cloud/apiregistry/v1beta/common.proto b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/proto/google/cloud/apiregistry/v1beta/common.proto new file mode 100644 index 000000000000..55d73c0ffaa2 --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/proto/google/cloud/apiregistry/v1beta/common.proto @@ -0,0 +1,37 @@ +// Copyright 2025 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.apiregistry.v1beta; + +option csharp_namespace = "Google.Cloud.ApiRegistry.V1Beta"; +option go_package = "cloud.google.com/go/apiregistry/apiv1beta/apiregistrypb;apiregistrypb"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.cloud.apiregistry.v1beta"; +option php_namespace = "Google\\Cloud\\ApiRegistry\\V1beta"; +option ruby_package = "Google::Cloud::ApiRegistry::V1beta"; + +// The state of McpServer resource. +enum State { + // The McpServer state is unspecified. + STATE_UNSPECIFIED = 0; + + // The McpServer is enabled. + ENABLED = 1; + + // The McpServer is disabled. + DISABLED = 2; +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/proto/google/cloud/apiregistry/v1beta/resources.proto b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/proto/google/cloud/apiregistry/v1beta/resources.proto new file mode 100644 index 000000000000..a9b0dd115186 --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/proto/google/cloud/apiregistry/v1beta/resources.proto @@ -0,0 +1,126 @@ +// Copyright 2025 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.apiregistry.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/apiregistry/v1beta/common.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.ApiRegistry.V1Beta"; +option go_package = "cloud.google.com/go/apiregistry/apiv1beta/apiregistrypb;apiregistrypb"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.google.cloud.apiregistry.v1beta"; +option php_namespace = "Google\\Cloud\\ApiRegistry\\V1beta"; +option ruby_package = "Google::Cloud::ApiRegistry::V1beta"; + +// Represents an MCP Server. MCP Servers act as endpoints that expose a +// collection of tools that can be invoked by agents. +message McpServer { + option (google.api.resource) = { + type: "cloudapiregistry.googleapis.com/McpServer" + pattern: "projects/{project}/locations/{location}/apiNamespaces/{api_namespace}/mcpServers/{mcp_server}" + pattern: "projects/{project}/locations/{location}/mcpServers/{mcp_server}" + plural: "mcpServers" + singular: "mcpServer" + }; + + // Identifier. The resource name of the MCP Server. + // Format: + // `projects/{project}/locations/{location}/mcpServers/{mcp_server}`. + // Example: + // projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp + // for 1p + // projects/12345/locations/us-central1/mcpServers/apphub:starbucks for + // 2p + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Optional. A human readable name for the MCP server. + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A human-readable description of the MCP Server's functionality. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp]. + repeated string urls = 4; + + // The capabilities that a server may support. Known capabilities defined in + // https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities + // and additional capabilities defined by the servers. + google.protobuf.Struct capabilities = 6; + + // Output only. The state of the MCP Server. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message describing McpTool object +message McpTool { + option (google.api.resource) = { + type: "cloudapiregistry.googleapis.com/McpTool" + pattern: "projects/{project}/locations/{location}/apiNamespaces/{api_namespace}/mcpServers/{mcp_server}/mcpTools/{mcp_tool}" + pattern: "projects/{project}/locations/{location}/mcpServers/{mcp_server}/mcpTools/{mcp_tool}" + plural: "mcpTools" + singular: "mcpTool" + }; + + // Identifier. The resource name of the McpTool. + // Format: + // `projects/{project}/locations/{location}/mcpServers/{mcp_server}/mcpTools/{mcp_tool}`. + // Example: + // projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp/mcpTools/insert_job + // for 1p + // projects/12345/locations/us-central1/mcpServers/apphub:starbucks/mcpTools/order_pizza + // for 2p + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Optional. A human-readable name for the tool, suitable for display. + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // A human-readable description of the tool's functionality. + string description = 3; + + // Automatically populated reference to MCP Server. Helpful when multiple + // tools are requested across different MCP Servers. + repeated string mcp_server_urls = 4; + + // A JSON Schema object defining the expected parameters for invoking the + // tool. + google.protobuf.Struct input_schema = 5; + + // Optional. A JSON Schema object defining the expected structure of the + // tool's output. + google.protobuf.Struct output_schema = 6; + + // Optional key-value object that allows developers to provide additional + // information regarding tool properties, behavior, and usage best practices. + // Annotations or tags to facilitate semantic search across tools ("semantic + // tags") are not in the MVP scope. When implemented, the first set of + // supported annotations will likely be the standard, predefined annotations + // from the open-source MCP spec. These include: + // - title: A human-readable title for the tool, useful for UI display. + // - readOnlyHint: If true, indicates the tool does not modify its + // environment. + // - destructiveHint: If true, the tool may perform destructive updates + // (only meaningful when readOnlyHint is false). + // - idempotentHint: If true, calling the tool repeatedly with the same + // arguments has no additional effect (only meaningful when readOnlyHint is + // false). + // - openWorldHint: If true, the tool may interact with an "open world" of + // external entities. + google.protobuf.Struct annotations = 7; +} diff --git a/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/proto/google/cloud/apiregistry/v1beta/service.proto b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/proto/google/cloud/apiregistry/v1beta/service.proto new file mode 100644 index 000000000000..e66bc65c4d4d --- /dev/null +++ b/java-cloudapiregistry/proto-google-cloud-cloudapiregistry-v1beta/src/main/proto/google/cloud/apiregistry/v1beta/service.proto @@ -0,0 +1,169 @@ +// Copyright 2025 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.apiregistry.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/apiregistry/v1beta/resources.proto"; + +option csharp_namespace = "Google.Cloud.ApiRegistry.V1Beta"; +option go_package = "cloud.google.com/go/apiregistry/apiv1beta/apiregistrypb;apiregistrypb"; +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option java_package = "com.google.cloud.apiregistry.v1beta"; +option php_namespace = "Google\\Cloud\\ApiRegistry\\V1beta"; +option ruby_package = "Google::Cloud::ApiRegistry::V1beta"; +option (google.api.resource_definition) = { + type: "cloudapiregistry.googleapis.com/ApiNamespace" + pattern: "projects/{project}/locations/{location}/apiNamespaces/{api_namespace}" +}; + +// The Cloud API Registry service provides a central registry for managing API +// Data. +service CloudApiRegistry { + option (google.api.default_host) = "cloudapiregistry.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Gets a single McpServer. + rpc GetMcpServer(GetMcpServerRequest) returns (McpServer) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/mcpServers/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists McpServers in a given Project. + rpc ListMcpServers(ListMcpServersRequest) returns (ListMcpServersResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*}/mcpServers" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a single McpTool. + rpc GetMcpTool(GetMcpToolRequest) returns (McpTool) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/mcpServers/*/mcpTools/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists McpTools in a given McpServer. + rpc ListMcpTools(ListMcpToolsRequest) returns (ListMcpToolsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/mcpServers/*}/mcpTools" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Message for getting a McpServer +message GetMcpServerRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudapiregistry.googleapis.com/McpServer" + } + ]; +} + +// Message for requesting list of McpServers +message ListMcpServersRequest { + // Required. Parent value for ListMcpServersRequest + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing McpServers +message ListMcpServersResponse { + // The list of McpServer + repeated McpServer mcp_servers = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a McpTool +message GetMcpToolRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudapiregistry.googleapis.com/McpTool" + } + ]; +} + +// Message for requesting list of McpTools +message ListMcpToolsRequest { + // Required. Parent value for ListMcpToolsRequest + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudapiregistry.googleapis.com/McpTool" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing McpTools +message ListMcpToolsResponse { + // The list of McpTool + repeated McpTool mcp_tools = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/create/SyncCreateSetCredentialsProvider.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..8f24d0f3b6b6 --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.apiregistry.v1beta.CloudApiRegistrySettings; +import com.google.cloud.apiregistry.v1beta.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // 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); + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_Create_SetCredentialsProvider_sync] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/create/SyncCreateSetEndpoint.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..d579a3b8e81b --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_Create_SetEndpoint_sync] +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.apiregistry.v1beta.CloudApiRegistrySettings; +import com.google.cloud.apiregistry.v1beta.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // 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); + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_Create_SetEndpoint_sync] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/create/SyncCreateUseHttpJsonTransport.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..121b064d8c2d --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_Create_UseHttpJsonTransport_sync] +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.apiregistry.v1beta.CloudApiRegistrySettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() throws Exception { + // 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); + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_Create_UseHttpJsonTransport_sync] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getlocation/AsyncGetLocation.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..d077939e905c --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // 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(); + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_GetLocation_async] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getlocation/SyncGetLocation.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..b05cf73731ab --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_GetLocation_sync] +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // 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); + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_GetLocation_sync] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcpserver/AsyncGetMcpServer.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcpserver/AsyncGetMcpServer.java new file mode 100644 index 000000000000..c05eb7c05970 --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcpserver/AsyncGetMcpServer.java @@ -0,0 +1,53 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_GetMcpServer_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.apiregistry.v1beta.GetMcpServerRequest; +import com.google.cloud.apiregistry.v1beta.McpServer; +import com.google.cloud.apiregistry.v1beta.McpServerName; + +public class AsyncGetMcpServer { + + public static void main(String[] args) throws Exception { + asyncGetMcpServer(); + } + + public static void asyncGetMcpServer() throws Exception { + // 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(); + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_GetMcpServer_async] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcpserver/SyncGetMcpServer.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcpserver/SyncGetMcpServer.java new file mode 100644 index 000000000000..b68e243669a6 --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcpserver/SyncGetMcpServer.java @@ -0,0 +1,49 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_GetMcpServer_sync] +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.apiregistry.v1beta.GetMcpServerRequest; +import com.google.cloud.apiregistry.v1beta.McpServer; +import com.google.cloud.apiregistry.v1beta.McpServerName; + +public class SyncGetMcpServer { + + public static void main(String[] args) throws Exception { + syncGetMcpServer(); + } + + public static void syncGetMcpServer() throws Exception { + // 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); + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_GetMcpServer_sync] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcpserver/SyncGetMcpServerMcpservername.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcpserver/SyncGetMcpServerMcpservername.java new file mode 100644 index 000000000000..e7a2973f658a --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcpserver/SyncGetMcpServerMcpservername.java @@ -0,0 +1,43 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_GetMcpServer_Mcpservername_sync] +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.apiregistry.v1beta.McpServer; +import com.google.cloud.apiregistry.v1beta.McpServerName; + +public class SyncGetMcpServerMcpservername { + + public static void main(String[] args) throws Exception { + syncGetMcpServerMcpservername(); + } + + public static void syncGetMcpServerMcpservername() throws Exception { + // 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); + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_GetMcpServer_Mcpservername_sync] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcpserver/SyncGetMcpServerString.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcpserver/SyncGetMcpServerString.java new file mode 100644 index 000000000000..141dd5004fd4 --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcpserver/SyncGetMcpServerString.java @@ -0,0 +1,45 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_GetMcpServer_String_sync] +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.apiregistry.v1beta.McpServer; +import com.google.cloud.apiregistry.v1beta.McpServerName; + +public class SyncGetMcpServerString { + + public static void main(String[] args) throws Exception { + syncGetMcpServerString(); + } + + public static void syncGetMcpServerString() throws Exception { + // 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); + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_GetMcpServer_String_sync] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcptool/AsyncGetMcpTool.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcptool/AsyncGetMcpTool.java new file mode 100644 index 000000000000..1017636f9e3f --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcptool/AsyncGetMcpTool.java @@ -0,0 +1,52 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_GetMcpTool_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.apiregistry.v1beta.GetMcpToolRequest; +import com.google.cloud.apiregistry.v1beta.McpTool; +import com.google.cloud.apiregistry.v1beta.McpToolName; + +public class AsyncGetMcpTool { + + public static void main(String[] args) throws Exception { + asyncGetMcpTool(); + } + + public static void asyncGetMcpTool() throws Exception { + // 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(); + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_GetMcpTool_async] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcptool/SyncGetMcpTool.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcptool/SyncGetMcpTool.java new file mode 100644 index 000000000000..e32a555ad2f2 --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcptool/SyncGetMcpTool.java @@ -0,0 +1,49 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_GetMcpTool_sync] +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.apiregistry.v1beta.GetMcpToolRequest; +import com.google.cloud.apiregistry.v1beta.McpTool; +import com.google.cloud.apiregistry.v1beta.McpToolName; + +public class SyncGetMcpTool { + + public static void main(String[] args) throws Exception { + syncGetMcpTool(); + } + + public static void syncGetMcpTool() throws Exception { + // 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); + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_GetMcpTool_sync] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcptool/SyncGetMcpToolMcptoolname.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcptool/SyncGetMcpToolMcptoolname.java new file mode 100644 index 000000000000..0dfcbde33c43 --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcptool/SyncGetMcpToolMcptoolname.java @@ -0,0 +1,44 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_GetMcpTool_Mcptoolname_sync] +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.apiregistry.v1beta.McpTool; +import com.google.cloud.apiregistry.v1beta.McpToolName; + +public class SyncGetMcpToolMcptoolname { + + public static void main(String[] args) throws Exception { + syncGetMcpToolMcptoolname(); + } + + public static void syncGetMcpToolMcptoolname() throws Exception { + // 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); + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_GetMcpTool_Mcptoolname_sync] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcptool/SyncGetMcpToolString.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcptool/SyncGetMcpToolString.java new file mode 100644 index 000000000000..e25c97a21a37 --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/getmcptool/SyncGetMcpToolString.java @@ -0,0 +1,45 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_GetMcpTool_String_sync] +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.apiregistry.v1beta.McpTool; +import com.google.cloud.apiregistry.v1beta.McpToolName; + +public class SyncGetMcpToolString { + + public static void main(String[] args) throws Exception { + syncGetMcpToolString(); + } + + public static void syncGetMcpToolString() throws Exception { + // 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); + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_GetMcpTool_String_sync] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listlocations/AsyncListLocations.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..a75f8db585ba --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // 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); + } + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_ListLocations_async] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listlocations/AsyncListLocationsPaged.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..303d383da151 --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,62 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_ListLocations_Paged_async] +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // 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; + } + } + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_ListLocations_Paged_async] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listlocations/SyncListLocations.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..bfdbe4751d95 --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_ListLocations_sync] +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // 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); + } + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_ListLocations_sync] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcpservers/AsyncListMcpServers.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcpservers/AsyncListMcpServers.java new file mode 100644 index 000000000000..e88e8fd63eb0 --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcpservers/AsyncListMcpServers.java @@ -0,0 +1,56 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_ListMcpServers_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.apiregistry.v1beta.ListMcpServersRequest; +import com.google.cloud.apiregistry.v1beta.LocationName; +import com.google.cloud.apiregistry.v1beta.McpServer; + +public class AsyncListMcpServers { + + public static void main(String[] args) throws Exception { + asyncListMcpServers(); + } + + public static void asyncListMcpServers() throws Exception { + // 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); + } + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_ListMcpServers_async] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcpservers/AsyncListMcpServersPaged.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcpservers/AsyncListMcpServersPaged.java new file mode 100644 index 000000000000..499788193fd2 --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcpservers/AsyncListMcpServersPaged.java @@ -0,0 +1,64 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_ListMcpServers_Paged_async] +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.apiregistry.v1beta.ListMcpServersRequest; +import com.google.cloud.apiregistry.v1beta.ListMcpServersResponse; +import com.google.cloud.apiregistry.v1beta.LocationName; +import com.google.cloud.apiregistry.v1beta.McpServer; +import com.google.common.base.Strings; + +public class AsyncListMcpServersPaged { + + public static void main(String[] args) throws Exception { + asyncListMcpServersPaged(); + } + + public static void asyncListMcpServersPaged() throws Exception { + // 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; + } + } + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_ListMcpServers_Paged_async] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcpservers/SyncListMcpServers.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcpservers/SyncListMcpServers.java new file mode 100644 index 000000000000..30ca5d5a07ac --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcpservers/SyncListMcpServers.java @@ -0,0 +1,52 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_ListMcpServers_sync] +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.apiregistry.v1beta.ListMcpServersRequest; +import com.google.cloud.apiregistry.v1beta.LocationName; +import com.google.cloud.apiregistry.v1beta.McpServer; + +public class SyncListMcpServers { + + public static void main(String[] args) throws Exception { + syncListMcpServers(); + } + + public static void syncListMcpServers() throws Exception { + // 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); + } + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_ListMcpServers_sync] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcpservers/SyncListMcpServersLocationname.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcpservers/SyncListMcpServersLocationname.java new file mode 100644 index 000000000000..47ac6189f2e7 --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcpservers/SyncListMcpServersLocationname.java @@ -0,0 +1,44 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_ListMcpServers_Locationname_sync] +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.apiregistry.v1beta.LocationName; +import com.google.cloud.apiregistry.v1beta.McpServer; + +public class SyncListMcpServersLocationname { + + public static void main(String[] args) throws Exception { + syncListMcpServersLocationname(); + } + + public static void syncListMcpServersLocationname() throws Exception { + // 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); + } + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_ListMcpServers_Locationname_sync] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcpservers/SyncListMcpServersString.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcpservers/SyncListMcpServersString.java new file mode 100644 index 000000000000..22a4e6f3b6d0 --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcpservers/SyncListMcpServersString.java @@ -0,0 +1,44 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_ListMcpServers_String_sync] +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.apiregistry.v1beta.LocationName; +import com.google.cloud.apiregistry.v1beta.McpServer; + +public class SyncListMcpServersString { + + public static void main(String[] args) throws Exception { + syncListMcpServersString(); + } + + public static void syncListMcpServersString() throws Exception { + // 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); + } + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_ListMcpServers_String_sync] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcptools/AsyncListMcpTools.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcptools/AsyncListMcpTools.java new file mode 100644 index 000000000000..6a29b52b1ec2 --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcptools/AsyncListMcpTools.java @@ -0,0 +1,59 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_ListMcpTools_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest; +import com.google.cloud.apiregistry.v1beta.McpServerName; +import com.google.cloud.apiregistry.v1beta.McpTool; + +public class AsyncListMcpTools { + + public static void main(String[] args) throws Exception { + asyncListMcpTools(); + } + + public static void asyncListMcpTools() throws Exception { + // 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); + } + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_ListMcpTools_async] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcptools/AsyncListMcpToolsPaged.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcptools/AsyncListMcpToolsPaged.java new file mode 100644 index 000000000000..f7748f68ccfe --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcptools/AsyncListMcpToolsPaged.java @@ -0,0 +1,66 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_ListMcpTools_Paged_async] +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest; +import com.google.cloud.apiregistry.v1beta.ListMcpToolsResponse; +import com.google.cloud.apiregistry.v1beta.McpServerName; +import com.google.cloud.apiregistry.v1beta.McpTool; +import com.google.common.base.Strings; + +public class AsyncListMcpToolsPaged { + + public static void main(String[] args) throws Exception { + asyncListMcpToolsPaged(); + } + + public static void asyncListMcpToolsPaged() throws Exception { + // 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; + } + } + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_ListMcpTools_Paged_async] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcptools/SyncListMcpTools.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcptools/SyncListMcpTools.java new file mode 100644 index 000000000000..07ba0df38803 --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcptools/SyncListMcpTools.java @@ -0,0 +1,55 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_ListMcpTools_sync] +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.apiregistry.v1beta.ListMcpToolsRequest; +import com.google.cloud.apiregistry.v1beta.McpServerName; +import com.google.cloud.apiregistry.v1beta.McpTool; + +public class SyncListMcpTools { + + public static void main(String[] args) throws Exception { + syncListMcpTools(); + } + + public static void syncListMcpTools() throws Exception { + // 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); + } + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_ListMcpTools_sync] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcptools/SyncListMcpToolsMcpservername.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcptools/SyncListMcpToolsMcpservername.java new file mode 100644 index 000000000000..08349f78b8d7 --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcptools/SyncListMcpToolsMcpservername.java @@ -0,0 +1,45 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_ListMcpTools_Mcpservername_sync] +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.apiregistry.v1beta.McpServerName; +import com.google.cloud.apiregistry.v1beta.McpTool; + +public class SyncListMcpToolsMcpservername { + + public static void main(String[] args) throws Exception { + syncListMcpToolsMcpservername(); + } + + public static void syncListMcpToolsMcpservername() throws Exception { + // 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); + } + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_ListMcpTools_Mcpservername_sync] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcptools/SyncListMcpToolsString.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcptools/SyncListMcpToolsString.java new file mode 100644 index 000000000000..228ee1a9a59f --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistry/listmcptools/SyncListMcpToolsString.java @@ -0,0 +1,47 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistry_ListMcpTools_String_sync] +import com.google.cloud.apiregistry.v1beta.CloudApiRegistryClient; +import com.google.cloud.apiregistry.v1beta.McpServerName; +import com.google.cloud.apiregistry.v1beta.McpTool; + +public class SyncListMcpToolsString { + + public static void main(String[] args) throws Exception { + syncListMcpToolsString(); + } + + public static void syncListMcpToolsString() throws Exception { + // 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); + } + } + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistry_ListMcpTools_String_sync] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistrysettings/getmcpserver/SyncGetMcpServer.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistrysettings/getmcpserver/SyncGetMcpServer.java new file mode 100644 index 000000000000..2806e2c23a7d --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/cloudapiregistrysettings/getmcpserver/SyncGetMcpServer.java @@ -0,0 +1,56 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistrySettings_GetMcpServer_sync] +import com.google.cloud.apiregistry.v1beta.CloudApiRegistrySettings; +import java.time.Duration; + +public class SyncGetMcpServer { + + public static void main(String[] args) throws Exception { + syncGetMcpServer(); + } + + public static void syncGetMcpServer() throws Exception { + // 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(); + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistrySettings_GetMcpServer_sync] diff --git a/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/stub/cloudapiregistrystubsettings/getmcpserver/SyncGetMcpServer.java b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/stub/cloudapiregistrystubsettings/getmcpserver/SyncGetMcpServer.java new file mode 100644 index 000000000000..224c73235a54 --- /dev/null +++ b/java-cloudapiregistry/samples/snippets/generated/com/google/cloud/apiregistry/v1beta/stub/cloudapiregistrystubsettings/getmcpserver/SyncGetMcpServer.java @@ -0,0 +1,56 @@ +/* + * 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.samples; + +// [START cloudapiregistry_v1beta_generated_CloudApiRegistryStubSettings_GetMcpServer_sync] +import com.google.cloud.apiregistry.v1beta.stub.CloudApiRegistryStubSettings; +import java.time.Duration; + +public class SyncGetMcpServer { + + public static void main(String[] args) throws Exception { + syncGetMcpServer(); + } + + public static void syncGetMcpServer() throws Exception { + // 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(); + } +} +// [END cloudapiregistry_v1beta_generated_CloudApiRegistryStubSettings_GetMcpServer_sync] diff --git a/pom.xml b/pom.xml index d61b4c18e4c6..96bd03560242 100644 --- a/pom.xml +++ b/pom.xml @@ -59,6 +59,7 @@ java-channel java-chat java-chronicle + java-cloudapiregistry java-cloudbuild java-cloudcommerceconsumerprocurement java-cloudcontrolspartner diff --git a/versions.txt b/versions.txt index 9cbe2eb77f5d..78703d71a977 100644 --- a/versions.txt +++ b/versions.txt @@ -934,3 +934,6 @@ grpc-google-cloud-maintenance-v1:0.15.0:0.16.0-SNAPSHOT google-cloud-gkerecommender:0.1.0:0.2.0-SNAPSHOT proto-google-cloud-gkerecommender-v1:0.1.0:0.2.0-SNAPSHOT grpc-google-cloud-gkerecommender-v1:0.1.0:0.2.0-SNAPSHOT +google-cloud-cloudapiregistry:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-cloudapiregistry-v1beta:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-cloudapiregistry-v1beta:0.0.0:0.0.1-SNAPSHOT