|
| 1 | +/* |
| 2 | + * Copyright 2025 Google LLC |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +// Auto-generated code. Do not edit. |
| 18 | + |
| 19 | +package com.google.genai.types; |
| 20 | + |
| 21 | +import com.fasterxml.jackson.annotation.JsonCreator; |
| 22 | +import com.fasterxml.jackson.annotation.JsonProperty; |
| 23 | +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; |
| 24 | +import com.google.auto.value.AutoValue; |
| 25 | +import com.google.errorprone.annotations.CanIgnoreReturnValue; |
| 26 | +import com.google.genai.JsonSerializable; |
| 27 | +import java.util.Optional; |
| 28 | + |
| 29 | +/** |
| 30 | + * A MCPServer is a server that can be called by the model to perform actions. It is a server that |
| 31 | + * implements the MCP protocol. Next ID: 5. This data type is not supported in Vertex AI. |
| 32 | + */ |
| 33 | +@AutoValue |
| 34 | +@JsonDeserialize(builder = McpServer.Builder.class) |
| 35 | +public abstract class McpServer extends JsonSerializable { |
| 36 | + /** The name of the MCPServer. */ |
| 37 | + @JsonProperty("name") |
| 38 | + public abstract Optional<String> name(); |
| 39 | + |
| 40 | + /** A transport that can stream HTTP requests and responses. */ |
| 41 | + @JsonProperty("streamableHttpTransport") |
| 42 | + public abstract Optional<StreamableHttpTransport> streamableHttpTransport(); |
| 43 | + |
| 44 | + /** Instantiates a builder for McpServer. */ |
| 45 | + @ExcludeFromGeneratedCoverageReport |
| 46 | + public static Builder builder() { |
| 47 | + return new AutoValue_McpServer.Builder(); |
| 48 | + } |
| 49 | + |
| 50 | + /** Creates a builder with the same values as this instance. */ |
| 51 | + public abstract Builder toBuilder(); |
| 52 | + |
| 53 | + /** Builder for McpServer. */ |
| 54 | + @AutoValue.Builder |
| 55 | + public abstract static class Builder { |
| 56 | + /** For internal usage. Please use `McpServer.builder()` for instantiation. */ |
| 57 | + @JsonCreator |
| 58 | + private static Builder create() { |
| 59 | + return new AutoValue_McpServer.Builder(); |
| 60 | + } |
| 61 | + |
| 62 | + /** |
| 63 | + * Setter for name. |
| 64 | + * |
| 65 | + * <p>name: The name of the MCPServer. |
| 66 | + */ |
| 67 | + @JsonProperty("name") |
| 68 | + public abstract Builder name(String name); |
| 69 | + |
| 70 | + @ExcludeFromGeneratedCoverageReport |
| 71 | + abstract Builder name(Optional<String> name); |
| 72 | + |
| 73 | + /** Clears the value of name field. */ |
| 74 | + @ExcludeFromGeneratedCoverageReport |
| 75 | + @CanIgnoreReturnValue |
| 76 | + public Builder clearName() { |
| 77 | + return name(Optional.empty()); |
| 78 | + } |
| 79 | + |
| 80 | + /** |
| 81 | + * Setter for streamableHttpTransport. |
| 82 | + * |
| 83 | + * <p>streamableHttpTransport: A transport that can stream HTTP requests and responses. |
| 84 | + */ |
| 85 | + @JsonProperty("streamableHttpTransport") |
| 86 | + public abstract Builder streamableHttpTransport( |
| 87 | + StreamableHttpTransport streamableHttpTransport); |
| 88 | + |
| 89 | + /** |
| 90 | + * Setter for streamableHttpTransport builder. |
| 91 | + * |
| 92 | + * <p>streamableHttpTransport: A transport that can stream HTTP requests and responses. |
| 93 | + */ |
| 94 | + @CanIgnoreReturnValue |
| 95 | + public Builder streamableHttpTransport( |
| 96 | + StreamableHttpTransport.Builder streamableHttpTransportBuilder) { |
| 97 | + return streamableHttpTransport(streamableHttpTransportBuilder.build()); |
| 98 | + } |
| 99 | + |
| 100 | + @ExcludeFromGeneratedCoverageReport |
| 101 | + abstract Builder streamableHttpTransport( |
| 102 | + Optional<StreamableHttpTransport> streamableHttpTransport); |
| 103 | + |
| 104 | + /** Clears the value of streamableHttpTransport field. */ |
| 105 | + @ExcludeFromGeneratedCoverageReport |
| 106 | + @CanIgnoreReturnValue |
| 107 | + public Builder clearStreamableHttpTransport() { |
| 108 | + return streamableHttpTransport(Optional.empty()); |
| 109 | + } |
| 110 | + |
| 111 | + public abstract McpServer build(); |
| 112 | + } |
| 113 | + |
| 114 | + /** Deserializes a JSON string to a McpServer object. */ |
| 115 | + @ExcludeFromGeneratedCoverageReport |
| 116 | + public static McpServer fromJson(String jsonString) { |
| 117 | + return JsonSerializable.fromJsonString(jsonString, McpServer.class); |
| 118 | + } |
| 119 | +} |
0 commit comments